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

initial commit for 4p2z settings #423

Merged

Conversation

kristenkrumhardt
Copy link
Collaborator

This is my first attempt at creating the yaml file for the 4p2z settings.

mnlevy1981 and others added 10 commits July 1, 2022 12:19
1. auto_graze_zoo_zint and auto_graze_zoo_zint_100m were defined as
   per-autotroph but not per-zooplankton, so they were effectively
   auto_graze_zootot_zint and auto_graze_zootot_zint_100m. This commit
   adds the per-zooplankton portion of the defintion.
2. Similarly, zoo_graze_zoo_zint and zoo_graze_zoo_zint_100m were
   actually computing zoo_graze_zootot_zint and
   zoo_graze_zootot_zint_100m. This commit adds the second
   per-zooplankton portion of the definition.

This will NOT change the short names of the diagnostics in typical CESM
usage because the 1-zoo configurations all name the single zooplankton
"zoo". It _will_ allow more flexibility in the output when running with
multiple zooplankton functional types.
Previously, pocToFloor wasn't included in output by default
1. want pocToFloor in daily and monthly streams, not just monthly
2. added new ((zoo))_los_zint_150m (integrating to 150m, rather than
   100m that is default for other shallow integrals)
3. Capped picpoc at 1.0 to prevent "ballast exceeds POC" errors
A few files that were generated by MARBL scripts got added in the previous
commit
1. MARBL_settings_file_class.py needs to recognize CESM2+4p2z as valid
PFT_defaults setting; also, need to allow case where the number of grazing
relationships is less than max_grazer_prey_cnt * zooplankton_cnt (e.g. only 7
of the potential 8 relationships with 4 prey and 2 zooplankton are defined)
2. settings_latest+4p2z.{yaml,json} also need to handle fewer than max grazing
relationships; done by adding "null" as valid grazer_sname
3. marbl_settings_mod.F90 also needs to recognize CESM2+4p2z as valid
PFT_defaults setting
There were some default values from the CESM 2.1 version, which hadn't yet been
tuned. I think this yaml file matches the marbl_in values found in the 1 degree
companion run to the high-res BGC run done on frontera
* auto_ind_cnt should default to 1, not zero
* zoo_ind_cnt should default to 0, not 1
* mesozoo short name should be mesozoo, not repeating microzoo
* f_zoo_detr should be .4 for diaz_mesozoo, not 1.2
* need microzoo_mesozoo to be grazing_relationship(4,2) not (4,1)
  -- the second index must match the zooplankton index of the predator!
@mnlevy1981
Copy link
Collaborator

Progress so far

  1. The marbl.settings file generated by MARBL_tools/MARBL_generate_settings_file.py pointing at the new 4p2z JSON file (and using CESM_x1 for the grid) produces bit-for-bit identical results in the call_compute_subroutines test when compared to the same test reading the marbl_in file @kristenkrumhardt has been using for her 4p2z runs, e.g. /glade/work/kristenk/cesm_work/cesm2.2_scope_cases/g.e22.GOMIPECOIAF_JRA-1p4-2018.TL319_g17.4p2z.001branch/CaseDocs/marbl_in (note that I needed to generate an updated IC file to include cocco tracers and split zooC into microzooC and mesozooC; I also updated both settings files to turn off tracer restoring)
  2. I've merged the update_zoo_diags branch into this branch; there were some diagnostics that were named *_zoo* that were effectively *_zootot*, but now that we can run with multiple zooplankton we should really be providing them as per-zoo fields.

The next step will be to merge development into this branch, and run the same tests. There are also two points we should discuss before accepting this PR...

Discussion Topics

  1. update_zoo_diags also includes a change to picpoc that is not BFB
