FMS  2024.01.00
Flexible Modeling System
fms_diag_bbox_mod

fms_diag_bbox_mod defines classes encapsulating bounding boxes and interval bounds. More...

Data Types

type  fmsdiagboundshalos_type
 Data structure holding starting and ending indices in the I, J, and K dimensions. It also has extra members related to halo sizes and updated indices in I and J dimensions. More...
 

Functions/Subroutines

logical pure function, public determine_if_block_is_in_region (subregion_start, subregion_end, bounds, dim)
 The PEs grid points are divided further into "blocks". This function determines if a block. More...
 
procedure get_fie
 
pure integer function get_fie (this)
 Gets the updated index ‘fie’ of fmsDiagBoundsHalos_type in the I dimension. More...
 
procedure get_fis
 
pure integer function get_fis (this)
 Gets the updated index ‘fis’ of fmsDiagBoundsHalos_type in the I dimension. More...
 
procedure get_fje
 
pure integer function get_fje (this)
 Gets the updated index ‘fje’ of fmsDiagBoundsHalos_type in the I dimension. More...
 
procedure get_fjs
 
pure integer function get_fjs (this)
 Gets the updated index ‘fjs’ of fmsDiagBoundsHalos_type in the I dimension. More...
 
procedure get_hi
 
pure integer function get_hi (this)
 Gets the halo size of fmsDiagBoundsHalos_type in the I dimension. More...
 
procedure get_hj
 
pure integer function get_hj (this)
 Gets the halo size of fmsDiagBoundsHalos_type in the J dimension. More...
 
procedure get_imax
 
pure integer function get_imax (this)
 Gets imax of fmsDiagIbounds_type. More...
 
procedure get_imin
 
pure integer function get_imin (this)
 Gets imin of fmsDiagIbounds_type. More...
 
procedure get_jmax
 
pure integer function get_jmax (this)
 Gets jmax of fmsDiagIbounds_type. More...
 
procedure get_jmin
 
pure integer function get_jmin (this)
 Gets jmin of fmsDiagIbounds_type. More...
 
procedure get_kmax
 
pure integer function get_kmax (this)
 Gets kmax of fmsDiagIbounds_type. More...
 
procedure get_kmin
 
pure integer function get_kmin (this)
 Gets kmin of fmsDiagIbounds_type. More...
 
procedure rebase_input
 
subroutine rebase_input (bounds_in, bounds, starting, ending, dim)
 Rebase the input bounds for a given dimension based on the starting and ending indices of a subregion. This is for when blocking is used. More...
 
procedure rebase_output
 
subroutine rebase_output (bounds_out, starting, ending, dim)
 Rebase the ouput bounds for a given dimension based on the starting and ending indices of a subregion. This is for when blocking is used. More...
 
logical function, public recondition_indices (indices, field, is_in, js_in, ks_in, ie_in, je_in, ke_in, err_msg)
 Updates indices based on presence/absence of input indices is, js, ks, ie, je, and ke. More...
 
procedure reset => reset_bounds
 
subroutine reset_bounds (this, lower_val, upper_val)
 Reset the instance bounding lower and upper bounds to lower_val and upper_val, respectively. More...
 
procedure reset_bounds_from_array_4d
 
subroutine reset_bounds_from_array_4d (this, array)
 Reset the instance bounding box with the bounds determined from the first three dimensions of the 5D "array" argument. More...
 
procedure reset_bounds_from_array_5d
 
subroutine reset_bounds_from_array_5d (this, array)
 Reset the instance bounding box with the bounds determined from the first three dimensions of the 5D "array" argument. More...
 
procedure set_bounds
 
character(len=150) function set_bounds (this, field_data, lower_i, upper_i, lower_j, upper_j, lower_k, upper_k, has_halos)
 Sets the bounds of a bounding region. More...
 
procedure update_bounds
 
subroutine update_bounds (this, lower_i, upper_i, lower_j, upper_j, lower_k, upper_k)
 Update the the first three (normally x, y, and z) min and max boundaries (array indices) of the instance bounding box the six specified bounds values. More...
 
procedure update_index
 
subroutine update_index (this, starting_index, ending_index, dim, ignore_halos)
 Updates the starting and ending index of a given dimension. More...
 

Variables

