From da763f7c6e347aa810033a7886fb753951c836f5 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 23 Feb 2021 05:18:20 -0700 Subject: [PATCH 1/5] more doxygen work --- sorc/fvcom_tools.fd/CMakeLists.txt | 5 + sorc/fvcom_tools.fd/kinds.f90 | 16 +- sorc/fvcom_tools.fd/module_ncio.f90 | 487 +++++++++++++++++++--------- 3 files changed, 350 insertions(+), 158 deletions(-) diff --git a/sorc/fvcom_tools.fd/CMakeLists.txt b/sorc/fvcom_tools.fd/CMakeLists.txt index 7f0bec898..682389d68 100644 --- a/sorc/fvcom_tools.fd/CMakeLists.txt +++ b/sorc/fvcom_tools.fd/CMakeLists.txt @@ -1,3 +1,8 @@ +# This is the CMake file for the fvcom_tools utility in the UFS_UTILS +# project. +# +# David Wright + set(fortran_src kinds.f90 module_ncio.f90 diff --git a/sorc/fvcom_tools.fd/kinds.f90 b/sorc/fvcom_tools.fd/kinds.f90 index 5fd4eceb9..1474b8b38 100644 --- a/sorc/fvcom_tools.fd/kinds.f90 +++ b/sorc/fvcom_tools.fd/kinds.f90 @@ -1,15 +1,11 @@ !> @file -!! . . . . -!! Module to hold specification kinds for variable declaration. +!! @brief Module to hold specification kinds for variable declaration. +!! !! This module is based on (copied from) Paul vanDelst's !! type_kinds module found in the community radiative transfer !! model !! -!! The numerical data types defined in this module are: -!! - r_single - specification kind for single precision (4-byte) real variable -!! - i_kind - generic specification kind for default integer -!! - r_kind - generic specification kind for default floating point -!! +!! @author David Wright, University of Michigan module kinds implicit none private @@ -20,12 +16,12 @@ module kinds ! Integer type definitions below ! Integer types - integer, parameter, public :: i_kind = 4 + integer, parameter, public :: i_kind = 4 !< generic specification kind for default integer. integer, parameter, public :: i_short = 2 integer, parameter, public :: i_byte = 1 ! Real types - integer, parameter, public :: r_single = 4 ! single precision - integer, parameter, public :: r_kind = 8 + integer, parameter, public :: r_single = 4 !< specification kind for single precision (4-byte) real variable. + integer, parameter, public :: r_kind = 8 !< generic specification kind for default floating point ! real(r_single),parameter,public :: rmissing=-99999.0 diff --git a/sorc/fvcom_tools.fd/module_ncio.f90 b/sorc/fvcom_tools.fd/module_ncio.f90 index f6ba24628..1a790aaa9 100644 --- a/sorc/fvcom_tools.fd/module_ncio.f90 +++ b/sorc/fvcom_tools.fd/module_ncio.f90 @@ -1,5 +1,5 @@ !> @file -!! module: functions to read and write netcdf files +!! @brief Functions to read and write netcdf files. !! !! @author Ming Hu @date 2017-11-01 !! @@ -99,14 +99,14 @@ module module_ncio contains +!> Open a netcdf file, set initial debug level. +!! +!! @param this instance of an ncio class +!! @param filename the file to open +!! @param action "r" for read, "w" for write +!! @param debug_level set to non-zero for some verbose output +!! @author Ming Hu @date 2017-11-01 subroutine open_nc(this,filename,action,debug_level) -! -! open a netcdf file, set initial debug level -! -! prgmmr: Ming Hu org: GSD date: 2017-11-01 -! -! abstract: -! implicit none ! @@ -139,14 +139,11 @@ subroutine open_nc(this,filename,action,debug_level) end subroutine open_nc +!> Close a netcdf file. +!! +!! @param this instance of an ncio class +!! @author Ming Hu org: GSD/AMB @date 2017-04-10 subroutine close_nc(this) -! -! initial netcdf file -! -! prgmmr: Ming Hu org: GSD/AMB date: 2017-04-10 -! -! abstract: -! implicit none ! @@ -162,15 +159,13 @@ subroutine close_nc(this) end subroutine close_nc +!> Get attribute in wrf netcdf file. +!! +!! @param this instance of an ncio class +!! @param attname name of the attribute to get +!! @param rval return value +!! @author Ming Hu org: GSD/AMB @date 2017-10-04 subroutine get_att_nc_real(this,attname,rval) -! -! get attribute in wrf netcdf file -! -! prgmmr: Ming Hu org: GSD/AMB date: 2017-10-04 -! -! abstract: -! - implicit none ! class(ncio) :: this @@ -188,15 +183,13 @@ subroutine get_att_nc_real(this,attname,rval) ! end subroutine get_att_nc_real +!> Get integer attribute in wrf netcdf file. +!! +!! @param this instance of an ncio class +!! @param attname name of the attribute to get +!! @param ival value of attribute. +!! @author Ming Hu org: GSD/AMB @date 2017-10-04 subroutine get_att_nc_int(this,attname,ival) -! -! get attribute in wrf netcdf file -! -! prgmmr: Ming Hu org: GSD/AMB date: 2017-10-04 -! -! abstract: -! - implicit none ! class(ncio) :: this @@ -214,15 +207,13 @@ subroutine get_att_nc_int(this,attname,ival) ! end subroutine get_att_nc_int +!> Get string attribute in wrf netcdf file. +!! +!! @param this instance of an ncio class +!! @param attname name of the attribute to get +!! @param string value of attribute. +!! @author Ming Hu org: GSD/AMB @date 2017-10-04 subroutine get_att_nc_string(this,attname,string) -! -! get attribute in wrf netcdf file -! -! prgmmr: Ming Hu org: GSD/AMB date: 2017-10-04 -! -! abstract: -! - implicit none ! class(ncio) :: this @@ -241,15 +232,13 @@ subroutine get_att_nc_string(this,attname,string) end subroutine get_att_nc_string +!> Get dimensions in netcdf file. +!! +!! @param[in] this instance of an ncio class +!! @param[in] dimname name of the dimension +!! @param[out] dimvalue length of the dimension +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_dim_nc(this,dimname,dimvalue) -! -! get dimensions in netcdf file -! -! prgmmr: Ming Hu org: GSD/AMB date: 2017-11-01 -! -! abstract: -! - implicit none ! class(ncio) :: this @@ -270,11 +259,15 @@ subroutine get_dim_nc(this,dimname,dimvalue) ! end subroutine get_dim_nc -!==========================begin replace_var ========================== +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_char_1d(this,varname,nd1,field) -! -! read in one field -! + use netcdf ! implicit none @@ -301,10 +294,15 @@ subroutine replace_var_nc_char_1d(this,varname,nd1,field) ! end subroutine replace_var_nc_char_1d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_char_2d(this,varname,nd1,nd2,field) -! -! read in one field -! use netcdf ! implicit none @@ -343,10 +341,16 @@ subroutine replace_var_nc_char_2d(this,varname,nd1,nd2,field) ! end subroutine replace_var_nc_char_2d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] nd3 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_char_3d(this,varname,nd1,nd2,nd3,field) -! -! read in one field -! use netcdf ! implicit none @@ -388,11 +392,15 @@ subroutine replace_var_nc_char_3d(this,varname,nd1,nd2,nd3,field) deallocate(temp) ! end subroutine replace_var_nc_char_3d -! + +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] ilength +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_char(this,varname,ilength,field) -! -! read in one field -! use netcdf ! implicit none @@ -492,11 +500,14 @@ subroutine replace_var_nc_char(this,varname,ilength,field) end subroutine replace_var_nc_char !--- replace_var_nc_char -!---- replace real +!> Replace real. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_real_1d(this,varname,nd1,field) -! -! read in one field -! use netcdf ! implicit none @@ -523,10 +534,15 @@ subroutine replace_var_nc_real_1d(this,varname,nd1,field) ! end subroutine replace_var_nc_real_1d +!> Replace real. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_real_2d(this,varname,nd1,nd2,field) -! -! read in one field -! use netcdf ! implicit none @@ -565,6 +581,15 @@ subroutine replace_var_nc_real_2d(this,varname,nd1,nd2,field) ! end subroutine replace_var_nc_real_2d +!> Replace real. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] nd3 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_real_3d(this,varname,nd1,nd2,nd3,field) ! ! read in one field @@ -613,10 +638,14 @@ subroutine replace_var_nc_real_3d(this,varname,nd1,nd2,nd3,field) ! end subroutine replace_var_nc_real_3d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] ilength +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_real(this,varname,ilength,field) -! -! read in one field -! use netcdf ! implicit none @@ -715,7 +744,13 @@ subroutine replace_var_nc_real(this,varname,ilength,field) ! end subroutine replace_var_nc_real -!---- repalce double +!> Replace double. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_double_1d(this,varname,nd1,field) ! ! read in one field @@ -746,6 +781,14 @@ subroutine replace_var_nc_double_1d(this,varname,nd1,field) ! end subroutine replace_var_nc_double_1d +!> Replace double. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_double_2d(this,varname,nd1,nd2,field) ! ! read in one field @@ -788,6 +831,15 @@ subroutine replace_var_nc_double_2d(this,varname,nd1,nd2,field) ! end subroutine replace_var_nc_double_2d +!> Replace double. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] nd3 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_double_3d(this,varname,nd1,nd2,nd3,field) ! ! read in one field @@ -837,10 +889,14 @@ subroutine replace_var_nc_double_3d(this,varname,nd1,nd2,nd3,field) end subroutine replace_var_nc_double_3d ! +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] ilength +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_double(this,varname,ilength,field) -! -! read in one field -! use netcdf ! implicit none @@ -938,12 +994,15 @@ subroutine replace_var_nc_double(this,varname,ilength,field) endif ! end subroutine replace_var_nc_double -! -!---- replace int + +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_int_1d(this,varname,nd1,field) -! -! read in one field -! use netcdf ! implicit none @@ -970,6 +1029,14 @@ subroutine replace_var_nc_int_1d(this,varname,nd1,field) ! end subroutine replace_var_nc_int_1d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_int_2d(this,varname,nd1,nd2,field) ! ! read in one field @@ -1012,10 +1079,16 @@ subroutine replace_var_nc_int_2d(this,varname,nd1,nd2,field) ! end subroutine replace_var_nc_int_2d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] nd3 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_int_3d(this,varname,nd1,nd2,nd3,field) -! -! read in one field -! use netcdf ! implicit none @@ -1059,11 +1132,15 @@ subroutine replace_var_nc_int_3d(this,varname,nd1,nd2,nd3,field) deallocate(temp) ! end subroutine replace_var_nc_int_3d -! + +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] ilength +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine replace_var_nc_int(this,varname,ilength,field) -! -! read in one field -! use netcdf ! implicit none @@ -1161,14 +1238,15 @@ subroutine replace_var_nc_int(this,varname,ilength,field) endif ! end subroutine replace_var_nc_int -! -!==========================end of replace_var ========================== -!==========================begin get_var ========================== +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_double_1d(this,varname,nd1,field) -! -! read in one field -! use netcdf ! implicit none @@ -1198,10 +1276,15 @@ subroutine get_var_nc_double_1d(this,varname,nd1,field) ! end subroutine get_var_nc_double_1d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_double_2d(this,varname,nd1,nd2,field) -! -! read in one field -! use netcdf ! implicit none @@ -1244,10 +1327,16 @@ subroutine get_var_nc_double_2d(this,varname,nd1,nd2,field) ! end subroutine get_var_nc_double_2d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] nd3 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_double_3d(this,varname,nd1,nd2,nd3,field) -! -! read in one field -! use netcdf ! implicit none @@ -1295,11 +1384,15 @@ subroutine get_var_nc_double_3d(this,varname,nd1,nd2,nd3,field) deallocate(temp) ! end subroutine get_var_nc_double_3d -! + +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] ilength +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_double(this,varname,ilength,field) -! -! read in one field -! use netcdf ! implicit none @@ -1398,10 +1491,14 @@ subroutine get_var_nc_double(this,varname,ilength,field) ! end subroutine get_var_nc_double +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_real_1d(this,varname,nd1,field) -! -! read in one field -! use netcdf ! implicit none @@ -1431,6 +1528,14 @@ subroutine get_var_nc_real_1d(this,varname,nd1,field) ! end subroutine get_var_nc_real_1d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_real_2d(this,varname,nd1,nd2,field) ! ! read in one field @@ -1477,10 +1582,16 @@ subroutine get_var_nc_real_2d(this,varname,nd1,nd2,field) ! end subroutine get_var_nc_real_2d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] nd3 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_real_3d(this,varname,nd1,nd2,nd3,field) -! -! read in one field -! use netcdf ! implicit none @@ -1528,7 +1639,14 @@ subroutine get_var_nc_real_3d(this,varname,nd1,nd2,nd3,field) deallocate(temp) ! end subroutine get_var_nc_real_3d -! + +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] ilength +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_real(this,varname,ilength,field) ! ! read in one field @@ -1631,10 +1749,14 @@ subroutine get_var_nc_real(this,varname,ilength,field) ! end subroutine get_var_nc_real +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_int_1d(this,varname,nd1,field) -! -! read in one field -! use netcdf ! implicit none @@ -1664,6 +1786,14 @@ subroutine get_var_nc_int_1d(this,varname,nd1,field) ! end subroutine get_var_nc_int_1d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_int_2d(this,varname,nd1,nd2,field) ! ! read in one field @@ -1710,10 +1840,16 @@ subroutine get_var_nc_int_2d(this,varname,nd1,nd2,field) ! end subroutine get_var_nc_int_2d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] nd3 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_int_3d(this,varname,nd1,nd2,nd3,field) -! -! read in one field -! use netcdf ! implicit none @@ -1761,7 +1897,14 @@ subroutine get_var_nc_int_3d(this,varname,nd1,nd2,nd3,field) deallocate(temp) ! end subroutine get_var_nc_int_3d -! + +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] ilength +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_int(this,varname,ilength,field) ! ! read in one field @@ -1863,11 +2006,15 @@ subroutine get_var_nc_int(this,varname,ilength,field) endif ! end subroutine get_var_nc_int -! + +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_short_1d(this,varname,nd1,field) -! -! read in one field -! use netcdf ! implicit none @@ -1896,7 +2043,15 @@ subroutine get_var_nc_short_1d(this,varname,nd1,field) endif ! end subroutine get_var_nc_short_1d -! + +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_short_2d(this,varname,nd1,nd2,field) ! ! read in one field @@ -1943,10 +2098,14 @@ subroutine get_var_nc_short_2d(this,varname,nd1,nd2,field) ! end subroutine get_var_nc_short_2d ! +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] ilength +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_short(this,varname,ilength,field) -! -! read in one field -! use netcdf ! implicit none @@ -2045,10 +2204,14 @@ subroutine get_var_nc_short(this,varname,ilength,field) ! end subroutine get_var_nc_short +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_char_1d(this,varname,nd1,field) -! -! read in one field -! use netcdf ! implicit none @@ -2078,10 +2241,15 @@ subroutine get_var_nc_char_1d(this,varname,nd1,field) ! end subroutine get_var_nc_char_1d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_char_2d(this,varname,nd1,nd2,field) -! -! read in one field -! use netcdf ! implicit none @@ -2124,10 +2292,16 @@ subroutine get_var_nc_char_2d(this,varname,nd1,nd2,field) ! end subroutine get_var_nc_char_2d +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] nd1 +!! @param[in] nd2 +!! @param[in] nd3 +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_char_3d(this,varname,nd1,nd2,nd3,field) -! -! read in one field -! use netcdf ! implicit none @@ -2174,6 +2348,13 @@ subroutine get_var_nc_char_3d(this,varname,nd1,nd2,nd3,field) ! end subroutine get_var_nc_char_3d ! +!> Read in one field. +!! +!! @param[in] this instance of an ncio class +!! @param[in] varname name of the variable +!! @param[in] ilength +!! @param[in] field +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine get_var_nc_char(this,varname,ilength,field) ! ! read in one field @@ -2275,8 +2456,12 @@ subroutine get_var_nc_char(this,varname,ilength,field) endif ! end subroutine get_var_nc_char -!==========================end of get_var ========================== +!> Handle netCDF errors. +!! +!! @param[in] this instance of an ncio class +!! @param[in] status return code from neCDF +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine handle_err(this,status) use netcdf implicit none @@ -2289,8 +2474,15 @@ subroutine handle_err(this,status) end if end subroutine handle_err +!> Convert theta T to T. +!! +!! @param[in] this instance of an ncio class +!! @param[in] nx +!! @param[in] ny +!! @param[in] ps +!! @param[in] t2 +!! @author Ming Hu org: GSD/AMB @date 2017-11-01 subroutine convert_theta2t_2dgrid(this,nx,ny,ps,t2) -! convertt theta T to T implicit none class(ncio) :: this @@ -2314,19 +2506,18 @@ subroutine convert_theta2t_2dgrid(this,nx,ny,ps,t2) end subroutine convert_theta2t_2dgrid +!> Add a new variable to sfc_data.nc with dimensions (Time, yaxis_1, +!! xaxis_1). +!! +!! @param[in] varname Name of variable to be created in netcdf file +!! @param[in] dname1 1st dimension name +!! @param[in] dname2 2nd dimension name +!! @param[in] dname3 3rd dimension name +!! @param lname long name output for netcdf variable +!! @param units units to use in netcdf variable +!! +!! @author David.M.Wright org: UM/GLERL @date 2020-09-01 subroutine add_new_var_3d(this,varname,dname1,dname2,dname3,lname,units) -! -! prgmmr: David.M.Wright org: UM/GLERL date: 2020-09-01 -! -! abstract: Add a new variable to sfc_data.nc with dimensions -! (Time, yaxis_1, xaxis_1) -! -! Input: varname = Name of variable to be created in netcdf file -! dname1,dname2,dname3 = 1st,2nd, and 3rd dimension names -! lname = long name output for netcdf variable -! units = units to use in netcdf variable -! - use netcdf implicit none ! class(ncio) :: this From 64afc62c23d0d8629aa5d44701c60c47ff2289af Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 25 Feb 2021 05:31:01 -0700 Subject: [PATCH 2/5] more doxygen --- sorc/fvcom_tools.fd/process_FVCOM.f90 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sorc/fvcom_tools.fd/process_FVCOM.f90 b/sorc/fvcom_tools.fd/process_FVCOM.f90 index 871c6a959..b0d66310d 100755 --- a/sorc/fvcom_tools.fd/process_FVCOM.f90 +++ b/sorc/fvcom_tools.fd/process_FVCOM.f90 @@ -1,8 +1,12 @@ !> @file !! -!! This is the code to put lake surface temperature and aerial ice -!! concentration from GLERL-provided FVCOM forecast files (which have -!! already been mapped to the FV3-LAM grid) into sfc_data.nc. +!! @brief This is the code to put lake surface temperature and aerial +!! ice concentration from GLERL-provided FVCOM forecast files (which +!! have already been mapped to the FV3-LAM grid) into sfc_data.nc. + +!> Put lake surface temperature and aerial ice concentration from +!! GLERL-provided FVCOM forecast files (which have already been mapped +!! to the FV3-LAM grid) into sfc_data.nc. !! !! This script will take two variables from the command line: !! 1. Name of FV3 sfc data file (e.g. sfc_data.tile7.halo0.nc) @@ -12,9 +16,9 @@ !! names as needed: !! ./fvcom_to_FV3 sfc_data.tile7.halo0.nc fvcom.nc !! -!! Code is strongly based upon Eric James' (ESRL/GSL) work -!! to update HRRR/WRF Great Lakes' temperature data with FVCOM. -!! Code also relies heavily on Ming Hu's ncio module. +!! Code is strongly based upon Eric James' (ESRL/GSL) work to update +!! HRRR/WRF Great Lakes' temperature data with FVCOM. Code also +!! relies heavily on Ming Hu's ncio module. !! !! @author David Wright, University of Michigan and GLERL !! @date 17 Aug 2020 From 9cd58bea8eca140ee462cfda1477c656c13d441b Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 25 Feb 2021 07:39:33 -0700 Subject: [PATCH 3/5] updated docs --- sorc/fvcom_tools.fd/process_FVCOM.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/sorc/fvcom_tools.fd/process_FVCOM.f90 b/sorc/fvcom_tools.fd/process_FVCOM.f90 index b0d66310d..960980cc7 100755 --- a/sorc/fvcom_tools.fd/process_FVCOM.f90 +++ b/sorc/fvcom_tools.fd/process_FVCOM.f90 @@ -22,6 +22,7 @@ !! !! @author David Wright, University of Michigan and GLERL !! @date 17 Aug 2020 +!! @return 0 for success, error code otherwise !! program process_FVCOM From 18d7fb72039dcd0ac5a97aaebbf3983a6545b1fb Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 25 Feb 2021 07:44:01 -0700 Subject: [PATCH 4/5] updated docs --- sorc/fvcom_tools.fd/kinds.f90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sorc/fvcom_tools.fd/kinds.f90 b/sorc/fvcom_tools.fd/kinds.f90 index 1474b8b38..f261fe35c 100644 --- a/sorc/fvcom_tools.fd/kinds.f90 +++ b/sorc/fvcom_tools.fd/kinds.f90 @@ -17,15 +17,15 @@ module kinds ! Integer types integer, parameter, public :: i_kind = 4 !< generic specification kind for default integer. - integer, parameter, public :: i_short = 2 - integer, parameter, public :: i_byte = 1 + integer, parameter, public :: i_short = 2 !< generic specification kind for default short. + integer, parameter, public :: i_byte = 1 !< generic specification kind for default byte. ! Real types integer, parameter, public :: r_single = 4 !< specification kind for single precision (4-byte) real variable. integer, parameter, public :: r_kind = 8 !< generic specification kind for default floating point ! - real(r_single),parameter,public :: rmissing=-99999.0 - real(i_kind),parameter,public :: imissing=-99999 - real(r_kind),parameter,public :: drmissing=-99999.0 + real(r_single),parameter,public :: rmissing=-99999.0 !< Fill value for single real missing data. + real(i_kind),parameter,public :: imissing=-99999 !< Fill value for integer missing data. + real(r_kind),parameter,public :: drmissing=-99999.0 !< Fill value for double real missing data. end module kinds From fd82a987f061589b55fe61072fee52378ac14217 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 25 Feb 2021 07:44:56 -0700 Subject: [PATCH 5/5] updated docs --- sorc/fvcom_tools.fd/kinds.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/fvcom_tools.fd/kinds.f90 b/sorc/fvcom_tools.fd/kinds.f90 index f261fe35c..37734c31c 100644 --- a/sorc/fvcom_tools.fd/kinds.f90 +++ b/sorc/fvcom_tools.fd/kinds.f90 @@ -11,7 +11,7 @@ module kinds private ! ! for name string - integer, parameter, public :: len_sta_name = 8 + integer, parameter, public :: len_sta_name = 8 !< Name length. ! Integer type definitions below