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 1 commit
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
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 (William.Ramstrom@noaa.gov), 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 William.Ramstrom@noaa.gov
!=======================================================================!


!> @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