Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuopc cmeps removed #3126

Merged
merged 41 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
464a003
Merge pull request #89 from ESMCI/jedwards/mergetob896c79
uturuncoglu May 7, 2019
2db97d1
set stampede2 default PIO 2 and pnetcdf 1.11.1, change flux max itera…
uturuncoglu May 7, 2019
6ae4bc3
fixes for running f19_f19_mg17
May 7, 2019
edb917b
add izumi to testlist
uturuncoglu May 7, 2019
4a67f36
fix stampede2 pnetcdf module version
uturuncoglu May 8, 2019
a018cfa
changes to get mom cap working again
Apr 17, 2019
7b8e02b
introduction of new aofluxes calculation in mediator
Apr 23, 2019
7b49507
updates to get pop/ww3 caps working
Apr 23, 2019
fdaa2ab
fixes to get GECO compset running
Apr 26, 2019
f3f1fd8
add --xml-driver to create_test
jedwards4b Apr 26, 2019
2f1b4e9
changes to git dice working with Si_ifrac_01
Apr 26, 2019
e0a1a0e
added new grid for pop forcing
Apr 30, 2019
0fc0ee2
changes to have nag working
May 1, 2019
8c42a8c
updates for merge to latest nuopc-cmeps
May 4, 2019
427261d
fixed bug in coldair outbreak setting
May 5, 2019
201c1c3
changes for new calendar functionality
May 6, 2019
c493c3c
reverted back to original version for med_phases_aofluxes_mod.F90 due…
May 6, 2019
50eb5d7
removed shr_cal references
May 10, 2019
635001c
removal of use_string_mod
May 10, 2019
03f1d19
set default for PIO_REARRANGER to box rearranger
May 12, 2019
1ca2910
Merge pull request #91 from ESMCI/mvertens/newcalendar
uturuncoglu May 14, 2019
e45af40
changes to define and use empty groups
uturuncoglu May 17, 2019
9102e24
else statement is removed to eliminate code duplication
uturuncoglu May 17, 2019
7dd2ade
Merge branch 'fv3namelist' into nuopc-cmeps
rsdunlapiv May 17, 2019
1586bf1
fix memleak in med_phases_prep_ocn_mod
alperaltuntas May 20, 2019
b7527d2
Merge branch 'nuopc-cmeps' of https://github.com/ESMCI/cmeps-cime int…
May 22, 2019
428d528
added new runseq directory and removed all nuopc_runseq files
May 20, 2019
6111db8
bug fixes
May 22, 2019
bcb3582
fixed bugs in run sequence generation
May 22, 2019
daf0c4d
fix pylint error
May 22, 2019
ddf1e00
address pylint issues
jedwards4b May 23, 2019
7a78dbb
fix py3 lint issue
jedwards4b May 23, 2019
bace875
get the name right
jedwards4b May 23, 2019
3af676b
Merge pull request #93 from ESMCI/fix_memleak
uturuncoglu May 23, 2019
abe811e
Merge pull request #94 from ESMCI/mvertens/runseq
uturuncoglu May 23, 2019
6a73858
remove cmeps from cime and make it external
uturuncoglu May 23, 2019
979b021
update cime hash
uturuncoglu May 23, 2019
88b5cce
move Externals.cfg to ../Externals_cime.cfg (UFSCOMP)
jedwards4b May 31, 2019
c9b6606
make test optional
jedwards4b May 31, 2019
56cca5c
fix indentation
jedwards4b May 31, 2019
9a2b690
revert change
jedwards4b May 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/cesm/config_grids.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,7 @@
<file grid="ocnice" mask="tx0.1v2">$DIN_LOC_ROOT/share/domains/domain.ocn.tx0.1v2.161014.nc</file>
<file grid="atm|lnd" mask="tx0.1v3">$DIN_LOC_ROOT/share/domains/domain.lnd.TL319_tx0.1v3.170730.nc</file>
<file grid="ocnice" mask="tx0.1v3">$DIN_LOC_ROOT/share/domains/domain.ocn.tx0.1v3.170730.nc</file>
<mesh driver="nuopc">$DIN_LOC_ROOT/share/meshes/TL319_151007_ESMFmesh.nc</mesh>
<desc>TL319 grid for JRA55</desc>
</domain>

