MOM6
mom_diag_mediator::downsample_diag_field Interface Reference

Detailed Description

Down sample a diagnostic field.

Definition at line 85 of file MOM_diag_mediator.F90.

Private functions

subroutine downsample_diag_field_2d (locfield, locfield_dsamp, dl, diag_cs, diag, isv, iev, jsv, jev, mask)
 This subroutine allocates and computes a downsampled array from an input array It also determines the diagnostics-compurte indices for the downsampled array 2d interface. More...
 
subroutine downsample_diag_field_3d (locfield, locfield_dsamp, dl, diag_cs, diag, isv, iev, jsv, jev, mask)
 This subroutine allocates and computes a downsampled array from an input array It also determines the diagnostics-compurte indices for the downsampled array 3d interface. More...
 

Functions and subroutines

◆ downsample_diag_field_2d()

subroutine mom_diag_mediator::downsample_diag_field::downsample_diag_field_2d ( real, dimension(:,:), pointer  locfield,
real, dimension(:,:), intent(inout), allocatable  locfield_dsamp,
integer, intent(in)  dl,
type(diag_ctrl), intent(in)  diag_cs,
type(diag_type), intent(in)  diag,
integer, intent(inout)  isv,
integer, intent(inout)  iev,
integer, intent(inout)  jsv,
integer, intent(inout)  jev,
real, dimension(:,:), intent(in), optional, target  mask 
)
private

This subroutine allocates and computes a downsampled array from an input array It also determines the diagnostics-compurte indices for the downsampled array 2d interface.

Parameters
locfieldInput array pointer
[in,out]locfield_dsampOutput (downsampled) array
[in]diag_csStructure used to regulate diagnostic output
[in]diagA structure describing the diagnostic to post
[in]dlLevel of down sampling
[in,out]isvi-start index for diagnostics
[in,out]ievi-end index for diagnostics
[in,out]jsvj-start index for diagnostics
[in,out]jevj-end index for diagnostics
[in]maskIf present, use this real array as the data mask.

Definition at line 3752 of file MOM_diag_mediator.F90.

3752  real, dimension(:,:), pointer :: locfield !< Input array pointer
3753  real, dimension(:,:), allocatable, intent(inout) :: locfield_dsamp !< Output (downsampled) array
3754  type(diag_ctrl), intent(in) :: diag_CS !< Structure used to regulate diagnostic output
3755  type(diag_type), intent(in) :: diag !< A structure describing the diagnostic to post
3756  integer, intent(in) :: dl !< Level of down sampling
3757  integer, intent(inout) :: isv !< i-start index for diagnostics
3758  integer, intent(inout) :: iev !< i-end index for diagnostics
3759  integer, intent(inout) :: jsv !< j-start index for diagnostics
3760  integer, intent(inout) :: jev !< j-end index for diagnostics
3761  real, optional,target, intent(in) :: mask(:,:) !< If present, use this real array as the data mask.
3762  ! Locals
3763  real, dimension(:,:), pointer :: locmask
3764  integer :: f1,f2,isv_o,jsv_o
3765 
3766  locmask => null()
3767  !Get the correct indices corresponding to input field
3768  !Shape of the input diag field
3769  f1=size(locfield,1)
3770  f2=size(locfield,2)
3771  !Save the extents of the original (fine) domain
3772  isv_o=isv;jsv_o=jsv
3773  !Get the shape of the downsampled field and overwrite isv,iev,jsv,jev with them
3774  call downsample_diag_indices_get(f1,f2, dl, diag_cs,isv,iev,jsv,jev)
3775  !Set the non-downsampled mask, it must be associated and initialized
3776  if (present(mask)) then
3777  locmask => mask
3778  elseif (associated(diag%axes%mask2d)) then
3779  locmask => diag%axes%mask2d
3780  else
3781  call mom_error(fatal, "downsample_diag_field_2d: Cannot downsample without a mask!!! ")
3782  endif
3783 
3784  call downsample_field(locfield, locfield_dsamp, dl, diag%xyz_method, locmask, diag_cs,diag, &
3785  isv_o,jsv_o,isv,iev,jsv,jev)
3786 

◆ downsample_diag_field_3d()

subroutine mom_diag_mediator::downsample_diag_field::downsample_diag_field_3d ( real, dimension(:,:,:), pointer  locfield,
real, dimension(:,:,:), intent(inout), allocatable  locfield_dsamp,
integer, intent(in)  dl,
type(diag_ctrl), intent(in)  diag_cs,
type(diag_type), intent(in)  diag,
integer, intent(inout)  isv,
integer, intent(inout)  iev,
integer, intent(inout)  jsv,
integer, intent(inout)  jev,
real, dimension(:,:,:), intent(in), optional, target  mask 
)
private

This subroutine allocates and computes a downsampled array from an input array It also determines the diagnostics-compurte indices for the downsampled array 3d interface.

Parameters
locfieldInput array pointer
[in,out]locfield_dsampOutput (downsampled) array
[in]diag_csStructure used to regulate diagnostic output
[in]diagA structure describing the diagnostic to post
[in]dlLevel of down sampling
[in,out]isvi-start index for diagnostics
[in,out]ievi-end index for diagnostics
[in,out]jsvj-start index for diagnostics
[in,out]jevj-end index for diagnostics
[in]maskIf present, use this real array as the data mask.

Definition at line 3711 of file MOM_diag_mediator.F90.

3711  real, dimension(:,:,:), pointer :: locfield !< Input array pointer
3712  real, dimension(:,:,:), allocatable, intent(inout) :: locfield_dsamp !< Output (downsampled) array
3713  type(diag_ctrl), intent(in) :: diag_CS !< Structure used to regulate diagnostic output
3714  type(diag_type), intent(in) :: diag !< A structure describing the diagnostic to post
3715  integer, intent(in) :: dl !< Level of down sampling
3716  integer, intent(inout) :: isv !< i-start index for diagnostics
3717  integer, intent(inout) :: iev !< i-end index for diagnostics
3718  integer, intent(inout) :: jsv !< j-start index for diagnostics
3719  integer, intent(inout) :: jev !< j-end index for diagnostics
3720  real, optional,target, intent(in) :: mask(:,:,:) !< If present, use this real array as the data mask.
3721  ! Locals
3722  real, dimension(:,:,:), pointer :: locmask
3723  integer :: f1,f2,isv_o,jsv_o
3724 
3725  locmask => null()
3726  !Get the correct indices corresponding to input field
3727  !Shape of the input diag field
3728  f1=size(locfield,1)
3729  f2=size(locfield,2)
3730  !Save the extents of the original (fine) domain
3731  isv_o=isv;jsv_o=jsv
3732  !Get the shape of the downsampled field and overwrite isv,iev,jsv,jev with them
3733  call downsample_diag_indices_get(f1,f2, dl, diag_cs,isv,iev,jsv,jev)
3734  !Set the non-downsampled mask, it must be associated and initialized
3735  if (present(mask)) then
3736  locmask => mask
3737  elseif (associated(diag%axes%mask3d)) then
3738  locmask => diag%axes%mask3d
3739  else
3740  call mom_error(fatal, "downsample_diag_field_3d: Cannot downsample without a mask!!! ")
3741  endif
3742 
3743  call downsample_field(locfield, locfield_dsamp, dl, diag%xyz_method, locmask, diag_cs, diag, &
3744  isv_o,jsv_o,isv,iev,jsv,jev)
3745 

The documentation for this interface was generated from the following file: