grid_get_corners.F90 Source File


This file depends on

sourcefile~~grid_get_corners.f90~~EfferentGraph sourcefile~grid_get_corners.f90 grid_get_corners.F90 sourcefile~base_base.f90 Base_Base.F90 sourcefile~grid_get_corners.f90->sourcefile~base_base.f90 sourcefile~vectorbasis.f90 VectorBasis.F90 sourcefile~grid_get_corners.f90->sourcefile~vectorbasis.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~errorhandling.f90 ErrorHandling.F90 sourcefile~vectorbasis.f90->sourcefile~errorhandling.f90 sourcefile~fieldblas.f90 FieldBLAS.F90 sourcefile~vectorbasis.f90->sourcefile~fieldblas.f90 sourcefile~fieldpointerutilities.f90 FieldPointerUtilities.F90 sourcefile~vectorbasis.f90->sourcefile~fieldpointerutilities.f90 sourcefile~internalconstants.f90 InternalConstants.F90 sourcefile~constants.f90->sourcefile~internalconstants.f90 sourcefile~mathconstants.f90 MathConstants.F90 sourcefile~constants.f90->sourcefile~mathconstants.f90 sourcefile~physicalconstants.f90 PhysicalConstants.F90 sourcefile~constants.f90->sourcefile~physicalconstants.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90 sourcefile~fieldblas.f90->sourcefile~fieldpointerutilities.f90 sourcefile~mapl_exceptionhandling.f90 MAPL_ExceptionHandling.F90 sourcefile~fieldblas.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~fieldpointerutilities.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~mapl_range.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~maplgrid.f90->sourcefile~constants.f90 sourcefile~maplgrid.f90->sourcefile~errorhandling.f90 sourcefile~maplgrid.f90->sourcefile~keywordenforcer.f90 sourcefile~mapl_sort.f90 MAPL_Sort.F90 sourcefile~maplgrid.f90->sourcefile~mapl_sort.f90 sourcefile~pflogger_stub.f90 pflogger_stub.F90 sourcefile~maplgrid.f90->sourcefile~pflogger_stub.f90 sourcefile~mapl_exceptionhandling.f90->sourcefile~errorhandling.f90 sourcefile~mapl_exceptionhandling.f90->sourcefile~mapl_throw.f90 sourcefile~mapl_sort.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~pfl_keywordenforcer.f90 PFL_KeywordEnforcer.F90 sourcefile~pflogger_stub.f90->sourcefile~pfl_keywordenforcer.f90 sourcefile~wraparray.f90 WrapArray.F90 sourcefile~pflogger_stub.f90->sourcefile~wraparray.f90 sourcefile~physicalconstants.f90->sourcefile~mathconstants.f90

Source Code

#include "MAPL_ErrLog.h"

submodule (mapl3g_VectorBasis) grid_get_corners_smod
   use mapl_base, only: MAPL_GridGetCorners
contains


   module subroutine grid_get_corners(grid, corners, rc)
      type(ESMF_Grid), intent(inout) :: grid
      real(kind=ESMF_KIND_R8), allocatable, intent(out) :: corners(:,:,:)
      integer, optional, intent(out) :: rc

      integer :: status
      integer :: im, jm
      real(kind=ESMF_KIND_R8), pointer :: longitudes(:,:)
      real(kind=ESMF_KIND_R8), pointer :: latitudes(:,:)
      real(kind=ESMF_KIND_R8), allocatable :: corner_lons(:,:)
      real(kind=ESMF_KIND_R8), allocatable :: corner_lats(:,:)

      call GridGetCoords(grid, longitudes, latitudes, _RC)
      im = size(longitudes,1)
      jm = size(longitudes,2)

      allocate(corner_lons(im+1,jm+1))
      allocate(corner_lats(im+1,jm+1))

      call MAPL_GridGetCorners(grid, corner_lons, corner_lats, _RC)

      allocate(corners(size(longitudes,1),size(longitudes,2),2))
      corners(:,:,1) = corner_lons
      corners(:,:,2) = corner_lats

      _RETURN(ESMF_SUCCESS)
   end subroutine grid_get_corners
   
end submodule grid_get_corners_smod