Expand Down Expand Up @@ -1528,6 +1529,7 @@

<domain name="JRA025">
<nx>1440</nx> <ny>720</ny>
<mesh driver="nuopc">$DIN_LOC_ROOT/share/meshes/JRA025m.170209_ESMFmesh.nc</mesh>
<!-- TODO (mvertens, 2018-12-02): create a domain file for this -->
<desc>JRA is 0.25 degree runoff grid for use with JRA-55 runoff data</desc>
</domain>
Expand Down
8 changes: 4 additions & 4 deletions config/cesm/machines/config_machines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2276,13 +2276,13 @@ This allows using a different mpirun command to launch unit tests
</modules>
<modules mpilib="mvapich2">
<command name="load">mvapich2/2.3b</command>
<command name="load">pnetcdf/1.8.1</command>
<command name="load">pnetcdf/1.11.0</command>
<command name="load">parallel-netcdf/4.3.3.1</command>
</modules>
<modules mpilib="impi">
<command name="rm">mvapich2</command>
<command name="load">impi/18.0.2</command>
<command name="load">pnetcdf/1.8.1</command>
<command name="load">pnetcdf/1.11.0</command>
<command name="load">parallel-netcdf/4.3.3.1</command>
</modules>
<modules mpilib="mpi-serial">
Expand Down Expand Up @@ -2350,13 +2350,13 @@ This allows using a different mpirun command to launch unit tests
</modules>
<modules mpilib="mvapich2">
<command name="load">mvapich2/2.3b</command>
<command name="load">pnetcdf/1.8.1</command>
<command name="load">pnetcdf/1.11.0</command>
<command name="load">parallel-netcdf/4.3.3.1</command>
</modules>
<modules mpilib="impi">
<command name="rm">mvapich2</command>
<command name="load">impi/17.0.3</command>
<command name="load">pnetcdf/1.8.1</command>
<command name="load">pnetcdf/1.11.0</command>
<command name="load">parallel-netcdf/4.3.3.1</command>
</modules>
<modules mpilib="mpi-serial">
Expand Down
7 changes: 5 additions & 2 deletions config/cesm/machines/config_pio.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
</values>
</entry>

<!--
<entry id="PIO_VERSION">
<values>
<value mach="stampede2-skx">1</value>
</values>
</entry>

-->

<!--- uncomment and fill in relevant sections
<entry id="PIO_ROOT">
Expand All @@ -57,7 +58,9 @@

<entry id="PIO_REARRANGER">
<values>
<value>$PIO_VERSION</value>
<!-- Note: problem not using box rearranger with nuopc caps -->
<!-- <value>$PIO_VERSION</value> -->
<value>1</value>
</values>
</entry>

Expand Down
9 changes: 6 additions & 3 deletions scripts/create_test
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ def parse_command_line(args, description):
parser.add_argument("--xml-testlist",
help="Use this testlist to lookup tests.The default is specified in config_files.xml")

parser.add_argument("--xml-driver", choices=('mct', 'nuopc', 'moab'),
help="Override driver specified in tests and use this one.")

parser.add_argument("testargs", nargs="*",
help="Tests to run. Testname form is TEST.GRID.COMPSET[.MACHINE_COMPILER]")

Expand Down Expand Up @@ -388,9 +391,9 @@ def parse_command_line(args, description):
"At least one of --xml-machine, --xml-testlist, "
"--xml-compiler, --xml-category or a valid test name must be provided.")

