Skip to content

Commit cb36640

Browse files
authored
Merge pull request #341 from mvertens/feature/cplhist_and_ocnimport
changes needed for CDEPS PR #213
2 parents 96f1b73 + 70d6913 commit cb36640

5 files changed

+83
-36
lines changed

cime_config/config_component_cesm.xml

-31
Original file line numberDiff line numberDiff line change
@@ -466,37 +466,6 @@
466466
<!-- averaged history frequencies -->
467467
<!-- ===================================================================== -->
468468

469-
<entry id="AVGHIST_OPTION">
470-
<type>char</type>
471-
<valid_values>none,never,nsteps,nseconds,nminutes,nhours,ndays,nmonths,nyears,date,end</valid_values>
472-
<default_value>never</default_value>
473-
<values match="last">
474-
<value compset="_DOCN%IAF">nmonths</value>
475-
</values>
476-
<group>med_history</group>
477-
<file>env_run.xml</file>
478-
<desc>Sets mediator average history file frequency (like REST_OPTION)</desc>
479-
</entry>
480-
<entry id="AVGHIST_N">
481-
<type>char</type>
482-
<valid_values></valid_values>
483-
<default_value>-999</default_value>
484-
<values match="last">
485-
<value compset="_DOCN%IAF">1</value>
486-
</values>
487-
<group>med_history</group>
488-
<file>env_run.xml</file>
489-
<desc>Sets mediator average history file frequency (like REST_N)</desc>
490-
</entry>
491-
<entry id="AVGHIST_DATE">
492-
<type>integer</type>
493-
<valid_values></valid_values>
494-
<default_value>-999</default_value>
495-
<group>med_history</group>
496-
<file>env_run.xml</file>
497-
<desc>yyyymmdd format, sets mediator average history date (like REST_DATE)</desc>
498-
</entry>
499-
500469
<entry id="BUDGETS">
501470
<type>logical</type>
502471
<valid_values>TRUE,FALSE</valid_values>

cime_config/namelist_definition_drv.xml

+65
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,71 @@
18011801
<!-- MED ocn history files -->
18021802
<!-- ======================================= -->
18031803

1804+
<!-- MED histaux ocn2med file1 -->
1805+
<entry id="histaux_ocn2med_file1_enabled">
1806+
<type>logical</type>
1807+
<category>aux_hist</category>
1808+
<group>MED_attributes</group>
1809+
<desc>Auxiliary mediator ocn2med average history output every day.</desc>
1810+
<values>
1811+
<value>.false.</value>
1812+
</values>
1813+
</entry>
1814+
<entry id="histaux_ocn2med_file1_flds">
1815+
<type>char</type>
1816+
<category>aux_hist</category>
1817+
<group>MED_attributes</group>
1818+
<desc>Auxiliary mediator ocn2med average history output every day.</desc>
1819+
<values>
1820+
<value>So_bldepth:So_t:So_u:So_v</value>
1821+
</values>
1822+
</entry>
1823+
<entry id="histaux_ocn2med_file1_history_option">
1824+
<type>char</type>
1825+
<category>aux_hist</category>
1826+
<group>MED_attributes</group>
1827+
<desc>history option type</desc>
1828+
<values>
1829+
<value>ndays</value>
1830+
</values>
1831+
</entry>
1832+
<entry id="histaux_ocn2med_file1_history_n">
1833+
<type>char</type>
1834+
<category>aux_hist</category>
1835+
<group>MED_attributes</group>
1836+
<desc>history option type</desc>
1837+
<values>
1838+
<value>1</value>
1839+
</values>
1840+
</entry>
1841+
<entry id="histaux_ocn2med_file1_doavg">
1842+
<type>logical</type>
1843+
<category>aux_hist</category>
1844+
<group>MED_attributes</group>
1845+
<desc>If true, use time average for aux file output.</desc>
1846+
<values>
1847+
<value>.true.</value>
1848+
</values>
1849+
</entry>
1850+
<entry id="histaux_ocn2med_file1_auxname">
1851+
<type>char</type>
1852+
<category>aux_hist</category>
1853+
<group>MED_attributes</group>
1854+
<desc>Auxiliary name identifier in history name</desc>
1855+
<values>
1856+
<value>ocn.24h.avg</value>
1857+
</values>
1858+
</entry>
1859+
<entry id="histaux_ocn2med_file1_ntperfile">
1860+
<type>integer</type>
1861+
<category>aux_hist</category>
1862+
<group>MED_attributes</group>
1863+
<desc>Number of time sames per file.</desc>
1864+
<values>
1865+
<value>30</value>
1866+
</values>
1867+
</entry>
1868+
18041869
<entry id="history_option_ocn_inst">
18051870
<type>char</type>
18061871
<category>time</category>

