From dd2ef5ae13f56be5533879604502ef8a83843a06 Mon Sep 17 00:00:00 2001 From: apcraig Date: Mon, 17 Apr 2023 10:56:54 -0600 Subject: [PATCH] Fix bug in recent fsd mods to support optional wlat argument. Fix documentation noted in https://github.com/E3SM-Project/Icepack/pull/21 Fix documentation in issue https://github.com/CICE-Consortium/Icepack/issues/430 and https://github.com/CICE-Consortium/Icepack/issues/422 --- columnphysics/icepack_therm_vertical.F90 | 13 ++++--- doc/source/science_guide/sg_itd.rst | 6 ++-- doc/source/science_guide/sg_snow.rst | 2 +- doc/source/user_guide/ug_implementation.rst | 38 ++++++++++++--------- 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/columnphysics/icepack_therm_vertical.F90 b/columnphysics/icepack_therm_vertical.F90 index 32a9e8f4f..3e6aea082 100644 --- a/columnphysics/icepack_therm_vertical.F90 +++ b/columnphysics/icepack_therm_vertical.F90 @@ -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) :: & @@ -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) :: & @@ -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 @@ -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)) !----------------------------------------------------------------- @@ -644,6 +647,8 @@ subroutine frzmlt_bottom_lateral (dt, ncat, & endif + if (present(wlat)) wlat=wlat_loc + end subroutine frzmlt_bottom_lateral !======================================================================= diff --git a/doc/source/science_guide/sg_itd.rst b/doc/source/science_guide/sg_itd.rst index d73983c84..62d16745a 100755 --- a/doc/source/science_guide/sg_itd.rst +++ b/doc/source/science_guide/sg_itd.rst @@ -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. diff --git a/doc/source/science_guide/sg_snow.rst b/doc/source/science_guide/sg_snow.rst index 3b8db8a77..751fd8744 100755 --- a/doc/source/science_guide/sg_snow.rst +++ b/doc/source/science_guide/sg_snow.rst @@ -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 diff --git a/doc/source/user_guide/ug_implementation.rst b/doc/source/user_guide/ug_implementation.rst index 3af5df796..76a0db32d 100755 --- a/doc/source/user_guide/ug_implementation.rst +++ b/doc/source/user_guide/ug_implementation.rst @@ -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 `_ provides more extensive options for model output, including many derived output variables. @@ -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 @@ -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: