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 3774 of file MOM_diag_mediator.F90.

3774  real, dimension(:,:), pointer :: locfield !< Input array pointer
3775  real, dimension(:,:), allocatable, intent(inout) :: locfield_dsamp !< Output (downsampled) array
3776  type(diag_ctrl), intent(in) :: diag_CS !< Structure used to regulate diagnostic output
3777  type(diag_type), intent(in) :: diag !< A structure describing the diagnostic to post
3778  integer, intent(in) :: dl !< Level of down sampling
3779  integer, intent(inout) :: isv !< i-start index for diagnostics
3780  integer, intent(inout) :: iev !< i-end index for diagnostics
3781  integer, intent(inout) :: jsv !< j-start index for diagnostics
3782  integer, intent(inout) :: jev !< j-end index for diagnostics
3783  real, optional,target, intent(in) :: mask(:,:) !< If present, use this real array as the data mask.
3784  ! Locals
3785  real, dimension(:,:), pointer :: locmask
3786  integer :: f1,f2,isv_o,jsv_o
3787 
3788  locmask => null()
3789  !Get the correct indices corresponding to input field
3790  !Shape of the input diag field
3791  f1=size(locfield,1)
3792  f2=size(locfield,2)
3793  !Save the extents of the original (fine) domain
3794  isv_o=isv;jsv_o=jsv
3795  !Get the shape of the downsampled field and overwrite isv,iev,jsv,jev with them
3796  call downsample_diag_indices_get(f1,f2, dl, diag_cs,isv,iev,jsv,jev)
3797  !Set the non-downsampled mask, it must be associated and initialized
3798  if (present(mask)) then
3799  locmask => mask
3800  elseif (associated(diag%axes%mask2d)) then
3801  locmask => diag%axes%mask2d
3802  else
3803  call mom_error(fatal, "downsample_diag_field_2d: Cannot downsample without a mask!!! ")
3804  endif
3805 
3806  call downsample_field(locfield, locfield_dsamp, dl, diag%xyz_method, locmask, diag_cs,diag, &
3807  isv_o,jsv_o,isv,iev,jsv,jev)
3808 

◆ 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 3733 of file MOM_diag_mediator.F90.

3733  real, dimension(:,:,:), pointer :: locfield !< Input array pointer
3734  real, dimension(:,:,:), allocatable, intent(inout) :: locfield_dsamp !< Output (downsampled) array
3735  type(diag_ctrl), intent(in) :: diag_CS !< Structure used to regulate diagnostic output
3736  type(diag_type), intent(in) :: diag !< A structure describing the diagnostic to post
3737  integer, intent(in) :: dl !< Level of down sampling
3738  integer, intent(inout) :: isv !< i-start index for diagnostics
3739  integer, intent(inout) :: iev !< i-end index for diagnostics
3740  integer, intent(inout) :: jsv !< j-start index for diagnostics
3741  integer, intent(inout) :: jev !< j-end index for diagnostics
3742  real, optional,target, intent(in) :: mask(:,:,:) !< If present, use this real array as the data mask.
3743  ! Locals
3744  real, dimension(:,:,:), pointer :: locmask
3745  integer :: f1,f2,isv_o,jsv_o
3746 
3747  locmask => null()
3748  !Get the correct indices corresponding to input field
3749  !Shape of the input diag field
3750  f1=size(locfield,1)
3751  f2=size(locfield,2)
3752  !Save the extents of the original (fine) domain
3753  isv_o=isv;jsv_o=jsv
3754  !Get the shape of the downsampled field and overwrite isv,iev,jsv,jev with them
3755  call downsample_diag_indices_get(f1,f2, dl, diag_cs,isv,iev,jsv,jev)
3756  !Set the non-downsampled mask, it must be associated and initialized
3757  if (present(mask)) then
3758  locmask => mask
3759  elseif (associated(diag%axes%mask3d)) then
3760  locmask => diag%axes%mask3d
3761  else
3762  call mom_error(fatal, "downsample_diag_field_3d: Cannot downsample without a mask!!! ")
3763  endif
3764 
3765  call downsample_field(locfield, locfield_dsamp, dl, diag%xyz_method, locmask, diag_cs, diag, &
3766  isv_o,jsv_o,isv,iev,jsv,jev)
3767 

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