test_data = get_tests_from_xml(args.xml_machine, args.xml_category,
args.xml_compiler, args.xml_testlist,
machine_name, args.compiler)
test_data = get_tests_from_xml(xml_machine=args.xml_machine, xml_category=args.xml_category,
xml_compiler=args.xml_compiler, xml_testlist=args.xml_testlist,
machine=machine_name, compiler=args.compiler, driver=args.xml_driver)
test_names = [item["name"] for item in test_data]
for test_datum in test_data:
test_extra_data[test_datum["name"]] = test_datum
Expand Down
5 changes: 3 additions & 2 deletions scripts/lib/CIME/code_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ def _run_pylint(on_file, interactive):
cmd_options +=",relative-import"

# add init-hook option
cmd_options += " --init-hook='sys.path.extend((\"%s\",\"%s\",\"%s\"))'"%\
cmd_options += " --init-hook='sys.path.extend((\"%s\",\"%s\",\"%s\",\"%s\"))'"%\
(os.path.join(cimeroot,"scripts","lib"),
os.path.join(cimeroot,"scripts","Tools"),
os.path.join(cimeroot,"scripts","fortran_unit_testing","python"))
os.path.join(cimeroot,"scripts","fortran_unit_testing","python"),
os.path.join(cimeroot,"src","drivers","nuopc","cime_config","runseq"))

cmd = "%s %s %s" % (pylint, cmd_options, on_file)
logger.debug("pylint command is %s"%cmd)
Expand Down
56 changes: 29 additions & 27 deletions scripts/lib/CIME/namelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,32 +1178,34 @@ def _write(self, out_file, groups, format_, sorted_groups):
for group_name in group_names:
if format_ == 'nml':
out_file.write("&{}\n".format(group_name))
group = self._groups[group_name]
for name in sorted(group.keys()):
values = group[name]

# @ is used in a namelist to put the same namelist variable in multiple groups
# in the write phase, all characters in the namelist variable name after
# the @ and including the @ should be removed
if "@" in name:
name = re.sub('@.+$', "", name)

# To prettify things for long lists of values, build strings
# line-by-line.
if values[0] == "True" or values[0] == "False":
values[0] = values[0].replace("True",".true.").replace("False",".false.")
lines = [" {}{} {}".format(name, equals, values[0])]
for value in values[1:]:
if value == "True" or value == "False":
value = value.replace("True",".true.").replace("False",".false.")
if len(lines[-1]) + len(value) <= 77:
lines[-1] += ", " + value
else:
lines[-1] += ",\n"
lines.append(" " + value)
lines[-1] += "\n"
for line in lines:
out_file.write(line)
# allow empty group
if group_name in self._groups:
group = self._groups[group_name]
for name in sorted(group.keys()):
values = group[name]

# @ is used in a namelist to put the same namelist variable in multiple groups
# in the write phase, all characters in the namelist variable name after
# the @ and including the @ should be removed
if "@" in name:
name = re.sub('@.+$', "", name)

# To prettify things for long lists of values, build strings
# line-by-line.
if values[0] == "True" or values[0] == "False":
values[0] = values[0].replace("True",".true.").replace("False",".false.")
lines = [" {}{} {}".format(name, equals, values[0])]
for value in values[1:]:
if value == "True" or value == "False":
value = value.replace("True",".true.").replace("False",".false.")
if len(lines[-1]) + len(value) <= 77:
lines[-1] += ", " + value
else:
lines[-1] += ",\n"
lines.append(" " + value)
lines[-1] += "\n"
for line in lines:
out_file.write(line)
if format_ == 'nml':
out_file.write("/\n")
if format_ == 'nmlcontents':
Expand All @@ -1220,7 +1222,7 @@ def _write_nuopc(self, out_file, groups, sorted_groups, skip_comps):
group_names = groups

for group_name in group_names:
if "_attributes" not in group_name and "nuopc_" not in group_name:
if "_attributes" not in group_name and "nuopc_" not in group_name and "_no_group" not in group_name:
continue
if "_attributes" in group_name:
out_file.write("{}::\n".format(group_name))
Expand Down
15 changes: 14 additions & 1 deletion scripts/lib/CIME/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
logger = logging.getLogger(__name__)

