StationSampler Derived Type

type, public :: StationSampler


Inherits

type~~stationsampler~~InheritsGraph type~stationsampler StationSampler ESMF_FieldBundle ESMF_FieldBundle type~stationsampler->ESMF_FieldBundle bundle ESMF_LocStream ESMF_LocStream type~stationsampler->ESMF_LocStream LS_rt, LS_chunk, LS_ds ESMF_RouteHandle ESMF_RouteHandle type~stationsampler->ESMF_RouteHandle RH type~filemetadata FileMetadata type~stationsampler->type~filemetadata metadata type~griddedioitemvector GriddedIOitemVector type~stationsampler->type~griddedioitemvector items type~locstreamfactory LocStreamFactory type~stationsampler->type~locstreamfactory LSF type~locstreamregridder LocstreamRegridder type~stationsampler->type~locstreamregridder regridder type~mapl_metacomp MAPL_MetaComp type~stationsampler->type~mapl_metacomp GENSTATE type~netcdf4_fileformatter NetCDF4_FileFormatter type~stationsampler->type~netcdf4_fileformatter formatter type~timedata timeData type~stationsampler->type~timedata time_info type~verticaldata verticalData type~stationsampler->type~verticaldata vdata

Inherited by

type~~stationsampler~~InheritedByGraph type~stationsampler StationSampler type~historycollection~2 HistoryCollection type~historycollection~2->type~stationsampler station_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

Constructor

public interface StationSampler

  • private function new_StationSampler_readfile(bundle, filename, nskip_line, GENSTATE, rc) result(sampler)

    write(6,) ‘i=’, i write(6,) ‘line=’, trim(line)

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_FieldBundle), intent(in) :: bundle
    character(len=*), intent(in) :: filename
    integer, intent(in), optional :: nskip_line
    type(MAPL_MetaComp), intent(in), optional, pointer :: GENSTATE
    integer, intent(out), optional :: rc

    Return Value type(StationSampler)


Type-Bound Procedures

procedure, public :: add_metadata_route_handle

  • private subroutine add_metadata_route_handle(this, items, bundle, timeInfo, vdata, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(StationSampler), intent(inout) :: this
    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
    integer, intent(out), optional :: rc

procedure, public :: append_file

  • private subroutine append_file(this, current_time, rc)

    if (mapl_am_i_root()) write(6,*) ‘item%xname=’, trim(item%xname)

    Arguments

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

procedure, public :: close_file_handle

  • private subroutine close_file_handle(this, rc)

    Arguments

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

procedure, public :: compute_time_for_current

  • private function compute_time_for_current(this, current_time, rc) result(rtimes)

    Arguments

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

    Return Value real(kind=ESMF_KIND_R8), allocatable, (:)

procedure, public :: create_file_handle

  • private subroutine create_file_handle(this, filename, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(StationSampler), intent(inout) :: this
    character(len=*), intent(inout) :: filename
    integer, intent(out), optional :: rc

procedure, public :: create_variable => create_metadata_variable

  • private subroutine create_metadata_variable(this, vname, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(StationSampler), intent(inout) :: this
    character(len=*), intent(in) :: vname
    integer, intent(out), optional :: rc

procedure, public :: get_file_start_time

  • private subroutine get_file_start_time(this, start_time, time_units, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(StationSampler), intent(inout) :: this
    type(ESMF_Time), intent(inout) :: start_time
    character(len=*), intent(inout) :: time_units
    integer, intent(out), optional :: rc

Source Code

  type :: StationSampler
     private
     type(LocStreamFactory)   :: LSF
     type(ESMF_LocStream)     :: LS_rt
     type(ESMF_LocStream)     :: LS_chunk
     type(ESMF_LocStream)     :: LS_ds
     type(LocstreamRegridder) :: regridder
     type(ESMF_RouteHandle)   :: RH
     type(GriddedIOitemVector) :: items
     logical :: do_vertical_regrid
     logical :: level_by_level
     type(MAPL_MetaComp), pointer   :: GENSTATE

     integer                  :: nstation
     integer, allocatable :: station_id(:)
     character(len=ESMF_MAXSTR), allocatable :: station_name(:)
     character(len=ESMF_MAXSTR), allocatable :: station_fullname(:)
     character(len=ESMF_MAXSTR) ::  index_name_x
     real(kind=REAL64), allocatable :: lons(:)
     real(kind=REAL64), allocatable :: lats(:)
     real(kind=REAL64), allocatable :: elevs(:)
     type(ESMF_FieldBundle)         :: bundle
     type(FileMetadata)             :: metadata
     type(NetCDF4_FileFormatter)    :: formatter
     type(VerticalData)             :: vdata
     type(TimeData)                 :: time_info
     character(LEN=ESMF_MAXPATHLEN) :: ofile
     integer                        :: obs_written

   contains
     procedure                      :: add_metadata_route_handle
     procedure                      :: create_file_handle
     procedure                      :: close_file_handle
     procedure                      :: append_file
     procedure                      :: get_file_start_time
     procedure                      :: compute_time_for_current
     procedure                      :: create_variable => create_metadata_variable
  end type StationSampler