Skip to content

Commit

Permalink
Update CPPs and Documentation (#329)
Browse files Browse the repository at this point in the history
* update CPPs and documentation

* update documentation and script output

* remove NOFRAC cpp

* update doc precedence

* update documentation, change cpp directive to cpp macro

Co-authored-by: Philippe Blain <[email protected]>
  • Loading branch information
apcraig and phil-blain authored Jul 31, 2020
1 parent 3069cef commit 4c42a82
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 11 deletions.
4 changes: 0 additions & 4 deletions columnphysics/icepack_isotope.F90
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,6 @@ function wiso_alpi(isp,tk)

wiso_alpi = exp(alpai(isp)/tk**2 + alpbi(isp)/tk + alpci(isp))

#ifdef NOFRAC
wiso_alpi = c1
#endif
!
return
end function wiso_alpi

Expand Down
9 changes: 9 additions & 0 deletions columnphysics/icepack_kinds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
!
! author: Elizabeth C. Hunke and William H. Lipscomb, LANL
! 2006: ECH converted to free source form (F90)
! 2020: TC added support for NO_I8 and NO_R16

module icepack_kinds

Expand All @@ -17,10 +18,18 @@ module icepack_kinds
char_len_long = 256, &
log_kind = kind(.true.), &
int_kind = selected_int_kind(6), &
#if defined (NO_I8)
int8_kind = selected_int_kind(6), &
#else
int8_kind = selected_int_kind(13), &
#endif
real_kind = selected_real_kind(6), &
dbl_kind = selected_real_kind(13), &
#if defined (NO_R16)
r16_kind = selected_real_kind(13)
#else
r16_kind = selected_real_kind(33,4931)
#endif

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

Expand Down
4 changes: 2 additions & 2 deletions configuration/scripts/icepack_decomp.csh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#--- inputs ---

echo "${0:t} input ICE_DECOMP_GRID = $ICE_DECOMP_GRID"
#echo "${0:t} input ICE_DECOMP_GRID = $ICE_DECOMP_GRID"

set grid = $ICE_DECOMP_GRID

Expand All @@ -19,6 +19,6 @@ endif

setenv ICE_DECOMP_NXGLOB $nxglob

echo "${0:t} output ICE_DECOMP_NXGLOB = $ICE_DECOMP_NXGLOB"
#echo "${0:t} output ICE_DECOMP_NXGLOB = $ICE_DECOMP_NXGLOB"

exit 0
29 changes: 28 additions & 1 deletion doc/source/user_guide/ug_case_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,34 @@ Case Settings
There are two important files that define the case, **icepack.settings** and
**icepack_in**. **icepack.settings** is a list of env variables that define many
values used to setup, build and run the case. **icepack_in** is the input namelist file
for the icepack driver. Variables in both files are described below.
for the icepack driver. Variables in both files are described below. In addition,
the first table documents available C Preprocessor Macros.

.. _tabcpps:

Table of C Preprocessor (CPP) Macros
---------------------------------------------------

The Icepack model supports a few C Preprocessor (CPP) Macros. These
can be turned on during compilation to activate different pieces of source
code. The main purpose is to introduce build-time code modifications to
include or exclude certain libraries or Fortran language features, in part to
support CICE or other applications. More information
can be found in :ref:`cicecpps`. The following CPPs are available.

.. csv-table:: **CPP Macros**
:header: "CPP name", "description"
:widths: 15, 60

"",""
"**General Macros**", ""
"NO_I8", "Converts ``integer*8`` to ``integer*4``."
"NO_R16", "Converts ``real*16`` to ``real*8``."
"",""
"**Application Macros**", ""
"CESMCOUPLED", "Turns on code changes for the CESM coupled application "
"CICE_IN_NEMO", "Turns on code changes for coupling in the NEMO ocean model"


.. _tabsettings:

Expand Down
25 changes: 22 additions & 3 deletions doc/source/user_guide/ug_running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ preset setting (option), the set_env.setting and set_nml.setting will be used to
change the defaults. This is done as part of the ``icepack.setup`` and the
modifications are resolved in the **icepack.settings** and **icepack_in** file placed in
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.
option chosen takes precedence. Not all options are compatible with each other.

Some of the options are

Expand Down Expand Up @@ -201,6 +201,25 @@ To add some optional settings, one might do::

Once the cases are created, users are free to modify the **icepack.settings** and **icepack_in** namelist to further modify their setup.


.. _cicecpps:

C Preprocessor (CPP) Macros
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are a few C Preprocessor Macros supported in the Icepack model. These
support certain coding features to be excluded or included during the compile. They
exist in part to support the CICE model and other applications that use Icepack.

For standalone Icepack, The CPPs are defined by the `CPPDEFS` variable in the Icepack
Makefile. They are defined
by passing the -D[CPP] to the C and Fortran compilers (ie. -DNO_I8) and this
is what needs to be set in the ``CPPDEFS`` variable. The value of ``ICE_CPPDEFS`` in
**icepack.settings** is copied into the Makefile ``CPPDEFS`` variable as are settings
hardwired into the **Macros.[machine]_[environment]** file.

A list of available CPPs can be found in :ref:`tabcpps`.

.. _version:

Model Version Control
Expand Down Expand Up @@ -330,7 +349,7 @@ the **env.[machine]** file. The easiest way to change a user's default is to
create a file in your home directory called **.cice\_proj** and add your
preferred account name to the first line.
There is also an option (``--acct``) in **icepack.setup** to define the account number.
The order of precedent is **icepack.setup** command line option,
The order of precedence is **icepack.setup** command line option,
**.cice\_proj** setting, and then value in the **env.[machine]** file.

.. _queue:
Expand All @@ -343,7 +362,7 @@ the **env.[machine]** file. The easiest way to change a user's default is to
create a file in your home directory called **.cice\_queue** and add your
preferred account name to the first line.
There is also an option (``--queue``) in **icepack.setup** to define the queue name on a case basis.
The order of precedent is **icepack.setup** command line option,
The order of precedence is **icepack.setup** command line option,
**.cice\_queue** setting, and then value in the **env.[machine]** file.

.. _laptops:
Expand Down
2 changes: 1 addition & 1 deletion icepack.setup
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ EOF2
endif
if (${found} == 0) then
if (${name} == ${test}) then
echo "${ICE_SCRIPTS}/options/set_[nml,env].${name} not found"
#echo "${ICE_SCRIPTS}/options/set_[nml,env].${name} not found"
echo "`date`${0} ${ICE_SCRIPTS}/options/set_[nml,env].${name} not found" >> ${casedir}/README.case
else
echo "${0}: ERROR, ${ICE_SCRIPTS}/options/set_[nml,env].${name} not found"
Expand Down

0 comments on commit 4c42a82

Please sign in to comment.