def get_tests_from_xml(xml_machine=None,xml_category=None,xml_compiler=None, xml_testlist=None,
machine=None, compiler=None):
machine=None, compiler=None, driver=None):
"""
Parse testlists for a list of tests
"""
Expand Down Expand Up @@ -46,6 +46,19 @@ def get_tests_from_xml(xml_machine=None,xml_category=None,xml_compiler=None, xml
test["name"] = CIME.utils.get_full_test_name(test["testname"], grid=test["grid"], compset=test["compset"],
machine=thismach, compiler=thiscompiler,
testmod=None if "testmods" not in test else test["testmods"])
if driver:
# override default or specified driver
founddriver = False
for specdriver in ("Vnuopc","Vmct","Vmoab"):
if specdriver in test["name"]:
test["name"] = test["name"].replace(specdriver,"V{}".format(driver))
founddriver = True
if not founddriver:
name = test["name"]
index = name.find('.')
test["name"] = name[:index] + "_V{}".format(driver) + name[index:]


logger.debug("Adding test {} with compiler {}".format(test["name"], test["compiler"]))
listoftests += newtests
logger.debug("Found {:d} tests".format(len(listoftests)))
Expand Down
25 changes: 22 additions & 3 deletions src/components/data_comps/dice/nuopc/dice_comp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,16 @@ module dice_comp_mod
!===============================================================================

subroutine dice_comp_advertise(importState, exportState, flds_scalar_name, &
ice_present, ice_prognostic, fldsFrIce_num, fldsFrIce, fldsToIce_num, fldsToIce, rc)
ice_present, ice_prognostic, flds_i2o_per_cat, &
fldsFrIce_num, fldsFrIce, fldsToIce_num, fldsToIce, rc)

