Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
Browse files Browse the repository at this point in the history
… nuopc
  • Loading branch information
dabail10 committed Jul 1, 2020
2 parents 7848fdf + 55ca18b commit b5a6058
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 25 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CICE consists of a top level driver and dynamical core plus the [Icepack column

[icepack]: https://github.com/CICE-Consortium/Icepack

If you need help getting started using the model afer reviewing the [model documentation][doc-resources], the first point of contact with the CICE Consortium is the [Consortium Community Forum][forum].
The first point of contact with the CICE Consortium is the [Consortium Community Forum][forum].
This forum is monitored by Consortium members and also opened to the whole community.
Please do not use our issue tracker for general support questions.

Expand Down Expand Up @@ -47,4 +47,4 @@ Head over to our [Contribution guide][contributing] to learn more about how you
List of resources for information about the Consortium and its repositories as well as model documentation, testing, and development.

## License
See our [License](License.pdf) and [Distribution Policy](DistributionPolicy.pdf).
See our [License](LICENSE.pdf) and [Distribution Policy](DistributionPolicy.pdf).
16 changes: 12 additions & 4 deletions cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ DESCRIPTION
--setvers : updates cice version number in sandbox
--case, -c : case, case directory/name (not with --test or --suite)
--mach, -m : machine, machine name (required)
--env, -e : envname(s), comma separated (default = $envnames)
--env, -e : compilation environment name(s), comma separated (default = $envnames)
--pes, -p : tasks x threads [x blocksize_x x blocksize_y [x maxblocks]] (default is ${pesx})
--acct : account number for the batch submission
--grid, -g : grid, grid (default = ${grid})
Expand All @@ -112,7 +112,7 @@ DESCRIPTION
--diff : generate comparison against another case
--report : automatically post results when tests are complete
--coverage : generate and report test coverage metrics when tests are complete,
requires GNU env (--env gnu*)
requires GNU compiler (ie. normally ``--env gnu``)
--setup-only : for suite, setup testcases, no build, no submission
--setup-build : for suite, setup and build testcases, no submission
--setup-build-run : for suite, setup, build, and run interactively
Expand Down Expand Up @@ -529,7 +529,6 @@ if !(\$?CODECOV_TOKEN) then
endif
#for lcov
setenv PERL5LIB ~/usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi/
set lcovalist = ""
EOF0
Expand Down Expand Up @@ -791,14 +790,23 @@ EOF
end
# from basic script dir to casescr
foreach file (parse_namelist.sh parse_settings.sh parse_namelist_from_env.sh cice_decomp.csh cice.run.setup.csh cice.test.setup.csh cice.results.csh cice.codecov.csh cice.lcov.csh)
foreach file (parse_namelist.sh parse_settings.sh parse_namelist_from_env.sh cice_decomp.csh cice.run.setup.csh cice.test.setup.csh)
if !(-e ${ICE_SCRIPTS}/$file) then
echo "${0}: ERROR, ${ICE_SCRIPTS}/$file not found"
exit -1
endif
cp -f -p ${ICE_SCRIPTS}/$file ${casescr}/
end
# from tests dir to casescr
foreach file (cice.results.csh cice.codecov.csh cice.lcov.csh)
if !(-e ${ICE_SCRIPTS}/tests/$file) then
echo "${0}: ERROR, ${ICE_SCRIPTS}/$file not found"
exit -1
endif
cp -f -p ${ICE_SCRIPTS}/tests/$file ${casescr}/
end
cd ${casedir}
set quietmode = false
Expand Down
17 changes: 12 additions & 5 deletions cicecore/cicedynB/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ subroutine input_data
ahmax, R_ice, R_pnd, R_snw, dT_mlt, rsnw_mlt, emissivity, &
mu_rdg, hs0, dpscale, rfracmin, rfracmax, pndaspect, hs1, hp1, &
a_rapid_mode, Rac_rapid_mode, aspect_rapid_mode, dSdt_slow_mode, &
phi_c_slow_mode, phi_i_mushy, kalg, atmiter_conv
phi_c_slow_mode, phi_i_mushy, kalg, atmiter_conv, Pstar, Cstar

integer (kind=int_kind) :: ktherm, kstrength, krdg_partic, krdg_redist, natmiter, &
kitd, kcatbound
Expand Down Expand Up @@ -190,7 +190,8 @@ subroutine input_data
advection, coriolis, kridge, ktransport, &
kstrength, krdg_partic, krdg_redist, mu_rdg, &
e_ratio, Ktens, Cf, basalstress, &
k1, k2, alphab, threshold_hw
k1, k2, alphab, threshold_hw, &
Pstar, Cstar

namelist /shortwave_nml/ &
shortwave, albedo_type, &
Expand Down Expand Up @@ -298,6 +299,8 @@ subroutine input_data
revised_evp = .false. ! if true, use revised procedure for evp dynamics
yield_curve = 'ellipse'
kstrength = 1 ! 1 = Rothrock 75 strength, 0 = Hibler 79
Pstar = 2.75e4_dbl_kind ! constant in Hibler strength formula (kstrength = 0)
Cstar = 20._dbl_kind ! constant in Hibler strength formula (kstrength = 0)
krdg_partic = 1 ! 1 = new participation, 0 = Thorndike et al 75
krdg_redist = 1 ! 1 = new redistribution, 0 = Hibler 80
mu_rdg = 3 ! e-folding scale of ridged ice, krdg_partic=1 (m^0.5)
Expand Down Expand Up @@ -586,6 +589,8 @@ subroutine input_data
call broadcast_scalar(revised_evp, master_task)
call broadcast_scalar(yield_curve, master_task)
call broadcast_scalar(kstrength, master_task)
call broadcast_scalar(Pstar, master_task)
call broadcast_scalar(Cstar, master_task)
call broadcast_scalar(krdg_partic, master_task)
call broadcast_scalar(krdg_redist, master_task)
call broadcast_scalar(mu_rdg, master_task)
Expand Down Expand Up @@ -1207,8 +1212,8 @@ subroutine input_data
endif
write(nu_diag,1022) ' kstrength = ', kstrength,trim(tmpstr2)
if (kstrength == 0) then
! write(nu_diag,1007) ' Pstar = ', Pstar, ' P* strength factor'
! write(nu_diag,1007) ' Cstar = ', Cstar, ' C* strength exponent factor'
write(nu_diag,1009) ' Pstar = ', Pstar, ' P* strength factor'
write(nu_diag,1007) ' Cstar = ', Cstar, ' C* strength exponent factor'
elseif (kstrength == 1) then
write(nu_diag,1007) ' Cf = ', Cf, ' ratio of ridging work to PE change'
endif
Expand Down Expand Up @@ -1620,7 +1625,8 @@ subroutine input_data
phi_c_slow_mode_in=phi_c_slow_mode, phi_i_mushy_in=phi_i_mushy, conserv_check_in=conserv_check, &
wave_spec_type_in = wave_spec_type, &
wave_spec_in=wave_spec, nfreq_in=nfreq, &
tfrz_option_in=tfrz_option, kalg_in=kalg, fbot_xfer_type_in=fbot_xfer_type)
tfrz_option_in=tfrz_option, kalg_in=kalg, fbot_xfer_type_in=fbot_xfer_type, &
Pstar_in=Pstar, Cstar_in=Cstar)
call icepack_init_tracer_flags(tr_iage_in=tr_iage, tr_FY_in=tr_FY, &
tr_lvl_in=tr_lvl, tr_iso_in=tr_iso, tr_aero_in=tr_aero, &
tr_fsd_in=tr_fsd, tr_pond_in=tr_pond, &
Expand All @@ -1638,6 +1644,7 @@ subroutine input_data
1005 format (a30,2x,f12.6) ! float
1006 format (a20,2x,f10.6,a)
1007 format (a20,2x,f6.2,a)
1009 format (a20,2x,d13.6,a) ! float, exponential notation
1010 format (a30,2x,l6) ! logical
1012 format (a20,2x,l3,1x,a) ! logical
1020 format (a30,2x,i6) ! integer
Expand Down
2 changes: 2 additions & 0 deletions configuration/scripts/ice_in
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
krdg_partic = 1
krdg_redist = 1
mu_rdg = 3
Pstar = 2.75e4
Cstar = 20
Cf = 17.
Ktens = 0.
e_ratio = 2.
Expand Down
20 changes: 20 additions & 0 deletions configuration/scripts/machines/env.cheyenne_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,23 @@ setenv ICE_MACHINE_QUEUE "regular"
setenv ICE_MACHINE_TPNODE 36
setenv ICE_MACHINE_BLDTHRDS 1
setenv ICE_MACHINE_QSTAT "qstat "

# For lcov
set lcovpath = "/glade/u/home/tcraig/bin"
set lcovp5l = "/glade/u/home/tcraig/usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi"

if ($?PATH) then
if ("$PATH" !~ "*${lcovpath}*") then
setenv PATH ${PATH}:$lcovpath
endif
else
setenv PATH $lcovpath
endif

if ($?PERL5LIB) then
if ("$PERL5LIB" !~ "*${lcovp5l}*") then
setenv PERL5LIB ${PERL5LIB}:$lcovp5l
endif
else
setenv PERL5LIB $lcovp5l
endif
20 changes: 20 additions & 0 deletions configuration/scripts/machines/env.conrad_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,23 @@ setenv ICE_MACHINE_QUEUE "debug"
setenv ICE_MACHINE_TPNODE 32 # tasks per node
setenv ICE_MACHINE_BLDTHRDS 4
setenv ICE_MACHINE_QSTAT "qstat "

# For lcov
set lcovpath = "/p/home/apcraig/bin"
set lcovp5l = "/p/home/apcraig/usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi"

if ($?PATH) then
if ("$PATH" !~ "*${lcovpath}*") then
setenv PATH ${PATH}:$lcovpath
endif
else
setenv PATH $lcovpath
endif

if ($?PERL5LIB) then
if ("$PERL5LIB" !~ "*${lcovp5l}*") then
setenv PERL5LIB ${PERL5LIB}:$lcovp5l
endif
else
setenv PERL5LIB $lcovp5l
endif
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ set lcovrepo = apcraig.github.io
set lcovhtmldir = lcov_cice_${report_name}
genhtml -o ./${lcovhtmldir} --precision 2 -t "${report_name}" total.info

rm -r -f ${lcovrepo}
git clone https://github.com/apcraig/${lcovrepo}
cp -p -r ${lcovhtmldir} ${lcovrepo}/

cd ${lcovrepo}
set covp0 = `grep message coverage.json | cut -d : -f 2 | cut -d \" -f 2 | cut -d % -f 1`
set covp = `grep -i headerCovTableEntryLo ${lcovhtmldir}/index.html | head -1 | cut -d \> -f 2 | cut -d % -f 1`
set covp = `grep -i headerCovTableEntry ${lcovhtmldir}/index.html | grep % | head -1 | cut -d \> -f 2 | cut -d % -f 1`
set covpi = `echo $covp | cut -d . -f 1`

set lcovhtmlname = "${covpi}%:${report_name}"
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions doc/source/user_guide/ug_case_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ dynamics_nml
"``basalstress``", "logical", "use basal stress parameterization for landfast ice", "``.false.``"
"``Cf``", "real", "ratio of ridging work to PE change in ridging", "17.0"
"``coriolis``", "``constant``", "constant coriolis value = 1.46e-4", "``latitude``"
"``Cstar``", "real", "constant in Hibler strength formula", "20"
"", "``latitude``", "coriolis variable by latitude", ""
"", "``zero``", "zero coriolis", ""
"``e_ratio``", "real", "EVP ellipse aspect ratio", "2.0"
Expand All @@ -338,6 +339,7 @@ dynamics_nml
"``k2``", "real", "2nd free parameter (N/m^3) for landfast parameterization", "15.0"
"``mu_rdg``", "real", "e-folding scale of ridged ice for ``krdg_partic`` = 1 in m^0.5", "3.0"
"``ndte``", "integer", "number of EVP subcycles", "120"
"``Pstar``", "real", "constant in Hibler strength formula (N/m)", "2.75e4"
"``revised_evp``", "logical", "use revised EVP formulation", "``.false.``"
"``threshold_hw``", "real", "Max water depth for grounding (see :cite:`Amundrud04`)", "30."
"``yield_curve``", "``ellipse``", "elliptical yield curve", "``ellipse``"
Expand Down
28 changes: 15 additions & 13 deletions doc/source/user_guide/ug_running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,25 +101,23 @@ There are three usage modes,
* ``--test`` creates individual tests. Tests are just cases that have some extra automation in order to carry out particular tests such as exact restart.
* ``--suite`` creates a test suite. Test suites are predefined sets of tests and ``--suite`` provides the ability to quickly setup, build, and run a full suite of tests.

All modes will require use of ``--mach`` or ``-m`` to specify the machine and case and test modes
can use ``--set`` or ``-s`` to define specific options. ``--test`` and ``--suite`` will require ``--testid`` to be set
and both of the test modes can use ``--bdir``, ``--bgen``, ``--bcmp``, and ``--diff`` to generate (save) results and compare results with prior results as well as ``--tdir`` to specify the location of the test directory.
All modes will require use of ``--mach`` or ``-m`` to specify the machine. Use of ``--env`` is also recommended to specify the compilation environment. ``--case`` and ``--test`` modes can use ``--set`` or ``-s`` which will turn on various model options. ``--test`` and ``--suite`` will require ``--testid`` to be set and can use ``--bdir``, ``--bgen``, ``--bcmp``, and ``--diff`` to generate (save) results for regression testing (comparison with prior results). ``--tdir`` will specify the location of the test directory.
Testing will be described in greater detail in the :ref:`testing` section.

Again, ``cice.setup --help`` will show the latest usage information including
the available ``--set`` options, the current ported machines, and the test choices.

To create a case, run **cice.setup**::

cice.setup -c mycase -m machine
cice.setup -c mycase -m machine -e intel
cd mycase

Once a case/test is created, several files are placed in the case directory

- **env.[machine]** defines the environment
- **env.[machine]_[env]** defines the environment
- **cice.settings** defines many variables associated with building and running the model
- **makdep.c** is a tool that will automatically generate the make dependencies
- **Macros.[machine]** defines the Makefile macros
- **Macros.[machine]_[env]** defines the Makefile macros
- **Makefile** is the makefile used to build the model
- **cice.build** is a script that calls the Makefile and compiles the model
- **ice\_in** is the namelist input file
Expand All @@ -137,8 +135,8 @@ The **casescripts/** directory holds scripts used to create the case and can
largely be ignored. Once a case is created, the **cice.build** script should be run
interactively and then the case should be submitted by executing the
**cice.submit** script interactively. The **cice.submit** script
simply submits the **cice.run script**.
You can also submit the **cice.run** script on the command line.
submits the **cice.run script** or **cice.test** script. These scripts can
also be run interactively or submitted manually without the **cice.submit** script.

Some hints:

Expand All @@ -158,7 +156,7 @@ To build and run::
./cice.build
./cice.submit

The build and run log files will be copied into the logs directory in the case directory.
The build and run log files will be copied into the logs subdirectory in the case directory.
Other model output will be in the run directory. The run directory is set in **cice.settings**
via the ``ICE_RUNDIR`` variable. To modify the case setup, changes should be made in the
case directory, NOT the run directory.
Expand Down Expand Up @@ -186,10 +184,10 @@ Testing will be described in greater detail in the :ref:`testing` section.
specifies the case name. This can be either a relative path of an absolute path. This cannot be used with --test or --suite. Either ``--case``, ``--test``, or ``--suite`` is required.

``--mach``, ``-m`` MACHINE
specifies the machine name. This should be consistent with the name defined in the Macros and env files in **configurations/scripts/machines**. This is required in all modes.
specifies the machine name. This should be consistent with the name defined in the Macros and env files in **configurations/scripts/machines**. This is required in all modes and is paired with ``--env`` to define the compilation environment.

``--env``, ``-e`` ENVIRONMENT1,ENVIRONMENT2,ENVIRONMENT3
specifies the environment or compiler associated with the machine. This should be consistent with the name defined in the Macros and env files in **configurations/scripts/machines**. Each machine can have multiple supported environments including support for different compilers or other system setups. When used with ``--suite`` or ``--test``, the ENVIRONMENT can be a set of comma deliminated values with no spaces and the tests will then be run for all of those environments. With ``--case``, only one ENVIRONMENT should be specified. (default is intel)
specifies the compilation environment associated with the machine. This should be consistent with the name defined in the Macros and env files in **configurations/scripts/machines**. Each machine can have multiple supported environments including support for different compilers, different compiler versions, different mpi libraries, or other system settigs. When used with ``--suite`` or ``--test``, the ENVIRONMENT can be a set of comma deliminated values with no spaces and the tests will then be run for all of those environments. With ``--case``, only one ENVIRONMENT should be specified. (default is intel)

``--pes``, ``-p`` MxN[[xBXxBY[xMB]
specifies the number of tasks and threads the case should be run on. This only works with ``--case``. The format is tasks x threads or "M"x"N" where M is tasks and N is threads and both are integers. BX, BY, and MB can also be set via this option where BX is the x-direction blocksize, BY is the y-direction blocksize, and MB is the max-blocks setting. If BX, BY, and MB are not set, they will be computed automatically based on the grid size and the task/thread count. More specifically, this option has three modes, --pes MxN, --pes MxNxBXxBY, and --pes MxNxBXxBYxMB. (default is 4x1)
Expand Down Expand Up @@ -229,7 +227,7 @@ files **configuration/scripts/ice_in** and
settings (options), the set_env.setting and set_nml.setting will be used to
change the defaults. This is done as part of the ``cice.setup`` and the
modifications are resolved in the **cice.settings** and **ice_in** file placed in
the case directory. If multiple options are chosen and then conflict, then the last
the case directory. If multiple options are chosen that conflict, then the last
option chosen takes precedent. Not all options are compatible with each other.

Some of the options are
Expand Down Expand Up @@ -372,7 +370,10 @@ To port, an **env.[machine]_[environment]** and **Macros.[machine]_[environment]
**configuration/scripts/machines/** directory and the
**configuration/scripts/cice.batch.csh** and **configuration/scripts/cice.launch.csh** files need to be modified.
In general, the machine is specified in ``cice.setup`` with ``--mach``
and the environment (compiler) is specified with ``--env``.
and the environment (compiler) is specified with ``--env``. mach and env
in combination define the compiler, compiler version, supporting libaries,
and batch information. Multiple compilation environments can be created for
a single machine by choosing unique env names.

- cd to **configuration/scripts/machines/**

Expand Down Expand Up @@ -435,6 +436,7 @@ system. Some variables are optional.

Cross-compiling
~~~~~~~~~~~~~~~

It can happen that the model must be built on a platform and run on another, for example when the run environment is only available in a batch queue. The program **makdep** (see :ref:`overview`), however, is both compiled and run as part of the build process.

In order to support this, the Makefile uses a variable ``CFLAGS_HOST`` that can hold compiler flags specfic to the build machine for the compilation of makdep. If this feature is needed, add the variable ``CFLAGS_HOST`` to the **Macros.[machine]_[environment]** file. For example : ::
Expand Down

0 comments on commit b5a6058

Please sign in to comment.