ESCOMP / MOM_interface

CESM interface to MOM Ocean Model
5 stars 17 forks source link

Add additional KPP terms to diagnostics #103

Open mnlevy1981 opened 2 years ago

mnlevy1981 commented 2 years ago

I put the following into my sandbox (and ran yaml_to_json to generate changes in diag_table.yaml):

diff --git a/param_templates/diag_table.yaml b/param_templates/diag_table.yaml
index c30f177..650eb38 100644
--- a/param_templates/diag_table.yaml
+++ b/param_templates/diag_table.yaml
@@ -13,7 +13,8 @@ FieldLists:
     - &surface_flds     ["SSH", "tos", "sos", "SSU", "SSV", "mass_wt", "opottempmint",
                          "somint", "Rd_dx", "speed", "mlotst"]

-    - &kpp_diags        ["KPP_OBLdepth:oml"]
+    - &kpp_diags        ["KPP_OBLdepth:oml", "KPP_QminusSW", "KPP_netSalt"]
+    - &kpp_3d_diags     ["KPP_NLT_dTdt", "KPP_NLT_dSdT", "KPP_NLT_temp_budget", "KPP_NLT_saln_budget"]

     - &forcing_flds     ["tauuo", "tauvo", "friver", "prsn", "prlq", "evs", "hfsso", "rlntds",
                          "hfsnthermds", "sfdsi", "rsntds", "hfds", "ustar",
@@ -106,6 +107,7 @@ Files:
                       lists:    [ *prognostic,
                                   *hist_additional,
                                   *kpp_diags,
+                                  *kpp_3d_diags,
                                   *forcing_flds,
                                   *surface_flds,
                                   *visc_flds,
@@ -118,6 +120,7 @@ Files:
                       lists:    [ *prognostic,
                                   *hist_additional,
                                   *kpp_diags,
+                                  *kpp_3d_diags,
                                   *forcing_flds,
                                   *surface_flds,
                                   *visc_flds,

I'm not sure if these should only be included in testing, or if they would be useful in all runs. My use-case has been entirely on the testing side, though some of the testing includes one-off cases that I compare by hand so I didn't try to limit it to just tests.

https://github.com/NCAR/MOM6/pull/202 introduces round-off level changes to KPP_NLT_temp_budget and KPP_NLT_saln_budget, so it was useful for me to include them in the test suite. Also, I think all of these diagnostics include various dimensional-scaling terms so we want them included in the scaling test outputs.

After the NCAR/MOM6 PR is merged, there will also be some KPP variables in the optional tracer modules (specifically CFCs and pseudosalt). It's not clear to me how to add those variables, either. Maybe something like

- &cfc_kpp_diags ["diag1", "diag2"]
mnlevy1981 commented 2 years ago

@klindsay28 suggests starting out by only including these variables when running aux_mom, and then we can add them in additional situations in the future as needed.

@alperaltuntas can you tell me how to do this? I'm happy to put together a PR with these changes.

alperaltuntas commented 2 years ago

To turn on a field list for test runs only, you can do something like:

        fields:
             $TEST == True :
                - module:   "ocean_model"
                  packing:  2   
                  lists:    [ *foo, *bar ]
            else: 
                - module:   "ocean_model"
                  packing:  2   
                  lists:    [ *foo ]

In above case, the foo list will be included at all times and the bar list will be included in test runs only, including but not limited to aux_mom test suite instances.

Am I answering the right question?