Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions AppGridCreate.F90
Original file line number Diff line number Diff line change
Expand Up @@ -436,91 +436,6 @@ function AppGridCreateF(IM_WORLD, JM_WORLD, LM, NX, NY, rc) result(esmfgrid)
RETURN_(ESMF_SUCCESS)
end function AppGridCreateF

subroutine AppGridCreate (META, esmfgrid, RC)

#include "MAPL_Generic.h"

use ESMF
use MAPL
use MAPL2, only: MAPL_GetResource, MAPL_MetaComp
use fv_arrays_mod, only: REAL4, REAL8, R_GRID
implicit none

! !ARGUMENTS:

type(MAPL_MetaComp), intent(INOUT) :: META
type (ESMF_Grid), intent( OUT) :: esmfgrid
integer, optional, intent( OUT) :: rc

! ErrLog variables
!-----------------

integer :: STATUS
character(len=ESMF_MAXSTR), parameter :: Iam="AppGridCreate"

! Local variables
!-----------------

integer :: IM_WORLD
integer :: JM_WORLD
integer :: LM
integer :: NX, NY
character(len=ESMF_MAXSTR) :: tmpname, gridname
character(len=ESMF_MAXSTR) :: FMT, FMTIM, FMTJM
real(REAL8) :: deglon=0.0

interface
function AppGridCreateF(IM_WORLD, JM_WORLD, LM, NX, NY, rc)
use ESMF
implicit none
type(ESMF_Grid) :: AppGridCreateF
integer, intent(IN) :: IM_WORLD, JM_WORLD, LM
integer, intent(IN) :: NX, NY
integer, optional, intent(OUT) :: rc
end function AppGridCreateF
end interface

! Get Decomposition from CF
!--------------------------

! !RESOURCE_ITEM: none :: Processing elements in 1st dimension
call MAPL_GetResource( META, NX, label ='NX:', default=1, rc = status )
VERIFY_(STATUS)
! !RESOURCE_ITEM: none :: Processing elements in 2nd dimension
call MAPL_GetResource( META, NY, label ='NY:', default=1, rc = status )
VERIFY_(STATUS)

! Get World problem size from CF
!-------------------------------

! !RESOURCE_ITEM: none :: Grid size in 1st dimension
call MAPL_GetResource( META, IM_WORLD, 'AGCM_IM:', rc = status )
VERIFY_(STATUS)
! !RESOURCE_ITEM: none :: Grid size in 2nd dimension
call MAPL_GetResource( META, JM_WORLD, 'AGCM_JM:', rc = status )
VERIFY_(STATUS)
! !RESOURCE_ITEM: none :: Grid size in 3rd dimension
call MAPL_GetResource( META, LM, 'AGCM_LM:', default=1, rc = status )
VERIFY_(STATUS)

! The grid's name is optional
!----------------------------

call GET_INT_FORMAT(IM_WORLD, FMTIM)
call GET_INT_FORMAT(JM_WORLD, FMTJM)
FMT = '(A,' // trim(FMTIM) //',A,' // trim(FMTJM) // ',A)'
write(tmpname,trim(FMT)) 'PE',IM_WORLD,'x',JM_WORLD,'-CF'
! !RESOURCE_ITEM: none :: Optional grid name
call MAPL_GetResource( META, GRIDNAME, 'AGCM.GRIDNAME:', default=trim(tmpname), rc = status )
VERIFY_(STATUS)

esmfgrid = AppGridCreateF(IM_WORLD, JM_WORLD, LM, NX, NY, STATUS)
VERIFY_(STATUS)

RETURN_(ESMF_SUCCESS)

end subroutine AppGridCreate

subroutine GET_INT_FORMAT(N, FMT)
integer :: N
character(len=*) :: FMT
Expand Down
Loading