Skip to content

Commit

Permalink
Merge pull request #84 from ESMCI/nuopcnostub
Browse files Browse the repository at this point in the history
Nuopcnostub
  • Loading branch information
uturuncoglu authored Apr 24, 2019
2 parents 3d85cb8 + d03003b commit fb9da7f
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 130 deletions.
18 changes: 9 additions & 9 deletions scripts/Tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -836,17 +836,17 @@ ifeq ($(ULIBDEP),$(null))
ULIBDEP += $(LIBROOT)/libiac.a
endif
ULIBDEP += $(LIBROOT)/libesp.a
ifeq ($(COMP_GLC), cism)
ULIBDEP += $(CISM_LIBDIR)/libglimmercismfortran.a
ifeq ($(CISM_USE_TRILINOS), TRUE)
ULIBDEP += $(CISM_LIBDIR)/libglimmercismcpp.a
endif
endif
ifeq ($(OCN_SUBMODEL),moby)
ULIBDEP += $(LIBROOT)/libmoby.a
endif
endif
endif
ifeq ($(COMP_GLC), cism)
ULIBDEP += $(CISM_LIBDIR)/libglimmercismfortran.a
ifeq ($(CISM_USE_TRILINOS), TRUE)
ULIBDEP += $(CISM_LIBDIR)/libglimmercismcpp.a
endif
endif
ifeq ($(OCN_SUBMODEL),moby)
ULIBDEP += $(LIBROOT)/libmoby.a
endif

