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

MARBL support #75

Closed
wants to merge 45 commits into from
Closed

MARBL support #75

wants to merge 45 commits into from

Conversation

mnlevy1981
Copy link
Collaborator

Allows CESM to build MOM with MARBL and introduces compsets that turn on the ecosystem by default. The biggest task remaining is to plumb in a connection between the MARBL scripts for requesting diagnostics in history files and the RPS set-up; for now, I've just hard-coded a few diagnostics I want to see for testing. I think I also have some work to do to support changing parameters via user_nl_marbl, but at the moment the MOM code (in NCAR/MOM6#157) doesn't read marbl_in anyway...

This commit uncomments out code so that MARBL is built out of pkg/MARBL/src
This creates OCN_BGC_CONFIG in env_run.xml; as long as OCN_BGC_CONFIG != none
(the default value), USE_MARBL_TRACERS = True.
Hardcodes the names of 32 tracers to include in diag_table if running with
MARBL enabled. Note that eventually this will have to be replaced with
something more robust that relies on MARBL to report the names of the active
tracers... as it stands, enabling CISO will not increase output at all, and
running with cocco will not work (spCaCO3 is not a valid tracer name in that
configuration)
Default to 432 tasks on cheyenne instead of 144 when running with MARBL's
tracers.
Uses the CESM_x1 default values, allows override via user_nl_marbl
Updates MOM_input.json and diag_table.json
I missed a change in the default diag_table
Bring it in as a typical external instead
Eventually MARBL will only be built if a BGC-enabled compset is specified, so
it makes sense to only look for pkg/MARBL and add it to paths if it will be
needed. At this point it is in an "if True:" block, but down the line the
condition will change.
Adding -D_USE_MARBL_TRACERS to the build requires a CIME mod:

$ git diff
diff --git a/config/cesm/machines/config_compilers.xml
b/config/cesm/machines/config_compilers.xml
index fca45de02..c3cb51a2c 100644
--- a/config/cesm/machines/config_compilers.xml
+++ b/config/cesm/machines/config_compilers.xml
@@ -80,7 +80,7 @@ using a fortran linker.
   </INCLDIR>
   <FFLAGS>
     <append MODEL="fv3gfs"> $(FC_AUTO_R8) </append>
-    <append MODEL="mom"> $(FC_AUTO_R8) -Duse_LARGEFILE</append>
+    <append MODEL="mom"> $(FC_AUTO_R8) -Duse_LARGEFILE
-D_USE_MARBL_TRACERS</append>
   </FFLAGS>
   <SUPPORTS_CXX>FALSE</SUPPORTS_CXX>
 </compiler>

This is likely where changes to only enable the build CPP in some compsets will
need to go, and it will be handy to have a comment pointing to the file.
Added ECOSYS_ATMPRESS and ECOSYS_IFRAC to hm_bgc history file to make sure the
correct values were coming in from the coupler. Also increased NTASKS_OCN to
864 and set up pe layout for G1850MOMECO compset.
Stream is daily through test suite.

Also added PH to the stream (regardless of whether run is a test)
If MARBL is enabled (OCN_BGC_CONFIG anything but "none"), then diag_table comes
from both diag_table.json and diag_table_MARBL.json; the latter is copied to
Buildconf/momconf and then read in, but future commits will generate the json
file in place in Buildconf/
With a new case, it turned out buildnml was trying to copy a file to
Buildconf/momconf before that directory was created
File is created by buildnml; next step is to turn it into a JSON file
Create generate_diag_table_MARBL() function since there are a few steps in the
process
buildnml still relies on param_templates/json/diag_table_MARBL.json but the
switch to ecosys_diagnostics should provide as many useful parameters as
possible when it is made.
Adding these two fields to test the STF_ and J_ fields in the MOM6 source code;
if they look okay, next step will be to convert ecosys_diagnostics to json
First pass at turning the ecosys_diagnostics file MARBL generates into
something MOM can turn into diag_table entries. It hard codes the following:

1. double precision output (should be easy to make this an option)
2. variables on native grid (not sure about interpolating to z-space)
3. Names for streams (all have hm_bgc_...)

Also, while buildnml supports the idea of logical variables to control ALT_CO2
output and to say "all MARBL variables should be output". The former is useful
for avoiding duplicate output when the ALT_CO2 tracers are identical to the
regular tracers, and the latter is useful for testing, so I do plan on
incorporating them soon.

NOTE: this update requires modifying FMS:
* increase max_num_axis_sets by 3 (from 25 to 28)
* increase max_output_fields by 300 (from 300 to 600)

the latter will need to be even bigger once lMARBL_output_all option exists
MARBL needs more output fields and more output files, so those variables are
now set in input.nml depending on value of TEST and OCN_BGC_CONFIG
This means splitting all hm_bgc streams into hm_bgc_{freq} and hm_bgc_{freq}_z,
with the 2D fields in the former and 3D fields in the latter. It also means
generate_diag_table_MARBL() needs to know which fields are 2D and which are 3D;
for MARBL fields it can look at the vertical_grid key in the diagnostics JSON
file but for the MOM6 fields we assume STF_{tracer} are the only 2D fields for
now.
We want CESM to build MARBL by default, but having this flag will let us test
building with the stubs in config_src/externals/MARBL instead of the full
library.
1. Created aux_mom_MARBL testlist
   -- tests CMOM compset with the MARBL stubs and C1850MOMECO
2. Got lmarbl_output_all flag set based on env_build::TEST
   -- needed to increase max_fields_per_file in FMS:diag_data.F90 (via
      src_override) from 300 to 600
   -- increased max_input_fields from default of 600 to 900 when running
      a test with MARBL tracers
   -- update diag_table to create daily output files from test suite
      (currently creating one file per day, may want to save disk space by
      dropping the -DD portion of the name and overwriting YYYY-MM with the
      latest daily output)
Add C1850MOMECO_IAF and G1850MOMECO_IAF compsets
I realized that the IAF compset still relies on the CORE data, and we need
different compsets to run with JRA forcing. This commit adds both C and G
support with [CG]1850MOMECO_JRA compsets
1. do not need 3D grid variables for the 2D output (greatly reduces size of
   history file)
2. Everything but MOM should run on a single node on cheyenne for C / G
   compsets with MARBL enabled
@alperaltuntas alperaltuntas deleted the branch ESCOMP:master April 8, 2021 23:25
@alperaltuntas
Copy link
Member

@mnlevy1981, I just realized that I closed this PR inadvertently while renaming the master branch as main. Feel free to resubmit a PR to the main branch as you see fit.

@mnlevy1981 mnlevy1981 mentioned this pull request Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants