Skip to content

Commit c036c93

Browse files
committed
Using MAPL_GridCompGet to access grid and num_levels
1 parent fd4020e commit c036c93

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSgwd_GridComp/GEOS_GwdGridComp.F90

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module GEOS_GwdGridCompMod
3030
! !USES:
3131

3232
use ESMF
33-
use MAPL_ErrorHandling, only: MAPL_Verify, MAPL_RTRN
33+
use MAPL_ErrorHandling, only: MAPL_Verify, MAPL_RTRN, MAPL_ASSERT
3434
use MAPL_OpenMP_Support, only : MAPL_get_current_thread => get_current_thread
3535
use MAPL_OpenMP_Support, only : MAPL_get_num_threads => get_num_threads
3636
use MAPL_OpenMP_Support, only : MAPL_find_bounds => find_bounds
@@ -222,7 +222,6 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
222222
! Local derived type aliases
223223

224224
type(ESMF_Grid) :: grid
225-
type(ESMF_Geom) :: geom
226225
integer :: dims_(3), IM, JM
227226
real(kind=ESMF_KIND_R8), pointer, dimension(:,:) :: LATS, lons
228227

@@ -281,10 +280,9 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
281280
self => wrap%ptr
282281

283282
! Grid info
284-
call MAPL_GridCompGet(gc, geom=geom, _RC)
285-
call ESMF_GeomGet(geom, grid=grid, _RC)
283+
call MAPL_GridCompGet(gc, grid=grid, num_levels=LM, _RC)
286284
call MAPL_GridGet(grid, localCellCountPerDim=dims_, _RC)
287-
IM = dims_(1); JM = dims_(2); LM = dims_(3)
285+
IM = dims_(1); JM = dims_(2)
288286
call MAPL_GridGetCoords(grid, longitudes=lons, latitudes=lats, _RC)
289287

290288
! Get grid name to determine IMSIZE
@@ -471,7 +469,6 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
471469
type (GEOS_GwdGridComp), pointer :: self
472470
type(ThreadWorkspace), pointer :: workspace
473471
integer :: thread
474-
type(ESMF_Geom) :: geom
475472

476473
!=============================================================================
477474

@@ -500,10 +497,9 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
500497
!call MAPL_TimerOn(MAPL,"TOTAL")
501498

502499
! Grid info
503-
call MAPL_GridCompGet(gc, geom=geom, _RC)
504-
call ESMF_GeomGet(geom, grid=grid, _RC)
500+
call MAPL_GridCompGet(gc, grid=grid, num_levels=LM, _RC)
505501
call MAPL_GridGet(grid, localCellCountPerDim=dims_, _RC)
506-
IM = dims_(1); JM = dims_(2); LM = dims_(3)
502+
IM = dims_(1); JM = dims_(2)
507503
call MAPL_GridGetCoords(grid, longitudes=lons, latitudes=lats, _RC)
508504

509505
! call ESMF_ClockGetAlarm(clock,

0 commit comments

Comments
 (0)