Skip to content

Commit

Permalink
Merge branch 'main' into feature/sithick_to_wav
Browse files Browse the repository at this point in the history
  • Loading branch information
mvertens committed Aug 10, 2024
2 parents 5f71b36 + e71a5aa commit 55355f6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 65 deletions.
2 changes: 1 addition & 1 deletion cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
else:
config["single_column"] = "false"

# needed for determining the run sequence as well as glc_renormalize_smb
# needed for determining the run sequence
config["COMP_ATM"] = case.get_value("COMP_ATM")
config["COMP_ICE"] = case.get_value("COMP_ICE")
config["COMP_GLC"] = case.get_value("COMP_GLC")
Expand Down
13 changes: 13 additions & 0 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,19 @@
</entry>

<!-- ===================================================================== -->
<!-- optionally connect the case to a remote git repository, -->
<!-- the branch is the case name and must be unique in remote -->
<!-- ===================================================================== -->

<entry id="CASE_GIT_REPOSITORY">
<type>char</type>
<default_value></default_value>
<group>case_git</group>
<file>env_build.xml</file>
<desc>Remote git repository used for this case</desc>
</entry>

<!-- ===================================================================== -->
<!-- Include the AOFLUX calculation for this compset -->
<!-- ===================================================================== -->

Expand Down
19 changes: 3 additions & 16 deletions cime_config/config_component_cesm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
<value compset="_DATM">none</value>
<value compset="_DATM%CPLHIST.+POP\d">CO2A</value>
<value compset="_DATM%CPLHIST.+BLOM%ECO">CO2A</value>
<value compset="^OMIP_DATM%IAF.*_POP2%[^_]*ECO">CO2A</value>
<value compset="^OMIP_DATM%JRA.*_POP2%[^_]*ECO">CO2A</value>
<value compset="^OMIP_DATM%IAF.*_MOM6%[^_]*MARBL">CO2A</value>
<value compset="^OMIP_DATM%JRA.*_MOM6%[^_]*MARBL">CO2A</value>
<value compset="HIST.*_DATM.*_CLM">CO2A</value>
<value compset="SSP.*_DATM.*_CLM">CO2A</value>
<value compset="_BGC%BPRP">CO2C</value>
Expand Down Expand Up @@ -236,15 +236,12 @@
<!-- =================================================== -->
<!-- C compsets -->
<!-- =================================================== -->
<value compset="_DATM.*_DICE.*_POP2">24</value>
<value compset="_DATM.*_DICE.*_MOM6">24</value>
<value compset="_DATM.*_DICE.*_BLOM">24</value>
<!-- NOTE: currently a NUOPC runseqence cannot be generated with the ATM_NCPL < OCN_NCPL -->
<!-- =================================================== -->
<!-- G compsets -->
<!-- =================================================== -->
<value compset="_DATM.*_SLND.*_CICE.*_POP2">24</value>
<value compset="_DATM.*_SLND.*_CICE.*_POP2" grid="oi%tx0.1v3">144</value>
<value compset="_DATM.*_SLND.*_CICE.*_MOM6">24</value>
<value compset="_DATM.*_SLND.*_CICE.*_BLOM">24</value>
<value compset="_DATM.*_CICE.*_DOCN">24</value>
Expand Down Expand Up @@ -330,11 +327,6 @@
<values match="last">
<value compset="_MOM6">24</value>
<value compset="_BLOM">24</value>
<value compset="_POP2" grid="oi%gx3v7">1</value>
<value compset="_POP2" grid="oi%gx1v6">24</value>
<value compset="_POP2" grid="oi%gx1v7">24</value>
<value compset="_POP2" grid="oi%tx0.1v2">48</value>
<value compset="_POP2" grid="oi%tx0.1v3">48</value>
<value compset="_DLND.*_CISM\d">1</value>
<value compset="_NEMO">24</value>
</values>
Expand Down Expand Up @@ -386,7 +378,6 @@
<type>integer</type>
<default_value>8</default_value>
<values match="last">
<value compset="_DATM.*_POP2.*_DROF" grid="oi%gx3v7">1</value>
<value compset="_DATM.*_MOM6.*_DROF" >$ATM_NCPL</value>
<value compset="_DATM.*_BLOM.*_DROF" >$ATM_NCPL</value>
<value compset="_DATM.*_DOCN%SOM" >$ATM_NCPL</value>
Expand Down Expand Up @@ -475,11 +466,8 @@
<default_value>TIGHT</default_value>
<values match="last">
<value compset="_DATM.*_DOCN%SOM" >OPTION2</value>
<value compset="_POP2" >OPTION2</value>
<value compset="_MOM6" >OPTION1</value>
<value compset="_BLOM" >OPTION1</value>
<value compset="_POP2" grid="oi%gx1v6" >OPTION1</value>
<value compset="_POP2" grid="oi%gx1v7" >OPTION1</value>
<value compset="_DATM%NYF.*_SLND.*_DICE.*_DOCN" >OPTION2</value>
<value compset="_XATM.*_XLND.*_XICE.*_XOCN" >OPTION2</value>
<value compset="_SOCN" >OPTION2</value>
Expand Down Expand Up @@ -555,8 +543,7 @@
<default_value>284.7</default_value>
<values match="last">
<value compset="^2000">367.0</value>
<value compset="DATM.*_POP2%[^_]*ECO">284.317</value>
<value compset="DATM.*_POP2%[^_]*ECOCESM20">284.7</value>
<value compset="DATM.*_MOM6%[^_]*MARBL">284.317</value>
</values>
<group>run_co2</group>
<file>env_run.xml</file>
Expand Down
28 changes: 11 additions & 17 deletions cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -843,32 +843,26 @@
<type>char</type>
<category>control</category>
<group>MED_attributes</group>
<valid_values>on,off,on_if_glc_coupled_fluxes</valid_values>
<valid_values>on,off</valid_values>
<desc>
Whether to renormalize the surface mass balance (smb) sent from lnd to glc so that the
global integral on the glc grid agrees with the global integral on the lnd grid.