cime_config/runseq/driver_config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ def __compute_ocn(self, case, coupling_times):
132132
# TODO: check of data model prognostic flag is on - this is a new xml variable
133133
# If the prognostic flag is on, then should set med_to_wav to True
134134
docn_mode = case.get_value("DOCN_MODE")
135-
med_to_ocn = ('som' in docn_mode or 'interannual' in docn_mode)
135+
docn_import_fields = case.get_value("DOCN_IMPORT_FIELDS")
136+
med_to_ocn = ('som' in docn_mode or 'interannual' in docn_mode or docn_import_fields != 'none')
136137

137138
return (run_ocn, med_to_ocn, coupling_times["ocn_cpl_dt"])
138139

cime_config/runseq/runseq_general.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def gen_runseq(case, coupling_times):
9494
runseq.add_action("MED med_phases_aofluxes_run" , run_ocn and run_atm and (med_to_ocn or med_to_atm))
9595
runseq.add_action("MED med_phases_prep_ocn_accum" , med_to_ocn)
9696
runseq.add_action("MED med_phases_ocnalb_run" , (run_ocn and run_atm and (med_to_ocn or med_to_atm)) and not xcompset)
97-
runseq.add_action("MED med_phases_diag_ocn" , run_ocn and diag_mode)
97+
runseq.add_action("MED med_phases_diag_ocn" , run_ocn and diag_mode)
9898

9999
if (cpl_seq_option == 'OPTION1'):
100100
if ocn_cpl_time != atm_cpl_time:
@@ -104,11 +104,17 @@ def gen_runseq(case, coupling_times):
104104
if ocn_cpl_time != atm_cpl_time:
105105
runseq.leave_time_loop(inner_loop, addextra_atsign=True)
106106

107+
if (cpl_seq_option == 'TIGHT'):
108+
runseq.add_action("MED med_phases_aofluxes_run" , med_to_ocn)
109+
runseq.add_action("MED med_phases_prep_ocn_accum" , med_to_ocn)
110+
runseq.add_action("MED med_phases_prep_ocn_avg" , med_to_ocn and ocn_outer_loop)
111+
runseq.add_action("MED -> OCN :remapMethod=redist", med_to_ocn and ocn_outer_loop)
112+
107113
runseq.add_action("MED med_phases_prep_lnd" , med_to_lnd)
108114
runseq.add_action("MED -> LND :remapMethod=redist" , med_to_lnd)
109115

110-
runseq.add_action("MED med_phases_prep_ice" , med_to_ice)
111-
runseq.add_action("MED -> ICE :remapMethod=redist" , med_to_ice)
116+
runseq.add_action("MED med_phases_prep_ice" , med_to_ice)
117+
runseq.add_action("MED -> ICE :remapMethod=redist" , med_to_ice)
112118

113119
runseq.add_action("MED med_phases_prep_wav_accum" , med_to_wav)
114120
runseq.add_action("MED med_phases_prep_wav_avg" , med_to_wav)

mediator/med_phases_prep_ocn_mod.F90

+7-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ subroutine med_phases_prep_ocn_custom_cesm(gcomp, rc)
372372

373373
rc = ESMF_SUCCESS
374374

375-
call t_startf('MED:'//subname)
376375
if (dbug_flag > 20) then
377376
call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)
378377
end if
@@ -383,6 +382,13 @@ subroutine med_phases_prep_ocn_custom_cesm(gcomp, rc)
383382
call ESMF_GridCompGetInternalState(gcomp, is_local, rc)
384383
if (ChkErr(rc,__LINE__,u_FILE_u)) return
385384

385+
! Check that the necessary export field is present
386+
if ( .not. FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet', rc=rc)) then
387+
return
388+
end if
389+
390+
call t_startf('MED:'//subname)
391+
386392
!---------------------------------------
387393
! Compute netsw for ocean
388394
!---------------------------------------

0 commit comments

Comments
 (0)