Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doxygenated fv3_cap.F90 #819

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 109 additions & 14 deletions fv3_cap.F90
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
!--------------- FV3 ATM solo model ----------------
!
!*** The FV3 atmosphere grid component nuopc cap
!
! Author: Jun [email protected]
!
! revision history
! 11 Oct 2016: J. Wang Initial code
! 18 Apr 2017: J. Wang set up fcst grid component and write grid components
! 24 Jul 2017: J. Wang initialization and time stepping changes for coupling
! 02 Nov 2017: J. Wang Use Gerhard's transferable RouteHandle
!

!> @file
!> @brief The FV3 atmosphere grid component nuopc cap.
!> @author Jun Wang @date 01/2017

!> @brief The FV3 atmosphere grid component nuopc cap.
!>
!> FV3 ATM solo model
!>
!> ## Module History
!> Date | Author | Modification
!> -----|--------|-------------
!> 11 Oct 2016 | J. Wang | Initial code
!> 18 Apr 2017 | J. Wang | set up fcst grid component and write grid components
!> 24 Jul 2017 | J. Wang | initialization and time stepping changes for coupling
!> 02 Nov 2017 | J. Wang | Use Gerhard's transferable RouteHandle
!>
!> @author Jun Wang @date 01/2017
module fv3atm_cap_mod

use ESMF
Expand Down Expand Up @@ -56,30 +60,61 @@ module fv3atm_cap_mod
!
!-----------------------------------------------------------------------
!

!> ???
type(ESMF_GridComp) :: fcstComp

!> ???
type(ESMF_State) :: fcstState

!> ???
type(ESMF_FieldBundle), allocatable :: fcstFB(:)

!> ???
integer,dimension(:), allocatable :: fcstPetList

!> ???
integer, save :: FBCount
Comment on lines +63 to +75
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these variables are local (private) variables and are not accessible outside the module. Are you going to add doxygen the every local variable in every module and subroutine? I thought we are adding doxygen just to subroutine arguments and public module variables.

Copy link
Contributor

@edwardhartnett edwardhartnett Apr 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will not be adding doxygen for any subprogram variables.

Good question about private module variables, I will investigate and get back to you. My hunch is that doxygen doesn't distinguish between different types of module variables.

We need to document all the module variables that doxygen will complain about if undocumented. This is so we can turn on warning-check and ensure that no undocumented code is committed to the repo.


!> ???
type(ESMF_GridComp), allocatable :: wrtComp(:)

!> ???
type(ESMF_State), allocatable :: wrtState(:)

!> ???
type(ESMF_FieldBundle), allocatable :: wrtFB(:,:)

!> ???
type(ESMF_RouteHandle), allocatable :: routehandle(:,:)

!> ???
type(ESMF_RouteHandle), allocatable :: gridRedistRH(:,:)

!> ???
type(ESMF_Grid), allocatable :: srcGrid(:,:), dstGrid(:,:)

!> ???
logical, allocatable :: is_moving_FB(:)

!> ???
logical :: profile_memory = .true.

!> ???
logical :: write_runtimelog = .false.

!> ???
logical :: lprint = .false.

!> ???
integer :: mype = -1

!> ???
integer :: dbug = 0

!> ???
integer :: frestart(999) = -1

!> ???
real(kind=8) :: timere, timep2re
!-----------------------------------------------------------------------

Expand All @@ -89,6 +124,12 @@ module fv3atm_cap_mod
!------------------- Solo fv3atm code starts here ----------------------
!-----------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine SetServices(gcomp, rc)

type(ESMF_GridComp) :: gcomp
Expand Down Expand Up @@ -169,6 +210,12 @@ end subroutine SetServices

!-----------------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine InitializeAdvertise(gcomp, rc)

type(ESMF_GridComp) :: gcomp
Expand Down Expand Up @@ -972,6 +1019,12 @@ end subroutine InitializeAdvertise

!-----------------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine InitializeRealize(gcomp, rc)
type(ESMF_GridComp) :: gcomp
integer, intent(out) :: rc
Expand Down Expand Up @@ -1009,6 +1062,12 @@ end subroutine InitializeRealize