type(fmsdiagibounds_typebounds3d
 Holds starting and ending indices of the I, J, and K dimensions.
 
integer fie
 Updated ending index in the I dimension.
 
integer fis
 Updated starting index in the I dimension.
 
integer fje
 Updated ending index in the J dimension.
 
integer fjs
 Updated starting index in the J dimension.
 
logical has_halos
 .True. if the buffer has halos
 
integer hi
 Halo size in the I dimension.
 
integer hj
 Halo size in the J dimension.
 
integer imax
 Upper i bound.
 
integer imin
 Lower i bound.
 
integer jmax
 Upper j bound.
 
integer jmin
 Lower j bound.
 
integer kmax
 Upper k bound.
 
integer kmin
 Lower k bound.
 
integer nhalo_i
 Number of halos in i.
 
integer nhalo_j
 Number of halos in j.
 
integer, parameter xdimension = 1
 Parameter defining the x dimension.
 
integer, parameter ydimension = 2
 Parameter defining the y dimension.
 
integer, parameter zdimension = 3
 Parameter defininf the z dimension.
 

Detailed Description

fms_diag_bbox_mod defines classes encapsulating bounding boxes and interval bounds.

Author
Miguel Zuniga

Data Type Documentation

◆ fms_diag_bbox_mod::fmsdiagboundshalos_type

type fms_diag_bbox_mod::fmsdiagboundshalos_type

Data structure holding starting and ending indices in the I, J, and K dimensions. It also has extra members related to halo sizes and updated indices in I and J dimensions.

Definition at line 71 of file fms_diag_bbox.F90.

Collaboration diagram for fmsdiagboundshalos_type:
[legend]

Public Member Functions

procedure get_fie
 
procedure get_fis
 
procedure get_fje
 
procedure get_fjs
 
procedure get_hi
 
procedure get_hj
 

Public Attributes

type(fmsdiagibounds_typebounds3d
 Holds starting and ending indices of the I, J, and K dimensions.
 
integer fie
 Updated ending index in the I dimension.
 
integer fis
 Updated starting index in the I dimension.
 
integer fje
 Updated ending index in the J dimension.
 
integer fjs
 Updated starting index in the J dimension.
 
integer hi
 Halo size in the I dimension.
 
integer hj
 Halo size in the J dimension.
 

Function/Subroutine Documentation

◆ determine_if_block_is_in_region()

logical pure function, public fms_diag_bbox_mod::determine_if_block_is_in_region ( integer, intent(in)  subregion_start,
integer, intent(in)  subregion_end,
type(fmsdiagibounds_type), intent(in)  bounds,
integer, intent(in)  dim 
)

The PEs grid points are divided further into "blocks". This function determines if a block.

Parameters
[in]subregion_startBegining of the subregion
[in]subregion_endEnding of the subregion
[in]boundsStarting and ending of the subregion
[in]dimDimension to check

Definition at line 101 of file fms_diag_bbox.F90.

◆ get_fie()

pure integer function fms_diag_bbox_mod::get_fie ( class (fmsdiagboundshalos_type), intent(in)  this)

Gets the updated index ‘fie’ of fmsDiagBoundsHalos_type in the I dimension.

Returns
copy of integer member ‘fie’
Parameters
[in]thisCalling object

Definition at line 237 of file fms_diag_bbox.F90.

◆ get_fis()

pure integer function fms_diag_bbox_mod::get_fis ( class (fmsdiagboundshalos_type), intent(in)  this)

Gets the updated index ‘fis’ of fmsDiagBoundsHalos_type in the I dimension.

Returns
copy of integer member ‘fis’
Parameters
[in]thisCalling object

Definition at line 230 of file fms_diag_bbox.F90.

◆ get_fje()

pure integer function fms_diag_bbox_mod::get_fje ( class (fmsdiagboundshalos_type), intent(in)  this)

Gets the updated index ‘fje’ of fmsDiagBoundsHalos_type in the I dimension.

Returns
copy of integer member ‘fje’
Parameters
[in]thisCalling object

Definition at line 251 of file fms_diag_bbox.F90.

◆ get_fjs()

pure integer function fms_diag_bbox_mod::get_fjs ( class (fmsdiagboundshalos_type), intent(in)  this)

Gets the updated index ‘fjs’ of fmsDiagBoundsHalos_type in the I dimension.

Returns
copy of integer member ‘fjs’
Parameters
[in]thisCalling object

Definition at line 244 of file fms_diag_bbox.F90.

◆ get_hi()

pure integer function fms_diag_bbox_mod::get_hi ( class (fmsdiagboundshalos_type), intent(in)  this)

Gets the halo size of fmsDiagBoundsHalos_type in the I dimension.

Returns
copy of integer member hi
Parameters
[in]thisCalling object

Definition at line 216 of file fms_diag_bbox.F90.

◆ get_hj()

pure integer function fms_diag_bbox_mod::get_hj ( class (fmsdiagboundshalos_type), intent(in)  this)

Gets the halo size of fmsDiagBoundsHalos_type in the J dimension.

Returns
copy of integer member hj
Parameters
[in]thisCalling object

Definition at line 223 of file fms_diag_bbox.F90.

◆ get_imax()

pure integer function fms_diag_bbox_mod::get_imax ( class (fmsdiagibounds_type), intent(in)  this)

Gets imax of fmsDiagIbounds_type.

Returns
copy of integer member imax
Parameters
[in]thisThe !< ibounds instance

Definition at line 145 of file fms_diag_bbox.F90.

◆ get_imin()

pure integer function fms_diag_bbox_mod::get_imin ( class (fmsdiagibounds_type), intent(in)  this)

Gets imin of fmsDiagIbounds_type.

Returns
copy of integer member imin
Parameters
[in]thisThe !< ibounds instance

Definition at line 138 of file fms_diag_bbox.F90.

◆ get_jmax()

pure integer function fms_diag_bbox_mod::get_jmax ( class (fmsdiagibounds_type), intent(in)  this)

Gets jmax of fmsDiagIbounds_type.

Returns
copy of integer member jmax
Parameters
[in]thisThe !< ibounds instance

Definition at line 159 of file fms_diag_bbox.F90.

◆ get_jmin()

pure integer function fms_diag_bbox_mod::get_jmin ( class (fmsdiagibounds_type), intent(in)  this)

Gets jmin of fmsDiagIbounds_type.

Returns
copy of integer member jmin
Parameters
[in]thisThe !< ibounds instance

Definition at line 152 of file fms_diag_bbox.F90.

◆ get_kmax()

pure integer function fms_diag_bbox_mod::get_kmax ( class (fmsdiagibounds_type), intent(in)  this)

Gets kmax of fmsDiagIbounds_type.

Returns
copy of integer member kmax
Parameters
[in]thisThe !< ibounds instance

Definition at line 174 of file fms_diag_bbox.F90.

◆ get_kmin()

pure integer function fms_diag_bbox_mod::get_kmin ( class (fmsdiagibounds_type), intent(in)  this)

Gets kmin of fmsDiagIbounds_type.

Returns
copy of integer member kmin
Parameters
[in]thisThe !< ibounds instance

Definition at line 167 of file fms_diag_bbox.F90.

◆ rebase_input()

subroutine fms_diag_bbox_mod::rebase_input ( class (fmsdiagibounds_type), intent(inout)  bounds_in,
class (fmsdiagibounds_type), intent(in)  bounds,
integer, intent(in)  starting,
integer, intent(in)  ending,
integer, intent(in)  dim 
)

Rebase the input bounds for a given dimension based on the starting and ending indices of a subregion. This is for when blocking is used.

Parameters
[in,out]bounds_inBounds to rebase
[in]boundsOriginal indices (i.e is_in, ie_in, passed into diag_manager)
[in]startingStarting index of the dimension
[in]endingEnding index of the dimension
[in]dimDimension to update

The starting index is going to be either "starting" if only a section of the block is in the subregion or starting-boundsimin+1 if the whole section of the block is in the subregion.

The ending index is going to be either bounds_out%[]max if the whole section of the block is in the subregion or bounds%[]min + size of the subregion if only a section of the block is in the susbregion

Definition at line 497 of file fms_diag_bbox.F90.

◆ rebase_output()

subroutine fms_diag_bbox_mod::rebase_output ( class (fmsdiagibounds_type), intent(inout)  bounds_out,
integer, intent(in)  starting,
integer, intent(in)  ending,
integer, intent(in)  dim 
)

Rebase the ouput bounds for a given dimension based on the starting and ending indices of a subregion. This is for when blocking is used.

Parameters
[in,out]bounds_outBounds to rebase
[in]startingStarting index of the dimension
[in]endingEnding index of the dimension
[in]dimDimension to update

The starting index is going to be either "starting" if only a section of the block is in the subregion or bounds_out%[]min if the whole section of the block is in the subregion. The -starting+1 s needed so that indices start as 1 since the output buffer has indices 1:size of a subregion

The ending index is going to be either bounds_out%[]max if the whole section of the block is in the subregion or bounds_out%[]min + size of the subregion if only a section of the block is in the susbregion

Definition at line 468 of file fms_diag_bbox.F90.

◆ recondition_indices()

logical function, public fms_diag_bbox_mod::recondition_indices ( type(fmsdiagboundshalos_type), intent(inout)  indices,
class(*), dimension(:,:,:,:), intent(in)  field,
integer, intent(in), optional  is_in,
integer, intent(in), optional  js_in,
integer, intent(in), optional  ks_in,
integer, intent(in), optional  ie_in,
integer, intent(in), optional  je_in,
integer, intent(in), optional  ke_in,
character(len=*), intent(out), optional  err_msg 
)

Updates indices based on presence/absence of input indices is, js, ks, ie, je, and ke.

Returns
.false. if there is no error else .true.
Parameters
[in,out]indicesStores indices in order: (/is, js, ks, ie, je, ke, hi, fis, fie, hj, fjs, fje/)
[in]fieldDummy variable; only the sizes of the first 3 dimensions are used
[in]ke_inUser input indices
[out]err_msgError message to pass back to caller
Returns
Error flag

Definition at line 379 of file fms_diag_bbox.F90.

◆ reset_bounds()

subroutine fms_diag_bbox_mod::reset_bounds ( class (fmsdiagibounds_type), intent(inout), target  this,
integer, intent(in)  lower_val,
integer, intent(in)  upper_val 
)

Reset the instance bounding lower and upper bounds to lower_val and upper_val, respectively.

Parameters
[in,out]thisibounds instance
[in]lower_valvalue for the lower bounds in each dimension
[in]upper_valvalue for the upper bounds in each dimension

Definition at line 257 of file fms_diag_bbox.F90.

◆ reset_bounds_from_array_4d()

subroutine fms_diag_bbox_mod::reset_bounds_from_array_4d ( class (fmsdiagibounds_type), intent(inout)  this,
class(*), dimension(:,:,:,:), intent(in)  array 
)

Reset the instance bounding box with the bounds determined from the first three dimensions of the 5D "array" argument.

Parameters
[in,out]thisThe instance of the bounding box.
[in]arrayThe 4D input array.

Definition at line 347 of file fms_diag_bbox.F90.

◆ reset_bounds_from_array_5d()

subroutine fms_diag_bbox_mod::reset_bounds_from_array_5d ( class (fmsdiagibounds_type), intent(inout)  this,
class(*), dimension(:,:,:,:,:), intent(in)  array 
)

Reset the instance bounding box with the bounds determined from the first three dimensions of the 5D "array" argument.

Parameters
[in,out]thisThe instance of the bounding box.
[in]arrayThe 5D input array.

Definition at line 364 of file fms_diag_bbox.F90.

◆ set_bounds()

character(len=150) function fms_diag_bbox_mod::set_bounds ( class (fmsdiagibounds_type), intent(inout)  this,
class(*), dimension(:,:,:,:), intent(in)  field_data,
integer, intent(in)  lower_i,
integer, intent(in)  upper_i,
integer, intent(in)  lower_j,
integer, intent(in)  upper_j,
integer, intent(in)  lower_k,
integer, intent(in)  upper_k,
logical, intent(in)  has_halos 
)

Sets the bounds of a bounding region.

Returns
empty string if sucessful or error message if unsucessful
Parameters
[in,out]thisThe bounding box of the field
[in]field_dataField data
[in]lower_iLower i bound.
[in]upper_iUpper i bound.
[in]lower_jLower j bound.
[in]upper_jUpper j bound.
[in]lower_kLower k bound.
[in]upper_kUpper k bound.
[in]has_halos.true. if the field has halos
Returns
Error message to output

Definition at line 290 of file fms_diag_bbox.F90.

◆ update_bounds()

subroutine fms_diag_bbox_mod::update_bounds ( class (fmsdiagibounds_type), intent(inout)  this,
integer, intent(in)  lower_i,
integer, intent(in)  upper_i,
integer, intent(in)  lower_j,
integer, intent(in)  upper_j,
integer, intent(in)  lower_k,
integer, intent(in)  upper_k 
)

Update the the first three (normally x, y, and z) min and max boundaries (array indices) of the instance bounding box the six specified bounds values.

Parameters
[in,out]thisThe bounding box of the output field buffer inindex space.
[in]lower_iLower i bound.
[in]upper_iUpper i bound.
[in]lower_jLower j bound.
[in]upper_jUpper j bound.
[in]lower_kLower k bound.
[in]upper_kUpper k bound.

Definition at line 272 of file fms_diag_bbox.F90.

◆ update_index()

subroutine fms_diag_bbox_mod::update_index ( class (fmsdiagibounds_type), intent(inout)  this,
integer, intent(in)  starting_index,
integer, intent(in)  ending_index,
integer, intent(in)  dim,
logical, intent(in)  ignore_halos 
)

Updates the starting and ending index of a given dimension.

Parameters
[in,out]thisThe bounding box to update
[in]starting_indexStarting index to update to
[in]ending_indexEnding index to update to
[in]dimDimension to update
[in]ignore_halosIf .true. halos will be ignored i.e output buffers can ignore halos as they do not get updates. The indices of the Input buffers need to add the number of halos so math is done only on the compute domain

Definition at line 180 of file fms_diag_bbox.F90.