MAPL_LocStreamGet Subroutine

public subroutine MAPL_LocStreamGet(LocStream, NT_LOCAL, nt_global, TILETYPE, TILEKIND, TILELONS, TILELATS, TILEAREA, TILEGRID, GRIDIM, GRIDJM, GRIDNAMES, ATTACHEDGRID, LOCAL_ID, local_i, local_j, RC)

Arguments

Type IntentOptional Attributes Name
type(MAPL_LocStream), intent(in) :: LocStream
integer, intent(out), optional :: NT_LOCAL
integer, intent(out), optional :: nt_global
integer, optional, pointer :: TILETYPE(:)
integer, optional, pointer :: TILEKIND(:)
real, optional, pointer :: TILELONS(:)
real, optional, pointer :: TILELATS(:)
real, optional, pointer :: TILEAREA(:)
type(ESMF_Grid), intent(out), optional :: TILEGRID
integer, optional, pointer :: GRIDIM(:)
integer, optional, pointer :: GRIDJM(:)
character(len=*), optional, pointer :: GRIDNAMES(:)
type(ESMF_Grid), intent(out), optional :: ATTACHEDGRID
integer, optional, pointer :: LOCAL_ID(:)
integer, intent(out), optional, pointer :: local_i(:)
integer, intent(out), optional, pointer :: local_j(:)
integer, intent(out), optional :: RC

Calls

proc~~mapl_locstreamget~~CallsGraph proc~mapl_locstreamget MAPL_LocStreamGet interface~mapl_assert MAPL_Assert proc~mapl_locstreamget->interface~mapl_assert proc~mapl_return MAPL_Return proc~mapl_locstreamget->proc~mapl_return at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception

Called by

proc~~mapl_locstreamget~~CalledByGraph proc~mapl_locstreamget MAPL_LocStreamGet proc~mapl_esmfstatereadfromfile MAPL_ESMFStateReadFromFile proc~mapl_esmfstatereadfromfile->proc~mapl_locstreamget proc~mapl_genericfinalize MAPL_GenericFinalize proc~mapl_genericfinalize->proc~mapl_locstreamget proc~mapl_genericinitialize MAPL_GenericInitialize proc~mapl_genericinitialize->proc~mapl_locstreamget proc~mapl_genericinitialize->proc~mapl_esmfstatereadfromfile proc~mapl_genericrecord MAPL_GenericRecord proc~mapl_genericrecord->proc~mapl_locstreamget proc~mapl_genericstatesave MAPL_GenericStateSave proc~mapl_genericstatesave->proc~mapl_locstreamget proc~mapl_genericstatesave->proc~mapl_genericstatesave proc~mapl_gridcoordadjust MAPL_GridCoordAdjust proc~mapl_gridcoordadjust->proc~mapl_locstreamget proc~mapl_genericrefresh MAPL_GenericRefresh proc~mapl_genericrefresh->proc~mapl_esmfstatereadfromfile proc~mapl_genericrefresh->proc~mapl_genericrefresh proc~mapl_genericstaterestore MAPL_GenericStateRestore proc~mapl_genericstaterestore->proc~mapl_esmfstatereadfromfile proc~mapl_genericstaterestore->proc~mapl_genericstaterestore

Source Code

  subroutine MAPL_LocStreamGet(LocStream, NT_LOCAL, nt_global, TILETYPE, TILEKIND, &
                               TILELONS, TILELATS, TILEAREA, &
                               TILEGRID, &
                               GRIDIM, GRIDJM, GRIDNAMES, &
                               ATTACHEDGRID, LOCAL_ID, local_i, local_j,RC)
    type(MAPL_LocStream),                 intent(IN   ) :: LocStream
    integer, optional,                    intent(  OUT) :: NT_LOCAL
    integer, optional,                    pointer       :: TILETYPE(:)
    integer, optional,                    pointer       :: TILEKIND(:)
    real   , optional,                    pointer       :: TILELONS(:)
    real   , optional,                    pointer       :: TILELATS(:)
    real   , optional,                    pointer       :: TILEAREA(:)
