Skip to content

Commit

Permalink
Fix bug in recent fsd mods to support optional wlat argument. (#435)
Browse files Browse the repository at this point in the history
Fix documentation noted in E3SM-Project#21

Fix documentation in issue #430 and #422
  • Loading branch information
apcraig authored Apr 18, 2023
1 parent 008f5f6 commit 45bb78e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 25 deletions.
13 changes: 9 additions & 4 deletions columnphysics/icepack_therm_vertical.F90
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,12 @@ subroutine frzmlt_bottom_lateral (dt, ncat, &
real (kind=dbl_kind), intent(out) :: &
Tbot , & ! ice bottom surface temperature (deg C)
fbot , & ! heat flux to ice bottom (W/m^2)
wlat , & ! lateral melt rate (m/s)
rside , & ! fraction of ice that melts laterally
fside ! lateral heat flux (W/m^2)

real (kind=dbl_kind), intent(out), optional :: &
wlat ! lateral melt rate (m/s)

! local variables

integer (kind=int_kind) :: &
Expand All @@ -539,6 +541,7 @@ subroutine frzmlt_bottom_lateral (dt, ncat, &

real (kind=dbl_kind) :: &
etot , & ! total energy in column
wlat_loc, & ! lateral melt rate (m/s)
qavg ! average enthalpy in column (approximate)

real (kind=dbl_kind) :: &
Expand Down Expand Up @@ -569,7 +572,7 @@ subroutine frzmlt_bottom_lateral (dt, ncat, &
fside = c0
Tbot = Tf
fbot = c0
wlat = c0
wlat_loc = c0

if (aice > puny .and. frzmlt < c0) then ! ice can melt

Expand Down Expand Up @@ -605,8 +608,8 @@ subroutine frzmlt_bottom_lateral (dt, ncat, &
! Steele (1992): JGR, 97, 17,729-17,738
!-----------------------------------------------------------------

wlat = m1 * deltaT**m2 ! Maykut & Perovich
rside = wlat*dt*pi/(floeshape*floediam) ! Steele
wlat_loc = m1 * deltaT**m2 ! Maykut & Perovich
rside = wlat_loc*dt*pi/(floeshape*floediam) ! Steele
rside = max(c0,min(rside,c1))

!-----------------------------------------------------------------
Expand Down Expand Up @@ -644,6 +647,8 @@ subroutine frzmlt_bottom_lateral (dt, ncat, &

endif

if (present(wlat)) wlat=wlat_loc

end subroutine frzmlt_bottom_lateral

!=======================================================================
Expand Down
6 changes: 3 additions & 3 deletions doc/source/science_guide/sg_itd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ currently supports ``nfsd = 1, 12, 16, 24``. Although ``nfsd = 1`` tracks the s
is assumed when ``tr_fsd=false``, the processes acting on the floes differ.
It is assumed that the floe size lies at the midpoint of each floe size category.

If simulations begin without ice (``ice_init='none'``), the FSD can emerge without initialization.
If simulations begin without ice (``ice_ic='none'``), the FSD can emerge without initialization.
If simulations begin with ice cover,
some initial FSD must be prescribed in ``init_fsd``. The default (used for ``ice_init='default'``)
some initial FSD must be prescribed in ``init_fsd``. The default (used for ``ice_ic='default'``)
is a simple relationship determined from point observations by :cite:`Perovich14`, but its basin-wide
applicability has not been tested. In Icepack, ``ice_init='default'`` is selected for the slab
applicability has not been tested. In Icepack, ``ice_ic='default'`` is selected for the slab
and the full ITD cells.

The history output includes FSD tendency terms for each of the floe-size-modifying processes. Note that the sum of these does not equal the change in the FSD, as the FSD is also modified by changes in the ITD.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/science_guide/sg_snow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ the eroded mass, which :cite:`Lecomte15` set to :math:`10^{-5}` kg m :math:`^{-2
In :cite:`Lecomte15`, the fraction of this suspended snow lost in leads is

.. math::
f = \left(1-a_i\right) \exp\left({\sigma_{ITD}\over\sigma_{ref}}\right),
f = \left(1-a_i\right) \exp\left({-\sigma_{ITD}\over\sigma_{ref}}\right),
where the scale factor :math:`\sigma_{ref}=1` m and :math:`a_i` is the total ice area fraction within the grid cell.
Thus, the snow mass that is redistribution on the ice (i.e., not lost in leads) is
Expand Down
38 changes: 21 additions & 17 deletions doc/source/user_guide/ug_implementation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ default in this distribution, this is not a stringent limitation:
Model output
------------

The Icepack model provides diagnostic output files, binary restart files, and a primitive
netcdf history file capability.
The Icepack model provides diagnostic output files, binary or netCDF restart files,
and a primitive netCDF history file capability.
The sea ice model `CICE <https://github.com/CICE-Consortium/CICE>`_ provides more extensive
options for model output, including many derived output variables.

Expand All @@ -165,7 +165,7 @@ Icepack writes diagnostic information for each grid cell as a separate file,
Restart files
~~~~~~~~~~~~~

Icepack provides restart data in binary unformatted format or netcdf. The restart files
Icepack provides restart data in binary unformatted format or netCDF. The restart files
created by the Icepack driver contain all of the variables needed
for a full, exact restart. The filename begins with the character string
‘iced.’ and is placed in the directory specified by the namelist variable
Expand All @@ -174,34 +174,38 @@ variable ``dumpfreq``. The namelist variable ``ice_ic`` contains the
pointer to the filename from which the restart data is to be read and
the namelist option ``restart`` must be set to ``.true.`` to use the file.
``dump_last`` namelist can also be set to true to trigger restarts automatically
at then end of runs. The default restart file format is binary and is set
by setting the ``restart_format`` namelist to 'bin'. Netcdf restart files
are set by setting ``restart_format`` namelist to 'nc'.
at the end of runs. The default restart file format is binary, set in
namelist with ``restart_format`` = 'bin'. For netCDF, set ``restart_format`` = 'nc'
or use ``icepack.setup -s restcdf``.

The default configuration of Icepack does not support netCDF. If netCDF restart files are
desired, the USE_NETCDF C preprocessor directive must be set during compilation. This
is done by setting ``ICE_IOTYPE`` to ``netcdf`` in **icepack.settings** or using the
``icepack.setup -s`` option ``ionetcdf``. If netCDF is used on a particular machine,
the machine env and Macros file must support compilation with netCDF.

History files
~~~~~~~~~~~~~

Icepack has a primitive netcdf history capability that is turned on with the
Icepack has a primitive netCDF history capability that is turned on with the
``history_format`` namelist. When ``history_format`` is set to 'nc', history files
are created for each run with a naming convention of **icepack.h.yyyymmdd.nc**
in the run directory history directory. The yyyymmdd is the start date for each run.
Use ``icepack.setup -s histcdf`` to turn on netCDF history files automatically.

When Icepack history files are turned on, data for a set of fixed fields is written
to the history file for each column at every timestep without ability to control
fields, frequencies, or temporal averaging. All output fields are hardwired into
the implementation in **configuration/driver/icedrv_history.F90** file. The netcdf file
does NOT meet NetCDF CF conventions and is provided as an amenity in the standalone
the implementation in **configuration/driver/icedrv_history.F90** file. The netCDF file
does NOT meet netCDF CF conventions and is provided as an amenity in the standalone
Icepack model. Users are free to modify the output fields or
extend the implementation and are encouraged to share any updates with the Consortium.

The default configuration of Icepack does not require NetCDF. If history files are
written, the USE_NETCDF C preprocessor directive must be set during compilation. This
is done by setting ``ICE_IOTYPE`` to ``netcdf`` in **icepack.settings**. In addition,
the machine env and Macros files must include support for compilation with NetCDF. The
``icepack.setup -s`` option ``ionetcdf`` will set the ICE_IOTYPE to netcdf, which turns on
the USE_NETCDF C preprocessor. ``ionetcdf`` also sets the ``history_format`` and
``restart_format`` flags to 'nc'.

The default configuration of Icepack does not support netCDF. If netCDF history files are
desired, the USE_NETCDF C preprocessor directive must be set during compilation. This
is done by setting ``ICE_IOTYPE`` to ``netcdf`` in **icepack.settings** or using the
``icepack.setup -s`` option ``ionetcdf``. If netCDF is used on a particular machine,
the machine env and Macros file must support compilation with netCDF.

.. _bgc-hist:

Expand Down

0 comments on commit 45bb78e

Please sign in to comment.