! input/output arguments
type(ESMF_State) , intent(inout) :: importState
type(ESMF_State) , intent(inout) :: exportState
character(len=*) , intent(in) :: flds_scalar_name
logical , intent(in) :: ice_present
logical , intent(in) :: ice_prognostic
logical , intent(in) :: flds_i2o_per_cat
integer , intent(out) :: fldsToIce_num
integer , intent(out) :: fldsFrIce_num
type (fld_list_type) , intent(out) :: fldsToIce(:)
Expand Down Expand Up @@ -154,6 +156,15 @@ subroutine dice_comp_advertise(importState, exportState, flds_scalar_name, &
call dshr_fld_add(data_fld='ifrac', data_fld_array=avifld, model_fld='Si_ifrac', model_fld_array=avofld, &
model_fld_concat=flds_i2x, model_fld_index=kiFrac, fldlist_num=fldsFrIce_num, fldlist=fldsFrIce)

if (flds_i2o_per_cat) then
call dshr_fld_add(model_fld='Si_ifrac_01' , model_fld_concat=flds_i2x, model_fld_index=kiFrac_01)
call dshr_fld_add(model_fld='Fioi_swpen_ifrac_01', model_fld_concat=flds_i2x, model_fld_index=kswpen_iFrac_01)
call dshr_fld_add(med_fld='Si_ifrac_n', fldlist_num=fldsFrIce_num, fldlist=fldsFrIce, &
ungridded_lbound=1, ungridded_ubound=1)
call dshr_fld_add(med_fld='Fioi_swpen_ifrac_n', fldlist_num=fldsFrIce_num, fldlist=fldsFrIce, &
ungridded_lbound=1, ungridded_ubound=1)
end if

! export fields that have no corresponding stream field (computed internally)

call dshr_fld_add(model_fld='Si_imask', model_fld_concat=flds_i2x, model_fld_index=km, &
Expand Down Expand Up @@ -500,7 +511,7 @@ subroutine dice_comp_init(flds_i2o_per_cat, mpicom, compid, my_task, master_task
! optional per thickness category fields
if (flds_i2o_per_cat) then
kiFrac_01 = mct_aVect_indexRA(i2x,'Si_ifrac_01')
kswpen_iFrac_01 = mct_aVect_indexRA(i2x,'PFioi_swpen_ifrac_01')
kswpen_iFrac_01 = mct_aVect_indexRA(i2x,'Fioi_swpen_ifrac_01')
end if

call mct_aVect_init(x2i, rList=flds_x2i, lsize=lsize)
Expand Down Expand Up @@ -966,10 +977,11 @@ end subroutine dice_comp_import

!===============================================================================

subroutine dice_comp_export(exportState, rc)
subroutine dice_comp_export(exportState, flds_i2o_per_cat, rc)

! input/output variables
type(ESMF_State) :: exportState
logical, intent(in) :: flds_i2o_per_cat
integer, intent(out) :: rc

! local variables
Expand All @@ -981,6 +993,13 @@ subroutine dice_comp_export(exportState, rc)
call dshr_export(i2x%rattr(kiFrac,:) , exportState, 'Si_ifrac', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

if (flds_i2o_per_cat) then
call dshr_export(i2x%rattr(kiFrac_01,:), exportState, 'Si_ifrac_n', ungridded_index=1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call dshr_export(i2x%rattr(kswpen_iFrac_01,:), exportState, 'Fioi_swpen_ifrac_n', ungridded_index=1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

call dshr_export(i2x%rattr(km,:) , exportState, 'Si_imask', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

Expand Down
16 changes: 12 additions & 4 deletions src/components/data_comps/dice/nuopc/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,13 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
endif

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

call dice_comp_advertise(importstate, exportState, flds_scalar_name, &
ice_present, ice_prognostic, &
fldsFrIce_num, fldsFrIce, fldsToIce_num, fldsToIce, rc)
ice_present, ice_prognostic, flds_i2o_per_cat, &
fldsFrIce_num, fldsFrIce, fldsToIce_num, fldsToIce, rc)

!----------------------------------------------------------------------------
! Reset shr logging to original values
Expand Down Expand Up @@ -347,6 +351,10 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
Emesh = ESMF_MeshCreate(filename=trim(cvalue), fileformat=ESMF_FILEFORMAT_ESMFMESH, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

if (my_task == master_task) then
write(logunit,*) " obtaining dice mesh from " // trim(cvalue)
end if

!--------------------------------
! Initialize model
!--------------------------------
Expand Down Expand Up @@ -406,7 +414,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
calendar, modeldt, current_ymd, current_tod, cosArg)

! Pack export state
call dice_comp_export(exportState, rc=rc)
call dice_comp_export(exportState, flds_i2o_per_cat, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

call State_SetScalar(dble(nxg),flds_scalar_index_nx, exportState, &
Expand Down Expand Up @@ -539,7 +547,7 @@ subroutine ModelAdvance(gcomp, rc)
! Pack export state
!--------------------------------

call dice_comp_export(exportState, rc=rc)
call dice_comp_export(exportState, flds_i2o_per_cat, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

!--------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/components/xcpl_comps/xglc/nuopc/glc_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ subroutine field_setexport(exportState, fldname, lon, lat, nf, ungridded_index,
else
call ESMF_FieldGet(lfield, farrayPtr=data1d, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (fldname == 'Sg_icemask' .or. 'fldname == Sg_icemask_coupled_fluxes' .or. fldname == 'Sg_ice_covered') then
if (fldname == 'Sg_icemask' .or. fldname == 'Sg_icemask_coupled_fluxes' .or. fldname == 'Sg_ice_covered') then
data1d(:) = 1._r8
else
do i = 1,size(data1d)
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/mct/cime_config/config_component_cesm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
<value compset="_CAM\d+%WCXI">288</value>
<value compset="_DATM%COPYALL_NPS">72</value>
<value compset="_DATM.*_CLM">48</value>
<value compset="_DATM.*_DICE.*_POP2">4</value>
<value compset="_DATM.*_DICE.*_POP2">24</value>
<value compset="_DATM.*_SLND.*_CICE.*_POP2">24</value>
<value compset="_DATM.*_CICE.*_DOCN">24</value>
<value compset="_DATM.*_DOCN%US20">24</value>
Expand Down
Loading