!    integer, optional,                    pointer       :: TILEI(:)
!    integer, optional,                    pointer       :: TILEJ(:)
    integer, optional,                    pointer       :: GRIDIM(:)
    integer, optional,                    pointer       :: GRIDJM(:)
    integer, optional,                    pointer       :: LOCAL_ID(:)
    integer, optional,                    intent(out)   :: nt_global
    character(len=*), optional, pointer                 :: GRIDNAMES(:)
    type(ESMF_Grid), optional,            intent(  OUT) :: TILEGRID
    type(ESMF_Grid), optional,            intent(  OUT) :: ATTACHEDGRID
    integer, optional,  pointer,          intent(  OUT) :: local_i(:)
    integer, optional,  pointer,          intent(  OUT) :: local_j(:)
    integer, optional,                    intent(  OUT) :: RC

! MAT These GFORTRAN workarounds are needed because without them
!     runs of GEOS do not layout regress. That is a 4x24 run is not
!     zero-diff with a 3x18 run. If you decide to remove these, test
!     to make sure this works.
#ifdef __GFORTRAN__
    integer                    :: i
    integer, pointer           :: tmp_iptr(:) => null()
    real,    pointer           :: tmp_rptr(:) => null()
    character(len=MAPL_TileNameLength), pointer       :: tmp_strptr(:) => null()
#endif

! Local variables


    if (present(NT_LOCAL)) then
       NT_LOCAL = locstream%Ptr%NT_LOCAL
    end if

    if (present(nt_global)) then
       nt_global = locstream%ptr%nt_global
    end if


    if (present(tiletype)) then
       tiletype => locstream%Ptr%Local_GeoLocation(:)%t
    end if

    if (present(tilekind)) then
       PRINT *, 'IN LocStreamGet TILEKIND  NO LONGER VALID ARGUMENT'
       _FAIL('needs informative message')
!       tilekind => locstream%Ptr%Local_GeoLocation(:)%u
    end if

! MAT These GFORTRAN workarounds are needed because without them
!     runs of GEOS do not layout regress. That is a 4x24 run is not
!     zero-diff with a 3x18 run. If you decide to remove these, test
!     to make sure this works.
    if (present(tilelons)) then
#ifdef __GFORTRAN__
       allocate(tmp_rptr(lbound(locstream%Ptr%Local_GeoLocation,1):ubound(locstream%Ptr%Local_GeoLocation,1)))
       do i = lbound(locstream%Ptr%Local_GeoLocation,1), ubound(locstream%Ptr%Local_GeoLocation,1)
         tmp_rptr(i) = locstream%Ptr%Local_GeoLocation(i)%x
       enddo
       tilelons => tmp_rptr
#else
       tilelons => locstream%Ptr%Local_GeoLocation(:)%x
#endif
    end if

    if (present(tilelats)) then
#ifdef __GFORTRAN__
       allocate(tmp_rptr(lbound(locstream%Ptr%Local_GeoLocation,1):ubound(locstream%Ptr%Local_GeoLocation,1)))
       do i = lbound(locstream%Ptr%Local_GeoLocation,1), ubound(locstream%Ptr%Local_GeoLocation,1)
         tmp_rptr(i) = locstream%Ptr%Local_GeoLocation(i)%y
       enddo
       tilelats => tmp_rptr
#else
       tilelats => locstream%Ptr%Local_GeoLocation(:)%y
#endif
    end if

    if (present(tilearea)) then
       if (locstream%Ptr%IsTileAreaValid) then
          tilearea => locstream%Ptr%Local_GeoLocation(:)%a
       else
          tilearea => null()
       end if
    end if

    if (present(gridim)) then
       gridim => locstream%Ptr%tiling(:)%im
    end if

    if (present(gridjm)) then
       gridjm => locstream%Ptr%tiling(:)%jm
    end if

    if (present(local_id)) then
       local_id => locstream%Ptr%local_id
    end if

    if (present(gridnames)) then
       gridnames => locstream%Ptr%tiling(:)%name
    end if

    if (present(attachedgrid)) then
       attachedgrid = locstream%Ptr%grid
    end if

    if (present(tilegrid)) then
       tilegrid = locstream%Ptr%TILEGRID
    end if

    if (present(local_i)) then
       local_i => locstream%Ptr%LOCAL_INDEXLOCATION(:)%i
    end if

    if (present(local_j)) then
       local_j => locstream%Ptr%LOCAL_INDEXLOCATION(:)%j
    end if

    _RETURN(ESMF_SUCCESS)
  end subroutine MAPL_LocStreamGet