ExtData_IOBundleMod.F90 Source File


This file depends on

sourcefile~~extdata_iobundlemod.f90~~EfferentGraph sourcefile~extdata_iobundlemod.f90 ExtData_IOBundleMod.F90 sourcefile~base_base.f90 Base_Base.F90 sourcefile~extdata_iobundlemod.f90->sourcefile~base_base.f90 sourcefile~griddedio.f90 GriddedIO.F90 sourcefile~extdata_iobundlemod.f90->sourcefile~griddedio.f90 sourcefile~griddedioitem.f90 GriddedIOitem.F90 sourcefile~extdata_iobundlemod.f90->sourcefile~griddedioitem.f90 sourcefile~mapl_exceptionhandling.f90 MAPL_ExceptionHandling.F90 sourcefile~extdata_iobundlemod.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~tileio.f90 TileIO.F90 sourcefile~extdata_iobundlemod.f90->sourcefile~tileio.f90 sourcefile~constants.f90 Constants.F90 sourcefile~base_base.f90->sourcefile~constants.f90 sourcefile~keywordenforcer.f90 KeywordEnforcer.F90 sourcefile~base_base.f90->sourcefile~keywordenforcer.f90 sourcefile~mapl_range.f90 MAPL_Range.F90 sourcefile~base_base.f90->sourcefile~mapl_range.f90 sourcefile~maplgrid.f90 MaplGrid.F90 sourcefile~base_base.f90->sourcefile~maplgrid.f90 sourcefile~griddedio.f90->sourcefile~base_base.f90 sourcefile~griddedio.f90->sourcefile~griddedioitem.f90 sourcefile~griddedio.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~clientmanager.f90 ClientManager.F90 sourcefile~griddedio.f90->sourcefile~clientmanager.f90 sourcefile~griddedio.f90->sourcefile~constants.f90 sourcefile~datacollection.f90 DataCollection.F90 sourcefile~griddedio.f90->sourcefile~datacollection.f90 sourcefile~datacollectionmanager.f90 DataCollectionManager.F90 sourcefile~griddedio.f90->sourcefile~datacollectionmanager.f90 sourcefile~downbit.f90 DownBit.F90 sourcefile~griddedio.f90->sourcefile~downbit.f90 sourcefile~esmfl_mod.f90 ESMFL_Mod.F90 sourcefile~griddedio.f90->sourcefile~esmfl_mod.f90 sourcefile~filemetadatautilities.f90 FileMetadataUtilities.F90 sourcefile~griddedio.f90->sourcefile~filemetadatautilities.f90 sourcefile~mapl_abstractgridfactory.f90 MAPL_AbstractGridFactory.F90 sourcefile~griddedio.f90->sourcefile~mapl_abstractgridfactory.f90 sourcefile~mapl_abstractregridder.f90 MAPL_AbstractRegridder.F90 sourcefile~griddedio.f90->sourcefile~mapl_abstractregridder.f90 sourcefile~mapl_gridmanager.f90 MAPL_GridManager.F90 sourcefile~griddedio.f90->sourcefile~mapl_gridmanager.f90 sourcefile~mapl_timemethods.f90 MAPL_TimeMethods.F90 sourcefile~griddedio.f90->sourcefile~mapl_timemethods.f90 sourcefile~mapl_verticalmethods.f90 MAPL_VerticalMethods.F90 sourcefile~griddedio.f90->sourcefile~mapl_verticalmethods.f90 sourcefile~newregriddermanager.f90 NewRegridderManager.F90 sourcefile~griddedio.f90->sourcefile~newregriddermanager.f90 sourcefile~pfio.f90 pFIO.F90 sourcefile~griddedio.f90->sourcefile~pfio.f90 sourcefile~regridmethods.f90 RegridMethods.F90 sourcefile~griddedio.f90->sourcefile~regridmethods.f90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~mapl_exceptionhandling.f90->sourcefile~errorhandling.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~mapl_exceptionhandling.f90->sourcefile~mapl_throw.f90 sourcefile~tileio.f90->sourcefile~base_base.f90 sourcefile~tileio.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~fileioshared.f90 FileIOShared.F90 sourcefile~tileio.f90->sourcefile~fileioshared.f90 sourcefile~mapl_comms.f90 MAPL_Comms.F90 sourcefile~tileio.f90->sourcefile~mapl_comms.f90 sourcefile~tileio.f90->sourcefile~pfio.f90

Files dependent on this one

sourcefile~~extdata_iobundlemod.f90~~AfferentGraph sourcefile~extdata_iobundlemod.f90 ExtData_IOBundleMod.F90 sourcefile~extdata_iobundlevectormod.f90 ExtData_IOBundleVectorMod.F90 sourcefile~extdata_iobundlevectormod.f90->sourcefile~extdata_iobundlemod.f90 sourcefile~extdatagridcompng.f90 ExtDataGridCompNG.F90 sourcefile~extdatagridcompng.f90->sourcefile~extdata_iobundlemod.f90 sourcefile~extdatagridcompng.f90->sourcefile~extdata_iobundlevectormod.f90 sourcefile~extdatadrivergridcomp.f90 ExtDataDriverGridComp.F90 sourcefile~extdatadrivergridcomp.f90->sourcefile~extdatagridcompng.f90 sourcefile~mapl_capgridcomp.f90 MAPL_CapGridComp.F90 sourcefile~mapl_capgridcomp.f90->sourcefile~extdatagridcompng.f90 sourcefile~comp_testing_driver.f90 Comp_Testing_Driver.F90 sourcefile~comp_testing_driver.f90->sourcefile~mapl_capgridcomp.f90 sourcefile~extdatadriver.f90 ExtDataDriver.F90 sourcefile~extdatadriver.f90->sourcefile~extdatadrivergridcomp.f90 sourcefile~extdatadrivermod.f90 ExtDataDriverMod.F90 sourcefile~extdatadriver.f90->sourcefile~extdatadrivermod.f90 sourcefile~extdatadrivermod.f90->sourcefile~extdatadrivergridcomp.f90 sourcefile~mapl_cap.f90 MAPL_Cap.F90 sourcefile~mapl_cap.f90->sourcefile~mapl_capgridcomp.f90 sourcefile~mapl_gridcomps.f90 MAPL_GridComps.F90 sourcefile~mapl_gridcomps.f90->sourcefile~mapl_cap.f90 sourcefile~mapl_nuopcwrappermod.f90 MAPL_NUOPCWrapperMod.F90 sourcefile~mapl_nuopcwrappermod.f90->sourcefile~mapl_cap.f90

