MaskSampler Derived Type

type, public :: MaskSampler


Inherits

type~~masksampler~~InheritsGraph type~masksampler MaskSampler ESMF_Clock ESMF_Clock type~masksampler->ESMF_Clock clock ESMF_FieldBundle ESMF_FieldBundle type~masksampler->ESMF_FieldBundle bundle ESMF_Time ESMF_Time type~masksampler->ESMF_Time RingTime, obsfile_start_time, obsfile_end_time ESMF_TimeInterval ESMF_TimeInterval type~masksampler->ESMF_TimeInterval epoch_frequency, obsfile_interval type~filemetadata FileMetadata type~masksampler->type~filemetadata metadata type~griddedioitemvector GriddedIOitemVector type~masksampler->type~griddedioitemvector items type~mapl_metacomp MAPL_MetaComp type~masksampler->type~mapl_metacomp GENSTATE type~netcdf4_fileformatter NetCDF4_FileFormatter type~masksampler->type~netcdf4_fileformatter formatter type~timedata timeData type~masksampler->type~timedata timeinfo type~var2d_unit var2d_unit type~masksampler->type~var2d_unit var2d type~var3d_unit var3d_unit type~masksampler->type~var3d_unit var3d type~verticaldata verticalData type~masksampler->type~verticaldata vdata

Inherited by

type~~masksampler~~InheritedByGraph type~masksampler MaskSampler type~historycollection~2 HistoryCollection type~historycollection~2->type~masksampler mask_sampler type~historycollectionvectoriterator~2 HistoryCollectionVectorIterator type~historycollectionvectoriterator~2->type~historycollection~2 elements type~historycollectionvectorriterator~2 HistoryCollectionVectorRIterator type~historycollectionvectorriterator~2->type~historycollection~2 elements type~historycollectionvector~2 HistoryCollectionVector type~historycollectionvector~2->type~historycollection~2 elements

Components

Type Visibility Attributes Name Initial
character(len=ESMF_MAXSTR), public :: att_name_proj
character(len=ESMF_MAXSTR), public :: grid_file_name
character(len=ESMF_MAXSTR), public :: index_name_lat
character(len=ESMF_MAXSTR), public :: index_name_loc
character(len=ESMF_MAXSTR), public :: index_name_location
character(len=ESMF_MAXSTR), public :: index_name_lon
character(len=ESMF_MAXSTR), public :: index_name_x
character(len=ESMF_MAXSTR), public :: index_name_y
character(len=ESMF_MAXSTR), public :: ofile
character(len=ESMF_MAXSTR), public :: var_name_lat
character(len=ESMF_MAXSTR), public :: var_name_lon
character(len=ESMF_MAXSTR), public :: var_name_proj
character(len=ESMF_MAXSTR), public :: var_name_time
character(len=ESMF_MAXSTR), public :: var_name_x
character(len=ESMF_MAXSTR), public :: var_name_y
integer(kind=ESMF_KIND_I8), public :: epoch_index(2)
integer, public, allocatable :: displs(:)
integer, public :: epoch
integer, public, allocatable :: global_count(:)
integer, public, allocatable :: global_start(:)
integer, public :: i1
integer, public :: in
integer, public, allocatable :: index_mask(:,:)
integer, public, allocatable :: local_start(:)
integer, public :: nobs
integer, public :: nobs_dur
integer, public :: nobs_dur_sum
integer, public :: npt_mask
integer, public :: npt_mask_tot
integer, public :: obs_written
integer, public :: obsfile_Te_index
integer, public :: obsfile_Ts_index
integer, public, allocatable :: recvcounts(:)
integer, public :: thin_factor
integer, public :: tmax
integer, public :: write_collection_id
integer, public :: xdim_true
integer, public :: ydim_true
logical, public :: do_vertical_regrid
logical, public :: is_valid
logical, public :: itemOrderAlphabetical = .true.
logical, public :: use_pfio
real(kind=ESMF_KIND_R8), public, pointer :: obsTime(:)
real(kind=ESMF_KIND_R8), public, allocatable :: t_alongtrack(:)
real(kind=REAL32), public, allocatable :: lats_deg(:)
real(kind=REAL32), public, allocatable :: lons_deg(:)
real(kind=REAL32), public :: rtime
real(kind=REAL64), public, allocatable :: lats(:)
real(kind=REAL64), public, allocatable :: lons(:)
real, public, allocatable :: array_scalar_1d(:)
real, public, allocatable :: array_scalar_2d(:,:)
real, public, allocatable :: array_scalar_3d(:,:,:)
type(ESMF_Clock), public :: clock
type(ESMF_Time), public :: RingTime
type(ESMF_Time), public :: obsfile_end_time
type(ESMF_Time), public :: obsfile_start_time
type(ESMF_TimeInterval), public :: epoch_frequency
type(ESMF_TimeInterval), public :: obsfile_interval
type(ESMF_FieldBundle), public :: bundle
type(FileMetadata), public, allocatable :: metadata
type(GriddedIOitemVector), public :: items
type(MAPL_MetaComp), public, pointer :: GENSTATE
type(NetCDF4_FileFormatter), public :: formatter
type(timeData), public :: timeinfo
type(var2d_unit), public, allocatable :: var2d(:)
type(var3d_unit), public, allocatable :: var3d(:)
type(verticalData), public :: vdata

