Skip to content

Commit 7d1a152

Browse files
Merge pull request #2 from ESCOMP/master
2 parents 8109b13 + e0bfc6b commit 7d1a152

36 files changed

+2362
-5662
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ else
3939
@echo "ESMF_DEP_FRONT = MED" >> cmeps.mk.install
4040
@echo "ESMF_DEP_INCPATH = $(INSTALLDIR)/include" >> cmeps.mk.install
4141
@echo "ESMF_DEP_CMPL_OBJS = " >> cmeps.mk.install
42-
@echo "ESMF_DEP_LINK_OBJS = $(INSTALLDIR)/libcmeps.a $(INSTALLDIR)/libcmeps_util.a $(INSTALLDIR)/libgptl.a $(INSTALLDIR)/libpiof.a $(INSTALLDIR)/libpioc.a $(INSTALLDIR)/libgptl.a $(PNETCDF_LD_OPTS)" >> cmeps.mk.install
42+
@echo "ESMF_DEP_LINK_OBJS = $(INSTALLDIR)/libcmeps.a $(INSTALLDIR)/libcmeps_util.a $(INSTALLDIR)/libpiof.a $(INSTALLDIR)/libpioc.a $(PNETCDF_LD_OPTS)" >> cmeps.mk.install
4343
mkdir -p $(INSTALLDIR)
4444
mkdir -p $(INSTALLDIR)/include
4545
cp -f $(PIO_INSTALL_DIR)/lib/*.a $(INSTALLDIR)

cime_config/buildnml

+7-3
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,15 @@ def buildnml(case, caseroot, component):
476476
for filename in glob.glob(os.path.join(confdir, "*modelio*")):
477477
shutil.copy(filename, rundir)
478478

479-
# copy fd.yaml to rundir
479+
# copy fd_cesm.yaml to rundir
480480
cimeroot = case.get_value("CIMEROOT")
481481
fd_dir = os.path.join(cimeroot, "src","drivers","nuopc","mediator")
482-
filename = os.path.join(fd_dir,"fd.yaml")
483-
shutil.copy(filename, rundir)
482+
coupling_mode = case.get_value('COUPLING_MODE')
483+
if coupling_mode == 'cesm':
484+
filename = os.path.join(fd_dir,"fd_cesm.yaml")
485+
else:
486+
filename = os.path.join(fd_dir,"fd_nems.yaml")
487+
shutil.copy(filename, os.path.join(rundir, "fd.yaml"))
484488

485489
###############################################################################
486490
def _main_func():

cime_config/config_component.xml

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
<desc>Name of coupling component</desc>
2727
</entry>
2828

29+
<entry id="COUPLING_MODE">
30+
<type>char</type>
31+
<valid_values>cesm,nems_orig_active,nems_orig_data,nems_frac</valid_values>
32+
<default_value>cesm</default_value>
33+
<group>run_coupling</group>
34+
<file>env_run.xml</file>
35+
<desc>coupling mode</desc>
36+
</entry>
37+
2938
<!-- ===================================================================== -->
3039
<!-- master configuration file that specifies all relevant filenames and -->
3140
<!-- and directories to configure a case -->

cime_config/namelist_definition_drv.xml

+12
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,18 @@
796796
<!-- MED general attributes -->
797797
<!-- =========================================== -->
798798

799+
<entry id="coupling_mode" modify_via_xml="COUPLING_MODE">
800+
<type>char</type>
801+
<category>control</category>
802+
<group>MED_attributes</group>
803+
<desc>
804+
Type of coupling mode to use in the mediator
805+
</desc>
806+
<values>
807+
<value>$COUPLING_MODE</value>
808+
</values>
809+
</entry>
810+
799811
<entry id="glc_renormalize_smb">
800812
<type>char</type>
801813
<category>control</category>

drivers/cime/ensemble_driver.F90

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module Ensemble_driver
1111
use med_utils_mod , only : chkerr => med_utils_ChkErr
1212
use med_constants_mod , only : dbug_flag => med_constants_dbug_flag
1313
use med_internalstate_mod , only : mastertask
14+
use med_internalstate_mod , only : logunit ! initialized here
1415

1516
implicit none
1617
private
@@ -87,8 +88,7 @@ subroutine SetModelServices(ensemble_driver, rc)
8788
use NUOPC_Driver , only : NUOPC_DriverAddComp
8889
use esm , only : ESMSetServices => SetServices, ReadAttributes
8990
!use pio_interface , only : PIOSetServices => SetServices
90-
use med_time_mod , only : med_time_clockInit
91-
use med_internalstate_mod , only : logunit ! initialized here
91+
use esm_time_mod , only : esm_time_clockInit
9292
use shr_log_mod , only : shrloglev=>shr_log_level, shrlogunit=> shr_log_unit
9393
use shr_file_mod , only : shr_file_getUnit, shr_file_getLoglevel
9494
use shr_file_mod , only : shr_file_setloglevel, shr_file_setlogunit
@@ -259,7 +259,7 @@ subroutine SetModelServices(ensemble_driver, rc)
259259
call shr_file_setLogUnit (logunit)
260260
endif
261261
enddo
262-
call med_time_clockInit(ensemble_driver, driver, logunit, rc)
262+
call esm_time_clockInit(ensemble_driver, driver, logunit, rc)
263263
if (chkerr(rc,__LINE__,u_FILE_u)) return
264264

265265
deallocate(petList)

0 commit comments

Comments
 (0)