Unlike most fluxes, smb is remapped with bilinear rather than conservative mapping weights,
so this option is needed for conservation. However, conservation is not required in many
cases, since we often run glc as a diagnostic (one-way-coupled) component.
Unlike most fluxes, smb is remapped with bilinear rather than conservative mapping
weights, so this option is needed for conservation. However, this can be turned off
in non-fully-coupled configurations where conservation isn't important (e.g.,
glc-only configurations - T compsets) to avoid the global correction that comes with
this renormalization.

Allowable values are:
'on': always do this renormalization
'off': never do this renormalization (see WARNING below)
'on_if_glc_coupled_fluxes': Determine at runtime whether to do this renormalization.
Does the renormalization if we're running a two-way-coupled glc that sends fluxes
to other components (which is the case where we need conservation).
Does NOT do the renormalization if we're running a one-way-coupled glc, or if
we're running a glc-only compset (T compsets).
(In these cases, conservation is not important.)
'on': do this renormalization
'off': do not do this renormalization; note that this will break conservation so
typically should not be used in fully-coupled cases

Only used if running with a prognostic GLC component.

WARNING: Setting this to 'off' will break conservation when running with an
evolving, two-way-coupled glc.
Only used if running with a GLC component.
</desc>
<values>
<value>on_if_glc_coupled_fluxes</value>
<value>on</value>
<value COMP_LND="xlnd">off</value>
</values>
</entry>
Expand Down
27 changes: 11 additions & 16 deletions doc/source/addendum/req_attributes_cesm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,19 @@ Mediator land-ice component attribtes
Whether to renormalize the surface mass balance (smb) sent from lnd to glc so that the
global integral on the glc grid agrees with the global integral on the lnd grid.

Unlike most fluxes, smb is remapped with bilinear rather than conservative mapping weights,
so this option is needed for conservation. However, conservation is not required in many
cases, since we often run glc as a diagnostic (one-way-coupled) component.
Unlike most fluxes, smb is remapped with bilinear rather than conservative mapping
weights, so this option is needed for conservation. However, this can be turned off in
non-fully-coupled configurations where conservation isn't important (e.g., glc-only
configurations - T compsets) to avoid the global correction that comes with this
renormalization.

Allowable values are:
``on``: always do this renormalization

``off``: never do this renormalization (see WARNING below)

``on_if_glc_coupled_fluxes``: Determine at runtime whether to do this renormalization.
Does the renormalization if we're running a two-way-coupled glc that sends fluxes
to other components (which is the case where we need conservation).
Does NOT do the renormalization if we're running a one-way-coupled glc, or if
we're running a glc-only compset (T compsets).
(In these cases, conservation is not important.)
Only used if running with a prognostic GLC component.
WARNING: Setting this to 'off' will break conservation when running with an
evolving, two-way-coupled glc.
``on``: do this renormalization

``off``: do not do this renormalization; note that this will break conservation so
typically should not be used in fully-coupled cases

Only used if running with a GLC component.

**glc_avg_period**
Period at which coupler averages fields sent to GLC (the land-ice component).
Expand Down
15 changes: 0 additions & 15 deletions mediator/med_phases_prep_glc_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ subroutine med_phases_prep_glc_init(gcomp, rc)
type(ESMF_Mesh) :: mesh_o
type(ESMF_Field) :: lfield
character(len=CS) :: glc_renormalize_smb
logical :: glc_coupled_fluxes
integer :: ungriddedUBound_output(1) ! currently the size must equal 1 for rank 2 fieldds
character(len=*),parameter :: subname=' (med_phases_prep_glc_init) '
!---------------------------------------
Expand Down Expand Up @@ -234,25 +233,11 @@ subroutine med_phases_prep_glc_init(gcomp, rc)
call NUOPC_CompAttributeGet(gcomp, name='glc_renormalize_smb', value=glc_renormalize_smb, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

! TODO: talk to Bill Sacks to determine if this is the correct logic
glc_coupled_fluxes = is_local%wrap%med_coupling_active(compglc(1),complnd)
! Note glc_coupled_fluxes should be false in the no_evolve cases
! Goes back to the zero-gcm fluxes variable - if zero-gcm fluxes is true than do not renormalize
! The user can set this to true in an evolve cases

select case (glc_renormalize_smb)
case ('on')
smb_renormalize = .true.
case ('off')
smb_renormalize = .false.
case ('on_if_glc_coupled_fluxes')
if (.not. glc_coupled_fluxes) then
! Do not renormalize if med_coupling_active is not true for compglc->complnd
! In this case, conservation is not important
smb_renormalize = .false.
else
smb_renormalize = .true.
end if
case default
write(logunit,*) subname,' ERROR: unknown value for glc_renormalize_smb: ', trim(glc_renormalize_smb)
call ESMF_LogWrite(trim(subname)//' ERROR: unknown value for glc_renormalize_smb: '// trim(glc_renormalize_smb), &
Expand Down

0 comments on commit 55355f6

Please sign in to comment.