Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sub-regioan diag output example in 1D case #39

Merged
merged 36 commits into from
Jun 27, 2024
Merged

Conversation

yichengt900
Copy link
Contributor

@yichengt900 yichengt900 commented May 14, 2024

This PR inclues the following changes:

  • enhances the build script to include the libyaml build process;
  • added an example diag_table YAML file for sub-region output in the 1D case;
  • added an example xml about how to use new diag manager as well as how to convert legacy diag_table to diag_table.yaml;
  • added short paragraph for the new yaml style of diag_table in our online documentation.

Keep in mind the old diag_manager code has been kept intact and will be used by default, so these updates should not have impact to your current experiments. If you want to try the new indices subsetting (comes with the new re-written diag manager), you will have to first build the model system with FMS2 as well as -Duse_yaml flag, and set use_modern_diag = .true. in your diag_manager_nml. You also have to prepare a yaml format of diag_table.

The sub-region diagnostic works ok with indices for both NEP and Arctic domains (see below example plot from Arctic domain). The NWA domain works with either latlon or indices subsetting.
example_temp

Also, if you prefer FMS1 and still want to use index subsetting, you can try turning on USE_INDEX_DIAGNOSTIC_AXES = True in MOM6. This should allow you to specify the index instead of latlon for sub-region diagnostic output.

theresa-morrison pushed a commit that referenced this pull request May 15, 2024
* Clean up of the light and phytoplankton growth calculations

* update baseline answers

---------

Co-authored-by: Charles Stock <[email protected]>
Co-authored-by: yuchengt900 <[email protected]>
@yichengt900 yichengt900 marked this pull request as ready for review May 15, 2024 17:56
@yichengt900 yichengt900 self-assigned this May 15, 2024
@theresa-morrison
Copy link
Contributor

This will be relevant for the NEP and Arctic domains
@wchengpmel @kshedstrom

@yichengt900
Copy link
Contributor Author

Following our discussion this morning, I'd appreciate it if someone could review this PR when there's a chance.

@kshedstrom
Copy link

My understanding is that the latest FMS is not compatible with the gnu compiler and I therefore can't test this at home. I hope to get to this on gaea next week.

@yichengt900
Copy link
Contributor Author

@kshedstrom, Yes, FMS2 does not work with the latest GCC. It only works with previous versions of GCC.

@yichengt900
Copy link
Contributor Author

@uwagura, it would be nice if you could review this PR when you get chance, especially the new XML file, which is related to the topic of YAML-based diagnostics that @charliestock mentioned. Any comments are more than welcome!

@kshedstrom
Copy link

Following the NWA xml example, I can compile with yaml and get it to run. However, trying for FMS 2024.01.02 causes it to look for that version of ice_param here:

<codeBase version="$(CPL_GIT_TAG)"> ice_param.git </codeBase>

and it doesn't find it. I made a separate ICE_PARAM_TAG for it.

Then I got bold and asked for my favorite vertical sections and it failed on me:

FATAL from PE  1037: axis_utils2::nearest_index array is NOT monotonously ordered

The mess is here: /gpfs/f5/cpo_rmom6/scratch/Katherine.Hedstrom/work/run75_1x1m0d_1648x1o.o135017531

@kshedstrom
Copy link

My bad - I needed to use USE_INDEX_DIAGNOSTIC_AXES = True. Why did you say it's for FMS1?

@yichengt900
Copy link
Contributor Author

yichengt900 commented Jun 18, 2024

@kshedstrom, thanks for your testing. I fixed the ice_param tag issue in the XML.

The USE_INDEX_DIAGNOSTIC_AXES = True is a trick from MOM6, not FMS. The index subsetting comes naturally with the FMS2 newly rewritten diag-manager and should not need to set USE_INDEX_DIAGNOSTIC_AXES = True.

I took a quick look at your config and noticed that the sub_region grid type in your diag_table.yaml is still latlon, not index. My first guess is this might be an issue from the diag-table-to-yaml tool. Since the legacy diag_table does not indicate whether the sub-region is in latlon or index, the tool probably has a problem identifying that at this moment. @thomas-robinson, can you confirm this is the case?

