NOAA-CEFI-Regional-Ocean-Modeling / ocean_BGC

3 stars 4 forks source link

Output COBALT runtime parameters to stdout #45

Closed yichengt900 closed 2 months ago

yichengt900 commented 2 months ago

Considering our timeline of code cleanup is tight, I propose a simple solution to partially addresses issue #30. This PR adds a simple do_not_log option to the g_tracer_add_param subroutine. The default behavior will output COBALT runtime parameters to stdout, as shown in the example below:

!-----------------------START--------------------------------------------'
! generic_cobalt parameter check
!-----------------------START--------------------------------------------'
 ml_aclm_efold= 0.2500000000000000E+1
 zmld_ref= 0.1000000000000000E+2
 densdiff_mld= 0.3000000000000000E-1
 irrad_day_thresh= 0.1000000000000000E+1
 min_daylength= 0.6000000000000000E+1
......
 ml_aclm_efold= 0.2500000000000000E+1
 zmld_ref= 0.1000000000000000E+2
 densdiff_mld= 0.3000000000000000E-1
 irrad_day_thresh= 0.1000000000000000E+1
 min_daylength= 0.6000000000000000E+1
......
 ml_aclm_efold= 0.2500000000000000E+1
 zmld_ref= 0.1000000000000000E+2
 densdiff_mld= 0.3000000000000000E-1
 irrad_day_thresh= 0.1000000000000000E+1
 min_daylength= 0.6000000000000000E+1
!------------------------END--------------------------------------------'
! generic_cobalt parameter check
!------------------------END--------------------------------------------'

This simple option allows users can check of the COBALT runtime parameters in stdout to ensure they are sensible. Additionally, if users would like to overwrite runtime parameters, they can add their desired value for a specific parameter in the field_table (see below field_table example) without recompiling the code.

# specific humidity for moist runs
 "TRACER", "atmos_mod", "sphum"
           "longname",     "specific humidity"
           "units",        "kg/kg" /
##         "profile_type", "fixed", "surface_value=3.e-6" /
# prognostic cloud scheme tracers
  "TRACER", "atmos_mod", "liq_wat"
            "longname",     "cloud liquid specific humidity"
            "units",        "kg/kg" /
  "TRACER", "atmos_mod", "ice_wat"
            "longname",     "cloud ice water specific humidity"
            "units",        "kg/kg" /
  "TRACER", "atmos_mod", "cld_amt"
            "longname",     "cloud fraction"
            "units",        "none" /
# sphum must be present on land as well
 "TRACER", "land_mod",     "sphum"
           "longname",     "specific humidity"
           "units",        "kg/kg" /
# test tracer for radon
#
# "TRACER", "atmos_mod", "radon"
#           "longname",     "radon test tracer"
#           "units",        "kg/kg" /      
###.................................................
"namelists","ocean_mod","generic_COBALT"
enforce_src_info = t
#
 ml_aclm_efold= 0.4600000000000000E+1
#
......

This PR does not change baseline answers.

Update:

After discussing with @theresa-morrison, our plan will be to make this simple stdout function live for users to start using it for parameter sanity checks. Meanwhile, @theresa-morrison will begin bringing blank MOM6-type parameter inputs/outputs. In the short to medium term, both methods will co-exist. This approach will give us time to transition gradually towards MOM6-type parameter input and output. @charliestock does this sound ok to you?

charliestock commented 2 months ago

This sounds like a great approach. Thank you both. I think we should use the field table option sparingly knowing that it isn't the long-term solution we are looking for. It could, however, be useful for parameter sensitivity tests in the nearterm.