diff --git a/src/marbl_interior_tendency_mod.F90 b/src/marbl_interior_tendency_mod.F90
index e6017ef..398b42c 100644
--- a/src/marbl_interior_tendency_mod.F90
+++ b/src/marbl_interior_tendency_mod.F90
@@ -1452,7 +1452,8 @@ subroutine compute_autotroph_calcification(km, autotroph_local, temperature, car
           picpoc = max(0.0_r8, -0.0136_r8 * CO2(:) + picpoc(:) + 0.21_r8)

           !P-limitation effect (CaCO2/organicC ratio increases when P limitation term is low)
-          picpoc = max(0.0_r8, -0.48_r8 * Plim(auto_ind,:) + picpoc(:) + 0.48_r8)
+          ! max out picpoc at one to prevent crashing due to "ballast exceeds POC" error
+          picpoc = min(1., max(0.0_r8, -0.48_r8 * Plim(auto_ind,:) + picpoc(:) + 0.48_r8))

           !multiply cocco growth rate by picpoc to get CaCO3 formation
           CaCO3_form(auto_ind,:) = picpoc(:) * photoC(auto_ind,:)

I'd like to know if we would expect to see answer changes in the current 3p1z setup, or if picpoc is only used in explicit calcification so it will only effect runs with cocco

  1. The current way we handle grazing requires the pred_ind in grazing_relationship_settings(prey_ind, pred_ind) to match the index of zooplankton_settings(:) referring to the predator. This can be seen in marbl_interior_tendency_mod.F90, where we need the biomass of the predator and use zooplankton_local%C(pred_ind,k). Addressing grazing type should be a subset of zooplankton type #320 would remove this problem, but in the meantime we need grazing_relationship_settings(4,1) = "null" and grazing_relationship_settings(4,2) = "Grazing of microzooplankton by mesozooplankton" because grazing_relationship_settings(4,1) = "Grazing of microzooplankton by mesozooplankton" implicitly uses microzoo biomass instead of mesozoo biomass.

I am happy waiting until we fix #320 and letting this take care of itself, but an alternative approach would be to add pred_ind to the grazing_relationship_settings_type; we could then collapse grazing_relationship_settings to a 1D array (there are a few changes in this PR that are meant to handle the fact that there are 7 grazing relationships in the 4p2z setup but we need to allocate a 4x2 array to store them all)

Next Steps

Next up, I'll merge development into this branch; it looks like there are conflicts in a couple of files to resolve, and I'll also need to add the following new variables to the 4p2z settings file:

diff --git a/defaults/settings_latest.yaml b/defaults/settings_latest.yaml
index 87e50c0..2f105ce 100644
--- a/defaults/settings_latest.yaml
+++ b/defaults/settings_latest.yaml
@@ -232,6 +232,12 @@ general_parms :
       units : unitless
       datatype : logical
       default_value : .true.
+   lcheck_forcing :
+      longname : Control whether consistency checks are performed on forcing input (useful for debugging)
+      subcategory : 2. config flags
+      units : unitless
+      datatype : logical
+      default_value : .false.
    lecovars_full_depth_tavg :
       longname : If .false., MARBL will recommend truncating the column for some diagnostics
       subcategory : 2. config flags
@@ -283,6 +289,12 @@ general_parms :
       units : unitless
       datatype : logical
       default_value : .false.
+   bftt_dz_sum_thres:
+      longname : MARBL will abort if abs(1 - sum(bot_flux_to_tend)) exceeds this threshold
+      subcategory : 4. general parameters
+      units : unitless
+      datatype : real
+      default_value : 1.0e-14
    Jint_Ctot_thres_molpm2pyr :
       longname : MARBL will abort if abs(Jint_Ctot) exceeds this threshold
       subcategory : 4. general parameters
@@ -1008,6 +1020,14 @@ PFT_derived_types :
             default_value :
                default : 1e34
                ((zooplankton_sname)) == "zoo" : 0.4
+         basal_respiration_rate_per_day :
+            longname : Basal respiration rate
+            subcategory : 11. zooplankton
+            units : 1/day
+            datatype : real
+            default_value :
+               default : 1e34
+               ((zooplankton_sname)) == "zoo" : 0.0
          loss_thres :
             longname : Zoo concentration where losses go to zero
             subcategory : 11. zooplankton

After merging in development, there were three new variables to add to
settings_latest+4p2z (a basal loss term in zooplankton_settings and two
configuration flags)
This branch adds the zoo_loss_zint_150m diagnostic, so we need a baseline that
contains this field
The original way I wrote this was causing problems in the CESM-SPECTRA test
This isn't really a CESM2 configuration; at some point we may want to update it
to be CESM3+4p2z, though.
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