-
-
diff --git a/config_src/dynamic_symmetric/MOM_memory.h b/config_src/dynamic_symmetric/MOM_memory.h
index 76061c3259..125dcf212f 100644
--- a/config_src/dynamic_symmetric/MOM_memory.h
+++ b/config_src/dynamic_symmetric/MOM_memory.h
@@ -1,48 +1,33 @@
-!********+*********+*********+*********+*********+*********+*********+*
-!* This include file determines the compile-time memory settings *
-!* for the Modular Ocean Model (MOM), versions 6 and later. *
-!********+*********+*********+*********+*********+*********+*********+*
+!/*! \brief Compile-time memory settings */
+!/*! \details This include file determines the compile-time memory settings. There are several variants of this file and only one should be in the search path for compilation. */
+!/*! \file MOM_memory.h */
-! Specify the numerical domain.
+!/*! The number of thickness grid points in the i-direction of the global domain. */
#define NIGLOBAL_ NONSENSE_NIGLOBAL
+!/*! The number of thickness grid points in the j-direction of the global domain. */
#define NJGLOBAL_ NONSENSE_NJGLOBAL
- ! NIGLOBAL_ and NJGLOBAL_ are the number of thickness
- ! grid points in the zonal and meridional
- ! directions of the physical domain.
+!/*! The number of layers in the vertical direction. */
#define NK_ NONSENSE_NK
- ! The number of layers.
+!/*! \def STATIC_MEMORY_ If STATIC_MEMORY_ is defined, the principle variables will have sizes that are statically determined at compile time. Otherwise the sizes are not determined until run time. */
#undef STATIC_MEMORY_
- ! If STATIC_MEMORY_ is defined, the principle
- ! variables will have sizes that are statically
- ! determined at compile time. Otherwise the
- ! sizes are not determined until run time. The
- ! STATIC option is substantially faster, but
- ! does not allow the PE count to be changed at
- ! run time.
+
+!/*! If SYMMETRIC_MEMORY_ is defined, the velocity point data domain includes every face of the thickness points. In other words, some arrays are larger than others, depending on where they are on the staggered grid. */
#define SYMMETRIC_MEMORY_
- ! If defined, the velocity point data domain
- ! includes every face of the thickness points.
- ! In other words, some arrays are larger than
- ! others, depending on where they are on the
- ! staggered grid.
+!/*! The number of processors in the i-direction. */
#define NIPROC_ NONSENSE_NIPROC
- ! NIPROC_ is the number of processors in the
- ! x-direction.
+
+!/*! The number of processors in the j-direction. */
#define NJPROC_ NONSENSE_NJPROC
- ! NJPROC_ is the number of processors in the
- ! y-direction.
+!/*! The maximum permitted number (each) of restart variables, time derivatives, etc. This is mostly used for the size of pointer arrays, so it should be set generously. */
#define MAX_FIELDS_ 50
- ! The maximum permitted number (each) of
- ! restart variables, time derivatives, etc.
- ! This is mostly used for the size of pointer
- ! arrays, so it should be set generously.
+!/*! The number of memory halo cells on each side of the computational domain in the i-direction */
#define NIHALO_ 2
+
+!/*! The number of memory halo cells on each side of the computational domain in the j-direction */
#define NJHALO_ 2
- ! NIHALO_ and NJHALO_ are the sizes of the
- ! memory halos on each side.
#include
diff --git a/config_src/solo_driver/coupler_types.html b/config_src/solo_driver/coupler_types.html
deleted file mode 100644
index 752425d682..0000000000
--- a/config_src/solo_driver/coupler_types.html
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-Module coupler_types_mod
-
-
-
-
-PUBLIC INTERFACE ~
- PUBLIC DATA ~
- PUBLIC ROUTINES ~
- NAMELIST ~
- DIAGNOSTIC FIELDS ~
- ERROR MESSAGES ~
- REFERENCES ~
- NOTES
-
-
This module contains simplified type declarations for the coupler
- of an ocean-only model. With mom4, this is used with ocean_solo_mod
- as the driver, and with MOM it is used with MOM_driver.
-
-
-
-
This module contains simplified type declarations for the coupler
- of an ocean-only model. With mom4, this is used with ocean_solo_mod
- as the driver, and with MOM it is used with MOM_driver.
-
-
diff --git a/docs/Doxyfile_nortd b/docs/Doxyfile_nortd
index a75384ebed..0d34cc4764 100644
--- a/docs/Doxyfile_nortd
+++ b/docs/Doxyfile_nortd
@@ -780,7 +780,12 @@ WARN_LOGFILE = doxygen.log
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = ../config_src ../src ../README.md
+INPUT = ../src \
+ front_page.md \
+ ../config_src/solo_driver \
+ ../config_src/dynamic_symmetric \
+ ../config_src/coupled_driver/coupler_util.F90 \
+ ../config_src/coupled_driver/ocean_model_MOM.F90
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -839,7 +844,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE =
+EXCLUDE = ../src/equation_of_state/TEOS10
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -855,7 +860,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
-EXCLUDE_PATTERNS = makedep.py
+EXCLUDE_PATTERNS = makedep.py Makefile INSTALL
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -872,7 +877,7 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH = ../config_src ../src
+EXAMPLE_PATH = ../src
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -892,7 +897,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
-IMAGE_PATH = images ../config_src ../src
+IMAGE_PATH = images ../src
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -948,7 +953,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
-USE_MDFILE_AS_MAINPAGE = ../README.md
+USE_MDFILE_AS_MAINPAGE = front_page.md
#---------------------------------------------------------------------------
# Configuration options related to source browsing
@@ -1052,7 +1057,7 @@ ALPHABETICAL_INDEX = YES
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-COLS_IN_ALPHA_INDEX = 5
+COLS_IN_ALPHA_INDEX = 1
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
@@ -2014,7 +2019,7 @@ MACRO_EXPANSION = YES
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-EXPAND_ONLY_PREDEF = YES
+EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES, the include files in the
# INCLUDE_PATH will be searched if a #include is found.
@@ -2028,7 +2033,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-INCLUDE_PATH = ../src/framework
+INCLUDE_PATH = ../src/framework ../config_src/dynamic_symmetric
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
@@ -2036,7 +2041,7 @@ INCLUDE_PATH = ../src/framework
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-INCLUDE_FILE_PATTERNS =
+INCLUDE_FILE_PATTERNS = *.h
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
@@ -2046,7 +2051,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED = ALLOCABLE_=allocatable
+PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -2065,7 +2070,7 @@ EXPAND_AS_DEFINED =
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-SKIP_FUNCTION_MACROS = YES
+SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------
# Configuration options related to external references
@@ -2431,4 +2436,4 @@ GENERATE_LEGEND = YES
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_CLEANUP = YES
+DOT_CLEANUP = NO
diff --git a/docs/Doxyfile_rtd b/docs/Doxyfile_rtd
index 3e94ed0eb3..652f46f076 100644
--- a/docs/Doxyfile_rtd
+++ b/docs/Doxyfile_rtd
@@ -780,7 +780,11 @@ WARN_LOGFILE = doxygen.log
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = ../config_src ../src ../README.md
+INPUT = ../src \
+ ../config_src/solo_driver \
+ ../config_src/dynamic_symmetric \
+ ../config_src/coupled_driver/coupler_util.F90 \
+ ../config_src/coupled_driver/ocean_model_MOM.F90
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -839,7 +843,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE =
+EXCLUDE = ../src/equation_of_state/TEOS10
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -872,7 +876,7 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH = ../config_src ../src
+EXAMPLE_PATH = ../src
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -892,7 +896,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
-IMAGE_PATH = images ../config_src ../src
+IMAGE_PATH = images ../src
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -2014,7 +2018,7 @@ MACRO_EXPANSION = YES
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-EXPAND_ONLY_PREDEF = YES
+EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES, the include files in the
# INCLUDE_PATH will be searched if a #include is found.
@@ -2028,7 +2032,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-INCLUDE_PATH = ../src/framework
+INCLUDE_PATH = ../src/framework ../config_src/dynamic_symmetric
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
@@ -2036,7 +2040,7 @@ INCLUDE_PATH = ../src/framework
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-INCLUDE_FILE_PATTERNS =
+INCLUDE_FILE_PATTERNS = *.h
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
@@ -2046,7 +2050,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED = ALLOCABLE_=allocatable
+PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -2065,7 +2069,7 @@ EXPAND_AS_DEFINED =
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-SKIP_FUNCTION_MACROS = YES
+SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------
# Configuration options related to external references
diff --git a/docs/api/todo.rst b/docs/api/todo.rst
deleted file mode 100644
index 614ca70e76..0000000000
--- a/docs/api/todo.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-.. _Todo:
-
-Todo list
-=========
-
-.. raw:: html
-
-
-
-
-
-
diff --git a/docs/apiref.rst b/docs/apiref.rst
index 2b27921531..7f94e1c4b9 100644
--- a/docs/apiref.rst
+++ b/docs/apiref.rst
@@ -3,6 +3,10 @@
API Reference
=============
+This API reference is a partial image of the complete API documentation.
+The pages you find here are linkable - the url for the page is static.
+The complete API documentation is generated with doxygen and can be found at http://noaa-gfdl.github.io/MOM6/APIs/.
+
.. toctree::
:maxdepth: 1
diff --git a/docs/front_page.md b/docs/front_page.md
new file mode 100644
index 0000000000..4997244524
--- /dev/null
+++ b/docs/front_page.md
@@ -0,0 +1,22 @@
+# MOM6 APIs
+
+This is the generated documentation for the MOM6 source code which describes the APIs as well as some features of the code.
+
+This documentation is also available as web-linkable pages hosted on [read the docs](http://mom6.readthedocs.io/), where the pages are generated with sphinx.
+
+If you are looking for a user guide, start at the [MOM6-examples wiki](https://github.com/NOAA-GFDL/MOM6-examples/wiki) which has installation instructions, links to tutorials, and more.
+
+The APIs in MOM6 are documented using doxygen - you are viewing the result. A brief style guide for using doxygen in MOM6 is available at https://github.com/NOAA-GFDL/MOM6/wiki/Doxygen.
+
+***
+
+## Contents
+
+- [List of modules](namespaces.html)
+ - Alphabetical list of modules
+- [List of classes](annotated.html)
+ - Modules with types
+- [List of files](files.html)
+ - File structure
+- [List of feature pages](pages.html)
+ - Detailed description of some features of the code
diff --git a/docs/index.rst b/docs/index.rst
index a143c94d0a..61a11c2a91 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -15,7 +15,6 @@ Contents:
equations/overview
parameterizations
working_with_MOM6
- tutorials
apiref
diff --git a/docs/tutorials.rst b/docs/tutorials.rst
deleted file mode 100644
index ec12ebc9d3..0000000000
--- a/docs/tutorials.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-Tutorial
-========
-
-Tutorials and walk through will be hosted on the `MOM6-examples wiki `_.
-
-Jupyter notebooks
------------------
-
-Some examples contain jupyter notebooks to illustrate analysis of model output.
diff --git a/src/ALE/MOM_regridding.F90 b/src/ALE/MOM_regridding.F90
index 43d63d22a9..5f5ad2a369 100644
--- a/src/ALE/MOM_regridding.F90
+++ b/src/ALE/MOM_regridding.F90
@@ -1204,6 +1204,11 @@ subroutine build_sigma_grid( CS, G, GV, h, dzInterface )
do i = G%isc-1,G%iec+1
do j = G%jsc-1,G%jec+1
+ if (G%mask2dT(i,j)==0.) then
+ dzInterface(i,j,:) = 0.
+ cycle
+ endif
+
! The rest of the model defines grids integrating up from the bottom
nominalDepth = G%bathyT(i,j)*GV%m_to_H
@@ -1293,6 +1298,12 @@ subroutine build_rho_grid( G, GV, h, tv, dzInterface, remapCS, CS )
do j = G%jsc-1,G%jec+1
do i = G%isc-1,G%iec+1
+ if (G%mask2dT(i,j)==0.) then
+ dzInterface(i,j,:) = 0.
+ cycle
+ endif
+
+
! Local depth (G%bathyT is positive)
nominalDepth = G%bathyT(i,j)*GV%m_to_H
diff --git a/src/core/MOM.F90 b/src/core/MOM.F90
index 1b19d45ea7..f2286c3673 100644
--- a/src/core/MOM.F90
+++ b/src/core/MOM.F90
@@ -4093,37 +4093,6 @@ end subroutine MOM_end
!! * set_restart_fields is used to specify those fields that are
!! written to and read from the restart file.
!!
-!! Macros written all in capital letters are defined in MOM_memory.h.
-!!
-!! \section section_gridlayout MOM grid layout
-!!
-!! A small fragment of the grid is shown below:
-!!
-!! \verbatim
-!! j+1 x ^ x ^ x
-!!
-!! j+1 > o > o >
-!!
-!! j x ^ x ^ x
-!!
-!! j > o > o >
-!!
-!! j-1 x ^ x ^ x
-!!
-!! i-1 i i+1
-!!
-!! i i+1
-!!
-!! \endverbatim
-!!
-!! Fields at each point
-!! * x = q, CoriolisBu
-!! * ^ = v, PFv, CAv, vh, diffv, tauy, vbt, vhtr
-!! * > = u, PFu, CAu, uh, diffu, taux, ubt, uhtr
-!! * o = h, bathyT, eta, T, S, tr
-!!
-!! The boundaries always run through q grid points (x).
-!!
!! \section section_heat_budget Diagnosing MOM heat budget
!!
!! Here are some example heat budgets for the ALE version of MOM6.
diff --git a/src/core/MOM_dynamics_split_RK2.F90 b/src/core/MOM_dynamics_split_RK2.F90
index 4d86e7f639..512774522f 100644
--- a/src/core/MOM_dynamics_split_RK2.F90
+++ b/src/core/MOM_dynamics_split_RK2.F90
@@ -1202,37 +1202,5 @@ end subroutine end_dyn_split_RK2
!! does not have its own control structure, but shares the same
!! control structure with MOM.F90 and the other MOM_dynamics_...
!! modules.
-!!
-!! Macros written all in capital letters are defined in MOM_memory.h.
-!!
-!! \section section_gridlayout MOM grid layout
-!!
-!! A small fragment of the grid is shown below:
-!!
-!! \verbatim
-!! j+1 x ^ x ^ x
-!!
-!! j+1 > o > o >
-!!
-!! j x ^ x ^ x
-!!
-!! j > o > o >
-!!
-!! j-1 x ^ x ^ x
-!!
-!! i-1 i i+1
-!!
-!! i i+1
-!!
-!! \endverbatim
-!!
-!! Fields at each point
-!! * x = q, CoriolisBu
-!! * ^ = v, PFv, CAv, vh, diffv, tauy, vbt, vhtr
-!! * > = u, PFu, CAu, uh, diffu, taux, ubt, uhtr
-!! * o = h, bathyT, eta, T, S, tr
-!!
-!! The boundaries always run through q grid points (x).
-
end module MOM_dynamics_split_RK2
diff --git a/src/core/MOM_grid.F90 b/src/core/MOM_grid.F90
index 6d5597ce4e..abb6329ef2 100644
--- a/src/core/MOM_grid.F90
+++ b/src/core/MOM_grid.F90
@@ -578,7 +578,7 @@ end subroutine MOM_grid_end
!! u-, v- and q- point coordinates are follow same pattern of replacing T with Cu, Cv and Bu respectively.
!!
!! Each location also has a 2D mask indicating whether the entire column is land or ocean.
-!! `mask2dT` is 1. is the column is wet or 0. is the T-cell is land.
-!! `mask2dCu` is 1. if both neighboring column are ocean, and 0. if either is land.
+!! `mask2dT` is 1 if the column is wet or 0 if the T-cell is land.
+!! `mask2dCu` is 1 if both neighboring column are ocean, and 0 if either is land.
end module MOM_grid
diff --git a/src/equation_of_state/MOM_EOS_NEMO.F90 b/src/equation_of_state/MOM_EOS_NEMO.F90
index bf703bfaf1..3c6bd3973a 100644
--- a/src/equation_of_state/MOM_EOS_NEMO.F90
+++ b/src/equation_of_state/MOM_EOS_NEMO.F90
@@ -206,11 +206,17 @@ subroutine calculate_density_scalar_nemo(T, S, pressure, rho)
call calculate_density_array_nemo(T0, S0, pressure0, rho0, 1, 1)
rho = rho0(1)
end subroutine calculate_density_scalar_nemo
-
+!> This subroutine computes the in situ density of sea water (rho in
+!! units of kg/m^3) from absolute salinity (S in g/Kg),
+!! conservative temperature (T in deg C), and pressure in Pa.
subroutine calculate_density_array_nemo(T, S, pressure, rho, start, npts)
- real, intent(in), dimension(:) :: T, S, pressure
- real, intent(out), dimension(:) :: rho
- integer, intent(in) :: start, npts
+ real, intent(in), dimension(:) :: T !< Conservative temperature in C.
+ real, intent(in), dimension(:) :: S !< Absoulte salinity in g/Kg.
+ real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
+ real, intent(out), dimension(:) :: rho !< In situ density in kg m-3.
+ integer, intent(in) :: start !< The starting point in the arrays.
+ integer, intent(in) :: npts !< The number of values to calculate.
+
! * Arguments: T - conservative temperature in C. *
! * (in) S - absoulte salinity in g/Kg. *
! * (in) pressure - pressure in Pa. *
@@ -269,9 +275,15 @@ subroutine calculate_density_array_nemo(T, S, pressure, rho, start, npts)
end subroutine calculate_density_array_nemo
subroutine calculate_density_derivs_nemo(T, S, pressure, drho_dT, drho_dS, start, npts)
- real, intent(in), dimension(:) :: T, S, pressure
- real, intent(out), dimension(:) :: drho_dT, drho_dS
- integer, intent(in) :: start, npts
+ real, intent(in), dimension(:) :: T !< Conservative temperature in C.
+ real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg.
+ real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
+ real, intent(out), dimension(:) :: drho_dT !< The partial derivative of density with potential
+ !! temperature, in kg m-3 K-1.
+ real, intent(out), dimension(:) :: drho_dS !< The partial derivative of density with salinity,
+ !! in kg m-3 psu-1.
+ integer, intent(in) :: start !< The starting point in the arrays.
+ integer, intent(in) :: npts !< The number of values to calculate.
! * Arguments: T - conservative temperature in C. *
! * (in) S - absolute salinity in g/kg. *
! * (in) pressure - pressure in Pa. *
@@ -343,9 +355,15 @@ subroutine calculate_density_derivs_nemo(T, S, pressure, drho_dT, drho_dS, start
end subroutine calculate_density_derivs_nemo
subroutine calculate_compress_nemo(T, S, pressure, rho, drho_dp, start, npts)
- real, intent(in), dimension(:) :: T, S, pressure
- real, intent(out), dimension(:) :: rho, drho_dp
- integer, intent(in) :: start, npts
+ real, intent(in), dimension(:) :: T !< Conservative temperature in C.
+ real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg.
+ real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
+ real, intent(out), dimension(:) :: rho !< In situ density in kg m-3.
+ real, intent(out), dimension(:) :: drho_dp !< The partial derivative of density with pressure
+ !! (also the inverse of the square of sound speed)
+ !! in s2 m-2.
+ integer, intent(in) :: start !< The starting point in the arrays.
+ integer, intent(in) :: npts !< The number of values to calculate.
! * Arguments: T - conservative temperature in C. *
! * (in) S - absolute salinity in g/kg. *
! * (in) pressure - pressure in Pa. *
diff --git a/src/equation_of_state/MOM_EOS_TEOS10.F90 b/src/equation_of_state/MOM_EOS_TEOS10.F90
index 200b59b35d..6dc7af1706 100644
--- a/src/equation_of_state/MOM_EOS_TEOS10.F90
+++ b/src/equation_of_state/MOM_EOS_TEOS10.F90
@@ -44,9 +44,15 @@ module MOM_EOS_TEOS10
contains
+!> This subroutine computes the in situ density of sea water (rho in
+!! units of kg/m^3) from salinity (S in psu), potential temperature
+!! (T in deg C), and pressure in Pa. It uses the expression from
+!! TEOS10 website.
subroutine calculate_density_scalar_teos10(T, S, pressure, rho)
-real, intent(in) :: T, S, pressure
-real, intent(out) :: rho
+real, intent(in) :: T !< Conservative temperature in C.
+real, intent(in) :: S !< Absolute salinity in g/kg.
+real, intent(in) :: pressure !< Pressure in Pa.
+real, intent(out) :: rho !< In situ density in kg m-3.
! * Arguments: T - conservative temperature in C. *
! * (in) S - absolute salinity in g/kg. *
! * (in) pressure - pressure in Pa. *
@@ -105,9 +111,15 @@ subroutine calculate_density_array_teos10(T, S, pressure, rho, start, npts)
end subroutine calculate_density_array_teos10
subroutine calculate_density_derivs_teos10(T, S, pressure, drho_dT, drho_dS, start, npts)
- real, intent(in), dimension(:) :: T, S, pressure
- real, intent(out), dimension(:) :: drho_dT, drho_dS
- integer, intent(in) :: start, npts
+ real, intent(in), dimension(:) :: T !< Conservative temperature in C.
+ real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg.
+ real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
+ real, intent(out), dimension(:) :: drho_dT !< The partial derivative of density with potential
+ !! temperature, in kg m-3 K-1.
+ real, intent(out), dimension(:) :: drho_dS !< The partial derivative of density with salinity,
+ !! in kg m-3 psu-1.
+ integer, intent(in) :: start !< The starting point in the arrays.
+ integer, intent(in) :: npts !< The number of values to calculate.
! * Arguments: T - conservative temperature in C. *
! * (in) S - absolute salinity in g/kg. *
! * (in) pressure - pressure in Pa. *
@@ -132,9 +144,15 @@ subroutine calculate_density_derivs_teos10(T, S, pressure, drho_dT, drho_dS, sta
end subroutine calculate_density_derivs_teos10
subroutine calculate_specvol_derivs_teos10(T, S, pressure, dSV_dT, dSV_dS, start, npts)
- real, intent(in), dimension(:) :: T, S, pressure
- real, intent(out), dimension(:) :: dSV_dT, dSV_dS
- integer, intent(in) :: start, npts
+ real, intent(in), dimension(:) :: T !< Conservative temperature in C.
+ real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg.
+ real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
+ real, intent(out), dimension(:) :: dSV_dT !< The partial derivative of specific volume with
+ !! potential temperature, in m3 kg-1 K-1.
+ real, intent(out), dimension(:) :: dSV_dS !< The partial derivative of specific volume with
+ !! salinity, in m3 kg-1 / (g/kg).
+ integer, intent(in) :: start !< The starting point in the arrays.
+ integer, intent(in) :: npts !< The number of values to calculate.
! * Arguments: T - conservative temperature in C. *
! * (in) S - absolute salinity in g/kg. *
! * (in) pressure - pressure in Pa. *
@@ -158,10 +176,21 @@ subroutine calculate_specvol_derivs_teos10(T, S, pressure, dSV_dT, dSV_dS, start
end subroutine calculate_specvol_derivs_teos10
+!> This subroutine computes the in situ density of sea water (rho in *
+!! units of kg/m^3) and the compressibility (drho/dp = C_sound^-2) *
+!! (drho_dp in units of s2 m-2) from salinity (sal in psu), potential*
+!! temperature (T in deg C), and pressure in Pa. It uses the *
+!! subroutines from TEOS10 website
subroutine calculate_compress_teos10(T, S, pressure, rho, drho_dp, start, npts)
- real, intent(in), dimension(:) :: T, S, pressure
- real, intent(out), dimension(:) :: rho, drho_dp
- integer, intent(in) :: start, npts
+ real, intent(in), dimension(:) :: T !< Conservative temperature in C.
+ real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg.
+ real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
+ real, intent(out), dimension(:) :: rho !< In situ density in kg m-3.
+ real, intent(out), dimension(:) :: drho_dp !< The partial derivative of density with pressure
+ !! (also the inverse of the square of sound speed)
+ !! in s2 m-2.
+ integer, intent(in) :: start !< The starting point in the arrays.
+ integer, intent(in) :: npts !< The number of values to calculate.
! * Arguments: T - conservative temperature in C. *
! * (in) S - absolute salinity in g/kg. *
! * (in) pressure - pressure in Pa. *
diff --git a/src/framework/MOM_memory_macros.h b/src/framework/MOM_memory_macros.h
index dcac15beed..7de33e4949 100644
--- a/src/framework/MOM_memory_macros.h
+++ b/src/framework/MOM_memory_macros.h
@@ -1,8 +1,10 @@
-!***********************************************************************
-! This is a header file to define macros for static and dynamic memory *
-! allocation. Define STATIC_MEMORY_ in MOM_memory.h for static memory *
-! allocation. Otherwise dynamic memory allocation will be assumed. *
-!***********************************************************************
+!//! \brief Memory macros
+!//! \details This is a header file to define macros for static and dynamic memory allocation.
+!//! Define STATIC_MEMORY_ in MOM_memory.h for static memory allocation.
+!//! Otherwise dynamic memory allocation will be assumed.
+!//!
+!//! For explanation of symmetric and non-symmetric memory modes see \ref Horizontal_indexing.
+!//! \file MOM_memory_macros.h
#ifdef STATIC_MEMORY_
# define DEALLOC_(x)
@@ -11,12 +13,12 @@
# define PTR_
# define TO_NULL_
-! NIMEM and NJMEM are the maximum number of grid points in the
+! NIMEM and NJMEM are the maximum number of grid points in the
! x- and y-directions on each processsor.
# define NIMEM_ (((NIGLOBAL_-1)/NIPROC_)+1+2*NIHALO_)
# define NJMEM_ (((NJGLOBAL_-1)/NJPROC_)+1+2*NJHALO_)
-! These are the macors that should be used when setting up ALLOCABLE_ or
+! These are the macros that should be used when setting up ALLOCABLE_ or
! PTR_ (heap) variables.
# ifdef SYMMETRIC_MEMORY_
# define NIMEMB_ 0:NIMEM_
@@ -47,50 +49,85 @@
# define SZJBS_(G) 0:NJMEM_
#else
-! Dynamic memory allocation
+!/* Dynamic memory allocation section */
+!/*! Deallocates array x when using dynamic memory mode. Does nothing in static memory mode.*/
# define DEALLOC_(x) deallocate(x)
+!/*! Allocates array x when using dynamic memory mode. Does nothing in static memory mode.*/
# define ALLOC_(x) allocate(x)
+!/*! Attaches the ALLOCATABLE attribute to an array in dynamic memory mode. Does nothing in static memory mode.*/
# define ALLOCABLE_ ,allocatable
+!/*! Attaches the POINTER attribute to an array in dynamic memory mode. Does nothing in static memory mode.*/
# define PTR_ ,pointer
+!/*! Nullify a pointer in dynamic memory mode. Does nothing in static memory mode.*/
# define TO_NULL_ =>NULL()
-! These are the macors that should be used when setting up ALLOCABLE_ or
-! PTR_ (heap) variables.
+!/* These are the macros that should be used when setting up ALLOCABLE_ or PTR_ (heap) variables. */
+
+!/*! Expands to : in dynamic memory mode, or is the i-shape of a tile in static memory mode. Use for heap (ALLOCABLE_ or PTR_) variables at h- or v- points. */
# define NIMEM_ :
+!/*! Expands to : in dynamic memory mode, or is the j-shape of a tile in static memory mode. Use for heap (ALLOCABLE_ or PTR_) variables at h- or u- points. */
# define NJMEM_ :
+!/*! Expands to : in dynamic memory mode, or to NIMEMB_ in static memory mode. Use for heap (ALLOCABLE_ or PTR_) variables at h- or v- points. */
# define NIMEMB_PTR_ :
+!/*! Expands to : in dynamic memory mode, or to NJMEMB_ in static memory mode. Use for heap (ALLOCABLE_ or PTR_) variables at h- or u- points. */
# define NJMEMB_PTR_ :
# ifdef SYMMETRIC_MEMORY_
+!/*! Expands to : or 0: in dynamic memory mode, or is the staggered i-shape of a tile in static memory mode. Use for heap (ALLOCABLE_ or PTR_) variables at q- or u- points. */
# define NIMEMB_ 0:
+!/*! Expands to : or 0: in dynamic memory mode, or is the staggered j-shape of a tile in static memory mode. Use for heap (ALLOCABLE_ or PTR_) variables at q- or v- points. */
# define NJMEMB_ 0:
# else
# define NIMEMB_ :
# define NJMEMB_ :
# endif
+!/*! Expands to 0: in dynamic memory mode, or is the staggered i-shape of a tile in static memory mode. Use for always-symmetric heap (ALLOCABLE_ or PTR_) variables at q- or u- points. */
# define NIMEMB_SYM_ 0:
+!/*! Expands to 0: in dynamic memory mode, or is the staggered j-shape of a tile in static memory mode. Use for always-symmetric heap (ALLOCABLE_ or PTR_) variables at q- or v- points. */
# define NJMEMB_SYM_ 0:
+!/*! Expands to : in dynamic memory mode or is to the number of layers in static memory mode. Use for heap (ALLOCABLE_ or PTR_) layer variables. */
# define NKMEM_ :
+!/*! Expands to 0: in dynamic memory mode or to 0:NK_ in static memory mode. Use for heap (ALLOCABLE_ or PTR_) interface variables. */
# define NKMEM0_ 0:
+!/*! Expands to : in dynamic memory mode or to NK_+1 in static memory mode. Use for heap (ALLOCABLE_ or PTR_) interface variables. */
# define NK_INTERFACE_ :
+!/*! Expands to : or 1. UNKNOWN PURPOSE! */
# define C1_ :
+!/*! Expands to : or 2. UNKNOWN PURPOSE! */
# define C2_ :
+!/*! Expands to : or 3. UNKNOWN PURPOSE! */
# define C3_ :
-! These are the macros that should be used for subroutine arguments
-! or for automatically allocated (stack) variables.
+
+!/*! \todo Explain or remove C1_, C2_ and C3_ */
+
+!/* These are the macros that should be used for subroutine arguments or for automatically allocated (stack) variables. */
+
+!/*! The i-shape of a dummy argument staggered at h- or v-points. */
# define SZI_(G) G%isd:G%ied
+!/*! The j-shape of a dummy argument staggered at h- or u-points. */
# define SZJ_(G) G%jsd:G%jed
+!/*! The k-shape of a layer dummy argument. */
# define SZK_(G) G%ke
+!/*! The k-shape of an interface dummy argument. */
# define SZK0_(G) 0:G%ke
+!/*! The i-shape of a dummy argument staggered at q- or u-points. */
# define SZIB_(G) G%IsdB:G%IedB
+!/*! The j-shape of a dummy argument staggered at q- or v-points. */
# define SZJB_(G) G%JsdB:G%JedB
+!/*! The i-shape of a symmetric dummy argument staggered at q- or u-points. */
# define SZIBS_(G) G%isd-1:G%ied
+!/*! The j-shape of a symmetric dummy argument staggered at q- or v-points. */
# define SZJBS_(G) G%jsd-1:G%jed
#endif
-! These dynamic size macros always give the same results (for now).
+!/* These dynamic size macros always give the same results (for now). */
+
+!/*! The i-shape of a dynamic dummy argument staggered at h- or v-points. */
#define SZDI_(G) G%isd:G%ied
+!/*! The i-shape of a dynamic dummy argument staggered at q- or u-points. */
#define SZDIB_(G) G%IsdB:G%IedB
+!/*! The j-shape of a dynamic dummy argument staggered at h- or u-points. */
#define SZDJ_(G) G%jsd:G%jed
+!/*! The j-shape of a dynamic dummy argument staggered at q- or v-points. */
#define SZDJB_(G) G%JsdB:G%JedB
diff --git a/src/framework/_Diagnostics.dox b/src/framework/_Diagnostics.dox
index af5f36c209..853ad2cadd 100644
--- a/src/framework/_Diagnostics.dox
+++ b/src/framework/_Diagnostics.dox
@@ -152,8 +152,8 @@ The run-time parameter `NUM_DIAG_COORDS` controls how many diagnostic coordinate
The run-time parameter `DIAG_COORDS` defines the mapping between each coordinate, the name of the module in the diag_table and run-time parameter names that define the coordinate.
A list of string tuples, separated by commas, with each tuple in the form of MODULE_SUFFIX PARAMETER_SUFFIX COORDINATE_NAME.
-`MODULE_SUFFIX` is the string appended to "ocean_model_" to create a module in the diag_table.
-`PARAMETER_SUFFIX` is the string appended to "DiAG_COORD_DEF_", and other paramaters, used to control the generation of the named coordinate.
+`MODULE_SUFFIX` is the string appended to "ocean_model" to create a module in the diag_table.
+`PARAMETER_SUFFIX` is the string appended to "DiAG_COORD_DEF", and other parameters, used to control the generation of the named coordinate.
`COORDINATE_NAME` is a name understood by the MOM6 regridding module. Valid examples are "ZSTAR", "SIGMA", "RHO", etc.
By default, `NUM_DIAG_COORDS=1` and `DIAG_COORDS="z Z ZSTAR"`, meaning the module "ocean_model_z" provides diagnostics in "z*" coordinates and uses the parameter `DIAG_COORD_DEF_Z`.
diff --git a/src/framework/_Horizontal_indexing.dox b/src/framework/_Horizontal_indexing.dox
index fb15604e82..ea9f7ffde9 100644
--- a/src/framework/_Horizontal_indexing.dox
+++ b/src/framework/_Horizontal_indexing.dox
@@ -80,6 +80,8 @@ The file MOM_memory_macros.h provides the macros `SZI_`, `SZJ_`, `SZIB_` and `SZ
- `real, dimension(SZI_(HI), SZJB_(HI)) :: Dv !< Depth at v-points (m)`
- `real, dimension(SZIB_(HI), SZJB_(HI)) :: Dq !< Depth at q-points (m)`
+See MOM_memory_macros.h for the complete list of macros used in various memory modes.
+
\section Global_index Calculating a global index
For the most part MOM6 code should be independent of an equivalent absolute global index.
diff --git a/src/framework/_Runtime_parameter_system.dox b/src/framework/_Runtime_parameter_system.dox
index 25e9e5031e..20baa8a0a3 100644
--- a/src/framework/_Runtime_parameter_system.dox
+++ b/src/framework/_Runtime_parameter_system.dox
@@ -9,7 +9,7 @@ MOM6 has an extensive set of parameters that are set at run-time by parsing an i
Run-time parameters are provided to the model in two phases:
1. A very small set of logistical parameters are read as namelist variables from the FMS parameter file `input.nml`. One of these logistical parameters is a list of ascii files that contain all the other run-time parameters.
-1. All of the above-named parameter files are scanned for MOM6 model parameters, default values assigned and replaced, conflicts detected and various parameter summaries logged to files and/or the standard output.
+2. All of the above-named parameter files are scanned for MOM6 model parameters, default values assigned and replaced, conflicts detected and various parameter summaries logged to files and/or the standard output.
\subsection mom6_namelist Namelist parameters (`input.nml`)
@@ -33,9 +33,7 @@ Parameter names must be constructed from the characters `[A-Za-z0-9_]` and by so
Parameters that are not specified in the parameter files may assume a default value. It is not an error to specify a parameter more than once with the same value. It is an error to specify different values.
-The keyword `#override` indicates that this parameter specification takes precedence over other specifications. It is **not** an error to have two #override specifications for a single parameter with the same values. It is an error to have two #override statements with different values.
-
-The __soon to be deprecated__ #define keyword causes the parameter to assume the provided value (or in the case of logical parameters to be set to .TRUE.). If the parameter has a default value, the value provided will be assumed and the default value ignored. It is not an error to have two #define statements for a single parameter with the same values. It is an error to have two #define statements with different values.
+The keyword \#override indicates that this parameter specification takes precedence over other specifications. It is **not** an error to have two \#override specifications for a single parameter with the same values. It is an error to have two \#override statements with different values.
Some illustrations:
\code{.unparsed}
@@ -77,7 +75,7 @@ In addition, there are also calls that log derived quantities (e.g., a time-step
There are several techniques that are used for error checking on MOM6 parameters:
- Some parameters have internal error messages if they are set to nonsensical values.
-- No parameter can be set twice inconsistently without an explicit `#override` specification.
+- No parameter can be set twice inconsistently without an explicit \#override specification.
- If the run-time parameter REPORT_UNUSED_PARAMS is true, a warning will be issued for any entries in the input parameter files that are not read in, for instance if they are misspelled.
- Setting the run-time parameter FATAL_UNUSED_PARAMS to true causes a fatal error that will bring down the model if there are any unused entries in the input parameter files.
diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90
index 0af1dd7ee5..853a62a29c 100644
--- a/src/ice_shelf/MOM_ice_shelf.F90
+++ b/src/ice_shelf/MOM_ice_shelf.F90
@@ -6715,7 +6715,7 @@ end subroutine ice_shelf_advect_temp_y
!! (ISSUE: No need to use control structure - add arguments.
!! matrix_diagonal_triangle - LET'S TAKE THIS OUT
!! ice_shelf_advect - Given the melt rate and velocities, it advects the ice shelf THICKNESS
-!! - modified h_shelf, area_shelf_h, hmask
+!! - modified h_shelf, area_shelf_h, hmask
!! (maybe should updater mass_shelf as well ???)
!! ice_shelf_advect_thickness_x, ice_shelf_advect_thickness_y - These
!! subroutines determine the mass fluxes through the faces.
diff --git a/src/initialization/MOM_coord_initialization.F90 b/src/initialization/MOM_coord_initialization.F90
index c59bece6fa..161970623b 100644
--- a/src/initialization/MOM_coord_initialization.F90
+++ b/src/initialization/MOM_coord_initialization.F90
@@ -32,13 +32,13 @@ module MOM_coord_initialization
!> MOM_initialize_coord sets up time-invariant quantities related to MOM6's
!! vertical coordinate.
subroutine MOM_initialize_coord(GV, PF, write_geom, output_dir, tv, max_depth)
- type(verticalGrid_type), intent(inout) :: GV !< Ocean vertical grid structure
- type(param_file_type), intent(in) :: PF !< A structure indicating the open file
- !! to parse for model parameter values.
+ type(verticalGrid_type), intent(inout) :: GV !< Ocean vertical grid structure.
+ type(param_file_type), intent(in) :: PF !< A structure indicating the open file
+ !! to parse for model parameter values.
logical, intent(in) :: write_geom !< If true, write grid geometry files.
character(len=*), intent(in) :: output_dir !< The directory into which to write files.
- type(thermo_var_ptrs), intent(inout) :: tv !< The thermodynamic variable structure.
- real, intent(in) :: max_depth !< The ocean's maximum depth, in m.
+ type(thermo_var_ptrs), intent(inout) :: tv !< The thermodynamic variable structure.
+ real, intent(in) :: max_depth !< The ocean's maximum depth, in m.
! Local
character(len=200) :: config
logical :: debug
@@ -115,8 +115,11 @@ end subroutine MOM_initialize_coord
! The set_coord routines deal with initializing aspects of the vertical grid.
! -----------------------------------------------------------------------------
subroutine set_coord_from_gprime(Rlay, g_prime, GV, param_file)
- real, dimension(:), intent(out) :: Rlay, g_prime
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
+ real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values
+ !! (potential density).
+ real, dimension(:), intent(out) :: g_prime !< A structure indicating the open file to
+ !! parse for model parameter values.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
! Arguments: Rlay - the layers' target coordinate values (potential density).
! (out) g_prime - the reduced gravity across the interfaces, in m s-2.
@@ -153,8 +156,11 @@ end subroutine set_coord_from_gprime
! -----------------------------------------------------------------------------
subroutine set_coord_from_layer_density(Rlay, g_prime, GV, param_file)
- real, dimension(:), intent(out) :: Rlay, g_prime
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
+ real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values
+ !! (potential density).
+ real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces,
+ !! in m s-2.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
! Arguments: Rlay - the layers' target coordinate values (potential density).
! (out) g_prime - the reduced gravity across the interfaces, in m s-2.
@@ -200,11 +206,16 @@ end subroutine set_coord_from_layer_density
! -----------------------------------------------------------------------------
subroutine set_coord_from_TS_ref(Rlay, g_prime, GV, param_file, eqn_of_state, &
P_Ref)
- real, dimension(:), intent(out) :: Rlay, g_prime
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
- type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
- type(EOS_type), pointer :: eqn_of_state
- real, intent(in) :: P_Ref
+ real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values
+ !! (potential density).
+ real, dimension(:), intent(out) :: g_prime !< the reduced gravity across the interfaces,
+ !! in m s-2.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
+ type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time
+ !! parameters
+ type(EOS_type), pointer :: eqn_of_state !< integer selecting the equation of state.
+ real, intent(in) :: P_Ref !< The coordinate-density reference pressure
+ !! in Pa.
! Arguments: Rlay - the layers' target coordinate values (potential density).
! (out) g_prime - the reduced gravity across the interfaces, in m s-2.
! (in) GV - The ocean's vertical grid structure.
@@ -256,11 +267,16 @@ end subroutine set_coord_from_TS_ref
! -----------------------------------------------------------------------------
subroutine set_coord_from_TS_profile(Rlay, g_prime, GV, param_file, &
eqn_of_state, P_Ref)
- real, dimension(:), intent(out) :: Rlay, g_prime
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
- type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
- type(EOS_type), pointer :: eqn_of_state
- real, intent(in) :: P_Ref
+ real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values
+ !! (potential density).
+ real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces,
+ !! in m s-2.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
+ type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time
+ !! parameters
+ type(EOS_type), pointer :: eqn_of_state !< integer that selects equation of state.
+ real, intent(in) :: P_Ref !< The coordinate-density reference pressure
+ !! in Pa.
! Arguments: Rlay - the layers' target coordinate values (potential density).
! (out) g_prime - the reduced gravity across the interfaces, in m s-2.
! (in) GV - The ocean's vertical grid structure.
@@ -309,11 +325,16 @@ end subroutine set_coord_from_TS_profile
! -----------------------------------------------------------------------------
subroutine set_coord_from_TS_range(Rlay, g_prime, GV, param_file, &
eqn_of_state, P_Ref)
- real, dimension(:), intent(out) :: Rlay, g_prime
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
- type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
- type(EOS_type), pointer :: eqn_of_state
- real, intent(in) :: P_Ref
+ real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values
+ !! (potential density).
+ real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces,
+ !! in m s-2.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
+ type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time
+ !! parameters
+ type(EOS_type), pointer :: eqn_of_state !< integer that selects equation of state
+ real, intent(in) :: P_Ref !< The coordinate-density reference pressure
+ !! in Pa.
! Arguments: Rlay - the layers' target coordinate values (potential density).
! (out) g_prime - the reduced gravity across the interfaces, in m s-2.
! (in) GV - The ocean's vertical grid structure.
@@ -396,8 +417,11 @@ end subroutine set_coord_from_TS_range
! -----------------------------------------------------------------------------
subroutine set_coord_from_file(Rlay, g_prime, GV, param_file)
- real, dimension(:), intent(out) :: Rlay, g_prime
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
+ real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values
+ !! (potential density).
+ real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces,
+ !! in m s-2.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
! Arguments: Rlay - the layers' target coordinate values (potential density).
! (out) g_prime - the reduced gravity across the interfaces, in m s-2.
@@ -447,8 +471,11 @@ end subroutine set_coord_from_file
! -----------------------------------------------------------------------------
subroutine set_coord_linear(Rlay, g_prime, GV, param_file)
- real, dimension(:), intent(out) :: Rlay, g_prime
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
+ real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values
+ !! (potential density).
+ real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces,
+ !! in m s-2.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
! Arguments: Rlay - the layers' target coordinate values (potential density).
! (out) g_prime - the reduced gravity across the interfaces, in m s-2.
@@ -494,10 +521,13 @@ subroutine set_coord_linear(Rlay, g_prime, GV, param_file)
end subroutine set_coord_linear
! -----------------------------------------------------------------------------
+
+!> This subroutine writes out a file containing any available data related
+!! to the vertical grid used by the MOM ocean model.
subroutine write_vertgrid_file(GV, param_file, directory)
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
- character(len=*), intent(in) :: directory
+ character(len=*), intent(in) :: directory !< The directory into which to place the file.
! This subroutine writes out a file containing any available data related
! to the vertical grid used by the MOM ocean model.
! Arguments: GV - The container for the vertical grid data.
diff --git a/src/initialization/MOM_state_initialization.F90 b/src/initialization/MOM_state_initialization.F90
index cf0ca85d5a..ac9beb6734 100644
--- a/src/initialization/MOM_state_initialization.F90
+++ b/src/initialization/MOM_state_initialization.F90
@@ -103,22 +103,33 @@ module MOM_state_initialization
subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, PF, dirs, &
restart_CS, ALE_CSp, tracer_Reg, sponge_CSp, &
ALE_sponge_CSp, OBC, Time_in)
- type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
- real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(out) :: u !< The zonal velocity that is being initialized, in m s-1
- real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(out) :: v !< The meridional velocity that is being initialized, in m s-1
- real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: h !< Layer thicknesses, in H (usually m or kg m-2)
- type(thermo_var_ptrs), intent(inout) :: tv !< A structure pointing to various thermodynamic variables
- type(time_type), intent(inout) :: Time
- type(param_file_type), intent(in) :: PF
- type(directories), intent(in) :: dirs
- type(MOM_restart_CS), pointer :: restart_CS
- type(ALE_CS), pointer :: ALE_CSp
- type(tracer_registry_type), pointer :: tracer_Reg
- type(sponge_CS), pointer :: sponge_CSp
- type(ALE_sponge_CS), pointer :: ALE_sponge_CSp
- type(ocean_OBC_type), pointer :: OBC
- type(time_type), optional, intent(in) :: Time_in
+ type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
+ real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
+ intent(out) :: u !< The zonal velocity that is being initialized,
+ !! in m s-1
+ real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
+ intent(out) :: v !< The meridional velocity that is being
+ !! initialized, in m s-1
+ real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
+ intent(out) :: h !< Layer thicknesses, in H (usually m or
+ !! kg m-2)
+ type(thermo_var_ptrs), intent(inout) :: tv !< A structure pointing to various thermodynamic
+ !! variables
+ type(time_type), intent(inout) :: Time !< Time at the start of the run segment.
+ type(param_file_type), intent(in) :: PF !< A structure indicating the open file to parse
+ !! for model parameter values.
+ type(directories), intent(in) :: dirs !< A structure containing several relevant
+ !! directory paths.
+ type(MOM_restart_CS), pointer :: restart_CS !< A pointer to the restart control
+ !! structure.
+ type(ALE_CS), pointer :: ALE_CSp
+ type(tracer_registry_type), pointer :: tracer_Reg
+ type(sponge_CS), pointer :: sponge_CSp
+ type(ALE_sponge_CS), pointer :: ALE_sponge_CSp
+ type(ocean_OBC_type), pointer :: OBC
+ type(time_type), optional, intent(in) :: Time_in !< Time at the start of the run segment.
+ !! Time_in overrides any value set for Time.
! Arguments: u - Zonal velocity, in m s-1.
! (out) v - Meridional velocity, in m s-1.
! (out) h - Layer thickness, in m.
@@ -199,8 +210,12 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, PF, dirs, &
if (present(Time_in)) Time = Time_in
! Otherwise leave Time at its input value.
- ! h will be converted from m to H below
- h(:,:,:) = GV%Angstrom_z
+ ! This initialization should not be needed. Certainly restricting it
+ ! to the computational domain helps detect possible uninitialized
+ ! data in halos which should be covered by the pass_var(h) later.
+ !do k = 1, nz; do j = js, je; do i = is, ie
+ ! h(i,j,k) = 0.
+ !enddo
endif
! The remaining initialization calls are done, regardless of whether the
@@ -407,9 +422,13 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, PF, dirs, &
call convert_thickness(h, G, GV, tv)
elseif (GV%Boussinesq) then
! Convert h from m to thickness units (H)
- h(:,:,:) = h(:,:,:)*GV%m_to_H
+ do k = 1, nz; do j = js, je; do i = is, ie
+ h(i,j,k) = h(i,j,k)*GV%m_to_H
+ enddo ; enddo ; enddo
else
- h(:,:,:) = h(:,:,:)*GV%kg_m2_to_H
+ do k = 1, nz; do j = js, je; do i = is, ie
+ h(i,j,k) = h(i,j,k)*GV%kg_m2_to_H
+ enddo ; enddo ; enddo
endif
endif
@@ -798,8 +817,12 @@ end subroutine initialize_thickness_search
subroutine convert_thickness(h, G, GV, tv)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
- real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(inout) :: h !< Layer thicknesses, being converted from m to H (m or kg m-2)
- type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various thermodynamic variables
+ real, dimension(SZI_(G),SZJ_(G), SZK_(G)), &
+ intent(inout) :: h !< Layer thicknesses, being
+ !! converted from m to H (m or kg
+ !! m-2)
+ type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various
+ !! thermodynamic variables
! Arguments: h - The thickness that is being initialized.
! (in) G - The ocean's grid structure.
! (in) GV - The ocean's vertical grid structure.
@@ -1307,7 +1330,8 @@ end subroutine initialize_velocity_circular
! -----------------------------------------------------------------------------
subroutine initialize_temp_salt_from_file(T, S, G, param_file, just_read_params)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
- real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: T, S
+ real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: T !< The potential temperature that is being initialized.
+ real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: S !< The salinity that is being initialized.
type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
logical, optional, intent(in) :: just_read_params !< If present and true, this call will
!! only read parameters without changing h.
@@ -1424,14 +1448,20 @@ end subroutine initialize_temp_salt_from_profile
! -----------------------------------------------------------------------------
subroutine initialize_temp_salt_fit(T, S, G, GV, param_file, eqn_of_state, P_Ref, just_read_params)
- type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
- real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: T, S
- type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
- type(EOS_type), pointer :: eqn_of_state
- real, intent(in) :: P_Ref
+ type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
+ real, dimension(SZI_(G),SZJ_(G), SZK_(G)), &
+ intent(out) :: T !< The potential temperature that is being
+ !! initialized.
+ real, dimension(SZI_(G),SZJ_(G), SZK_(G)), &
+ intent(out) :: S !< The salinity that is being initialized.
+ type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time
+ !! parameters.
+ type(EOS_type), pointer :: eqn_of_state !< Integer that selects the equatio of state.
+ real, intent(in) :: P_Ref !< The coordinate-density reference pressure
+ !! in Pa.
logical, optional, intent(in) :: just_read_params !< If present and true, this call will
- !! only read parameters without changing h.
+ !! only read parameters without changing h.
! This function puts the initial layer temperatures and salinities !
! into T(:,:,:) and S(:,:,:). !
@@ -1518,11 +1548,14 @@ end subroutine initialize_temp_salt_fit
! -----------------------------------------------------------------------------
subroutine initialize_temp_salt_linear(T, S, G, param_file, just_read_params)
- type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
+ type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: T, S
- type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
- logical, optional, intent(in) :: just_read_params !< If present and true, this call will
- !! only read parameters without changing h.
+ type(param_file_type), intent(in) :: param_file !< A structure to parse for
+ !! run-time parameters
+ logical, optional, intent(in) :: just_read_params !< If present and true,
+ !! this call will only read
+ !! parameters without
+ !! changing h.
! This subroutine initializes linear profiles for T and S according to
! reference surface layer salinity and temperature and a specified range.
@@ -1579,13 +1612,20 @@ end subroutine initialize_temp_salt_linear
! -----------------------------------------------------------------------------
! -----------------------------------------------------------------------------
+!> This subroutine sets the inverse restoration time (Idamp), and
+!! the values towards which the interface heights and an arbitrary
+!! number of tracers should be restored within each sponge. The
+!!interface height is always subject to damping, and must always be
+!! the first registered field.
subroutine initialize_sponges_file(G, GV, use_temperature, tv, param_file, CSp)
- type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
+ type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
logical, intent(in) :: use_temperature
- type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various thermodynamic variables
- type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
- type(sponge_CS), pointer :: CSp
+ type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various thermodynamic
+ !! variables.
+ type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters.
+ type(sponge_CS), pointer :: CSp !! A pointer that is set to point to the control
+ !! structure for this module.
! This subroutine sets the inverse restoration time (Idamp), and !
! the values towards which the interface heights and an arbitrary !
! number of tracers should be restored within each sponge. The !
@@ -2209,9 +2249,9 @@ end subroutine MOM_temp_salt_initialize_from_Z
!> Run simple unit tests
subroutine MOM_state_init_tests(G, GV, tv)
- type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure
- type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
- type(thermo_var_ptrs), intent(in) :: tv !< Thermodynamics structure
+ type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure.
+ type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
+ type(thermo_var_ptrs), intent(in) :: tv !< Thermodynamics structure.
! Local variables
integer, parameter :: nk=5
real, dimension(nk) :: T, T_t, T_b, S, S_t, S_b, rho, h, z
diff --git a/src/initialization/MOM_tracer_initialization_from_Z.F90 b/src/initialization/MOM_tracer_initialization_from_Z.F90
index 246d47dc5c..78bd4b0cfa 100644
--- a/src/initialization/MOM_tracer_initialization_from_Z.F90
+++ b/src/initialization/MOM_tracer_initialization_from_Z.F90
@@ -66,17 +66,18 @@ subroutine MOM_initialize_tracer_from_Z(h, tr, G, GV, PF, src_file, src_var_nam,
! (in) G - The ocean's grid structure.
! (in) GV - The ocean's vertical grid structure.
- type(ocean_grid_type), intent(inout) :: G !< Ocean grid structure
- type(verticalGrid_type), intent(in) :: GV !< Ocean vertical grid structure
- real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h
- real, dimension(:,:,:), pointer :: tr
- type(param_file_type), intent(in) :: PF
- character(len=*), intent(in) :: src_file, src_var_nam
- real, optional, intent(in) :: src_var_unit_conversion
- integer, optional, intent(in) :: src_var_record
- logical, optional, intent(in) :: homogenize, useALEremapping
- character(len=*), optional, intent(in) :: remappingScheme
- character(len=*), optional, intent(in) :: src_var_gridspec ! Not implemented yet.
+ type(ocean_grid_type), intent(inout) :: G !< Ocean grid structure.
+ type(verticalGrid_type), intent(in) :: GV !< Ocean vertical grid structure.
+ real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
+ intent(in) :: h !< Layer thickness, in m.
+ real, dimension(:,:,:), pointer :: tr
+ type(param_file_type), intent(in) :: PF
+ character(len=*), intent(in) :: src_file, src_var_nam
+ real, optional, intent(in) :: src_var_unit_conversion
+ integer, optional, intent(in) :: src_var_record
+ logical, optional, intent(in) :: homogenize, useALEremapping
+ character(len=*), optional, intent(in) :: remappingScheme
+ character(len=*), optional, intent(in) :: src_var_gridspec ! Not implemented yet.
real :: land_fill = 0.0
character(len=200) :: inputdir ! The directory where NetCDF input files are.
@@ -280,14 +281,19 @@ subroutine fill_miss_2d(aout,good,fill,prev,G,smooth,num_pass,relc,crit,keep_bug
!
use MOM_coms, only : sum_across_PEs
- type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure
+ type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure.
real, dimension(SZI_(G),SZJ_(G)), intent(inout) :: aout
- real, dimension(SZI_(G),SZJ_(G)), intent(in) :: good, fill
- real, dimension(SZI_(G),SZJ_(G)), optional, intent(in) :: prev
- logical, intent(in), optional :: smooth
- integer, intent(in), optional :: num_pass
- real, intent(in), optional :: relc,crit
- logical, intent(in), optional :: keep_bug, debug
+ real, dimension(SZI_(G),SZJ_(G)), intent(in) :: good !< Valid data mask for incoming array
+ !! (1==good data; 0==missing data).
+ real, dimension(SZI_(G),SZJ_(G)), intent(in) :: fill !< Same shape array of points which need
+ !! filling (1==please fill;0==leave
+ !! it alone).
+ real, dimension(SZI_(G),SZJ_(G)), optional, &
+ intent(in) :: prev !< First guess where isolated holes exist.
+ logical, intent(in), optional :: smooth
+ integer, intent(in), optional :: num_pass
+ real, intent(in), optional :: relc,crit
+ logical, intent(in), optional :: keep_bug, debug
real, dimension(SZI_(G),SZJ_(G)) :: b,r
@@ -430,24 +436,26 @@ end subroutine fill_miss_2d
subroutine horiz_interp_and_extrap_tracer(filename, varnam, conversion, recnum, G, tr_z, mask_z, z_in, z_edges_in, missing_value, reentrant_x, tripolar_n, homogenize )
- character(len=*), intent(in) :: filename ! Path to file containing tracer to be interpolated
- character(len=*), intent(in) :: varnam ! name of tracer in filee
- real, intent(in) :: conversion ! conversion factor for tracer
- integer, intent(in) :: recnum ! record number of tracer to be read
- type(ocean_grid_type), intent(inout) :: G ! Grid object
- real, allocatable, dimension(:,:,:) :: tr_z ! pointer to allocatable tracer array on local model grid
- ! and native vertical levels
- real, allocatable, dimension(:,:,:) :: mask_z ! pointer to allocatable tracer mask array on local model grid
- ! and native vertical levels
- real, allocatable, dimension(:) :: z_in ! Cell grid values for input data
- real, allocatable, dimension(:) :: z_edges_in ! Cell grid edge values for input data
- real, intent(out) :: missing_value
- logical, intent(in) :: reentrant_x, tripolar_n
- logical, intent(in), optional :: homogenize
-
- real, dimension(:,:), allocatable :: tr_in,tr_inp ! A 2-d array for holding input data on native horizontal
- ! grid and extended grid with poles
- real, dimension(:,:), allocatable :: mask_in ! A 2-d mask for extended input grid
+ character(len=*), intent(in) :: filename !< Path to file containing tracer to be
+ !! interpolated.
+ character(len=*), intent(in) :: varnam !< Name of tracer in filee.
+ real, intent(in) :: conversion !< Conversion factor for tracer.
+ integer, intent(in) :: recnum !< Record number of tracer to be read.
+ type(ocean_grid_type), intent(inout) :: G !< Grid object
+ real, allocatable, dimension(:,:,:) :: tr_z !< pointer to allocatable tracer array on local
+ !! model grid and native vertical levels.
+ real, allocatable, dimension(:,:,:) :: mask_z !< pointer to allocatable tracer mask array on
+ !! local model grid and native vertical levels.
+ real, allocatable, dimension(:) :: z_in !< Cell grid values for input data.
+ real, allocatable, dimension(:) :: z_edges_in !< Cell grid edge values for input data.
+ real, intent(out) :: missing_value
+ logical, intent(in) :: reentrant_x, tripolar_n
+ logical, intent(in), optional :: homogenize
+
+ real, dimension(:,:), allocatable :: tr_in,tr_inp !< A 2-d array for holding input data on
+ !! native horizontal grid and extended grid
+ !! with poles.
+ real, dimension(:,:), allocatable :: mask_in !< A 2-d mask for extended input grid.
real :: PI_180
integer :: rcode, ncid, varid, ndims, id, jd, kd, jdp
@@ -764,16 +772,23 @@ function tracer_z_init(tr_in,z_edges,e,nkml,nkbl,land_fill,wet,nlay,nlevs,debug,
! center and normalized by the cell thickness, nondim.
! Note that -1/2 <= z1 <= z2 <= 1/2.
!
-real, dimension(:,:,:), intent(in) :: tr_in
-real, dimension(size(tr_in,3)+1), intent(in) :: z_edges
-integer, intent(in) :: nlay
-real, dimension(size(tr_in,1),size(tr_in,2),nlay+1), intent(in) :: e
-integer, intent(in) :: nkml,nkbl
-real, intent(in) :: land_fill
-real, dimension(size(tr_in,1),size(tr_in,2)), intent(in) :: wet
-real, dimension(size(tr_in,1),size(tr_in,2)), optional, intent(in) ::nlevs
-logical, intent(in), optional :: debug
-integer, intent(in), optional :: i_debug, j_debug
+real, dimension(:,:,:), intent(in) :: tr_in !< The z-space array of tracer
+ !! concentrations that is read in.
+real, dimension(size(tr_in,3)+1), intent(in) :: z_edges !< The depths of the cell edges in the input
+ !! z* data (m).
+integer, intent(in) :: nlay !< Number of layers.
+real, dimension(size(tr_in,1),size(tr_in,2),nlay+1), &
+ intent(in) :: e !< The depths of the layer interfaces (m).
+integer, intent(in) :: nkml !< Number of mixed layer pieces.
+integer, intent(in) :: nkbl !< Number of buffer layer pieces.
+real, intent(in) :: land_fill !< Fill in data over land.
+real, dimension(size(tr_in,1),size(tr_in,2)), &
+ intent(in) :: wet !< Wet mask (1=ocean)
+real, dimension(size(tr_in,1),size(tr_in,2)), &
+ optional, intent(in) :: nlevs !< Number of levels
+logical, intent(in), optional :: debug
+integer, intent(in), optional :: i_debug
+integer, intent(in), optional :: j_debug
real, dimension(size(tr_in,1),size(tr_in,2),nlay) :: tr
real, dimension(size(tr_in,3)) :: tr_1d
@@ -940,10 +955,11 @@ function bisect_fast(a, x, lo, hi) result(bi_r)
! (in) x - item to be inserted
! (in) lo, hi - optional range to search
-real, dimension(:,:), intent(in) :: a
-real, dimension(:), intent(in) :: x
-integer, dimension(size(a,1)), intent(in), optional :: lo,hi
-integer, dimension(size(a,1),size(x,1)) :: bi_r
+real, dimension(:,:), intent(in) :: a !< Sorted list.
+real, dimension(:), intent(in) :: x !< Item to be inserted.
+integer, dimension(size(a,1)), &
+ intent(in), optional :: lo,hi !< Optional range to search.
+integer, dimension(size(a,1),size(x,1)) :: bi_r
integer :: mid,num_x,num_a,i
integer, dimension(size(a,1)) :: lo_,hi_,lo0,hi0
@@ -983,10 +999,9 @@ end function bisect_fast
#ifdef PY_SOLO
subroutine determine_temperature(temp,salt,R,p_ref,niter,land_fill,h,k_start)
-
-! # This subroutine determines the potential temperature and
-! # salinity that is consistent with the target density
-! # using provided initial guess
+!< This subroutine determines the potential temperature and
+!! salinity that is consistent with the target density
+!! using provided initial guess
! # (inout) temp - potential temperature (degC)
! # (inout) salt - salinity (PSU)
! # (in) R - Desired potential density, in kg m-3.
@@ -996,17 +1011,21 @@ subroutine determine_temperature(temp,salt,R,p_ref,niter,land_fill,h,k_start)
! # (in) k_start - starting index (i.e. below the buffer layer)
! # (in) land_fill - land fill value
-real(kind=8), dimension(:,:,:), intent(inout) :: temp,salt
-real(kind=8), dimension(size(temp,3)), intent(in) :: R
-real, intent(in) :: p_ref
-integer, intent(in) :: niter
-integer, intent(in) :: k_start
-real, intent(in) :: land_fill
-real(kind=8), dimension(:,:,:), intent(in) :: h
-
-real(kind=8), dimension(size(temp,1),size(temp,3)) :: T,S,dT,dS,rho,hin
-real(kind=8), dimension(size(temp,1),size(temp,3)) :: drho_dT,drho_dS
-real(kind=8), dimension(size(temp,1)) :: press
+real(kind=8), dimension(:,:,:), intent(inout) :: temp !< Potential temperature (degC).
+real(kind=8), dimension(:,:,:), intent(inout) :: salt !< Salinity (PSU).
+real(kind=8), dimension(size(temp,3)), intent(in) :: R !< Desired potential density,
+ !! in kg m-3.
+real, intent(in) :: p_ref !< Reference pressure, in Pa.
+integer, intent(in) :: niter !< Maximum number of iterations.
+integer, intent(in) :: k_start !< Starting index (i.e. below the
+ !! buffer layer).
+real, intent(in) :: land_fill !< Land fill value.
+real(kind=8), dimension(:,:,:), intent(in) :: h !< Layer thickness. Do not iterate
+ !! for massless layers.
+
+real(kind=8), dimension(size(temp,1),size(temp,3)) :: T,S,dT,dS,rho,hin
+real(kind=8), dimension(size(temp,1),size(temp,3)) :: drho_dT,drho_dS
+real(kind=8), dimension(size(temp,1)) :: press
integer :: nx,ny,nz,nt,i,j,k,n,itt
logical :: adjust_salt , old_fit
@@ -1019,9 +1038,9 @@ subroutine determine_temperature(temp,salt,R,p_ref,niter,land_fill,h,k_start)
subroutine determine_temperature(temp,salt,R,p_ref,niter,land_fill,h,k_start,eos)
-! # This subroutine determines the potential temperature and
-! # salinity that is consistent with the target density
-! # using provided initial guess
+!< This subroutine determines the potential temperature and
+!! salinity that is consistent with the target density
+!! using provided initial guess
! # (inout) temp - potential temperature (degC)
! # (inout) salt - salinity (PSU)
! # (in) R - Desired potential density, in kg m-3.
@@ -1032,14 +1051,17 @@ subroutine determine_temperature(temp,salt,R,p_ref,niter,land_fill,h,k_start,eos
! # (in) land_fill - land fill value
! # (in) eos - seawater equation of state
-real, dimension(:,:,:), intent(inout) :: temp,salt
-real, dimension(size(temp,3)), intent(in) :: R
-real, intent(in) :: p_ref
-integer, intent(in) :: niter
-integer, intent(in) :: k_start
-real, intent(in) :: land_fill
-real, dimension(:,:,:), intent(in) :: h
-type(eos_type), pointer, intent(in) :: eos
+real, dimension(:,:,:), intent(inout) :: temp !< Potential temperature (degC).
+real, dimension(:,:,:), intent(inout) :: salt !< Salinity (PSU).
+real, dimension(size(temp,3)), intent(in) :: R !< Desired potential density, in kg m-3.
+real, intent(in) :: p_ref !< Reference pressure, in Pa.
+integer, intent(in) :: niter !< Maximum number of iterations.
+integer, intent(in) :: k_start !< Starting index (i.e. below the buffer
+ !! layer).
+real, intent(in) :: land_fill !< Land fill value.
+real, dimension(:,:,:), intent(in) :: h !< Layer thickness . Do not iterate for
+ !! massless layers.
+type(eos_type), pointer, intent(in) :: eos !< Seawater equation of state
real(kind=8), dimension(size(temp,1),size(temp,3)) :: T,S,dT,dS,rho,hin
real(kind=8), dimension(size(temp,1),size(temp,3)) :: drho_dT,drho_dS
@@ -1151,11 +1173,11 @@ end subroutine determine_temperature
subroutine find_overlap(e, Z_top, Z_bot, k_max, k_start, k_top, k_bot, wt, z1, z2)
-! This subroutine determines the layers bounded by interfaces e that overlap
-! with the depth range between Z_top and Z_bot, and also the fractional weights
-! of each layer. It also calculates the normalized relative depths of the range
-! of each layer that overlaps that depth range.
-! Note that by convention, e decreases with increasing k and Z_top > Z_bot.
+!< This subroutine determines the layers bounded by interfaces e that overlap
+!! with the depth range between Z_top and Z_bot, and also the fractional weights
+!! of each layer. It also calculates the normalized relative depths of the range
+!! of each layer that overlaps that depth range.
+!! Note that by convention, e decreases with increasing k and Z_top > Z_bot.
!
! Arguments: e - A column's interface heights, in m.
! (in) Z_top - The top of the range being mapped to, in m.
@@ -1170,11 +1192,19 @@ subroutine find_overlap(e, Z_top, Z_bot, k_max, k_start, k_top, k_bot, wt, z1, z
! relative to the cell center and normalized by the cell
! thickness, nondim. Note that -1/2 <= z1 < z2 <= 1/2.
-real, dimension(:), intent(in) :: e
-real, intent(in) :: Z_top, Z_bot
-integer, intent(in) :: k_max, k_start
-integer, intent(out) :: k_top, k_bot
-real, dimension(:), intent(out) :: wt, z1, z2
+real, dimension(:), intent(in) :: e !< A column's interface heights, in m.
+real, intent(in) :: Z_top !< The top of the range being mapped to, in m.
+real, intent(in) :: Z_bot !< The bottom of the range being mapped to, in m.
+integer, intent(in) :: k_max !< The number of valid layers.
+integer, intent(in) :: k_start !< The layer at which to start searching.
+integer, intent(out) :: k_top, k_bot !< The indices of the top and bottom layers that
+ !! overlap with the depth range.
+real, dimension(:), intent(out) :: wt !< The relative weights of each layer from k_top to k_bot.
+real, dimension(:), intent(out) :: z1, z2 !< z1 and z2 are the depths of the top and bottom limits
+ !! of the part of a layer that contributes to a depth
+ !! level, relative to the cell center and normalized by
+ !! the cell thickness, nondim. Note that -1/2 <= z1
+ !! < z2 <= 1/2.
real :: Ih, e_c, tot_wt, I_totwt
integer :: k
@@ -1222,8 +1252,8 @@ end subroutine find_overlap
function find_limited_slope(val, e, k) result(slope)
-! This subroutine determines a limited slope for val to be advected with
-! a piecewise limited scheme.
+!< This subroutine determines a limited slope for val to be advected with
+!! a piecewise limited scheme.
! Arguments: val - An column the values that are being interpolated.
! (in) e - A column's interface heights, in m.
@@ -1231,9 +1261,9 @@ function find_limited_slope(val, e, k) result(slope)
! (in) k - The layer whose slope is being determined.
-real, dimension(:), intent(in) :: val
-real, dimension(:), intent(in) :: e
-integer, intent(in) :: k
+real, dimension(:), intent(in) :: val !< An column the values that are being interpolated.
+real, dimension(:), intent(in) :: e !< A column's interface heights, in m.
+integer, intent(in) :: k !< The layer whose slope is being determined.
real :: slope,amx,bmx,amn,bmn,cmn,dmn
real :: d1, d2
@@ -1276,15 +1306,18 @@ function find_interfaces(rho,zin,Rb,depth,nlevs,nkml,nkbl,hml,debug) result(zi)
! (in) nkbl : number of buffer layer pieces
! (in) hml : mixed layer depth
-real, dimension(:,:,:), intent(in) :: rho
-real, dimension(size(rho,3)), intent(in) :: zin
-real, dimension(:), intent(in) :: Rb
-real, dimension(size(rho,1),size(rho,2)), intent(in) :: depth
-real, dimension(size(rho,1),size(rho,2)), optional, intent(in) ::nlevs
-logical, optional, intent(in) :: debug
+real, dimension(:,:,:), intent(in) :: rho !< Potential density in z-space (kg m-3)
+real, dimension(size(rho,3)), intent(in) :: zin !< LKevels (m)
+real, dimension(:), intent(in) :: Rb !< Target interface densities (kg m-3)
+real, dimension(size(rho,1),size(rho,2)), &
+ intent(in) :: depth !< Ocean depth (m)
+real, dimension(size(rho,1),size(rho,2)), &
+ optional, intent(in) :: nlevs !< Number of valid points in each column
+logical, optional, intent(in) :: debug
real, dimension(size(rho,1),size(rho,2),size(Rb,1)) :: zi
-integer, intent(in), optional :: nkml, nkbl
-real, intent(in), optional :: hml
+integer, intent(in), optional :: nkml !< Number of mixed layer pieces
+integer, intent(in), optional :: nkbl !< Number of buffer layer pieces
+real, intent(in), optional :: hml !< Mixed layer depth
real, dimension(size(rho,1),size(rho,3)) :: rho_
real, dimension(size(rho,1)) :: depth_
@@ -1405,10 +1438,10 @@ end function find_interfaces
subroutine meshgrid(x,y,x_T,y_T)
-! create a 2d-mesh of grid coordinates
-! from 1-d arrays.
+!< create a 2d-mesh of grid coordinates
+!! from 1-d arrays.
-real, dimension(:), intent(in) :: x,y
+real, dimension(:), intent(in) :: x,y
real, dimension(size(x,1),size(y,1)), intent(inout) :: x_T,y_T
integer :: ni,nj,i,j
@@ -1428,21 +1461,19 @@ subroutine meshgrid(x,y,x_T,y_T)
end subroutine meshgrid
subroutine smooth_heights(zi,fill,bad,sor,niter,cyclic_x, tripolar_n)
-!
-! Solve del2 (zi) = 0 using successive iterations
-! with a 5 point stencil. Only points fill==1 are
-! modified. Except where bad==1, information propagates
-! isotropically in index space. The resulting solution
-! in each region is an approximation to del2(zi)=0 subject to
-! boundary conditions along the valid points curve bounding this region.
-
-
-real, dimension(:,:), intent(inout) :: zi
+!< Solve del2 (zi) = 0 using successive iterations
+!! with a 5 point stencil. Only points fill==1 are
+!! modified. Except where bad==1, information propagates
+!! isotropically in index space. The resulting solution
+!! in each region is an approximation to del2(zi)=0 subject to
+!! boundary conditions along the valid points curve bounding this region.
+
+real, dimension(:,:), intent(inout) :: zi
integer, dimension(size(zi,1),size(zi,2)), intent(in) :: fill
integer, dimension(size(zi,1),size(zi,2)), intent(in) :: bad
-real, intent(in) :: sor
-integer, intent(in) :: niter
-logical, intent(in) :: cyclic_x, tripolar_n
+real, intent(in) :: sor
+integer, intent(in) :: niter
+logical, intent(in) :: cyclic_x, tripolar_n
integer :: i,j,k,n
integer :: ni,nj
@@ -1504,10 +1535,10 @@ function fill_boundaries_int(m,cyclic_x,tripolar_n) result(mp)
!
! fill grid edges
!
-integer, dimension(:,:), intent(in) :: m
-logical, intent(in) :: cyclic_x, tripolar_n
-real, dimension(size(m,1),size(m,2)) :: m_real
-real, dimension(0:size(m,1)+1,0:size(m,2)+1) :: mp_real
+integer, dimension(:,:), intent(in) :: m
+logical, intent(in) :: cyclic_x, tripolar_n
+real, dimension(size(m,1),size(m,2)) :: m_real
+real, dimension(0:size(m,1)+1,0:size(m,2)+1) :: mp_real
integer, dimension(0:size(m,1)+1,0:size(m,2)+1) :: mp
m_real = real(m)
@@ -1521,11 +1552,10 @@ function fill_boundaries_int(m,cyclic_x,tripolar_n) result(mp)
end function fill_boundaries_int
function fill_boundaries_real(m,cyclic_x,tripolar_n) result(mp)
-!
-! fill grid edges
-!
-real, dimension(:,:), intent(in) :: m
-logical, intent(in) :: cyclic_x, tripolar_n
+!< fill grid edges
+
+real, dimension(:,:), intent(in) :: m
+logical, intent(in) :: cyclic_x, tripolar_n
real, dimension(0:size(m,1)+1,0:size(m,2)+1) :: mp
integer :: ni,nj,i,j
diff --git a/src/parameterizations/lateral/MOM_hor_visc.F90 b/src/parameterizations/lateral/MOM_hor_visc.F90
index aa2e581244..b69f3fc854 100644
--- a/src/parameterizations/lateral/MOM_hor_visc.F90
+++ b/src/parameterizations/lateral/MOM_hor_visc.F90
@@ -369,6 +369,7 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, CS,
if (.not.associated(CS)) call MOM_error(FATAL, &
"MOM_hor_visc: Module must be initialized before it is used.")
+ if (.not.(CS%Laplacian .or. CS%biharmonic)) return
find_FrictWork = (CS%id_FrictWork > 0)
if (CS%id_FrictWorkIntz > 0) find_FrictWork = .true.
@@ -1227,9 +1228,13 @@ subroutine hor_visc_init(Time, G, param_file, diag, CS)
call MOM_error(FATAL,"ERROR: NOSLIP and BIHARMONIC cannot be defined "// &
"at the same time in MOM.")
- if (.not.(CS%Laplacian .or. CS%biharmonic)) call MOM_error(WARNING, &
- "hor_visc_init: It is usually a very bad idea not to use either "//&
- "LAPLACIAN or BIHARMONIC viscosity.")
+ if (.not.(CS%Laplacian .or. CS%biharmonic)) then
+ ! Only issue inviscid warning if not in single column mode (usually 2x2 domain)
+ if ( max(G%domain%niglobal, G%domain%njglobal)>2 ) call MOM_error(WARNING, &
+ "hor_visc_init: It is usually a very bad idea not to use either "//&
+ "LAPLACIAN or BIHARMONIC viscosity.")
+ return ! We are not using either Laplacian or Bi-harmonic lateral viscosity
+ endif
ALLOC_(CS%dx2h(isd:ied,jsd:jed)) ; CS%dx2h(:,:) = 0.0
ALLOC_(CS%dy2h(isd:ied,jsd:jed)) ; CS%dy2h(:,:) = 0.0
@@ -1572,10 +1577,11 @@ subroutine hor_visc_end(CS)
! hor_visc_init.
type(hor_visc_CS), pointer :: CS
- DEALLOC_(CS%dx2h) ; DEALLOC_(CS%dx2q) ; DEALLOC_(CS%dy2h) ; DEALLOC_(CS%dy2q)
- DEALLOC_(CS%dx_dyT) ; DEALLOC_(CS%dy_dxT) ; DEALLOC_(CS%dx_dyBu) ; DEALLOC_(CS%dy_dxBu)
-
- DEALLOC_(CS%reduction_xx) ; DEALLOC_(CS%reduction_xy)
+ if (CS%Laplacian .or. CS%biharmonic) then
+ DEALLOC_(CS%dx2h) ; DEALLOC_(CS%dx2q) ; DEALLOC_(CS%dy2h) ; DEALLOC_(CS%dy2q)
+ DEALLOC_(CS%dx_dyT) ; DEALLOC_(CS%dy_dxT) ; DEALLOC_(CS%dx_dyBu) ; DEALLOC_(CS%dy_dxBu)
+ DEALLOC_(CS%reduction_xx) ; DEALLOC_(CS%reduction_xy)
+ endif
if (CS%Laplacian) then
DEALLOC_(CS%Kh_bg_xx) ; DEALLOC_(CS%Kh_bg_xy)
diff --git a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
index e76cbad338..85ef9aeaf8 100644
--- a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
+++ b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
@@ -996,7 +996,7 @@ end subroutine mixedlayer_restrat_register_restarts
!! \f[
!! \bar{H} \leftarrow \max \left( H, \frac{ \Delta t H + \tau_h \bar{H} }{ \Delta t + \tau_h } \right)
!! \f]
-!! which allows the effective mixed-layer depth seen by the parameterization, $\bar{H}$, to instantaneously deepen
+!! which allows the effective mixed-layer depth seen by the parameterization, \f$\bar{H}\f$, to instantaneously deepen
!! but to decay with time-scale \f$ \tau_h \f$.
!! \f$ \bar{H} \f$ is substituted for \f$ H \f$ in the above equations.
!!
diff --git a/src/parameterizations/lateral/MOM_thickness_diffuse.F90 b/src/parameterizations/lateral/MOM_thickness_diffuse.F90
index 0d658bbaf6..1b18c80c2f 100644
--- a/src/parameterizations/lateral/MOM_thickness_diffuse.F90
+++ b/src/parameterizations/lateral/MOM_thickness_diffuse.F90
@@ -1816,6 +1816,8 @@ end subroutine thickness_diffuse_end
!> \namespace mom_thickness_diffuse
!!
+!! \section section_gm Thickness diffusion (aka Gent-McWilliams)
+!!
!! Thickness diffusion is implemented via along-layer mass fluxes
!! \f[
!! h^\dagger \leftarrow h^n - \Delta t \nabla \cdot ( \vec{uh}^* )
diff --git a/src/parameterizations/vertical/MOM_diabatic_driver.F90 b/src/parameterizations/vertical/MOM_diabatic_driver.F90
index 0302e3ce8e..d261a9675d 100644
--- a/src/parameterizations/vertical/MOM_diabatic_driver.F90
+++ b/src/parameterizations/vertical/MOM_diabatic_driver.F90
@@ -2381,36 +2381,5 @@ end subroutine diabatic_driver_end
!! the length of time over which to act (dt). The velocities and
!! thickness are taken as inputs and modified within the subroutine.
!! There is no limit on the time step.
-!!
-!!
-!! \section section_gridlayout MOM grid layout
-!!
-!! A small fragment of the grid is shown below:
-!!
-!! \verbatim
-!! j+1 x ^ x ^ x
-!!
-!! j+1 > o > o >
-!!
-!! j x ^ x ^ x
-!!
-!! j > o > o >
-!!
-!! j-1 x ^ x ^ x
-!!
-!! i-1 i i+1
-!!
-!! i i+1
-!!
-!! \endverbatim
-!!
-!! Fields at each point
-!! * x = q, CoriolisBu
-!! * ^ = v, PFv, CAv, vh, diffv, tauy, vbt, vhtr
-!! * > = u, PFu, CAu, uh, diffu, taux, ubt, uhtr
-!! * o = h, bathyT, eta, T, S, tr
-!!
-!! The boundaries always run through q grid points (x).
-!!
end module MOM_diabatic_driver
diff --git a/src/parameterizations/vertical/MOM_kappa_shear.F90 b/src/parameterizations/vertical/MOM_kappa_shear.F90
index 18957e12e4..52e48f4a00 100644
--- a/src/parameterizations/vertical/MOM_kappa_shear.F90
+++ b/src/parameterizations/vertical/MOM_kappa_shear.F90
@@ -808,7 +808,7 @@ subroutine Calculate_kappa_shear(u_in, v_in, h, tv, p_surf, kappa_io, tke_io, &
ksrc_av(K) = (1.0-wt_itt)*ksrc_av(K) + wt_itt*k_src(K)
wt_tot = wt_tot + dz_Int(K) * ksrc_av(K)
enddo
- ! Use Adcroft's 1/0=0 convention.
+ ! Use the 1/0=0 convention.
I_wt_tot = 0.0 ; if (wt_tot > 0.0) I_wt_tot = 1.0/wt_tot
do K=1,nzc+1
diff --git a/src/parameterizations/vertical/MOM_set_diffusivity.F90 b/src/parameterizations/vertical/MOM_set_diffusivity.F90
index 4e37a5755f..f026a7f477 100644
--- a/src/parameterizations/vertical/MOM_set_diffusivity.F90
+++ b/src/parameterizations/vertical/MOM_set_diffusivity.F90
@@ -1313,9 +1313,11 @@ end subroutine find_N2
!> This subroutine sets the additional diffusivities of temperature and
!! salinity due to double diffusion, using the same functional form as is
-!! used in MOM4.1, and taken from an NCAR technical note (###REF?) that updates
+!! used in MOM4.1, and taken from an NCAR technical note (REF?) that updates
!! what was in Large et al. (1994). All the coefficients here should probably
!! be made run-time variables rather than hard-coded constants.
+!!
+!! \todo Find reference for NCAR tech note above.
subroutine double_diffusion(tv, h, T_f, S_f, j, G, GV, CS, Kd_T_dd, Kd_S_dd)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
diff --git a/src/tracer/MOM_tracer_advect.F90 b/src/tracer/MOM_tracer_advect.F90
index 3bd4569b53..98aa65c5e3 100644
--- a/src/tracer/MOM_tracer_advect.F90
+++ b/src/tracer/MOM_tracer_advect.F90
@@ -939,35 +939,5 @@ end subroutine tracer_advect_end
!! it is essential that the volume fluxes should be correct. It is
!! also important that the tracer advection occurs before each
!! calculation of the diabatic forcing.
-!!
-!! \section section_gridlayout MOM grid layout
-!!
-!! A small fragment of the grid is shown below:
-!!
-!! \verbatim
-!! j+1 x ^ x ^ x
-!!
-!! j+1 > o > o >
-!!
-!! j x ^ x ^ x
-!!
-!! j > o > o >
-!!
-!! j-1 x ^ x ^ x
-!!
-!! i-1 i i+1
-!!
-!! i i+1
-!!
-!! \endverbatim
-!!
-!! Fields at each point
-!! * x = q, CoriolisBu
-!! * ^ = v, PFv, CAv, vh, diffv, tauy, vbt, vhtr
-!! * > = u, PFu, CAu, uh, diffu, taux, ubt, uhtr
-!! * o = h, bathyT, eta, T, S, tr
-!!
-!! The boundaries always run through q grid points (x).
-!!
end module MOM_tracer_advect
diff --git a/src/tracer/MOM_tracer_hor_diff.F90 b/src/tracer/MOM_tracer_hor_diff.F90
index 0fd5d697f8..8840970037 100644
--- a/src/tracer/MOM_tracer_hor_diff.F90
+++ b/src/tracer/MOM_tracer_hor_diff.F90
@@ -1464,35 +1464,5 @@ end subroutine tracer_hor_diff_end
!! diffusion if Khtr is defined and positive. The tracer diffusion
!! can use a suitable number of iterations to guarantee stability
!! with an arbitrarily large time step.
-!!
-!! \section section_gridlayout MOM grid layout
-!!
-!! A small fragment of the grid is shown below:
-!!
-!! \verbatim
-!! j+1 x ^ x ^ x
-!!
-!! j+1 > o > o >
-!!
-!! j x ^ x ^ x
-!!
-!! j > o > o >
-!!
-!! j-1 x ^ x ^ x
-!!
-!! i-1 i i+1
-!!
-!! i i+1
-!!
-!! \endverbatim
-!!
-!! Fields at each point
-!! * x = q, CoriolisBu
-!! * ^ = v, PFv, CAv, vh, diffv, tauy, vbt, vhtr
-!! * > = u, PFu, CAu, uh, diffu, taux, ubt, uhtr
-!! * o = h, bathyT, eta, T, S, tr
-!!
-!! The boundaries always run through q grid points (x).
-!!
end module MOM_tracer_hor_diff
diff --git a/src/tracer/boundary_impulse_tracer.F90 b/src/tracer/boundary_impulse_tracer.F90
index d4e29c02f5..be586320e9 100644
--- a/src/tracer/boundary_impulse_tracer.F90
+++ b/src/tracer/boundary_impulse_tracer.F90
@@ -503,7 +503,7 @@ end subroutine boundary_impulse_tracer_end
!! mean age.
!!
!! A boundary impulse response (BIR) is a passive tracer whose surface boundary condition is a rectangle
-!! function with width $\Delta t$. In the case of unsteady flow, multiple BIRs, initiated at different
+!! function with width \f$\Delta t\f$. In the case of unsteady flow, multiple BIRs, initiated at different
!! times in the model can be used to infer the transit time distribution or Green's function between
!! the oceanic surface and interior. In the case of steady or cyclostationary flow, a single BIR is
!! sufficient.
diff --git a/src/user/SCM_CVmix_tests.F90 b/src/user/SCM_CVmix_tests.F90
index bd135c5046..82f228d687 100644
--- a/src/user/SCM_CVmix_tests.F90
+++ b/src/user/SCM_CVmix_tests.F90
@@ -47,7 +47,7 @@ module SCM_CVmix_tests
!> Initializes temperature and salinity for the SCM CVmix test example
subroutine SCM_CVmix_tests_TS_init(T, S, h, G, GV, param_file, just_read_params)
- real, dimension(NIMEM_,NJMEM_, NKMEM_), intent(out) :: T !< Potential tempera\ture (degC)
+ real, dimension(NIMEM_,NJMEM_, NKMEM_), intent(out) :: T !< Potential temperature (degC)
real, dimension(NIMEM_,NJMEM_, NKMEM_), intent(out) :: S !< Salinity (psu)
real, dimension(NIMEM_,NJMEM_, NKMEM_), intent(in) :: h !< Layer thickness (m or Pa)
type(ocean_grid_type), intent(in) :: G !< Grid structure