From 457ae349d364af1d1a476e55e2e2cdc06ec7204b Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Wed, 17 Jan 2024 05:10:47 -0700 Subject: [PATCH 1/8] more doxygen changes --- io/module_write_netcdf.F90 | 60 +++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index e9670945b..faf6c9e23 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -1,10 +1,19 @@ +!> @file +!> @brief ??? +!> @author Dusan Jovic @date Nov 1, 2017 + +!> Return error to ESMF and finalize it. #define ESMF_ERR_RETURN(rc) \ if (ESMF_LogFoundError(rc, msg="Breaking out of subroutine", line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) +!> Return error to ESMF and finalize it. #define NC_ERR_STOP(status) \ if (status /= nf90_noerr) write(0,*) "file: ", __FILE__, " line: ", __LINE__, trim(nf90_strerror(status)); \ if (status /= nf90_noerr) call ESMF_Finalize(endflag=ESMF_END_ABORT) +!> @brief ??? +!> +!> @author Dusan Jovic @date Nov 1, 2017 module module_write_netcdf use mpi @@ -19,11 +28,21 @@ module module_write_netcdf private public write_netcdf - logical :: par - - contains - -!---------------------------------------------------------------------------------------- + logical :: par !< ??? + +contains + + !> Write netCDF file. + !> + !> @param[in] wrtfb ??? + !> @param[in] filename NetCDF filename. + !> @param[in] use_parallel_netcdf True if parallel I/O should be used. + !> @param[in] mpi_comm MPI communicator for parallel I/O. + !> @param[in] mype ??? + !> @param[in] grid_id ??? + !> @param[out] rc Return code: ??? + !> + !> @author Dusan Jovic @date Nov 1, 2017 subroutine write_netcdf(wrtfb, filename, & use_parallel_netcdf, mpi_comm, mype, & grid_id, rc) @@ -716,7 +735,14 @@ subroutine write_netcdf(wrtfb, filename, & end subroutine write_netcdf -!---------------------------------------------------------------------------------------- + !> Get global attribute. + !> + !> @param[in] fldbundle ??? + !> @param[in] ncid NetCDF file ID. + !> @param[in] mype ??? + !> @param[out] rc Return code: ??? + !> + !> @author Dusan Jovic @date Nov 1, 2017 subroutine get_global_attr(fldbundle, ncid, mype, rc) type(ESMF_FieldBundle), intent(in) :: fldbundle integer, intent(in) :: ncid @@ -785,7 +811,15 @@ subroutine get_global_attr(fldbundle, ncid, mype, rc) end subroutine get_global_attr -!---------------------------------------------------------------------------------------- + !> Get grid attribute. + !> + !> @param[in] grid ??? + !> @param[in] prefix ??? + !> @param[in] ncid NetCDF file ID. + !> @param[in] varid NetCDF variable ID. + !> @param[out] rc Return code: ??? + !> + !> @author Dusan Jovic @date Nov 1, 2017 subroutine get_grid_attr(grid, prefix, ncid, varid, rc) type(ESMF_Grid), intent(in) :: grid character(len=*), intent(in) :: prefix @@ -849,7 +883,17 @@ subroutine get_grid_attr(grid, prefix, ncid, varid, rc) end subroutine get_grid_attr -!---------------------------------------------------------------------------------------- + !> Add a dimension. + !> + !> @param[in] ncid NetCDF file ID. + !> @param[in] dim_name Dimension name. + !> @param[in] dimid Dimension ID. + !> @param[in] grpid Group ID. + !> @param[in] grid ??? + !> @param[in] mtype ??? + !> @param[out] rc Return code: ??? + !> + !> @author Dusan Jovic @date Nov 1, 2017 subroutine add_dim(ncid, dim_name, dimid, grid, mype, rc) integer, intent(in) :: ncid character(len=*), intent(in) :: dim_name From 7b431ce454c10c57ac0298166e17ad2327d97b65 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Wed, 17 Jan 2024 05:16:15 -0700 Subject: [PATCH 2/8] more doxygen changes --- io/module_write_internal_state.F90 | 86 ++++++++++++++++-------------- 1 file changed, 47 insertions(+), 39 deletions(-) diff --git a/io/module_write_internal_state.F90 b/io/module_write_internal_state.F90 index 9ab449c0e..997f36eab 100644 --- a/io/module_write_internal_state.F90 +++ b/io/module_write_internal_state.F90 @@ -1,16 +1,8 @@ +!> @file +!> @brief The internal state of the write component. +!> @author Jun Wang @date Feb, 2017 !----------------------------------------------------------------------- module write_internal_state -! -!----------------------------------------------------------------------- -!*** the internal state of the write component. -!----------------------------------------------------------------------- -!*** -!*** revision history -!*** -! Feb 2017: J. Wang - Initial code -! -!----------------------------------------------------------------------- -! use esmf ! !----------------------------------------------------------------------- @@ -20,12 +12,27 @@ module write_internal_state !----------------------------------------------------------------------- ! type output_grid_info - integer :: im, jm, lm - integer :: i_start,i_end, j_start,j_end - real,dimension(:,:),allocatable :: lonPtr, latPtr - integer,dimension(:),allocatable :: i_start_wrtgrp, i_end_wrtgrp, j_start_wrtgrp, j_end_wrtgrp - real :: latse, latnw, lonse, lonnw - real :: latstart, latlast, lonstart, lonlast + integer :: im !< ??? + integer :: jm !< ??? + integer :: lm !< ??? + integer :: i_start !< ??? + integer :: i_end !< ??? + integer :: j_start !< ??? + integer :: j_end !< ??? + real,dimension(:,:),allocatable :: lonPtr !< ??? + real,dimension(:,:),allocatable :: latPtr !< ??? + integer,dimension(:),allocatable :: i_start_wrtgrp !< ??? + integer,dimension(:),allocatable :: i_end_wrtgrp !< ??? + integer,dimension(:),allocatable :: j_start_wrtgrp !< ??? + integer,dimension(:),allocatable :: j_end_wrtgrp !< ??? + real :: latse !< ??? + real :: latnw !< ??? + real :: lonse !< ??? + real :: lonnw !< ??? + real :: latstart !< ??? + real :: latlast !< ??? + real :: lonstart !< ??? + real :: lonlast !< ??? end type output_grid_info type wrt_internal_state @@ -34,61 +41,62 @@ module write_internal_state ! pe information and task layout !-------------------------------- ! - integer :: mype - integer :: petcount + integer :: mype !< ??? + integer :: petcount !< Number of PEs. ! !-------------------- !*** grid information !-------------------- - type(esmf_grid) :: wrtgrid + type(esmf_grid) :: wrtgrid !< ??? - type(output_grid_info) ,dimension(:), allocatable :: out_grid_info + type(output_grid_info) ,dimension(:), allocatable :: out_grid_info !< ??? ! !-------------------------- !*** file bundle for output !-------------------------- - integer :: FBCount + integer :: FBCount !< ??? ! !----------------------------------------------------------------------- !*** THE OUTPUT FILE !----------------------------------------------------------------------- ! - integer :: num_files + integer :: num_files !< ??? ! !----------------------------------------------------------------------- !*** THE OUTPUT FILE !----------------------------------------------------------------------- ! - type(ESMF_FieldBundle),dimension(:),allocatable :: wrtFB + type(ESMF_FieldBundle),dimension(:),allocatable :: wrtFB !< ??? ! !------------------------------------- !*** Times used in history filenames !------------------------------------- ! - type(ESMF_Time) :: io_basetime - integer :: idate(7) - integer :: fdate(7) + type(ESMF_Time) :: io_basetime !< ??? + integer :: idate(7) !< ??? + integer :: fdate(7) !< ??? ! !----------------------------------------- !*** I/O direction flags (Read or Write) !----------------------------------------- ! - logical :: output_history + logical :: output_history !< ??? ! !----------------------------------------- !*** POST flags and required variables !----------------------------------------- ! - logical :: write_dopost - character(80) :: post_namelist -! - integer :: fhzero - integer :: ntrac - integer :: ncld - integer :: nsoil - integer :: imp_physics - integer :: dtp - real,dimension(:),allocatable :: ak,bk + logical :: write_dopost !< ??? + character(80) :: post_namelist !< ??? +! + integer :: fhzero !< ??? + integer :: ntrac !< ??? + integer :: ncld !< ??? + integer :: nsoil !< ??? + integer :: imp_physics !< ??? + integer :: dtp !< ??? + real,dimension(:),allocatable :: ak !< ??? + real,dimension(:),allocatable :: bk !< ??? !----------------------------------------------------------------------- ! end type wrt_internal_state @@ -99,7 +107,7 @@ module write_internal_state !----------------------------------------------------------- ! type write_wrap - type(wrt_internal_state),pointer :: write_int_state + type(wrt_internal_state),pointer :: write_int_state !< ??? end type write_wrap !----------------------------------------------------------- From 92ba266587809e5b8c24cd36bbd687b40dc8f116 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Wed, 17 Jan 2024 05:19:29 -0700 Subject: [PATCH 3/8] more doxygen changes --- io/module_write_internal_state.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/module_write_internal_state.F90 b/io/module_write_internal_state.F90 index 997f36eab..a1c95e6d3 100644 --- a/io/module_write_internal_state.F90 +++ b/io/module_write_internal_state.F90 @@ -1,8 +1,10 @@ !> @file !> @brief The internal state of the write component. !> @author Jun Wang @date Feb, 2017 -!----------------------------------------------------------------------- - module write_internal_state + +!> @brief The internal state of the write component. +!> @author Jun Wang @date Feb, 2017 +module write_internal_state use esmf ! !----------------------------------------------------------------------- From c1e16a2742d826dc113e042ccc61b9b88147f9db Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Wed, 17 Jan 2024 15:13:32 +0000 Subject: [PATCH 4/8] Update documentation in module_write_internal_state.F90 and module_write_netcdf.F90 --- io/module_write_internal_state.F90 | 90 +++++++++++++++--------------- io/module_write_netcdf.F90 | 48 ++++++++-------- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/io/module_write_internal_state.F90 b/io/module_write_internal_state.F90 index a1c95e6d3..e8ae06547 100644 --- a/io/module_write_internal_state.F90 +++ b/io/module_write_internal_state.F90 @@ -1,9 +1,9 @@ !> @file !> @brief The internal state of the write component. -!> @author Jun Wang @date Feb, 2017 +!> @author Jun Wang @date Feb, 2017 !> @brief The internal state of the write component. -!> @author Jun Wang @date Feb, 2017 +!> @author Jun Wang @date Feb, 2017 module write_internal_state use esmf ! @@ -14,27 +14,27 @@ module write_internal_state !----------------------------------------------------------------------- ! type output_grid_info - integer :: im !< ??? - integer :: jm !< ??? - integer :: lm !< ??? - integer :: i_start !< ??? - integer :: i_end !< ??? - integer :: j_start !< ??? - integer :: j_end !< ??? - real,dimension(:,:),allocatable :: lonPtr !< ??? - real,dimension(:,:),allocatable :: latPtr !< ??? - integer,dimension(:),allocatable :: i_start_wrtgrp !< ??? - integer,dimension(:),allocatable :: i_end_wrtgrp !< ??? - integer,dimension(:),allocatable :: j_start_wrtgrp !< ??? - integer,dimension(:),allocatable :: j_end_wrtgrp !< ??? - real :: latse !< ??? - real :: latnw !< ??? - real :: lonse !< ??? - real :: lonnw !< ??? - real :: latstart !< ??? - real :: latlast !< ??? - real :: lonstart !< ??? - real :: lonlast !< ??? + integer :: im !< output grid global I dimension size + integer :: jm !< output grid global J dimension size + integer :: lm !< output grid global L dimension size + integer :: i_start !< output grid lower bound of I dimension on current PE + integer :: i_end !< output grid upper bound of I dimension on current PE + integer :: j_start !< output grid lower bound of J dimension on current PE + integer :: j_end !< output grid upper bound of J dimension on current PE + real,dimension(:,:),allocatable :: lonPtr !< output grid longitudes + real,dimension(:,:),allocatable :: latPtr !< output grid latitudes + integer,dimension(:),allocatable :: i_start_wrtgrp !< I dimension lower bound of all wrire groups + integer,dimension(:),allocatable :: i_end_wrtgrp !< I dimension upper bound of all wrire groups + integer,dimension(:),allocatable :: j_start_wrtgrp !< J dimension lower bound of all wrire groups + integer,dimension(:),allocatable :: j_end_wrtgrp !< J dimension upper bound of all wrire groups + real :: latse !< output grid South East corner latitude + real :: latnw !< output grid North West corner latitude + real :: lonse !< output grid South East corner longitude + real :: lonnw !< output grid North West corner longitude + real :: latstart !< output grid start latitude + real :: latlast !< output grid last latitude + real :: lonstart !< output grid start logitude + real :: lonlast !< output grid last longitude end type output_grid_info type wrt_internal_state @@ -43,62 +43,62 @@ module write_internal_state ! pe information and task layout !-------------------------------- ! - integer :: mype !< ??? + integer :: mype !< MPI rank integer :: petcount !< Number of PEs. ! !-------------------- !*** grid information !-------------------- - type(esmf_grid) :: wrtgrid !< ??? + type(esmf_grid) :: wrtgrid !< ESMF output grid - type(output_grid_info) ,dimension(:), allocatable :: out_grid_info !< ??? + type(output_grid_info) ,dimension(:), allocatable :: out_grid_info !< Array of output_grid_info for all domains ! !-------------------------- !*** file bundle for output !-------------------------- - integer :: FBCount !< ??? + integer :: FBCount !< Numebr of output ESMF field bundles ! !----------------------------------------------------------------------- !*** THE OUTPUT FILE !----------------------------------------------------------------------- ! - integer :: num_files !< ??? + integer :: num_files !< number of output files ! !----------------------------------------------------------------------- !*** THE OUTPUT FILE !----------------------------------------------------------------------- ! - type(ESMF_FieldBundle),dimension(:),allocatable :: wrtFB !< ??? + type(ESMF_FieldBundle),dimension(:),allocatable :: wrtFB !< ESMF write field bundles ! !------------------------------------- !*** Times used in history filenames !------------------------------------- ! - type(ESMF_Time) :: io_basetime !< ??? - integer :: idate(7) !< ??? - integer :: fdate(7) !< ??? + type(ESMF_Time) :: io_basetime !< ESMF clock's starting time + integer :: idate(7) !< Forecast initial time + integer :: fdate(7) !< Forecast current time ! !----------------------------------------- !*** I/O direction flags (Read or Write) !----------------------------------------- ! - logical :: output_history !< ??? + logical :: output_history !< True if history output is requested ! !----------------------------------------- !*** POST flags and required variables !----------------------------------------- ! - logical :: write_dopost !< ??? - character(80) :: post_namelist !< ??? -! - integer :: fhzero !< ??? - integer :: ntrac !< ??? - integer :: ncld !< ??? - integer :: nsoil !< ??? - integer :: imp_physics !< ??? - integer :: dtp !< ??? - real,dimension(:),allocatable :: ak !< ??? - real,dimension(:),allocatable :: bk !< ??? + logical :: write_dopost !< True if inline post is requested + character(80) :: post_namelist !< filename of the inline post namelist +! + integer :: fhzero !< hours between clearing of diagnostic buckets + integer :: ntrac !< number of tracers + integer :: ncld !< number of hydrometeors + integer :: nsoil !< number of soil layers + integer :: imp_physics !< choice of microphysics scheme + integer :: dtp !< physics timestep + real,dimension(:),allocatable :: ak !< a parameter for sigma pressure level calculations + real,dimension(:),allocatable :: bk !< b parameter for sigma pressure level calculations !----------------------------------------------------------------------- ! end type wrt_internal_state @@ -109,7 +109,7 @@ module write_internal_state !----------------------------------------------------------- ! type write_wrap - type(wrt_internal_state),pointer :: write_int_state !< ??? + type(wrt_internal_state),pointer :: write_int_state !< Write grid component internal state end type write_wrap !----------------------------------------------------------- diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index faf6c9e23..2ae56e64e 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -1,19 +1,19 @@ !> @file -!> @brief ??? -!> @author Dusan Jovic @date Nov 1, 2017 +!> @brief Module containing history files output routines +!> @author Dusan Jovic @date Nov 1, 2017 -!> Return error to ESMF and finalize it. +!> Return error to ESMF and finalize it. #define ESMF_ERR_RETURN(rc) \ if (ESMF_LogFoundError(rc, msg="Breaking out of subroutine", line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) -!> Return error to ESMF and finalize it. +!> Return error to ESMF and finalize it. #define NC_ERR_STOP(status) \ if (status /= nf90_noerr) write(0,*) "file: ", __FILE__, " line: ", __LINE__, trim(nf90_strerror(status)); \ if (status /= nf90_noerr) call ESMF_Finalize(endflag=ESMF_END_ABORT) -!> @brief ??? +!> @brief Module containing history files output routines !> -!> @author Dusan Jovic @date Nov 1, 2017 +!> @author Dusan Jovic @date Nov 1, 2017 module module_write_netcdf use mpi @@ -28,21 +28,21 @@ module module_write_netcdf private public write_netcdf - logical :: par !< ??? + logical :: par !< True if parallel I/O should be used. contains !> Write netCDF file. !> - !> @param[in] wrtfb ??? + !> @param[in] wrtfb ESMF write field bundle !> @param[in] filename NetCDF filename. !> @param[in] use_parallel_netcdf True if parallel I/O should be used. !> @param[in] mpi_comm MPI communicator for parallel I/O. - !> @param[in] mype ??? - !> @param[in] grid_id ??? - !> @param[out] rc Return code: ??? + !> @param[in] mype MPI rank + !> @param[in] grid_id Output grid identifier + !> @param[out] rc Return code: return code !> - !> @author Dusan Jovic @date Nov 1, 2017 + !> @author Dusan Jovic @date Nov 1, 2017 subroutine write_netcdf(wrtfb, filename, & use_parallel_netcdf, mpi_comm, mype, & grid_id, rc) @@ -737,12 +737,12 @@ end subroutine write_netcdf !> Get global attribute. !> - !> @param[in] fldbundle ??? + !> @param[in] fldbundle ESMF field bundle !> @param[in] ncid NetCDF file ID. - !> @param[in] mype ??? - !> @param[out] rc Return code: ??? + !> @param[in] mype MPI rank + !> @param[out] rc Return code: return code !> - !> @author Dusan Jovic @date Nov 1, 2017 + !> @author Dusan Jovic @date Nov 1, 2017 subroutine get_global_attr(fldbundle, ncid, mype, rc) type(ESMF_FieldBundle), intent(in) :: fldbundle integer, intent(in) :: ncid @@ -813,13 +813,13 @@ end subroutine get_global_attr !> Get grid attribute. !> - !> @param[in] grid ??? - !> @param[in] prefix ??? + !> @param[in] grid ESMF output grid + !> @param[in] prefix grid attribute prefix !> @param[in] ncid NetCDF file ID. !> @param[in] varid NetCDF variable ID. - !> @param[out] rc Return code: ??? + !> @param[out] rc Return code: return code !> - !> @author Dusan Jovic @date Nov 1, 2017 + !> @author Dusan Jovic @date Nov 1, 2017 subroutine get_grid_attr(grid, prefix, ncid, varid, rc) type(ESMF_Grid), intent(in) :: grid character(len=*), intent(in) :: prefix @@ -889,11 +889,11 @@ end subroutine get_grid_attr !> @param[in] dim_name Dimension name. !> @param[in] dimid Dimension ID. !> @param[in] grpid Group ID. - !> @param[in] grid ??? - !> @param[in] mtype ??? - !> @param[out] rc Return code: ??? + !> @param[in] grid ESMF output grid + !> @param[in] mype MPI rank + !> @param[out] rc Return code: retrun code !> - !> @author Dusan Jovic @date Nov 1, 2017 + !> @author Dusan Jovic @date Nov 1, 2017 subroutine add_dim(ncid, dim_name, dimid, grid, mype, rc) integer, intent(in) :: ncid character(len=*), intent(in) :: dim_name From 13c03ea49cc5fec82410b74dd4b6684fad810cb1 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 18 Jan 2024 08:18:52 -0700 Subject: [PATCH 5/8] minor edits --- io/module_write_internal_state.F90 | 84 +++++++++++++++--------------- io/module_write_netcdf.F90 | 26 ++++----- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/io/module_write_internal_state.F90 b/io/module_write_internal_state.F90 index e8ae06547..4ba2cd86e 100644 --- a/io/module_write_internal_state.F90 +++ b/io/module_write_internal_state.F90 @@ -14,27 +14,27 @@ module write_internal_state !----------------------------------------------------------------------- ! type output_grid_info - integer :: im !< output grid global I dimension size - integer :: jm !< output grid global J dimension size - integer :: lm !< output grid global L dimension size - integer :: i_start !< output grid lower bound of I dimension on current PE - integer :: i_end !< output grid upper bound of I dimension on current PE - integer :: j_start !< output grid lower bound of J dimension on current PE - integer :: j_end !< output grid upper bound of J dimension on current PE - real,dimension(:,:),allocatable :: lonPtr !< output grid longitudes - real,dimension(:,:),allocatable :: latPtr !< output grid latitudes - integer,dimension(:),allocatable :: i_start_wrtgrp !< I dimension lower bound of all wrire groups - integer,dimension(:),allocatable :: i_end_wrtgrp !< I dimension upper bound of all wrire groups - integer,dimension(:),allocatable :: j_start_wrtgrp !< J dimension lower bound of all wrire groups - integer,dimension(:),allocatable :: j_end_wrtgrp !< J dimension upper bound of all wrire groups - real :: latse !< output grid South East corner latitude - real :: latnw !< output grid North West corner latitude - real :: lonse !< output grid South East corner longitude - real :: lonnw !< output grid North West corner longitude - real :: latstart !< output grid start latitude - real :: latlast !< output grid last latitude - real :: lonstart !< output grid start logitude - real :: lonlast !< output grid last longitude + integer :: im !< Output grid global I dimension size. + integer :: jm !< Output grid global J dimension size. + integer :: lm !< Output grid global L dimension size. + integer :: i_start !< Output grid lower bound of I dimension on current PE. + integer :: i_end !< Output grid upper bound of I dimension on current PE. + integer :: j_start !< Output grid lower bound of J dimension on current PE. + integer :: j_end !< Output grid upper bound of J dimension on current PE. + real,dimension(:,:),allocatable :: lonPtr !< Output grid longitudes. + real,dimension(:,:),allocatable :: latPtr !< Output grid latitudes. + integer,dimension(:),allocatable :: i_start_wrtgrp !< I dimension lower bound of all wrire groups. + integer,dimension(:),allocatable :: i_end_wrtgrp !< I dimension upper bound of all wrire groups. + integer,dimension(:),allocatable :: j_start_wrtgrp !< J dimension lower bound of all wrire groups. + integer,dimension(:),allocatable :: j_end_wrtgrp !< J dimension upper bound of all wrire groups. + real :: latse !< Output grid South East corner latitude. + real :: latnw !< Output grid North West corner latitude. + real :: lonse !< Output grid South East corner longitude. + real :: lonnw !< Output grid North West corner longitude. + real :: latstart !< Output grid start latitude. + real :: latlast !< Output grid last latitude. + real :: lonstart !< Output grid start logitude. + real :: lonlast !< Output grid last longitude. end type output_grid_info type wrt_internal_state @@ -43,62 +43,62 @@ module write_internal_state ! pe information and task layout !-------------------------------- ! - integer :: mype !< MPI rank + integer :: mype !< MPI rank. integer :: petcount !< Number of PEs. ! !-------------------- !*** grid information !-------------------- - type(esmf_grid) :: wrtgrid !< ESMF output grid + type(esmf_grid) :: wrtgrid !< ESMF output grid. type(output_grid_info) ,dimension(:), allocatable :: out_grid_info !< Array of output_grid_info for all domains ! !-------------------------- !*** file bundle for output !-------------------------- - integer :: FBCount !< Numebr of output ESMF field bundles + integer :: FBCount !< Numebr of output ESMF field bundles. ! !----------------------------------------------------------------------- !*** THE OUTPUT FILE !----------------------------------------------------------------------- ! - integer :: num_files !< number of output files + integer :: num_files !< Number of output files. ! !----------------------------------------------------------------------- !*** THE OUTPUT FILE !----------------------------------------------------------------------- ! - type(ESMF_FieldBundle),dimension(:),allocatable :: wrtFB !< ESMF write field bundles + type(ESMF_FieldBundle),dimension(:),allocatable :: wrtFB !< ESMF write field bundles. ! !------------------------------------- !*** Times used in history filenames !------------------------------------- ! - type(ESMF_Time) :: io_basetime !< ESMF clock's starting time - integer :: idate(7) !< Forecast initial time - integer :: fdate(7) !< Forecast current time + type(ESMF_Time) :: io_basetime !< ESMF clock's starting time. + integer :: idate(7) !< Forecast initial time. + integer :: fdate(7) !< Forecast current time. ! !----------------------------------------- !*** I/O direction flags (Read or Write) !----------------------------------------- ! - logical :: output_history !< True if history output is requested + logical :: output_history !< True if history output is requested. ! !----------------------------------------- !*** POST flags and required variables !----------------------------------------- ! - logical :: write_dopost !< True if inline post is requested - character(80) :: post_namelist !< filename of the inline post namelist -! - integer :: fhzero !< hours between clearing of diagnostic buckets - integer :: ntrac !< number of tracers - integer :: ncld !< number of hydrometeors - integer :: nsoil !< number of soil layers - integer :: imp_physics !< choice of microphysics scheme - integer :: dtp !< physics timestep - real,dimension(:),allocatable :: ak !< a parameter for sigma pressure level calculations - real,dimension(:),allocatable :: bk !< b parameter for sigma pressure level calculations + logical :: write_dopost !< True if inline post is requested. + character(80) :: post_namelist !< File name of the inline post namelist. +! + integer :: fhzero !< Hours between clearing of diagnostic buckets. + integer :: ntrac !< Number of tracers. + integer :: ncld !< Number of hydrometeors. + integer :: nsoil !< Number of soil layers. + integer :: imp_physics !< Choice of microphysics scheme. + integer :: dtp !< Physics timestep. + real,dimension(:),allocatable :: ak !< a parameter for sigma pressure level calculations. + real,dimension(:),allocatable :: bk !< b parameter for sigma pressure level calculations. !----------------------------------------------------------------------- ! end type wrt_internal_state @@ -109,7 +109,7 @@ module write_internal_state !----------------------------------------------------------- ! type write_wrap - type(wrt_internal_state),pointer :: write_int_state !< Write grid component internal state + type(wrt_internal_state),pointer :: write_int_state !< Write grid component internal state. end type write_wrap !----------------------------------------------------------- diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index 2ae56e64e..22b37c44b 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -34,13 +34,13 @@ module module_write_netcdf !> Write netCDF file. !> - !> @param[in] wrtfb ESMF write field bundle + !> @param[in] wrtfb ESMF write field bundle. !> @param[in] filename NetCDF filename. !> @param[in] use_parallel_netcdf True if parallel I/O should be used. !> @param[in] mpi_comm MPI communicator for parallel I/O. - !> @param[in] mype MPI rank - !> @param[in] grid_id Output grid identifier - !> @param[out] rc Return code: return code + !> @param[in] mype MPI rank. + !> @param[in] grid_id Output grid identifier. + !> @param[out] rc Return code. !> !> @author Dusan Jovic @date Nov 1, 2017 subroutine write_netcdf(wrtfb, filename, & @@ -737,10 +737,10 @@ end subroutine write_netcdf !> Get global attribute. !> - !> @param[in] fldbundle ESMF field bundle + !> @param[in] fldbundle ESMF field bundle. !> @param[in] ncid NetCDF file ID. - !> @param[in] mype MPI rank - !> @param[out] rc Return code: return code + !> @param[in] mype MPI rank. + !> @param[out] rc Return code. !> !> @author Dusan Jovic @date Nov 1, 2017 subroutine get_global_attr(fldbundle, ncid, mype, rc) @@ -813,11 +813,11 @@ end subroutine get_global_attr !> Get grid attribute. !> - !> @param[in] grid ESMF output grid - !> @param[in] prefix grid attribute prefix + !> @param[in] grid ESMF output grid. + !> @param[in] prefix grid attribute prefix. !> @param[in] ncid NetCDF file ID. !> @param[in] varid NetCDF variable ID. - !> @param[out] rc Return code: return code + !> @param[out] rc Return code. !> !> @author Dusan Jovic @date Nov 1, 2017 subroutine get_grid_attr(grid, prefix, ncid, varid, rc) @@ -889,9 +889,9 @@ end subroutine get_grid_attr !> @param[in] dim_name Dimension name. !> @param[in] dimid Dimension ID. !> @param[in] grpid Group ID. - !> @param[in] grid ESMF output grid - !> @param[in] mype MPI rank - !> @param[out] rc Return code: retrun code + !> @param[in] grid ESMF output grid. + !> @param[in] mype MPI rank. + !> @param[out] rc Return code. !> !> @author Dusan Jovic @date Nov 1, 2017 subroutine add_dim(ncid, dim_name, dimid, grid, mype, rc) From e0aa33e1268f78d55c6316b1e3941e36f41232e6 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 18 Jan 2024 08:27:08 -0700 Subject: [PATCH 6/8] minor edits --- io/module_write_internal_state.F90 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/io/module_write_internal_state.F90 b/io/module_write_internal_state.F90 index 4ba2cd86e..51c422227 100644 --- a/io/module_write_internal_state.F90 +++ b/io/module_write_internal_state.F90 @@ -51,7 +51,8 @@ module write_internal_state !-------------------- type(esmf_grid) :: wrtgrid !< ESMF output grid. - type(output_grid_info) ,dimension(:), allocatable :: out_grid_info !< Array of output_grid_info for all domains + !> Array of output_grid_info for all domains. + type(output_grid_info) ,dimension(:), allocatable :: out_grid_info ! !-------------------------- !*** file bundle for output @@ -68,7 +69,8 @@ module write_internal_state !*** THE OUTPUT FILE !----------------------------------------------------------------------- ! - type(ESMF_FieldBundle),dimension(:),allocatable :: wrtFB !< ESMF write field bundles. + !> ESMF write field bundles. + type(ESMF_FieldBundle),dimension(:),allocatable :: wrtFB ! !------------------------------------- !*** Times used in history filenames @@ -102,14 +104,12 @@ module write_internal_state !----------------------------------------------------------------------- ! end type wrt_internal_state -! -!----------------------------------------------------------------------- -!*** THIS STATE IS SUPPORTED BY C POINTERS BUT NOT F90 POINTERS -!*** THEREFORE WE NEED THIS WRAP. -!----------------------------------------------------------- -! + + !> This state is supported by c pointers but not f90 pointers + !> therefore we need this wrap. type write_wrap - type(wrt_internal_state),pointer :: write_int_state !< Write grid component internal state. + !> Write grid component internal state. + type(wrt_internal_state),pointer :: write_int_state end type write_wrap !----------------------------------------------------------- From 2b1444c6d053bce518afbbb2457523ccb5f1dd92 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 18 Jan 2024 08:28:45 -0700 Subject: [PATCH 7/8] minor edits --- io/module_write_netcdf.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index 22b37c44b..d75552710 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -1,5 +1,5 @@ !> @file -!> @brief Module containing history files output routines +!> @brief Module containing history files output routines. !> @author Dusan Jovic @date Nov 1, 2017 !> Return error to ESMF and finalize it. @@ -11,7 +11,7 @@ if (status /= nf90_noerr) write(0,*) "file: ", __FILE__, " line: ", __LINE__, trim(nf90_strerror(status)); \ if (status /= nf90_noerr) call ESMF_Finalize(endflag=ESMF_END_ABORT) -!> @brief Module containing history files output routines +!> @brief Output routines for writing history files. !> !> @author Dusan Jovic @date Nov 1, 2017 module module_write_netcdf From 3cb99e1c7040e4bd9cc53ab0622688d34bd887de Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 18 Jan 2024 10:57:22 -0700 Subject: [PATCH 8/8] minor documentation fixes --- io/module_write_netcdf.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index d75552710..082b38839 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -40,7 +40,7 @@ module module_write_netcdf !> @param[in] mpi_comm MPI communicator for parallel I/O. !> @param[in] mype MPI rank. !> @param[in] grid_id Output grid identifier. - !> @param[out] rc Return code. + !> @param[out] rc Return code - 0 for success, ESMF error code otherwise. !> !> @author Dusan Jovic @date Nov 1, 2017 subroutine write_netcdf(wrtfb, filename, & @@ -740,7 +740,7 @@ end subroutine write_netcdf !> @param[in] fldbundle ESMF field bundle. !> @param[in] ncid NetCDF file ID. !> @param[in] mype MPI rank. - !> @param[out] rc Return code. + !> @param[out] rc Return code - 0 for success, ESMF error code otherwise. !> !> @author Dusan Jovic @date Nov 1, 2017 subroutine get_global_attr(fldbundle, ncid, mype, rc) @@ -817,7 +817,7 @@ end subroutine get_global_attr !> @param[in] prefix grid attribute prefix. !> @param[in] ncid NetCDF file ID. !> @param[in] varid NetCDF variable ID. - !> @param[out] rc Return code. + !> @param[out] rc Return code - 0 for success, ESMF error code otherwise. !> !> @author Dusan Jovic @date Nov 1, 2017 subroutine get_grid_attr(grid, prefix, ncid, varid, rc) @@ -891,7 +891,7 @@ end subroutine get_grid_attr !> @param[in] grpid Group ID. !> @param[in] grid ESMF output grid. !> @param[in] mype MPI rank. - !> @param[out] rc Return code. + !> @param[out] rc Return code - 0 for success, ESMF error code otherwise. !> !> @author Dusan Jovic @date Nov 1, 2017 subroutine add_dim(ncid, dim_name, dimid, grid, mype, rc)