get_esmf_grid_layout Subroutine

subroutine get_esmf_grid_layout(grid, nx, ny, ims_out, jms_out, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Grid), intent(inout) :: grid
integer, intent(out) :: nx
integer, intent(out) :: ny
integer, intent(inout), allocatable :: ims_out(:)
integer, intent(inout), allocatable :: jms_out(:)
integer, intent(out), optional :: rc

Calls

proc~~get_esmf_grid_layout~~CallsGraph proc~get_esmf_grid_layout get_esmf_grid_layout ESMF_GridGet ESMF_GridGet proc~get_esmf_grid_layout->ESMF_GridGet ESMF_VMGet ESMF_VMGet proc~get_esmf_grid_layout->ESMF_VMGet ESMF_VMGetCurrent ESMF_VMGetCurrent proc~get_esmf_grid_layout->ESMF_VMGetCurrent proc~mapl_abort MAPL_abort proc~get_esmf_grid_layout->proc~mapl_abort proc~mapl_distgridget MAPL_DistGridGet proc~get_esmf_grid_layout->proc~mapl_distgridget proc~mapl_getimsjms MAPL_GetImsJms proc~get_esmf_grid_layout->proc~mapl_getimsjms proc~mapl_verify MAPL_Verify proc~get_esmf_grid_layout->proc~mapl_verify mpi_abort mpi_abort proc~mapl_abort->mpi_abort proc~mapl_distgridget->proc~mapl_verify ESMF_DistGridGet ESMF_DistGridGet proc~mapl_distgridget->ESMF_DistGridGet proc~mapl_getimsjms->proc~mapl_verify interface~mapl_assert MAPL_Assert proc~mapl_getimsjms->interface~mapl_assert interface~mapl_sort MAPL_Sort proc~mapl_getimsjms->interface~mapl_sort proc~mapl_return MAPL_Return proc~mapl_getimsjms->proc~mapl_return proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception proc~mapl_return->proc~mapl_throw_exception at at proc~mapl_return->at insert insert proc~mapl_return->insert

Called by

proc~~get_esmf_grid_layout~~CalledByGraph proc~get_esmf_grid_layout get_esmf_grid_layout proc~latlon_zmean latlon_zmean proc~latlon_zmean->proc~get_esmf_grid_layout proc~latlon_zstar latlon_zstar proc~latlon_zstar->proc~latlon_zmean program~time_ave time_ave program~time_ave->proc~latlon_zstar

Source Code

   subroutine get_esmf_grid_layout(grid,nx,ny,ims_out,jms_out,rc)
      type(ESMF_Grid), intent(inout) :: grid
      integer, intent(out) :: nx
      integer, intent(out) :: ny
      integer, intent(inout), allocatable :: ims_out(:)
      integer, intent(inout), allocatable :: jms_out(:)
      integer, optional, intent(out) :: rc

      type(ESMF_VM) :: vm
      integer :: status
      type(ESMF_DistGrid) :: dist_grid
      integer, allocatable :: minindex(:,:),maxindex(:,:)
      integer :: dim_count, ndes
      integer, pointer :: ims(:),jms(:)

      call ESMF_VMGetCurrent(vm,_RC)
      call ESMF_VMGet(vm,petCount=ndes,_RC)
      call ESMF_GridGet(grid,distgrid=dist_grid,dimCOunt=dim_count,_RC)
      allocate(minindex(dim_count,ndes),maxindex(dim_count,ndes))
      call MAPL_DistGridGet(dist_grid,minIndex=minindex,maxIndex=maxindex,_RC)
      call MAPL_GetImsJms(minindex(1,:),maxindex(1,:),minindex(2,:),maxindex(2,:),ims,jms,_RC)
      nx = size(ims)
      ny = size(jms)
      allocate(ims_out(nx),jms_out(ny))
      ims_out = ims
      jms_out = jms

      if (present(rc)) then
         rc=_SUCCESS
      endif

   end subroutine get_esmf_grid_layout