Source Code

!#include "MAPL_Exceptions.h"
#include "MAPL_Generic.h"
#include "unused_dummy.H"

!-------------------------------------------------------------------------
!     NASA/GSFC, Global Modeling and Assimilation Office, Code 610.1     !
!-------------------------------------------------------------------------

module MAPL_ExtDataNG_IOBundleMod
  use ESMF
  use MAPL_BaseMod
  use MAPL_GriddedIOMod
  use MAPL_TileIOMod
  use MAPL_ExceptionHandling
  use MAPL_GriddedIOItemMod
  use MAPL_GriddedIOItemVectorMod

  public :: ExtDataNG_IOBundle

  type ExtDataNG_IOBundle
     type (MAPL_GriddedIO) :: grid_io
     type (MAPL_TileIO) :: tile_io
     type (ESMF_FieldBundle) :: pbundle
     character(:), allocatable :: template
     integer :: regrid_method
     
     integer :: bracket_side
     integer :: entry_index
     character(:), allocatable :: file_name
     integer :: time_index
     integer :: fraction
     integer :: metadata_coll_id
     integer :: server_coll_id
     type(GriddedIOItemVector) :: items
     logical :: on_tiles
     
   contains
     
     procedure :: clean
     procedure :: make_io
     procedure :: assign
     generic :: assignment(=) => assign
  end type ExtDataNG_IOBundle
  

  interface ExtDataNG_IOBundle
     module procedure new_ExtDataNG_IOBundle
  end interface ExtDataNG_IOBundle

contains

  function new_ExtDataNG_IOBundle(bracket_side, entry_index, file_name, time_index, regrid_method, fraction, template, metadata_coll_id,server_coll_id,items, on_tiles, rc) result(io_bundle)
    type (ExtDataNG_IOBundle) :: io_bundle

    integer, intent(in) :: bracket_side
    integer, intent(in) :: entry_index
    character(len=*), intent(in) :: file_name
    integer, intent(in) :: time_index
    integer, intent(in) :: regrid_method
    integer, intent(in) :: fraction
    character(len=*), intent(in) :: template
    integer, intent(in) :: metadata_coll_id
    integer, intent(in) :: server_coll_id
    type(GriddedIOItemVector), target :: items
    logical, intent(in) :: on_tiles
    integer, optional, intent(out) :: rc

    io_bundle%bracket_side = bracket_side
    io_bundle%entry_index = entry_index
    io_bundle%file_name = file_name
    io_bundle%time_index = time_index
    io_bundle%regrid_method = regrid_method
    io_bundle%fraction = fraction
    io_bundle%template = trim(template)

    io_bundle%metadata_coll_id=metadata_coll_id
    io_bundle%server_coll_id=server_coll_id
    io_bundle%items=items
    io_bundle%on_tiles = on_tiles

    _RETURN(ESMF_SUCCESS)
  end function new_ExtDataNG_IOBundle


  subroutine clean(this, rc)
    class (ExtDataNG_IOBundle), intent(inout) :: this
    integer, optional, intent(out) :: rc

    integer :: status
    call ESMF_FieldBundleDestroy(this%pbundle, noGarbage=.true.,rc=status)
    _VERIFY(status)
    
     _RETURN(ESMF_SUCCESS)

  end subroutine clean


  subroutine make_io(this, rc)
    class (ExtDataNG_IOBundle), target, intent(inout) :: this
    integer, optional, intent(out) :: rc

     if (this%on_tiles) then
        this%tile_io = MAPL_TileIO(this%pbundle,this%server_coll_id)
     else
        this%grid_io = MAPL_GriddedIO(output_bundle=this%pbundle,regrid_method=this%regrid_method, &
                           read_collection_id=this%server_coll_id, &
                           metadata_collection_id = this%metadata_coll_id, fraction = this%fraction, &
                           items=this%items)
     end if

     _RETURN(ESMF_SUCCESS)
   end subroutine make_io

   subroutine assign(to,from)
      class(ExtDataNG_IOBundle), intent(out) :: to
      type(ExtDataNG_IOBundle), intent(in) :: from
    
    to%bracket_side = from%bracket_side
    to%entry_index = from%entry_index
    to%file_name = from%file_name
    to%time_index = from%time_index
    to%regrid_method = from%regrid_method
    to%fraction = from%fraction
    to%template = from%template

    to%metadata_coll_id=from%metadata_coll_id
    to%server_coll_id=from%server_coll_id
    to%items=from%items 
    to%pbundle=from%pbundle 
    to%grid_io=from%grid_io 
    to%tile_io=from%tile_io
    to%on_tiles=from%on_tiles
 
   end subroutine assign

end module MAPL_ExtDataNG_IOBundleMod