Skip to content

Commit

Permalink
Update CMEPS for postphases, ice sheets and glc->ocn dynamic mapping
Browse files Browse the repository at this point in the history
* adds multiple ice sheet functionality (ESCOMP#140)
* adds post phases for performance enhancement (ESCOMP#146)
* adds ocn->glc (land ice) coupling at multiple levels (ESCOMP#148)
  • Loading branch information
DeniseWorthen committed Jan 11, 2021
1 parent 47dcaf1 commit 51d21d8
Show file tree
Hide file tree
Showing 46 changed files with 5,403 additions and 3,180 deletions.
18 changes: 15 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,26 @@ Any User Interface Changes (namelist or namelist defaults changes)?
- [ ] No

Testing performed if application target is CESM:(either UFS-S2S or CESM testing is required):
- [ ] (required) CIME_DRIVER=nuopc scripts_regression_tests.py
- [ ] (recommended) CIME_DRIVER=nuopc scripts_regression_tests.py
- machines:
- details (e.g. failed tests):
- [ ] (required) CESM testlist_drv.xml
- [ ] (recommended) CESM testlist_drv.xml
- machines and compilers:
- details (e.g. failed tests):
- [ ] (optional) CESM prealpha test
- machines and compilers
- details (e.g. failed tests):
- [ ] (other) please described in detail
- machines and compilers
- details (e.g. failed tests):

Testing performed if application target is UFS-S2S:
- [ ] (required) UFS-S2S testing
- [ ] (recommended) UFS-S2S testing
- description:
- details (e.g. failed tests):

Testing performed if application target is UFS-HAFS:
- [ ] (recommended) UFS-HAFS testing
- description:
- details (e.g. failed tests):

Expand All @@ -40,3 +48,7 @@ Hashes used for testing:
- repository to check out:
- branch:
- hash:
- [ ] UFS-HAFS, then umbrella repostiory to check out and associated hash:
- repository to check out:
- branch:
- hash:
48 changes: 48 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
cmake_minimum_required(VERSION 3.10)
include(ExternalProject)

if (DEFINED CIMEROOT)
message("Using CIME in ${CIMEROOT} with compiler ${COMPILER}")
include(${CASEROOT}/Macros.cmake)
if (${PIO_VERSION} LESS 2)
message( FATAL_ERROR "Version 2 of the PIO library required")
endif()
if (${MPILIB} STREQUAL "mpi-serial")
set(CMAKE_C_COMPILER ${SCC})
set(CMAKE_Fortran_COMPILER ${SFC})
set(CMAKE_CXX_COMPILER ${SCXX})
else()
set(CMAKE_C_COMPILER ${MPICC})
set(CMAKE_Fortran_COMPILER ${MPIFC})
set(CMAKE_CXX_COMPILER ${MPICXX})
endif()
set(CMAKE_Fortran_FLAGS "${FFLAGS} -I${LIBROOT}/include -I${LIBROOT}/finclude -I${LIBROOT}/nuopc/esmf/${NINST_VALUE}/include")
else()
set(BLD_STANDALONE TRUE)
endif()

project(CMEPS LANGUAGES Fortran VERSION 0.1)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

message("CMAKE_MODULE_PATH is ${CMAKE_MODULE_PATH}")

find_package(ESMF REQUIRED)
if (DEFINED PIO)
set(PIO_PATH ${PIO})
else()
set(PIO_PATH $ENV{PIO})
endif()
find_package(PIO REQUIRED COMPONENT C Fortran PATH ${PIO_PATH})

if (NOT DEFINED MPILIB OR NOT ${MPILIB} STREQUAL "mpi-serial")
find_package(MPI REQUIRED)
endif()

if(BLD_STANDALONE)
add_subdirectory(nems/util)
list(APPEND EXTRA_LIBS cmeps_share)
list(APPEND EXTRA_INCLUDES "${CMAKE_BINARY_DIR}/nems/util")
endif()

add_subdirectory(mediator)
6 changes: 1 addition & 5 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,6 @@ def _create_runseq(case, coupling_times, valid_comps):
from runseq_D import gen_runseq
elif (comp_lnd == 'dlnd' and comp_glc == "cism"):
from runseq_TG import gen_runseq
elif (comp_atm == 'ufsatm' and comp_ocn == "mom" and comp_ice == 'cice'):
from runseq_NEMS import gen_runseq
else:
from runseq_general import gen_runseq

Expand Down Expand Up @@ -571,10 +569,8 @@ def buildnml(case, caseroot, component):
filename = os.path.join(fd_dir,"fd_cesm.yaml")
elif coupling_mode == 'hafs':
filename = os.path.join(fd_dir,"fd_hafs.yaml")
elif 'nems' in coupling_mode:
filename = os.path.join(fd_dir,"fd_nems.yaml")
else:
expect(False, "coupling mode currently only supports cesm, hafs and nems")
expect(False, "coupling mode currently only supports cesm")
shutil.copy(filename, os.path.join(rundir, "fd.yaml"))

###############################################################################
Expand Down
198 changes: 189 additions & 9 deletions cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@
</values>
</entry>

<entry id="Profiling@driver_attributes" modify_via_xml="ESMF_PROFILING_LEVEL">
<type>char</type>
<category>nuopc</category>
<group>DRIVER_attributes</group>
<values>
<value>$ESMF_PROFILING_LEVEL</value>
</values>
</entry>

<entry id="Verbosity@med_attributes" modify_via_xml="ESMF_VERBOSITY_LEVEL">
<type>char</type>
<category>nuopc</category>
Expand Down Expand Up @@ -393,6 +384,15 @@
<!-- All components orbital attributes -->
<!-- =========================================== -->

<entry id="Profiling" modify_via_xml="ESMF_PROFILING_LEVEL">
<type>char</type>
<category>nuopc</category>
<group>ALLCOMP_attributes</group>
<values>
<value>$ESMF_PROFILING_LEVEL</value>
</values>
</entry>

<entry id="orb_mode">
<type>char</type>
<category>orbital</category>
Expand Down Expand Up @@ -768,6 +768,31 @@
</values>
</entry>

<entry id="ocn2glc_coupling">
<type>logical</type>
<category>flds</category>
<group>ALLCOMP_attributes</group>
<desc>
.true. if ocean sends fields at multiple ocean levels to the land-ice component
</desc>
<values>
<value>.false.</value>
</values>
</entry>

<entry id="ocn2glc_levels">
<type>char</type>
<category>flds</category>
<group>ALLCOMP_attributes</group>
<desc>
if the ocean component sends fields at multiple ocean levels to the
land-ice component, these are the colon deliminted level indices
</desc>
<values>
<value>1:10:19:26:30:33:35</value>
</values>
</entry>

<entry id="tfreeze_option" modify_via_xml="TFREEZE_SALTWATER_OPTION">
<type>char</type>
<category>control</category>
Expand Down Expand Up @@ -826,6 +851,161 @@
<!-- MED general attributes -->
<!-- =========================================== -->

<entry id="atm_nx" modify_via_xml="ATM_NX">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of atm cells in i direction
</desc>
<values>
<value>$ATM_NX</value>
</values>
</entry>
<entry id="atm_ny" modify_via_xml="ATM_NY">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of atm cells in j direction
</desc>
<values>
<value>$ATM_NY</value>
</values>
</entry>
<entry id="ice_nx" modify_via_xml="ICE_NX">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of ice cells in i direction
</desc>
<values>
<value>$ICE_NX</value>
</values>
</entry>
<entry id="ice_ny" modify_via_xml="ICE_NY">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of ice cells in j direction
</desc>
<values>
<value>$ICE_NY</value>
</values>
</entry>
<entry id="glc_nx" modify_via_xml="GLC_NX">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of glc cells in i direction
</desc>
<values>
<value>$GLC_NX</value>
</values>
</entry>
<entry id="glc_ny" modify_via_xml="GLC_NY">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of glc cells in j direction
</desc>
<values>
<value>$GLC_NY</value>
</values>
</entry>
<entry id="lnd_nx" modify_via_xml="LND_NX">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of lnd cells in i direction
</desc>
<values>
<value>$LND_NX</value>
</values>
</entry>
<entry id="lnd_ny" modify_via_xml="LND_NY">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of lnd cells in j direction
</desc>
<values>
<value>$LND_NY</value>
</values>
</entry>
<entry id="ocn_nx" modify_via_xml="OCN_NX">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of ocn cells in i direction
</desc>
<values>
<value>$OCN_NX</value>
</values>
</entry>
<entry id="ocn_ny" modify_via_xml="OCN_NY">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of ocn cells in j direction
</desc>
<values>
<value>$OCN_NY</value>
</values>
</entry>
<entry id="rof_nx" modify_via_xml="ROF_NX">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of rof cells in i direction
</desc>
<values>
<value>$ROF_NX</value>
</values>
</entry>
<entry id="rof_ny" modify_via_xml="ROF_NY">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of rof cells in j direction
</desc>
<values>
<value>$ROF_NY</value>
</values>
</entry>
<entry id="wav_nx" modify_via_xml="WAV_NX">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of wav cells in i direction
</desc>
<values>
<value>$WAV_NX</value>
</values>
</entry>
<entry id="wav_ny" modify_via_xml="WAV_NY">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
number of wav cells in j direction
</desc>
<values>
<value>$WAV_NY</value>
</values>
</entry>

<entry id="coupling_mode" modify_via_xml="COUPLING_MODE">
<type>char</type>
<category>control</category>
Expand Down
46 changes: 26 additions & 20 deletions cime_config/runseq/runseq_D.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,38 @@ def gen_runseq(case, coupling_times):

runseq.enter_time_loop(ocn_cpl_time, newtime=((ocn_cpl_time)))

runseq.add_action("MED med_phases_prep_ocn_accum_avg", med_to_ocn)
runseq.add_action("MED -> OCN :remapMethod=redist" , med_to_ocn)
runseq.add_action("MED med_phases_prep_ocn_avg" , med_to_ocn)
runseq.add_action("MED -> OCN :remapMethod=redist" , med_to_ocn)

runseq.enter_time_loop(atm_cpl_time, newtime=((atm_cpl_time < ocn_cpl_time)))

runseq.add_action ("MED med_phases_prep_ocn_map" , med_to_ocn)
runseq.add_action ("MED med_phases_aofluxes_run" , run_ocn and run_atm and (med_to_ocn or med_to_atm))
runseq.add_action ("MED med_phases_prep_ocn_merge" , med_to_ocn)
runseq.add_action ("MED med_phases_prep_ocn_accum_fast" , med_to_ocn)
runseq.add_action ("MED med_phases_ocnalb_run" , med_to_ocn)
runseq.add_action ("MED med_phases_prep_ice" , med_to_ice)
runseq.add_action ("MED -> ICE :remapMethod=redist" , med_to_ice)
runseq.add_action ("ICE" , run_ice)
runseq.add_action ("ROF" , run_rof)
runseq.add_action ("ATM" , run_atm)
runseq.add_action ("ICE -> MED :remapMethod=redist" , run_ice)
runseq.add_action ("MED med_fraction_set" , run_ice)
runseq.add_action ("ROF -> MED :remapMethod=redist" , run_rof)
runseq.add_action ("ATM -> MED :remapMethod=redist" , run_atm)
runseq.add_action ("MED med_phases_history_write" , atm_cpl_time == ocn_cpl_time)
runseq.add_action ("MED med_phases_aofluxes_run" , run_ocn and run_atm and (med_to_ocn or med_to_atm))
runseq.add_action ("MED med_phases_prep_ocn_accum" , med_to_ocn)
runseq.add_action ("MED med_phases_ocnalb_run" , med_to_ocn)

runseq.add_action ("MED med_phases_prep_ice" , med_to_ice)
runseq.add_action ("MED -> ICE :remapMethod=redist" , med_to_ice)

runseq.add_action ("ICE" , run_ice)
runseq.add_action ("ROF" , run_rof)
runseq.add_action ("ATM" , run_atm)

runseq.add_action ("ICE -> MED :remapMethod=redist" , run_ice)
runseq.add_action("MED med_phases_post_ice" , run_ice)

runseq.add_action ("ROF -> MED :remapMethod=redist" , run_rof)
runseq.add_action("MED med_phases_post_rof" , run_rof)

runseq.add_action ("ATM -> MED :remapMethod=redist" , run_atm)
runseq.add_action ("MED med_phases_history_write" , atm_cpl_time == ocn_cpl_time)
runseq.add_action ("MED med_phases_post_atm" , run_atm)

runseq.leave_time_loop(run_rof and (atm_cpl_time < ocn_cpl_time))

runseq.add_action ("OCN", run_ocn)
runseq.add_action ("OCN -> MED :remapMethod=redist" , run_ocn)
runseq.add_action ("MED med_phases_history_write" , atm_cpl_time < ocn_cpl_time)
runseq.add_action ("OCN" , run_ocn)
runseq.add_action ("OCN -> MED :remapMethod=redist" , run_ocn)
runseq.add_action ("MED med_phases_history_write" , atm_cpl_time < ocn_cpl_time)
runseq.add_action ("MED med_phases_post_ocn" , run_ocn)

runseq.leave_time_loop(True)

Expand Down
Loading

0 comments on commit 51d21d8

Please sign in to comment.