!-----------------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine ModelAdvance(gcomp, rc)

type(ESMF_GridComp) :: gcomp
Expand Down Expand Up @@ -1038,6 +1097,12 @@ end subroutine ModelAdvance

!-----------------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine ModelAdvance_phase1(gcomp, rc)
type(ESMF_GridComp) :: gcomp
integer, intent(out) :: rc
Expand Down Expand Up @@ -1092,6 +1157,12 @@ end subroutine ModelAdvance_phase1

!-----------------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine ModelAdvance_phase2(gcomp, rc)
type(ESMF_GridComp) :: gcomp
integer, intent(out) :: rc
Expand Down Expand Up @@ -1229,6 +1300,12 @@ end subroutine ModelAdvance_phase2

!-----------------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine ModelSetRunClock(gcomp, rc)

type(ESMF_GridComp) :: gcomp
Expand Down Expand Up @@ -1263,6 +1340,12 @@ end subroutine ModelSetRunClock

!-----------------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine fv3_checkimport(gcomp, rc)

!*** Check the import state fields
Expand Down Expand Up @@ -1352,6 +1435,12 @@ end subroutine fv3_checkimport

!-----------------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine TimestampExport_phase1(gcomp, rc)

! input arguments
Expand Down Expand Up @@ -1382,6 +1471,12 @@ end subroutine TimestampExport_phase1

!-----------------------------------------------------------------------------

!> ???
!>
!> @param gcomp ???
!> @param rc Return code.
!>
!> @author
subroutine ModelFinalize(gcomp, rc)

! input arguments
Expand Down
80 changes: 62 additions & 18 deletions moving_nest/bounding_box.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
!> @file
!> @brief Provides subroutines for grid bounding boxes for moving nest.
!> @author W. Ramstrom ([email protected]), AOML/HRD @date 07/28/2021

!***********************************************************************
!* GNU General Public License *
!* This file is a part of fvGFS. *
Expand All @@ -18,14 +22,9 @@
!* or see: http://www.gnu.org/licenses/gpl.html *
!***********************************************************************

!***********************************************************************
!> @file
!! @brief Provides subroutines for grid bounding boxes for moving nest
!! @author W. Ramstrom, AOML/HRD 07/28/2021
!! @email [email protected]
!=======================================================================!


!> @brief Provides subroutines for grid bounding boxes for moving nest.
!>
!> @author W. Ramstrom, AOML/HRD @date 07/28/2021
module bounding_box_mod
use mpp_domains_mod, only : mpp_get_C2F_index, nest_domain_type
use mpp_mod, only : mpp_pe
Expand All @@ -37,12 +36,16 @@ module bounding_box_mod
use IPD_typedefs, only : kind_phys => IPD_kind_phys
#endif

! Simple aggregation of the start and end indices of a 2D grid
! Makes argument lists clearer to read
!> Simple aggregation of the start and end indices of a 2D grid.
!> Makes argument lists clearer to read.
type bbox
integer :: is, ie, js, je
integer :: is !< ???
integer :: ie !< ???
integer :: js !< ???
integer :: je !< ???
end type bbox

!> ???
interface fill_bbox
module procedure fill_bbox_r4_2d
module procedure fill_bbox_r4_3d
Expand All @@ -54,6 +57,12 @@ module bounding_box_mod

contains

!> ???
!>
!> @param[out] out_bbox ???
!> @param[out] in_grid ???
!>
!> @author W. Ramstrom, AOML/HRD @date 07/28/2021
subroutine fill_bbox_r4_2d(out_bbox, in_grid)
type(bbox), intent(out) :: out_bbox
real*4, allocatable, intent(in) :: in_grid(:,:)
Expand All @@ -64,7 +73,12 @@ subroutine fill_bbox_r4_2d(out_bbox, in_grid)
out_bbox%je = ubound(in_grid, 2)
end subroutine fill_bbox_r4_2d