ifdef COSP_LIBDIR
ULIBDEP += $(COSP_LIBDIR)/libcosp.a
Expand Down
4 changes: 3 additions & 1 deletion scripts/lib/CIME/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ def _case_build_impl(caseroot, case, sharedlib_only, model_only, buildlist,
multi_driver = case.get_value("MULTI_DRIVER")
complist = []
ninst = 1
comp_interface = case.get_value("COMP_INTERFACE")
for comp_class in comp_classes:
if comp_class == "CPL":
config_dir = None
Expand All @@ -419,13 +420,14 @@ def _case_build_impl(caseroot, case, sharedlib_only, model_only, buildlist,
ninst = case.get_value("NINST_{}".format(comp_class))

comp = case.get_value("COMP_{}".format(comp_class))
if comp_interface == 'nuopc' and comp in ('satm', 'slnd', 'sesp', 'sglc', 'srof', 'sice', 'socn', 'swav', 'siac'):
continue
thrds = case.get_value("NTHRDS_{}".format(comp_class))
expect(ninst is not None,"Failed to get ninst for comp_class {}".format(comp_class))
complist.append((comp_class.lower(), comp, thrds, ninst, config_dir ))
os.environ["COMP_{}".format(comp_class)] = comp

compiler = case.get_value("COMPILER")
comp_interface = case.get_value("COMP_INTERFACE")
mpilib = case.get_value("MPILIB")
use_esmf_lib = case.get_value("USE_ESMF_LIB")
debug = case.get_value("DEBUG")
Expand Down
16 changes: 0 additions & 16 deletions src/components/stub_comps/satm/nuopc/atm_comp_nuopc.F90

This file was deleted.

12 changes: 0 additions & 12 deletions src/components/stub_comps/sglc/nuopc/glc_comp_nuopc.F90

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/stub_comps/sice/nuopc/ice_comp_nuopc.F90

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/stub_comps/slnd/nuopc/lnd_comp_nuopc.F90

This file was deleted.

11 changes: 0 additions & 11 deletions src/components/stub_comps/socn/nuopc/ocn_comp_nuopc.F90

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/stub_comps/srof/nuopc/rof_comp_nuopc.F90

This file was deleted.

10 changes: 0 additions & 10 deletions src/components/stub_comps/swav/nuopc/wav_comp_nuopc.F90

This file was deleted.

1 change: 1 addition & 0 deletions src/drivers/mct/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ add_definitions(
-DNUM_COMP_INST_WAV=1
-DNUM_COMP_INST_ROF=1
-DNUM_COMP_INST_ESP=1
-DNUM_COMP_INST_IAC=1
)

# The following definitions are needed when building with the mpi-serial library
Expand Down
57 changes: 57 additions & 0 deletions src/drivers/nuopc/cime_config/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version= "1.0"?>

<expectedFails version="1.1">

<!-- Notes about the format of this file:
The required elements for a given failure are just:
<test name="...">
<phase name="...">
<status>...</status>
</phase>
</test>
There can be multiple phase blocks in a given test block.
In addition, a number of optional elements are allowed, which
currently are just for human consumption (not parsed by any
scripts):
- A phase block can contain an "issue" element, which gives the
issue number associated with this failure. (#123 refers to issue
#123 in the ESCOMP/ctsm repository. Issues in other repositories
should be specified as ORG/repo#123 - e.g., ESMCI/cime#123.)
- A phase block can contain a "comment" element, which gives any
sort of comment you desire.
-->


<!-- aux_clm test suite failures -->

<test name="ERR_Vnuopc_Ld5.f19_g16.BMOM.cheyenne_intel.allactive-nuopc_cap_io">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<comment>Mom restarts are offset</comment>
</phase>
</test>
<test name="ERS_Vnuopc_Ld5.T62_g16.CMOM.cheyenne_intel.mom-nuopc_cap">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<comment>Mom restarts are offset</comment>
</phase>
</test>
<test name="ERS_Vnuopc_Ld5.T62_g16.GMOM.cheyenne_intel.mom-nuopc_cap">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<comment>Mom restarts are offset</comment>
</phase>
</test>
<test name="SMS_Vnuopc_Ln11_D.f19_g17_rx1.A.cheyenne_intel">
<phase name="RUN">
<status>FAIL</status>
<comment>Debug run fails due to esmf issue</comment>
</phase>
</test>
</expectedFails>
18 changes: 16 additions & 2 deletions src/drivers/nuopc/cime_config/buildexe
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _main_func():
exeroot = case.get_value("EXEROOT")
gmake = case.get_value("GMAKE")
gmake_j = case.get_value("GMAKE_J")
model = case.get_value("MODEL")
cime_model = case.get_value("MODEL")
num_esp = case.get_value("NUM_COMP_INST_ESP")
ocn_model = case.get_value("COMP_OCN")
atm_model = case.get_value("COMP_ATM")
Expand All @@ -40,6 +40,20 @@ def _main_func():
if ocn_model == 'mom' or atm_model == "fv3gfs":
gmake_args += "USE_FMS=TRUE"

comp_classes = case.get_values("COMP_CLASSES")
cppdefs = ""
ulibdep = ""
for comp in comp_classes:
model = case.get_value("COMP_{}".format(comp))
stubcomp = "s{}".format(comp.lower())
if model and model != stubcomp and comp != "CPL":
cppdefs += "-D{}_PRESENT ".format(comp)
if comp == "LND":
ulibdep += r"\$(LNDLIBDIR)/\$(LNDLIB) "
else:
ulibdep += r"\$(LIBROOT)/lib{}.a ".format(comp.lower())
gmake_args += " USER_CPPDEFS=\"{}\" ULIBDEP=\"{}\"".format(cppdefs,ulibdep)

expect((num_esp is None) or (int(num_esp) == 1), "ESP component restricted to one instance")

with open('Filepath', 'w') as out:
Expand All @@ -50,7 +64,7 @@ def _main_func():
# build model executable

makefile = os.path.join(casetools, "Makefile")
exename = os.path.join(exeroot, model + ".exe")
exename = os.path.join(exeroot, cime_model + ".exe")
# always relink
if os.path.isfile(exename):
os.remove(exename)
Expand Down
70 changes: 48 additions & 22 deletions src/drivers/nuopc/cime_driver/esm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,8 @@ subroutine SetModelServices(driver, rc)
use NUOPC , only : NUOPC_CompAttributeAdd, NUOPC_CompAttributeSet
use NUOPC_Driver , only : NUOPC_DriverAddComp, NUOPC_DriverGetComp

use med , only : med_SS => SetServices
use atm_comp_nuopc , only : ATMSetServices => SetServices
use ice_comp_nuopc , only : ICESetServices => SetServices
use lnd_comp_nuopc , only : LNDSetServices => SetServices
use ocn_comp_nuopc , only : OCNSetServices => SetServices
use wav_comp_nuopc , only : WAVSetServices => SetServices
use rof_comp_nuopc , only : ROFSetServices => SetServices
use glc_comp_nuopc , only : GLCSetServices => SetServices
use shr_nuopc_methods_mod , only : shr_nuopc_methods_Clock_TimePrint
use shr_file_mod , only : shr_file_setLogunit, shr_file_getunit
use pio , only : pio_file_is_open, pio_closefile, file_desc_t
use perf_mod , only : t_initf
use shr_mem_mod , only : shr_mem_init
Expand Down Expand Up @@ -1089,17 +1083,33 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
use NUOPC , only : NUOPC_CompAttributeGet
use NUOPC_Driver , only : NUOPC_DriverAddComp
use shr_string_mod , only : toLower => shr_string_toLower
use med_constants_mod , only : dbug_flag => med_constants_dbug_flag, CS, CL
use mpi , only : MPI_COMM_NULL
use mct_mod , only : mct_world_init
use shr_pio_mod , only : shr_pio_init2
use med , only : MedSetServices => SetServices
#ifdef ATM_PRESENT
use atm_comp_nuopc , only : ATMSetServices => SetServices
#endif
#ifdef ICE_PRESENT
use ice_comp_nuopc , only : ICESetServices => SetServices
#endif
#ifdef LND_PRESENT
use lnd_comp_nuopc , only : LNDSetServices => SetServices
#endif
#ifdef OCN_PRESENT
use ocn_comp_nuopc , only : OCNSetServices => SetServices
#endif
#ifdef WAV_PRESENT
use wav_comp_nuopc , only : WAVSetServices => SetServices
#endif
#ifdef ROF_PRESENT
use rof_comp_nuopc , only : ROFSetServices => SetServices
#endif
#ifdef GLC_PRESENT
use glc_comp_nuopc , only : GLCSetServices => SetServices
use MED , only : MEDSetServices => SetServices
use mpi , only : MPI_COMM_NULL
use mct_mod , only : mct_world_init
use shr_pio_mod , only : shr_pio_init2
#endif


! input/output variables
type(ESMF_GridComp) :: driver
Expand Down Expand Up @@ -1234,30 +1244,46 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
med_id = i + 1
call NUOPC_DriverAddComp(driver, trim(compLabels(i)), MEDSetServices, petList=petlist, comp=child, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif(trim(compLabels(i)) == 'ATM') then
#ifdef ATM_PRESENT
elseif(trim(compLabels(i)) .eq. 'ATM') then
call NUOPC_DriverAddComp(driver, trim(compLabels(i)), ATMSetServices, petList=petlist, comp=child, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif(trim(compLabels(i)) == 'LND') then
#endif
#ifdef LND_PRESENT
elseif(trim(compLabels(i)) .eq. 'LND') then
call NUOPC_DriverAddComp(driver, trim(compLabels(i)), LNDSetServices, PetList=petlist, comp=child, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif(trim(compLabels(i)) == 'OCN') then
#endif
#ifdef OCN_PRESENT
elseif(trim(compLabels(i)) .eq. 'OCN') then
call NUOPC_DriverAddComp(driver, trim(compLabels(i)), OCNSetServices, PetList=petlist, comp=child, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif(trim(compLabels(i)) == 'ICE') then
#endif
#ifdef ICE_PRESENT
elseif(trim(compLabels(i)) .eq. 'ICE') then
call NUOPC_DriverAddComp(driver, trim(compLabels(i)), ICESetServices, PetList=petlist, comp=child, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif(trim(compLabels(i)) == 'GLC') then
#endif
#ifdef GLC_PRESENT
elseif(trim(compLabels(i)) .eq. 'GLC') then
call NUOPC_DriverAddComp(driver, trim(compLabels(i)), GLCSetServices, PetList=petlist, comp=child, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif(trim(compLabels(i)) == 'ROF') then
#endif
#ifdef ROF_PRESENT
elseif(trim(compLabels(i)) .eq. 'ROF') then
call NUOPC_DriverAddComp(driver, trim(compLabels(i)), ROFSetServices, PetList=petlist, comp=child, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif(trim(compLabels(i)) == 'WAV') then
#endif
#ifdef WAV_PRESENT
elseif(trim(compLabels(i)) .eq. 'WAV') then
call NUOPC_DriverAddComp(driver, trim(compLabels(i)), WAVSetServices, PetList=petlist, comp=child, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif(trim(compLabels(i)) == 'ESP') then
!call NUOPC_DriverAddComp(driver, trim(compLabels(i)), ESPSetServices, PetList=petlist, comp=child, rc=rc)
!if (chkerr(rc,__LINE__,u_FILE_u)) return
#endif
#ifdef ESP_PRESENT
elseif(trim(compLabels(i)) .eq. 'ESP') then
call NUOPC_DriverAddComp(driver, trim(compLabels(i)), ESPSetServices, PetList=petlist, comp=child, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
#endif
endif

call AddAttributes(child, driver, config, i+1, trim(compLabels(i)), inst_suffix, rc=rc)
Expand Down

0 comments on commit fb9da7f

Please sign in to comment.