From 1db4b77b2f569d335bf794c62d43191f25cd9207 Mon Sep 17 00:00:00 2001
From: Ryan Mulhall <35538242+rem1776@users.noreply.github.com>
Date: Wed, 8 Jun 2022 17:32:18 -0400
Subject: [PATCH] docs: documentation updates (#935)
Reorganizes the doxygen site and adds missing pages for certain routines/files
---
.github/workflows/update_docs.yml | 8 +-
affinity/affinity.c | 9 +-
affinity/fms_affinity.F90 | 8 +-
amip_interp/amip_interp.F90 | 110 +++--
...nterp.rey_oi.txt => amip_interp.rey_oi.md} | 7 +-
astronomy/astronomy.F90 | 4 -
axis_utils/axis_utils.F90 | 6 +-
axis_utils/axis_utils2.F90 | 6 +-
block_control/block_control.F90 | 3 -
column_diagnostics/column_diagnostics.F90 | 3 -
constants/constants.F90 | 26 +-
coupler/atmos_ocean_fluxes.F90 | 3 -
coupler/coupler_types.F90 | 3 -
coupler/ensemble_manager.F90 | 3 -
data_override/data_override.F90 | 3 -
data_override/get_grid_version.F90 | 7 +-
diag_integral/diag_integral.F90 | 37 +-
diag_manager/diag_axis.F90 | 3 -
diag_manager/diag_data.F90 | 3 -
diag_manager/diag_grid.F90 | 4 -
diag_manager/diag_manager.F90 | 4 +-
diag_manager/diag_output.F90 | 3 -
diag_manager/diag_table.F90 | 3 -
diag_manager/diag_util.F90 | 3 -
docs/Doxyfile.in | 23 +-
docs/doxygenGuide.md | 29 +-
docs/grouping.h | 316 +++++++-------
docs/landingPage.md | 22 +-
docs/layout.xml | 10 +-
drifters/cloud_interpolator.F90 | 6 -
drifters/drifters.F90 | 4 -
drifters/drifters_comm.F90 | 3 -
drifters/drifters_core.F90 | 9 -
drifters/drifters_input.F90 | 3 -
drifters/drifters_io.F90 | 3 -
drifters/quicksort.F90 | 5 +-
exchange/stock_constants.F90 | 3 -
exchange/xgrid.F90 | 3 -
field_manager/field_manager.F90 | 3 -
field_manager/fm_util.F90 | 3 -
fms/fms.F90 | 3 -
fms/fms_io.F90 | 3 -
fms/fms_io_unstructured_field_exist.inc | 9 +-
fms/fms_io_unstructured_file_unit.inc | 7 +-
fms/fms_io_unstructured_get_field_size.inc | 6 +-
fms/fms_io_unstructured_get_file_name.inc | 7 +-
fms/fms_io_unstructured_get_file_unit.inc | 7 +-
fms/fms_io_unstructured_read.inc | 7 +-
..._io_unstructured_register_restart_axis.inc | 9 +-
...io_unstructured_register_restart_field.inc | 9 +-
fms/fms_io_unstructured_save_restart.inc | 7 +-
fms/fms_io_unstructured_setup_one_field.inc | 7 +-
fms2_io/blackboxio.F90 | 3 -
fms2_io/fms2_io.F90 | 45 +-
fms2_io/fms_io_utils.F90 | 3 -
fms2_io/fms_netcdf_domain_io.F90 | 3 -
fms2_io/fms_netcdf_unstructured_domain_io.F90 | 3 -
fms2_io/include/array_utils.inc | 5 +-
fms2_io/include/array_utils_char.inc | 8 +-
fms2_io/include/compressed_read.inc | 6 +-
fms2_io/include/compressed_write.inc | 6 +-
fms2_io/include/compute_global_checksum.inc | 6 +-
fms2_io/include/domain_read.inc | 6 +-
fms2_io/include/domain_write.inc | 6 +-
fms2_io/include/gather_data_bc.inc | 6 +-
fms2_io/include/get_data_type_string.inc | 9 +-
fms2_io/include/get_global_attribute.inc | 7 +-
fms2_io/include/get_variable_attribute.inc | 7 +-
.../include/netcdf_add_restart_variable.inc | 7 +-
fms2_io/include/netcdf_read_data.inc | 7 +-
fms2_io/include/netcdf_write_data.inc | 6 +-
.../register_domain_restart_variable.inc | 7 +-
fms2_io/include/register_global_attribute.inc | 7 +-
...r_unstructured_domain_restart_variable.inc | 7 +-
.../include/register_variable_attribute.inc | 7 +-
fms2_io/include/scatter_data_bc.inc | 5 +-
fms2_io/include/unstructured_domain_read.inc | 6 +-
fms2_io/include/unstructured_domain_write.inc | 7 +-
fms2_io/netcdf_io.F90 | 3 -
horiz_interp/horiz_interp.F90 | 3 -
horiz_interp/horiz_interp_bicubic.F90 | 3 -
horiz_interp/horiz_interp_bilinear.F90 | 3 -
horiz_interp/horiz_interp_conserve.F90 | 3 -
horiz_interp/horiz_interp_spherical.F90 | 3 -
horiz_interp/horiz_interp_type.F90 | 3 -
interpolator/interpolator.F90 | 3 -
memutils/memutils.F90 | 3 -
monin_obukhov/monin_obukhov.F90 | 3 -
monin_obukhov/monin_obukhov_inter.F90 | 3 -
mosaic/gradient.F90 | 3 -
mosaic/grid.F90 | 3 -
mosaic/mosaic.F90 | 3 -
mosaic2/grid2.F90 | 3 -
mosaic2/mosaic2.F90 | 3 -
mpp/include/mpp_alltoall_mpi.h | 46 +-
mpp/include/mpp_alltoall_nocomm.h | 7 +-
mpp/include/mpp_chksum.h | 22 +-
mpp/include/mpp_chksum_int.h | 11 +-
mpp/include/mpp_chksum_scalar.h | 18 +-
mpp/include/mpp_comm.inc | 10 +-
mpp/include/mpp_comm_mpi.inc | 67 +--
mpp/include/mpp_comm_nocomm.inc | 45 +-
mpp/include/mpp_data_mpi.inc | 7 +-
mpp/include/mpp_define_nest_domains.inc | 21 +-
mpp/include/mpp_do_check.h | 9 +-
mpp/include/mpp_do_checkV.h | 7 +-
mpp/include/mpp_do_global_field.h | 7 +-
mpp/include/mpp_do_global_field_ad.h | 7 +-
mpp/include/mpp_do_redistribute.h | 3 +
mpp/include/mpp_do_update.h | 5 +-
mpp/include/mpp_do_updateV.h | 5 +-
mpp/include/mpp_do_updateV_ad.h | 6 +-
mpp/include/mpp_do_updateV_nonblock.h | 4 +
mpp/include/mpp_do_update_ad.h | 5 +-
mpp/include/mpp_do_update_nest.h | 4 +-
mpp/include/mpp_do_update_nonblock.h | 3 +
mpp/include/mpp_domains_comm.inc | 9 +-
mpp/include/mpp_domains_define.inc | 202 ++++-----
mpp/include/mpp_domains_misc.inc | 177 ++++----
mpp/include/mpp_domains_reduce.inc | 6 +-
mpp/include/mpp_domains_util.inc | 118 ++----
mpp/include/mpp_gather.h | 5 +
mpp/include/mpp_get_boundary.h | 7 +-
mpp/include/mpp_get_boundary_ad.h | 8 +-
mpp/include/mpp_global_field.h | 7 +-
mpp/include/mpp_global_field_ad.h | 8 +-
mpp/include/mpp_global_field_ug.h | 6 +-
mpp/include/mpp_global_reduce.h | 3 +
mpp/include/mpp_global_sum.h | 3 +
mpp/include/mpp_global_sum_ad.h | 4 +-
mpp/include/mpp_global_sum_tl.h | 3 +
mpp/include/mpp_group_update.h | 3 +
mpp/include/mpp_io_connect.inc | 5 +-
mpp/include/mpp_io_misc.inc | 6 +-
mpp/include/mpp_io_read.inc | 7 +-
mpp/include/mpp_io_unstructured_read.inc | 12 +-
mpp/include/mpp_io_unstructured_write.inc | 12 +-
mpp/include/mpp_io_util.inc | 30 +-
mpp/include/mpp_io_write.inc | 121 +-----
mpp/include/mpp_read_distributed_ascii.inc | 6 +-
mpp/include/mpp_reduce_mpi.h | 8 +-
mpp/include/mpp_reduce_nocomm.h | 8 +-
mpp/include/mpp_scatter.h | 42 +-
mpp/include/mpp_sum.inc | 35 +-
mpp/include/mpp_sum_ad.inc | 35 +-
mpp/include/mpp_sum_mpi.h | 9 +-
mpp/include/mpp_sum_mpi_ad.h | 11 +-
mpp/include/mpp_sum_nocomm.h | 8 +-
mpp/include/mpp_sum_nocomm_ad.h | 8 +-
mpp/include/mpp_transmit.inc | 5 +-
mpp/include/mpp_transmit_mpi.h | 37 +-
mpp/include/mpp_transmit_nocomm.h | 30 +-
mpp/include/mpp_type_mpi.h | 3 +
mpp/include/mpp_unstruct_domain.inc | 15 +-
mpp/include/mpp_unstruct_pass_data.h | 12 +-
mpp/include/mpp_update_domains2D.h | 11 +-
mpp/include/mpp_update_domains2D_ad.h | 11 +-
mpp/include/mpp_update_domains2D_nonblock.h | 3 +
mpp/include/mpp_update_nest_domains.h | 3 +
mpp/include/mpp_util.inc | 399 +++++++-----------
mpp/include/mpp_util_mpi.inc | 5 +-
mpp/include/mpp_util_nocomm.inc | 17 +-
mpp/include/system_clock.h | 11 +-
mpp/mpp.F90 | 164 ++++---
mpp/mpp_data.F90 | 3 -
mpp/mpp_domains.F90 | 98 ++++-
mpp/mpp_efp.F90 | 3 -
mpp/mpp_io.F90 | 99 ++++-
mpp/mpp_memutils.F90 | 3 -
mpp/mpp_parameter.F90 | 3 -
mpp/mpp_pset.F90 | 15 +-
mpp/mpp_utilities.F90 | 3 -
platform/platform.F90 | 3 -
random_numbers/mersennetwister.F90 | 3 -
random_numbers/random_numbers.F90 | 3 -
sat_vapor_pres/sat_vapor_pres.F90 | 3 -
sat_vapor_pres/sat_vapor_pres_k.F90 | 3 -
time_interp/time_interp.F90 | 3 -
time_interp/time_interp_external.F90 | 3 -
time_interp/time_interp_external2.F90 | 3 -
time_manager/get_cal_time.F90 | 3 -
time_manager/time_manager.F90 | 38 +-
topography/gaussian_topog.F90 | 3 -
topography/topography.F90 | 3 -
tracer_manager/tracer_manager.F90 | 3 -
tridiagonal/tridiagonal.F90 | 3 -
186 files changed, 1537 insertions(+), 1782 deletions(-)
rename amip_interp/{amip_interp.rey_oi.txt => amip_interp.rey_oi.md} (97%)
diff --git a/.github/workflows/update_docs.yml b/.github/workflows/update_docs.yml
index 0327b8d2b7..aea7b04224 100644
--- a/.github/workflows/update_docs.yml
+++ b/.github/workflows/update_docs.yml
@@ -12,14 +12,14 @@ jobs:
- name: Setup repo
run: | # do autotool's job for substitutes since we don't need a full build environement
mkdir gen_docs
- sed 's/@abs_top_builddir@\/docs/gen_docs/' docs/Doxyfile.in > gen_docs/Doxyfile
- sed -i 's/@abs_top_srcdir@/./' gen_docs/Doxyfile
+ sed 's/@abs_top_builddir@\/docs/gen_docs/g' docs/Doxyfile.in > gen_docs/Doxyfile
+ sed -i 's/@abs_top_srcdir@/./g' gen_docs/Doxyfile
# grab version number from configure.ac
export VER="`awk '/AC_INIT/{getline;print}' configure.ac | cut -d "[" -f2 | cut -d "]" -f1`"
- sed -i "s/@PACKAGE_VERSION@/$VER/" gen_docs/Doxyfile
+ sed -i "s/@PACKAGE_VERSION@/$VER/g" gen_docs/Doxyfile
- name: Install and run doxygen
run: |
- sudo apt -y install doxygen
+ sudo apt -y install doxygen graphviz
doxygen gen_docs/Doxyfile
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
diff --git a/affinity/affinity.c b/affinity/affinity.c
index ebdda2cc35..fff6622fb1 100644
--- a/affinity/affinity.c
+++ b/affinity/affinity.c
@@ -40,12 +40,8 @@
// skips doc parsing for includes and license
/**
- * \file
- * \brief Routines to set and get thread CPU affinity
- * Get, set, and helper functions for thread CPU affinity to be interfaced
- * in fortran via fms_affinity_mod
- * \author @bensonr
- * \ingroup affinity
+ * \addtogroup affinity
+ * \@{
*/
/**
@@ -146,3 +142,4 @@ int set_cpu_affinity(int cpu)
#endif
return 0;
}
+///@}
diff --git a/affinity/fms_affinity.F90 b/affinity/fms_affinity.F90
index c1ded6ab45..c02fbc69cf 100644
--- a/affinity/fms_affinity.F90
+++ b/affinity/fms_affinity.F90
@@ -20,14 +20,11 @@
!> @defgroup fms_affinity_mod fms_affinity_mod
!> @ingroup affinity
!> @brief Fortran API interfaces to set the thread affinity.
-!! API interfaces to allow setting and getting thread affinity. The thread affinity get and set
-!! are managed in the C routines in affinity.c.
+!! API interfaces to allow setting and getting thread affinity. The routines @ref get_cpuset
+!! , @ref set_cpu_affinity , and @ref fms_affinity_get are defined via C routines in affinity.c.
!!
!! @author Rusty Benson
-!> @file
-!> File for @ref fms_affinity_mod
-
!> @addtogroup fms_affinity_mod
!> @{
module fms_affinity_mod
@@ -49,7 +46,6 @@ module fms_affinity_mod
!> Interface to get affinity from the current component.
!!
!> Defined in @ref affinity.c.
- !> @ingroup fms_affinity_mod
integer(KIND=c_int) function fms_affinity_get() bind(c, name="get_cpu_affinity")
import c_int
end function fms_affinity_get
diff --git a/amip_interp/amip_interp.F90 b/amip_interp/amip_interp.F90
index 6f77d951ab..931a16a745 100644
--- a/amip_interp/amip_interp.F90
+++ b/amip_interp/amip_interp.F90
@@ -26,10 +26,9 @@
!!
!> When using these routines three possible data sets are available:
!!
-!! 1. AMIP @link http://www-pcmdi.llnl.gov/amip @endlink from Jan 1979 to Jan 1989 (2 deg x 2 deg)
-!! 2. Reynolds OI @link amip_interp.rey_oi.txt @endlink from Nov 1981 to Jan 1999 (1 deg x 1 deg)
-!! 3. Reynolds EOF @link ftp://podaac.jpl.nasa.gov/pub/sea_surface_temperature/reynolds/rsst/doc/rsst.html
-!! @endlink from Jan 1950 to Dec 1998 (2 deg x 2 deg)
+!! 1. AMIP http://www.pcmdi.github.io/mips/amip from Jan 1979 to Jan 1989 (2 deg x 2 deg)
+!! 2. Reynolds OI @ref amip_interp.rey_oi.txt from Nov 1981 to Jan 1999 (1 deg x 1 deg)
+!! 3. Reynolds EOF podaac.jpl.nasa.gov/ from Jan 1950 to Dec 1998 (2 deg x 2 deg)
!!
!! All original data are observed monthly means. This module
!! interpolates linearly in time between pairs of monthly means.
@@ -62,10 +61,55 @@
!! amip1 INPUT/amip1_sst.data
!! reynolds_io INPUT/reyoi_sst.data
!! reynolds_eof INPUT/reynolds_sst.data
-
-
-!> @file
-!> File for amip_interp_mod
+!!
+!> @var character(len=24) data_set
+!! Name/type of SST data that will be used.
+!! Possible values (case-insensitive) are:
+!! 1) amip1
+!! 2) reynolds_eof
+!! 3) reynolds_oi
+!! See the @ref amip_interp_oi page for more information
+!! @var character(len=16) date_out_of_range
+!! Controls the use of climatological monthly mean data when
+!! the requested date falls outside the range of the data set.
+!! Possible values are:
+!!
+!! fail - program will fail if requested date is prior +!! to or after the data set period. +!! initclimo - program uses climatological requested data is +!! prior to data set period and will fail if +!! requested date is after data set period. +!! climo - program uses climatological data anytime. +!!+!! @var real tice_crit +!! Freezing point of sea water in degC or degK. Defaults to -1.80 +!! @var integer verbose +!! Controls printed output, 0 <= verbose <= 3, default=0 +!! additional parameters for controlling zonal prescribed sst ---- +!! these parameters only have an effect when use_zonal=.true. ---- +!! @var logical use_zonal +!! Flag to selected zonal sst or data set. Default=.false. +!! @var real teq +!! sst at the equator. Default=305 +!! @var real tdif +!! Equator to pole sst difference. Default=50 +!! @var real tann +!! Amplitude of annual cycle. Default=20 +!! @var real tlag +!! Offset for time of year (for annual cycle). Default=0.875 +!! @var integer amip_date +!! Single calendar date in integer "(year,month,day)" format +!! that is used only if set with year>0, month>0, day>0. +!! If used, model calendar date is replaced by this date, +!! but model time of day is still used to determine ice/sst. +!! Used for repeating-single-day (rsd) experiments. +!! Default=/-1,-1,-1/ +!! @var real sst_pert +!! Temperature perturbation in degrees Kelvin added onto the SST. +!! The perturbation is globally-uniform (even near sea-ice). +!! It is only used when abs(sst_pert) > 1.e-4. SST perturbation runs +!! may be useful in accessing model sensitivities. +!! Default=0. !> @addtogroup amip_interp_mod !> @{ @@ -299,56 +343,6 @@ module amip_interp_mod logical :: interp_oi_sst = .false. !< changed to false for regular runs logical :: use_mpp_io = .false. !< Set to .true. to use mpp_io, otherwise fms2io is used -!> @page amip_interp_nml @ref amip_interp_mod Namelist -!! -!> @var character(len=24) data_set -!! Name/type of SST data that will be used. -!! Possible values (case-insensitive) are: -!! 1) amip1 -!! 2) reynolds_eof -!! 3) reynolds_oi -!! See the @ref amip_interp_oi page for more information -!! @var character(len=16) date_out_of_range -!! Controls the use of climatological monthly mean data when -!! the requested date falls outside the range of the data set.
-!! fail - program will fail if requested date is prior -!! to or after the data set period. -!! initclimo - program uses climatological requested data is -!! prior to data set period and will fail if -!! requested date is after data set period. -!! climo - program uses climatological data anytime. -!!-!! @var real tice_crit -!! Freezing point of sea water in degC or degK. Defaults to -1.80 -!! @var integer verbose -!! Controls printed output, 0 <= verbose <= 3, default=0 -!! additional parameters for controlling zonal prescribed sst ---- -!! these parameters only have an effect when use_zonal=.true. ---- -!! @var logical use_zonal -!! Flag to selected zonal sst or data set. Default=.false. -!! @var real teq -!! sst at the equator. Default=305 -!! @var real tdif -!! Equator to pole sst difference. Default=50 -!! @var real tann -!! Amplitude of annual cycle. Default=20 -!! @var real tlag -!! Offset for time of year (for annual cycle). Default=0.875 -!! @var integer amip_date -!! Single calendar date in integer "(year,month,day)" format -!! that is used only if set with year>0, month>0, day>0. -!! If used, model calendar date is replaced by this date, -!! but model time of day is still used to determine ice/sst. -!! Used for repeating-single-day (rsd) experiments. -!! Default=/-1,-1,-1/ -!! @var real sst_pert -!! Temperature perturbation in degrees Kelvin added onto the SST. -!! The perturbation is globally-uniform (even near sea-ice). -!! It is only used when abs(sst_pert) > 1.e-4. SST perturbation runs -!! may be useful in accessing model sensitivities. -!! Default=0. namelist /amip_interp_nml/ use_ncep_sst, no_anom_sst, use_ncep_ice, tice_crit, & interp_oi_sst, data_set, date_out_of_range, & use_zonal, teq, tdif, tann, tlag, amip_date, & diff --git a/amip_interp/amip_interp.rey_oi.txt b/amip_interp/amip_interp.rey_oi.md similarity index 97% rename from amip_interp/amip_interp.rey_oi.txt rename to amip_interp/amip_interp.rey_oi.md index 5f3240e529..fb6b57bc5f 100644 --- a/amip_interp/amip_interp.rey_oi.txt +++ b/amip_interp/amip_interp.rey_oi.md @@ -1,9 +1,8 @@ -\file -\ingroup amip_interp +@ingroup amip_interp -(This file was edited for the Flexible Modeling System on July 26, 1999) +## Information for the use of the monthly NMC SST analyzed fields -Information for the use of the monthly NMC SST analyzed fields +(This file was edited for the Flexible Modeling System on July 26, 1999) The monthly optimum interpolation (OI) fields are derived by a linear interpolation of the weekly OI fields to daily fields then averaging diff --git a/astronomy/astronomy.F90 b/astronomy/astronomy.F90 index 890b195425..192fc8f22a 100644 --- a/astronomy/astronomy.F90 +++ b/astronomy/astronomy.F90 @@ -24,10 +24,6 @@ !! radiation packages. !> @author Fei Liu - -!> @file -!> @brief File for @ref astronomy_mod - !> @addtogroup astronomy_mod !> @{ module astronomy_mod diff --git a/axis_utils/axis_utils.F90 b/axis_utils/axis_utils.F90 index 0353c5ae10..3947e370e3 100644 --- a/axis_utils/axis_utils.F90 +++ b/axis_utils/axis_utils.F90 @@ -19,11 +19,11 @@ !> @defgroup axis_utils_mod axis_utils_mod !> @ingroup axis_utils !> @brief A set of utilities for manipulating axes and extracting axis attributes, +!! A more recent version of this module using the updated fms2_io is available, @ref axis_utils2 +!! but this module should be used if still using @ref mpp_io +!! !> @author M.J. Harrison -!> @file -!> @brief File for @ref axis_utils_mod - !> @addtogroup axis_utils_mod !> @{ module axis_utils_mod diff --git a/axis_utils/axis_utils2.F90 b/axis_utils/axis_utils2.F90 index 806e59baa4..3086f3b867 100644 --- a/axis_utils/axis_utils2.F90 +++ b/axis_utils/axis_utils2.F90 @@ -19,13 +19,9 @@ !> @defgroup axis_utils2_mod axis_utils2_mod !> @ingroup axis_utils !> @brief A set of utilities for manipulating axes and extracting axis attributes. -!! -!> FMS2_IO equivalent version of @ref axis_utils_mod. +!! FMS2_IO equivalent version of @ref axis_utils_mod. !> @author M.J. Harrison -!> @file -!> @brief File for @ref axis_utils2_mod - !> @addtogroup axis_utils2_mod !> @{ module axis_utils2_mod diff --git a/block_control/block_control.F90 b/block_control/block_control.F90 index 444cb2f773..ee251087b5 100644 --- a/block_control/block_control.F90 +++ b/block_control/block_control.F90 @@ -21,9 +21,6 @@ !> @brief Routines for "blocks" used for OpenMP threading of column-based !! calculations -!> @file -!> @brief File for @ref block_control_mod - module block_control_mod use mpp_mod, only: mpp_error, NOTE, WARNING, FATAL diff --git a/column_diagnostics/column_diagnostics.F90 b/column_diagnostics/column_diagnostics.F90 index fd4ced5ade..2254f32b6a 100644 --- a/column_diagnostics/column_diagnostics.F90 +++ b/column_diagnostics/column_diagnostics.F90 @@ -20,9 +20,6 @@ !> @ingroup column_diagnostics !! @brief Module to locate and mark desired diagnostic columns -!> @file -!> @brief File for @ref column_diagnostics_mod - !> @addtogroup column_diagnostics_mod !> @{ module column_diagnostics_mod diff --git a/constants/constants.F90 b/constants/constants.F90 index 4332af986b..d3d8887a32 100644 --- a/constants/constants.F90 +++ b/constants/constants.F90 @@ -16,13 +16,35 @@ !* You should have received a copy of the GNU Lesser General Public !* License along with FMS. If not, see
- ! integer :: id - ! id = mpp_clock_id( 'Atmosphere' ) - ! call mpp_clock_begin(id) - ! call atmos_model() - ! call mpp_clock_end() - !- ! Two flags may be used to alter the behaviour of - ! mpp_clock. If the flag MPP_CLOCK_SYNC is turned on - ! by mpp_clock_id, the clock calls mpp_sync across all - ! the PEs in the current pelist at the top of the timed code section, - ! but allows each PE to complete the code section (and reach - ! mpp_clock_end) at different times. This allows us to measure - ! load imbalance for a given code section. Statistics are written to - ! stdout by mpp_exit. - ! - ! The flag MPP_CLOCK_DETAILED may be turned on by - ! mpp_clock_id to get detailed communication - ! profiles. Communication events of the types SEND, RECV, BROADCAST, - ! REDUCE and WAIT are separately measured for data volume - ! and time. Statistics are written to stdout by - ! mpp_exit, and individual PE info is also written to the file - ! mpp_clock.out.#### where #### is the PE id given by - ! mpp_pe. - ! - ! The flags MPP_CLOCK_SYNC and MPP_CLOCK_DETAILED are - ! integer parameters available by use association, and may be summed to - ! turn them both on. - ! - ! While the nesting of clocks is allowed, please note that turning on - ! the non-optional flags on inner clocks has certain subtle issues. - ! Turning on MPP_CLOCK_SYNC on an inner - ! clock may distort outer clock measurements of load imbalance. Turning - ! on MPP_CLOCK_DETAILED will stop detailed measurements on its - ! outer clock, since only one detailed clock may be active at one time. - ! Also, detailed clocks only time a certain number of events per clock - ! (currently 40000) to conserve memory. If this array overflows, a - ! warning message is printed, and subsequent events for this clock are - ! not timed. - ! - ! Timings are done using the f90 standard - ! SYSTEM_CLOCK intrinsic. - ! - ! The resolution of SYSTEM_CLOCK is often too coarse for use except - ! across large swaths of code. On SGI systems this is transparently - ! overloaded with a higher resolution clock made available in a - ! non-portable fortran interface made available by - ! nsclock.c. This approach will eventually be extended to other - ! platforms. - ! - ! New behaviour added at the Havana release allows the user to embed - ! profiling calls at varying levels of granularity all over the code, - ! and for any particular run, set a threshold of granularity so that - ! finer-grained clocks become dormant. - ! - ! The threshold granularity is held in the private module variable - ! clock_grain. This value may be modified by the call - ! mpp_clock_set_grain, and affect clocks initiated by - ! subsequent calls to mpp_clock_id. The value of - ! clock_grain is set to an arbitrarily large number initially. - ! - ! Clocks initialized by mpp_clock_id can set a new optional - ! argument grain setting their granularity level. Clocks check - ! this level against the current value of clock_grain, and are - ! only triggered if they are at or below ("coarser than") the - ! threshold. Finer-grained clocks are dormant for that run. - ! - !The following grain levels are pre-defined: - ! - !
- !!predefined clock granularities, but you can use any integer - !!using CLOCK_LOOP and above may distort coarser-grain measurements - ! integer, parameter, public :: CLOCK_COMPONENT=1 !component level, e.g model, exchange - ! integer, parameter, public :: CLOCK_SUBCOMPONENT=11 !top level within a model component, e.g dynamics, physics - ! integer, parameter, public :: CLOCK_MODULE=21 !module level, e.g main subroutine of a physics module - ! integer, parameter, public :: CLOCK_ROUTINE=31 !level of individual subroutine or function - ! integer, parameter, public :: CLOCK_LOOP=41 !loops or blocks within a routine - ! integer, parameter, public :: CLOCK_INFRA=51 !infrastructure level, e.g halo update - !- ! - ! Note that subsequent changes to clock_grain do not - ! change the status of already initiated clocks, and that if the - ! optional grain argument is absent, the clock is always - ! triggered. This guarantees backward compatibility. - !
+ !! integer :: id + !! id = mpp_clock_id( 'Atmosphere' ) + !! call mpp_clock_begin(id) + !! call atmos_model() + !! call mpp_clock_end() + !!+ !! Two flags may be used to alter the behaviour of + !! mpp_clock. If the flag MPP_CLOCK_SYNC is turned on + !! by mpp_clock_id, the clock calls mpp_sync across all + !! the PEs in the current pelist at the top of the timed code section, + !! but allows each PE to complete the code section (and reach + !! mpp_clock_end) at different times. This allows us to measure + !! load imbalance for a given code section. Statistics are written to + !! stdout by mpp_exit. + !! + !! The flag MPP_CLOCK_DETAILED may be turned on by + !! mpp_clock_id to get detailed communication + !! profiles. Communication events of the types SEND, RECV, BROADCAST, + !! REDUCE and WAIT are separately measured for data volume + !! and time. Statistics are written to stdout by + !! mpp_exit, and individual PE info is also written to the file + !! mpp_clock.out.#### where #### is the PE id given by + !! mpp_pe. + !! + !! The flags MPP_CLOCK_SYNC and MPP_CLOCK_DETAILED are + !! integer parameters available by use association, and may be summed to + !! turn them both on. + !! + !! While the nesting of clocks is allowed, please note that turning on + !! the non-optional flags on inner clocks has certain subtle issues. + !! Turning on MPP_CLOCK_SYNC on an inner + !! clock may distort outer clock measurements of load imbalance. Turning + !! on MPP_CLOCK_DETAILED will stop detailed measurements on its + !! outer clock, since only one detailed clock may be active at one time. + !! Also, detailed clocks only time a certain number of events per clock + !! (currently 40000) to conserve memory. If this array overflows, a + !! warning message is printed, and subsequent events for this clock are + !! not timed. + !! + !! Timings are done using the f90 standard + !! SYSTEM_CLOCK intrinsic. + !! + !! The resolution of SYSTEM_CLOCK is often too coarse for use except + !! across large swaths of code. On SGI systems this is transparently + !! overloaded with a higher resolution clock made available in a + !! non-portable fortran interface made available by + !! nsclock.c. This approach will eventually be extended to other + !! platforms. + !! + !! New behaviour added at the Havana release allows the user to embed + !! profiling calls at varying levels of granularity all over the code, + !! and for any particular run, set a threshold of granularity so that + !! finer-grained clocks become dormant. + !! + !! The threshold granularity is held in the private module variable + !! clock_grain. This value may be modified by the call + !! mpp_clock_set_grain, and affect clocks initiated by + !! subsequent calls to mpp_clock_id. The value of + !! clock_grain is set to an arbitrarily large number initially. + !! + !! Clocks initialized by mpp_clock_id can set a new optional + !! argument grain setting their granularity level. Clocks check + !! this level against the current value of clock_grain, and are + !! only triggered if they are at or below ("coarser than") the + !! threshold. Finer-grained clocks are dormant for that run. + !! + !!The following grain levels are pre-defined: + !! + !!
+ !!!predefined clock granularities, but you can use any integer + !!!using CLOCK_LOOP and above may distort coarser-grain measurements + !! integer, parameter, public :: CLOCK_COMPONENT=1 !component level, e.g model, exchange + !! integer, parameter, public :: CLOCK_SUBCOMPONENT=11 !top level within a model component, e.g dynamics, physics + !! integer, parameter, public :: CLOCK_MODULE=21 !module level, e.g main subroutine of a physics module + !! integer, parameter, public :: CLOCK_ROUTINE=31 !level of individual subroutine or function + !! integer, parameter, public :: CLOCK_LOOP=41 !loops or blocks within a routine + !! integer, parameter, public :: CLOCK_INFRA=51 !infrastructure level, e.g halo update + !!+ !! + !! Note that subsequent changes to clock_grain do not + !! change the status of already initiated clocks, and that if the + !! optional grain argument is absent, the clock is always + !! triggered. This guarantees backward compatibility. subroutine mpp_clock_set_grain( grain ) integer, intent(in) :: grain !set the granularity of times: only clocks whose grain is lower than @@ -771,7 +668,7 @@ end function rarray_to_char end subroutine clock_init !##################################################################### - !return an ID for a new or existing clock + !> Return an ID for a new or existing clock function mpp_clock_id( name, flags, grain ) integer :: mpp_clock_id character(len=*), intent(in) :: name @@ -1165,8 +1062,8 @@ end function rarray_to_char end subroutine sum_clock_data !##################################################################### - ! This routine will double the size of peset and copy the original peset data - ! into the expanded one. The maximum allowed to expand is PESET_MAX. + !> This routine will double the size of peset and copy the original peset data + !! into the expanded one. The maximum allowed to expand is PESET_MAX. subroutine expand_peset() integer :: old_peset_max,n type(communicator), allocatable :: peset_old(:) @@ -1278,16 +1175,14 @@ end function rarray_to_char ! !----------------------------------------------------------------------- -! subroutine READ_INPUT_NML -! -! -! Reads an existing input nml file into a character array and broadcasts -! it to the non-root mpi-tasks. This allows the use of reads from an -! internal file for namelist settings (requires 2003 compliant compiler) -! -! read(input_nml_file, nml=
@@ -136,7 +138,7 @@ !! !!
!! -!! F90 is a strictly-typed language, and the syntax pass of the +!! @note F90 is a strictly-typed language, and the syntax pass of the !! compiler requires matching of type, kind and rank (TKR). Most calls !! listed here use a generic type, shown here as MPP_TYPE_. This !! is resolved in the pre-processor stage to any of a variety of @@ -146,9 +148,6 @@ !! generic interface. Any of the variables below shown as !! MPP_TYPE_ is treated in this way. -!> @file -!> @brief File for @ref mpp_mod - module mpp_mod ! Define rank(X) for PGI compiler @@ -406,6 +405,8 @@ module mpp_mod module procedure mpp_error_rs_rs end interface !> Takes a given integer or real array and returns it as a string + !> @param[in] array An array of integers or reals + !> @returns string equivalent of given array !> @ingroup mpp_mod interface array_to_char module procedure iarray_to_char @@ -424,38 +425,38 @@ module mpp_mod ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !> @fn subroutine mpp_init( flags, localcomm, test_level) - !> @brief Initialize @ref mpp_mod - !! - !> Called to initialize the mpp_mod package. It is recommended - !! that this call be the first executed line in your program. It sets the - !! number of PEs assigned to this run (acquired from the command line, or - !! through the environment variable NPES), and associates an ID - !! number to each PE. These can be accessed by calling @ref mpp_npes and - !! @ref mpp_pe. - !!
Example usage: - !! - !! call mpp_init( flags ) - !! - !! @param flags - !! flags can be set to MPP_VERBOSE to - !! have mpp_mod keep you informed of what it's up to. - !! @param test_level - !! Debugging flag to set amount of initialization tasks performed - !> @ingroup mpp_mod - - !> @fn subroutine mpp_exit() - !> @brief Exit @ref mpp_mod. - !! - !> Called at the end of the run, or to re-initialize mpp_mod, - !! should you require that for some odd reason. - !! - !! This call implies synchronization across all PEs. - !! - !!
Example usage: - !! - !! call mpp_exit() - !> @ingroup mpp_mod +!> @fn mpp_mod::mpp_init::mpp_init( flags, localcomm, test_level) +!> @ingroup mpp_mod +!> @brief Initialize @ref mpp_mod +!! +!> Called to initialize the mpp_mod package. It is recommended +!! that this call be the first executed line in your program. It sets the +!! number of PEs assigned to this run (acquired from the command line, or +!! through the environment variable NPES), and associates an ID +!! number to each PE. These can be accessed by calling @ref mpp_npes and +!! @ref mpp_pe. +!!
Example usage: +!! +!! call mpp_init( flags ) +!! +!! @param flags +!! flags can be set to MPP_VERBOSE to +!! have mpp_mod keep you informed of what it's up to. +!! @param test_level +!! Debugging flag to set amount of initialization tasks performed + +!> @fn mpp_mod::mpp_exit() +!> @brief Exit @ref mpp_mod. +!! +!> Called at the end of the run, or to re-initialize mpp_mod, +!! should you require that for some odd reason. +!! +!! This call implies synchronization across all PEs. +!! +!!
Example usage: +!! +!! call mpp_exit() +!> @ingroup mpp_mod !##################################################################### @@ -524,7 +525,7 @@ module mpp_mod !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> @brief Reduction operations. - !> Find the max of scalar a the PEs in pelist + !> Find the max of scalar a from the PEs in pelist !! result is also automatically broadcast to all PEs !! @code{.F90} !! call mpp_max( a, pelist ) @@ -545,8 +546,16 @@ module mpp_mod module procedure mpp_max_int4_1d end interface - !> @brief Get minimum value out of the PEs in pelist - !> Result is also broadcast to all PEs + !> @brief Reduction operations. + !> Find the min of scalar a from the PEs in pelist + !! result is also automatically broadcast to all PEs + !! @code{.F90} + !! call mpp_min( a, pelist ) + !! @endcode + !> @param a real or integer, of 4-byte of 8-byte kind. + !> @param pelist If pelist is omitted, the context is assumed to be the + !! current pelist. This call implies synchronization across the PEs in + !! pelist, or the current pelist if pelist is absent. !> @ingroup mpp_mod interface mpp_min module procedure mpp_min_real8_0d @@ -571,8 +580,8 @@ module mpp_mod !! bit-reproducible. In any case, changing the processor count changes !! the data layout, and thus very likely the order of operations. For !! bit-reproducible sums of distributed arrays, consider using the - !! mpp_global_sum routine provided by the mpp_domains module. + !! mpp_global_sum routine provided by the + !! @ref mpp_domains module. !! !! The bit_reproducible flag provided in earlier versions of !! this routine has been removed. @@ -673,8 +682,19 @@ module mpp_mod #endif end interface - !> @brief Gather information onto root pe + !> @brief Gather data sent from pelist onto the root pe + !! Wrapper for MPI_gather, can be used with and without indices !> @ingroup mpp_mod + !! + !> @param sbuf MPP_TYPE_ data buffer to send + !> @param rbuf MPP_TYPE_ data buffer to receive + !> @param pelist integer(:) optional pelist to gather from, defaults to current + !> + !>
Example usage: + !! + !! call mpp_gather(send_buffer,recv_buffer, pelist) + !! call mpp_gather(is, ie, js, je, pelist, array_seg, data, is_root_pe) + !! interface mpp_gather module procedure mpp_gather_logical_1d module procedure mpp_gather_int4_1d @@ -694,8 +714,23 @@ module mpp_mod module procedure mpp_gather_pelist_real8_3d end interface - !> @brief Scatter information to the given pelist + !> @brief Scatter (ie - is) * (je - js) contiguous elements of array data from the designated root pe + !! into contigous members of array segment in each pe that is included in the pelist argument. !> @ingroup mpp_mod + !! + !> @param is, ie integer start and end index of the first dimension of the segment array + !> @param je, js integer start and end index of the second dimension of the segment array + !> @param pelist integer(:) the PE list of target pes, needs to be monotonically increasing + !> @param array_seg MPP_TYPE_ 2D array that the data is to be copied into + !> @param data MPP_TYPE_ the source array + !> @param is_root_pe logical true if calling from root pe + !> @param ishift integer offsets specifying the first elelement in the data array + !> @param nk integer size of third dimension for 3D calls + !! + !>
Example usage: + !! + !! call mpp_scatter(is, ie, js, je, pelist, segment, data, .true.) + !! interface mpp_scatter module procedure mpp_scatter_pelist_int4_2d module procedure mpp_scatter_pelist_int4_3d @@ -709,6 +744,14 @@ module mpp_mod !> @brief Scatter a vector across all PEs !! !> Transpose the vector and PE index + !! Wrapper for the MPI_alltoall function, includes more generic _V and _W + !! versions if given displacements/data types + !! + !! Generic MPP_TYPE_ implentations: + !!
@@ -1144,6 +1184,12 @@ module mpp_mod !! @param pelist Optional list of PE's to include in checksum calculation if not using !! current pelist !! @return Parallel checksum of var across given or implicit pelist + !! + !! Generic MPP_TYPE_ implentations: + !!