!> ???
!>
!> @param[out] out_bbox ???
!> @param[out] in_grid ???
!>
!> @author W. Ramstrom, AOML/HRD @date 07/28/2021
subroutine fill_bbox_r4_3d(out_bbox, in_grid)
type(bbox), intent(out) :: out_bbox
real*4, allocatable, intent(in) :: in_grid(:,:,:)
Expand All @@ -75,6 +89,12 @@ subroutine fill_bbox_r4_3d(out_bbox, in_grid)
out_bbox%je = ubound(in_grid, 2)
end subroutine fill_bbox_r4_3d

!> ???
!>
!> @param[out] out_bbox ???
!> @param[out] in_grid ???
!>
!> @author W. Ramstrom, AOML/HRD @date 07/28/2021
subroutine fill_bbox_r4_4d(out_bbox, in_grid)
type(bbox), intent(out) :: out_bbox
real*4, allocatable, intent(in) :: in_grid(:,:,:,:)
Expand All @@ -85,7 +105,12 @@ subroutine fill_bbox_r4_4d(out_bbox, in_grid)
out_bbox%je = ubound(in_grid, 2)
end subroutine fill_bbox_r4_4d


!> ???
!>
!> @param[out] out_bbox ???
!> @param[out] in_grid ???
!>
!> @author W. Ramstrom, AOML/HRD @date 07/28/2021
subroutine fill_bbox_r8_2d(out_bbox, in_grid)
type(bbox), intent(out) :: out_bbox
real*8, allocatable, intent(in) :: in_grid(:,:)
Expand All @@ -96,6 +121,12 @@ subroutine fill_bbox_r8_2d(out_bbox, in_grid)
out_bbox%je = ubound(in_grid, 2)
end subroutine fill_bbox_r8_2d

!> ???
!>
!> @param[out] out_bbox ???
!> @param[out] in_grid ???
!>
!> @author W. Ramstrom, AOML/HRD @date 07/28/2021
subroutine fill_bbox_r8_3d(out_bbox, in_grid)
type(bbox), intent(out) :: out_bbox
real*8, allocatable, intent(in) :: in_grid(:,:,:)
Expand All @@ -106,7 +137,12 @@ subroutine fill_bbox_r8_3d(out_bbox, in_grid)
out_bbox%je = ubound(in_grid, 2)
end subroutine fill_bbox_r8_3d


!> ???
!>
!> @param[out] out_bbox ???
!> @param[out] in_grid ???
!>
!> @author W. Ramstrom, AOML/HRD @date 07/28/2021
subroutine fill_bbox_r8_4d(out_bbox, in_grid)
type(bbox), intent(out) :: out_bbox
real*8, allocatable, intent(in) :: in_grid(:,:,:,:)
Expand All @@ -117,9 +153,17 @@ subroutine fill_bbox_r8_4d(out_bbox, in_grid)
out_bbox%je = ubound(in_grid, 2)
end subroutine fill_bbox_r8_4d


!>@brief This subroutine returns the nest grid indices that correspond to the input nest domain, direction, and position
!>@details Simplifies the call signature with the bbox type rather than 4 separate integers
!> This subroutine returns the nest grid indices that correspond to
!> the input nest domain, direction, and position @details Simplifies
!> the call signature with the bbox type rather than 4 separate
!> integers.
!> @param[out] nest_domain ???
!> @param[out] bbox_fine ???
!> @param[out] bbox_coarse ???
!> @param[out] direction ???
!> @param[out] position ???
!>
!> @author W. Ramstrom, AOML/HRD @date 07/28/2021
subroutine bbox_get_C2F_index(nest_domain, bbox_fine, bbox_coarse, direction, position)
implicit none
type(nest_domain_type), intent(in) :: nest_domain
Expand All @@ -133,4 +177,4 @@ subroutine bbox_get_C2F_index(nest_domain, bbox_fine, bbox_coarse, direction, p

end subroutine bbox_get_C2F_index

end module bounding_box_mod
end module bounding_box_mod
Loading
Loading