For Artic we can either set USE_INDEX_DIAGNOSTIC_AXES = True or add an extra step in xml to replace latlon with index in the diag_table.yaml.

@thomas-robinson
Copy link
Member

Tagging @uramirez8707 here just in case he is needed. The diag table to diag yaml tool translates the diag table, and the diag table only supports latlon. Yes you're correct @yichengt900 . If your diag_table file has a subregion with local indicies and not latlon, then then output produced is probably not what you are expecting,

Copy link
Collaborator

@uwagura uwagura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sucessfully completed regression test for layout

@uwagura uwagura merged commit 2d8cc03 into main Jun 27, 2024
2 checks passed
@kshedstrom
Copy link

kshedstrom commented Jun 28, 2024

I recompiled outside of my conda environment and things went rather better (FMS 2024.01.02). Everything is fine as long as I use the old style diag format. Without my small cross-sections, the new format still fails:

FATAL from PE    43: freq units is required. Check your entry for file:ocean_hourly
#0  0x31eb527 in __mpp_mod_MOD_mpp_error_basic
        at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/FMS2/mpp/include/mpp_util_mpi.inc:74
#1  0x3b09506 in parse_key
        at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/FMS2/diag_manager/fms_diag_yaml.F90:801
#2  0x3b0c140 in fill_in_diag_files
        at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/FMS2/diag_manager/fms_diag_yaml.F90:551
#3  0x3b119eb in __fms_diag_yaml_mod_MOD_diag_yaml_object_init
        at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/FMS2/diag_manager/fms_diag_yaml.F90:488
#4  0x3835798 in __fms_diag_object_mod_MOD_fms_diag_object_init
        at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/FMS2/diag_manager/fms_diag_object.F90:130
#5  0x345fb1b in __diag_manager_mod_MOD_diag_manager_init
        at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/FMS2/diag_manager/diag_manager.F90:4213
#6  0xfec2ac in coupler_init
        at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/coupler/full/coupler_main.F90:1566
#7  0xfdb646 in coupler_main
        at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/coupler/full/coupler_main.F90:590
#8  0xff1607 in main
        at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/coupler/full/coupler_main.F90:335

@uramirez8707
Copy link

@kshedstrom Can you point me to your diag_table.yaml?

@kshedstrom
Copy link

I just copied it to /ncrc/home2/Katherine.Hedstrom/ESMG/ESMG-configs/Arctic6/mid_12
on gaea.

@yichengt900 yichengt900 deleted the fix/fms2_nudge branch July 1, 2024 11:05
@uramirez8707
Copy link

/ncrc/home2/Katherine.Hedstrom/ESMG/ESMG-configs/Arctic6/mid_12

@kshedstrom It looks like I don't have permissions to view the file

-rw------- 1 Katherine.Hedstrom esrl 10653 Jun 28 13:56 /ncrc/home2/Katherine.Hedstrom/ESMG/ESMG-configs/Arctic6/mid_12/diag_table.yaml

@kshedstrom
Copy link

Oops, sorry, fixed.

@uramirez8707
Copy link

It looks like your table was generated using an older version of the converter. Before this update which combined the freq and freq_units keys: NOAA-GFDL/fms_yaml_tools#26

On gaea, you can do

module load fre/bronx-21
diag-table-to-yaml -f /ncrc/home2/Katherine.Hedstrom/ESMG/ESMG-configs/Arctic6/mid_12/diag_table -o diag_table.yaml

on your system, please updated your install of fms_yaml_tools.

@kshedstrom
Copy link

Yes, that works better. Thanks!
The subregion output works for the Bering Sea domain in latlon mode.
I do not have the subregion output working for the Arctic domain in any mode. It seems to accept it in index mode, but doesn't output anything. I assume the tile numbering starts at 0? The attempt in /autofs/ncrc-svm1_home2/Katherine.Hedstrom/ESMG/ESMG-configs/Arctic6/mid_12/diag_table.yaml
is for 24 cores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants