-
Notifications
You must be signed in to change notification settings - Fork 20
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
Option to provide enthalpy fluxes via NUOPC coupler #214
Option to provide enthalpy fluxes via NUOPC coupler #214
Conversation
* Remove lrunoff_hflx and frunoff_hflx from the IOB type. These are never used; * mean_runoff_heat_flx and mean_calving_heat_flx are are never advertized, so these have been deleted; * If cesm_coupled=true, six new fields are imported: - heat_content_lprec - heat_content_fprec - heat_content_evap - heat_content_cond - heat_content_rofl - heat_content_rofi * Add a new parameter (ENTHALPY_FROM_COUPLER) to control if the enthalpy associated with mass entering/leaving the ocean is provided via the coupler or calculated in MOM6.
* If fluxes%heat_content_evap is associated, which will only happens in CESM and when ENTHALPY_FROM_COUPLER=True, the heat contribution from mass entering/leaving the ocean is accounted for using the six enthalpy terms provided by the coupler: heat_content_evap, heat_content_lprec, heat_content_fprec, heat_content_cond, heat_content_lrunoff, and heat_content_frunoff. If fluxes%heat_content_evap is not associated, these terms are accounted for via tv%TempxPmE; * TODO: check that these changes do not change answers for GFDL.
This commit change the description of parameter ENTHALPY_FROM_COUPLER, and it changes the call so that ENTHALPY_FROM_COUPLER is now logged at this point.
* Introduces a new constant (EnthalpyConst = 1.0, by default) which is set to 0.0 when fluxes%heat_content_evap is associated. This constant is used in the expression that accounts for the temperature of the mass exchange (dTemp) to avoid double-couting for the enthalpy terms when they are provided via coupler. * Use heat_content_evap to determine if the diagostics heat_content_massin, heat_content_massout, and TempxPmE should be calculated.
* Modify allocate_forcing_by_group so that heat_content_evap is allocated and heat_content_massin and heat_content_massout *are not* allocated when enthlapy terms are provided via coupler. This is done via optional argument (hevap); * Apply all modifications needed to include a new field in the flux type (heat_content_evap): rotate_array, deallocate, fluxes_accumulate, hchksum, and new diagnostics; * Modify forcing_diagnostics so that diagnostics are properly computed whether enthalpy terms are provided via coupler or computed by MOM6. This is done by introducing a logical variable mom_enthalpy (default = true, meaning dianostics are computed in the default way, using heat_content_massout). When then optional argument (enthalpy) is present and true, mom_enthalpy = false. In this case, diagnositcs are computed using heat_content_evap instead of heat_content_massout. * Deletes all entries associated with heat_content_icemelt. The enthalpy associated with the mass from sea ice formation/melting is already accounted for in field seaice_melt_heat. A note explaining this is also added. Subroutine extractFluxes1d: * When enthalpy terms are computed by MOM6, their contribution to the heat budget is accounted for in subroutine applyBoundaryFluxesInOut. On the other hand, when enthalpy terms are provided via coupler, they are included in net_heat in this subroutine; * By default the heat content from mass entering and leaving the ocean (enthalpy) is diagnosed in this subroutine. When heat_content_evap is associated, the enthalpy terms are provided via coupler and, therefore, they do not need to be computed again. A logical variable (do_enthalpy, deault = true) is introduced for this purposes. If luxes%heat_content_evap, do_enthalpy = false.
@alperaltuntas, I have not tested these changes when |
@gustavo-marques - is this good time to depracate the mct cap funcitonality? With cice6 coming in and not having an mct cap all simulations with cice6 and testing will only be with nuopc. |
@mvertens: yes, I think so but we need to make sure that others using CESM/MOM6 are okay with that. @klindsay28 and @mnlevy1981, are you still using MCT for the MARBL tests? |
My MARBL branch is based off of |
fluxes%heat_content_fprec(i,j) = US%W_m2_to_QRZ_T * IOB%hsnow(i-i0,j-j0) * G%mask2dT(i,j) | ||
|
||
if (associated(IOB%hevap)) & | ||
fluxes%heat_content_evap(i,j) = US%W_m2_to_QRZ_T * IOB%hevap(i-i0,j-j0) * G%mask2dT(i,j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am following the code correctly, IOB%hevap is allocated at all times when cesm_coupled is True. However, fluxes%heat_content_evap gets allocated only if ENTHALPY_FROM_COUPLER is set to True, which is problematic. I think IOB%hevap should also be allocated only when ENTHALPY_FROM_COUPLER is set to True. This may apply to other heat_content components too. @gustavo-marques ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out. I could not find an easy way to control the allocation of the enthalpy terms in the IOB type. Instead, I added a conditional statement for setting fluxes%heat_content_* in this subroutine. I tested this modification by running a BMOM case with ENTHALPY_FROM_COUPLER = False and there were no issues.
* only writes fluxes%heat_content_* when ENTHALPY_FROM_COUPLER = True.
Codecov Report
@@ Coverage Diff @@
## dev/ncar #214 +/- ##
============================================
- Coverage 28.87% 28.87% -0.01%
============================================
Files 243 243
Lines 71875 71899 +24
============================================
+ Hits 20756 20760 +4
- Misses 51119 51139 +20
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All aux_mom tests pass. Answer changes due to changed field list.
@gustavo-marques, could you confirm the github actions test failure is expected? |
@alperaltuntas, thanks. Diagnostics heat_content_icemelt and total_heat_content_icemelt were removed and this explains why the regression tests are failing. |
This PR must be evaluated in conjunction with ESCOMP/CMEPS#278
These changes allow MOM6 to receive enthalpy fluxes via coupler, instead of having them being computed inside the model. This option is only implemented in the NUOPC cap. To control how enthalpy fluxes are provided, a new
MOM_input
parameter is introducedENTHALPY_FROM_COUPLER
. Currently, by default, this parameter is set toFalse
(MOM6 will compute the enthalpy terms), but this can be changed in a future PR or via MOM_interface.When
cesm_coupled=True
andENTHALPY_FROM_COUPLER=True
, the NUOPC cap allocatesfluxes%heat_content_evap
. The latter is then used to control if MOM6 needs to compute the enthalpy fluxes and how/which diagnostics should be calculated or accounted for. The heat contribution from mass entering/leaving the ocean is considered using the following six terms provided by the coupler:Fields
heat_content_massout
andheat_content_massin
are no longer used/allocated whenENTHALPY_FROM_COUPLER=True
. This is because MOM6 can no longer determine if the corresponding heat content is from mass being added/removed into/from the ocean.Consistency/Conservation checks
This notebook documents consistency checks for heat, mass, and salt, where global changes are within truncation error of the corresponding forcing applied ✔️
This notebook provides a comparison between a yearly-average MOM6 history file against the heat and water budget tables generated by the coupler for the second year of a BMOM simulation ✔️
Diagnostics
heat_content_icemelt
andtotal_heat_content_icemelt
were removed. This explains why the regression tests are failing;ENTHALPY_FROM_COUPLER=True
, two new diagnostics become available:heat_content_evap
andtotal_heat_content_evap
; and the following diagnostics are no longer available:heat_content_massout
,heat_content_massin
,total_heat_content_massout
, andtotal_heat_content_massin
.Summary of additional commits:
lrunoff_hflx
andfrunoff_hflx
andmean_runoff_heat_flx
andmean_calving_heat_flx
from the NUOPC cap. These were never used;heat_content_icemelt
. The enthalpy associated with the mass from sea ice formation/melting is already accounted for inseaice_melt_heat
. A note explaining this has been added to the code;forcing_diagnostics
so that diagnostics are properly computed whether enthalpy terms are provided via coupler or computed by MOM6. This is done by introducing a logical variablemom_enthalpy
(default = true, meaning diagnostics are computed in the default way, usingheat_content_massout
). When the optional argument (enthalpy
) is present and true,mom_enthalpy = false
. In this case, diagnostics are computed usingheat_content_evap
instead ofheat_content_massout
.EnthalpyConst
= 1.0, by default) which is set to 0.0 whenfluxes%heat_content_evap
is associated. This constant is used in the expression that accounts for the temperature of the mass exchange (dTemp
) to avoid double-counting for the enthalpy terms when they are provided via coupler.Change in answers
aux_mom
test suit becauseheat_content_icemelt
has been removed. As mentioned before, the enthalpy associated with the mass from sea ice formation/melting is already accounted for inseaice_melt_heat
. Answers will also change onceENTHALPY_FROM_COUPLER=True
;MOM6-examples
test suite.