Skip to content

Commit e15627b

Browse files
committed
Added an overloaded routine that returns R8 pointer version of lats and lons (no copy)
1 parent c77132d commit e15627b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

geom/GridGet.F90

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module mapl3g_GridGet
1919
interface GridGetCoordinates
2020
procedure :: grid_get_coordinates_r4
2121
procedure :: grid_get_coordinates_r8
22+
procedure :: grid_get_coordinates_r8ptr
2223
end interface GridGetCoordinates
2324

2425
contains
@@ -116,4 +117,18 @@ subroutine grid_get_coordinates_r8(grid, longitudes, latitudes, rc)
116117
_RETURN(_SUCCESS)
117118
end subroutine grid_get_coordinates_r8
118119

120+
subroutine grid_get_coordinates_r8ptr(grid, longitudes, latitudes, rc)
121+
type(esmf_Grid), intent(in) :: grid
122+
real(ESMF_KIND_R8), pointer, intent(out) :: longitudes(:,:)
123+
real(ESMF_KIND_R8), pointer, intent(out) :: latitudes(:,:)
124+
integer, optional, intent(out) :: rc
125+
126+
integer :: status
127+
128+
call esmf_GridGetCoord(grid, coordDim=1, farrayPtr=longitudes, _RC)
129+
call esmf_GridGetCoord(grid, coordDim=2, farrayPtr=latitudes, _RC)
130+
131+
_RETURN(_SUCCESS)
132+
end subroutine grid_get_coordinates_r8ptr
133+
119134
end module mapl3g_GridGet

0 commit comments

Comments
 (0)