Constructor

public interface MaskSampler

  • private interface MaskSampler_from_config()

    Arguments

    None

Type-Bound Procedures

procedure, public :: alphabatize_variables

  • interface

    private module subroutine alphabatize_variables(this, nFixedVars, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    integer, intent(in) :: nFixedVars
    integer, intent(out), optional :: rc

procedure, public :: compute_time_for_current

  • interface

    private module function compute_time_for_current(this, current_time, rc) result(rtime)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    type(ESMF_Time), intent(in) :: current_time
    integer, intent(out), optional :: rc

    Return Value real(kind=ESMF_KIND_R8)

procedure, public :: create_Geosat_grid_find_mask

  • interface

    private module subroutine create_Geosat_grid_find_mask(this, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    integer, intent(out), optional :: rc

procedure, public :: create_metadata

  • interface

    private module subroutine create_metadata(this, global_attributes, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    type(StringStringMap), intent(in), target :: global_attributes
    integer, intent(out), optional :: rc

procedure, public :: finalize

  • interface

    private module subroutine finalize(this, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    integer, intent(out), optional :: rc

procedure, public :: initialize

  • interface

    private module subroutine initialize(this, duration, frequency, items, bundle, timeInfo, vdata, global_attributes, reinitialize, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    integer, intent(in) :: duration
    integer, intent(in) :: frequency
    type(GriddedIOitemVector), intent(inout), optional :: items
    type(ESMF_FieldBundle), intent(inout), optional :: bundle
    type(timeData), intent(inout), optional :: timeInfo
    type(verticalData), intent(inout), optional :: vdata
    type(StringStringMap), intent(in), optional, target :: global_attributes
    logical, intent(in), optional :: reinitialize
    integer, intent(out), optional :: rc

procedure, public :: modifytime => modifyTime

  • interface

    private module subroutine modifyTime(this, oClients, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    type(ClientManager), intent(inout), optional :: oClients
    integer, intent(out), optional :: rc

procedure, public :: regrid_append_file

  • interface

    private module subroutine regrid_append_file(this, current_time, filename, oClients, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    type(ESMF_Time), intent(inout) :: current_time
    character(len=*), intent(in) :: filename
    type(ClientManager), intent(inout), optional, target :: oClients
    integer, intent(out), optional :: rc

procedure, public :: set_param

  • interface

    private module subroutine set_param(this, deflation, quantize_algorithm, quantize_level, chunking, nbits_to_keep, regrid_method, itemOrder, write_collection_id, regrid_hints, oClients, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    integer, intent(in), optional :: deflation
    integer, intent(in), optional :: quantize_algorithm
    integer, intent(in), optional :: quantize_level
    integer, intent(in), optional :: chunking(:)
    integer, intent(in), optional :: nbits_to_keep
    integer, intent(in), optional :: regrid_method
    logical, intent(in), optional :: itemOrder
    integer, intent(in), optional :: write_collection_id
    integer, intent(in), optional :: regrid_hints
    type(ClientManager), intent(in), optional :: oClients
    integer, intent(out), optional :: rc

procedure, public :: stage2dlatlon

  • interface

    private module subroutine stage2dlatlon(this, fileName, oClients, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MaskSampler), intent(inout) :: this
    character(len=*), intent(in) :: fileName
    type(ClientManager), intent(inout), optional, target :: oClients
    integer, intent(out), optional :: rc

Source Code

  type :: MaskSampler
     character(len=ESMF_MAXSTR) :: grid_file_name
     !     we need on each PET
     !     npt_mask, index_mask(1:2,npt_mask)=[i,j]
     !
     integer :: npt_mask
     integer :: npt_mask_tot
     integer :: i1, in
     integer, allocatable :: index_mask(:,:)
     type(ESMF_FieldBundle) :: bundle
     type(GriddedIOitemVector) :: items
     type(VerticalData) :: vdata
     type(var2d_unit), allocatable :: var2d(:)
     type(var3d_unit), allocatable :: var3d(:)
     logical :: do_vertical_regrid
     type(TimeData)           :: timeinfo
     type(ESMF_Clock)         :: clock
     type(ESMF_Time)          :: RingTime
     type(ESMF_TimeInterval)  :: epoch_frequency
     type(FileMetadata), allocatable, public:: metadata
     type(NetCDF4_FileFormatter) :: formatter
     character(len=ESMF_MAXSTR)  :: ofile
     integer :: write_collection_id
     logical :: use_pfio
     !
     integer                        :: nobs
     integer                        :: obs_written
     character(len=ESMF_MAXSTR)     :: index_name_x
     character(len=ESMF_MAXSTR)     :: index_name_y
     character(len=ESMF_MAXSTR)     :: index_name_location
     character(len=ESMF_MAXSTR)     :: index_name_lon
     character(len=ESMF_MAXSTR)     :: index_name_lat
     character(len=ESMF_MAXSTR)     :: index_name_loc
     character(len=ESMF_MAXSTR)     :: var_name_time
     character(len=ESMF_MAXSTR)     :: var_name_lat
     character(len=ESMF_MAXSTR)     :: var_name_lon
     character(len=ESMF_MAXSTR)     :: var_name_x
     character(len=ESMF_MAXSTR)     :: var_name_y
     character(len=ESMF_MAXSTR)     :: var_name_proj
     character(len=ESMF_MAXSTR)     :: att_name_proj

     integer :: xdim_true
     integer :: ydim_true
     integer :: thin_factor

     integer                        :: epoch        ! unit: second
     integer(kind=ESMF_KIND_I8)     :: epoch_index(2)
     real(kind=REAL64), allocatable :: lons(:)
     real(kind=REAL64), allocatable :: lats(:)
     real(kind=REAL32), allocatable :: lons_deg(:)
     real(kind=REAL32), allocatable :: lats_deg(:)

     real(kind=REAL32) :: rtime
     integer, allocatable :: recvcounts(:)
     integer, allocatable :: displs(:)
     type(MAPL_MetaComp), pointer :: GENSTATE

     integer, allocatable :: local_start(:)
     integer, allocatable :: global_start(:)
     integer, allocatable :: global_count(:)

     real, allocatable :: array_scalar_1d(:)
     real, allocatable :: array_scalar_2d(:,:)
     real, allocatable :: array_scalar_3d(:,:,:)
     logical :: itemOrderAlphabetical = .true.

     integer :: tmax     ! duration / freq

     real(kind=ESMF_KIND_R8), pointer:: obsTime(:)
     real(kind=ESMF_KIND_R8), allocatable:: t_alongtrack(:)
     integer                        :: nobs_dur
     integer                        :: nobs_dur_sum
     type(ESMF_Time)                :: obsfile_start_time   ! user specify
     type(ESMF_Time)                :: obsfile_end_time
     type(ESMF_TimeInterval)        :: obsfile_interval
     integer                        :: obsfile_Ts_index     ! for epoch
     integer                        :: obsfile_Te_index
     logical                        :: is_valid
   contains

     procedure :: initialize
     procedure :: finalize
     procedure :: create_metadata
     procedure :: regrid_append_file
     procedure :: create_Geosat_grid_find_mask
     procedure :: compute_time_for_current
     procedure :: set_param
     procedure :: stage2dlatlon
     procedure :: modifytime
     procedure :: alphabatize_variables
  end type MaskSampler