Skip to content

Commit

Permalink
added wav/ice coupling
Browse files Browse the repository at this point in the history
  • Loading branch information
mvertens committed Apr 25, 2023
1 parent a268235 commit 263bebe
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
8 changes: 2 additions & 6 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,13 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
elif case.get_value('RUN_TYPE') == 'branch':
config['run_type'] = 'branch'

config['wav_ice_coupling'] = config['COMP_WAV'] == 'ww3dev' and config['COMP_ICE'] == 'cice'

#----------------------------------------------------
# Initialize namelist defaults
#----------------------------------------------------
nmlgen.init_defaults(infile, config, skip_default_for_groups=["modelio"])

#--------------------------------
# Set default wav-ice coupling (assumes cice6 as the ice component
#--------------------------------
if (case.get_value("COMP_WAV") == 'ww3dev' and case.get_value("COMP_ICE") == 'cice'):
nmlgen.add_default('wavice_coupling', value='.true.')

#--------------------------------
# Overwrite: set brnch_retain_casename
#--------------------------------
Expand Down
8 changes: 8 additions & 0 deletions cime_config/config_component_cesm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,15 @@
<value compset="_CAM">CO2A</value>
<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="HIST.*_DATM.*_CLM">CO2A</value>
<value compset="SSP.*_DATM.*_CLM">CO2A</value>
<value compset="_BGC%BPRP">CO2C</value>
<value compset="_BGC%BDRD">CO2C</value>
<value compset="20TR_DATM%IAF.*_BLOM%ECO">CO2A</value>
<value compset="20TR_DATM%JRA.*_BLOM%ECO">CO2A</value>
</values>
<group>run_coupling</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -232,6 +235,11 @@
<!-- =================================================== -->
<!-- TODO: why is this here? -->
<value compset="_DLND.*_CISM\d">1</value>
<!-- =================================================== -->
<!-- N compsets -->
<!-- =================================================== -->
<value compset="_DATM.*_BLOM">24</value>
<value compset="_BLOM" grid="oi%tnx0.25v">48</value>
</values>
<group>run_coupling</group>
<file>env_run.xml</file>
Expand Down
5 changes: 4 additions & 1 deletion cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2270,6 +2270,7 @@
</desc>
<values>
<value COMP_OCN="pop">4</value>
<value COMP_OCN="blom">4</value>
<value>0</value>
</values>
</entry>
Expand Down Expand Up @@ -3798,7 +3799,7 @@
</values>
</entry>

<entry id="wavice_coupling">
<entry id="wav_coupling_to_cice">
<type>logical</type>
<category>expdef</category>
<group>ALLCOMP_attributes</group>
Expand All @@ -3807,6 +3808,8 @@
</desc>
<values>
<value>.false.</value>
<!-- The following is not set as a default for now -->
<!-- <value wav_coupling_to_cice='on'>.true.</value> -->
</values>
</entry>

Expand Down
12 changes: 6 additions & 6 deletions mediator/esmFldsExchange_cesm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
integer :: n, ns
character(len=CL) :: cvalue
character(len=CS) :: name
logical :: wavice_coupling
logical :: wav_coupling_to_cice
logical :: ocn2glc_coupling
character(len=*) , parameter :: subname=' (esmFldsExchange_cesm) '
!--------------------------------------

rc = ESMF_SUCCESS

call NUOPC_CompAttributeGet(gcomp, name='wavice_coupling', value=cvalue, rc=rc)
call NUOPC_CompAttributeGet(gcomp, name='wav_coupling_to_cice', value=cvalue, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
read(cvalue,*) wavice_coupling
read(cvalue,*) wav_coupling_to_cice

call NUOPC_CompAttributeGet(gcomp, name='ocn2glc_coupling', value=cvalue, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -2809,7 +2809,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
! ---------------------------------------------------------------------
! to ice: wave elevation spectrum (field with ungridded dimensions)
! ---------------------------------------------------------------------
if (wavice_coupling) then
if (wav_coupling_to_cice) then
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_elevation_spectrum')
call addfld_to(compice, 'Sw_elevation_spectrum')
Expand Down Expand Up @@ -2844,7 +2844,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
!----------------------------------------------------------
! to wav: ice thickness from ice
!----------------------------------------------------------
if (wavice_coupling) then
if (wav_coupling_to_cice) then
if (phase == 'advertise') then
call addfld_from(compice, 'Si_thick')
call addfld_to(compwav, 'Si_thick')
Expand All @@ -2859,7 +2859,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
!----------------------------------------------------------
! to wav: ice floe diameter from ice
!----------------------------------------------------------
if (wavice_coupling) then
if (wav_coupling_to_cice) then
if (phase == 'advertise') then
call addfld_from(compice, 'Si_floediam')
call addfld_to(compwav, 'Si_floediam')
Expand Down

0 comments on commit 263bebe

Please sign in to comment.