11#include " MAPL.h"
22
33module mapl3g_GridGet
4+
45 use esmf
56 use mapl_KeywordEnforcer
67 use mapl_ErrorHandling
8+
79 implicit none
810 private
911
@@ -30,18 +32,18 @@ subroutine grid_get(grid, unusable, &
3032
3133 type (esmf_Grid), intent (in ) :: grid
3234 class(KeywordEnforcer), optional , intent (in ) :: unusable
33- character (:), optional , allocatable :: name
35+ character (:), optional , allocatable , intent ( out ) :: name
3436 integer , optional , intent (out ) :: dimCount
3537 integer , optional , allocatable , intent (out ) :: coordDimCount(:)
3638 integer , optional , intent (out ) :: im, jm
37- real (kind= ESMF_KIND_R4 ), optional , pointer :: longitudes(:,:), latitudes(:,:)
39+ real (kind= ESMF_KIND_R4 ), optional , allocatable , intent (out ) :: longitudes(:,:)
40+ real (kind= ESMF_KIND_R4 ), optional , allocatable , intent (out ) :: latitudes(:,:)
3841 integer , optional , intent (out ) :: rc
3942
4043 integer :: dimCount_
4144 character (ESMF_MAXSTR) :: name_
4245 integer :: status
4346 real (kind= ESMF_KIND_R8 ), pointer :: coords(:,:)
44- real (kind= ESMF_KIND_R4 ), allocatable , target :: lons(:,:), lats(:,:)
4547 logical :: has_de
4648
4749 call esmf_GridGet(grid, dimCount= dimCount_, _RC)
@@ -66,15 +68,11 @@ subroutine grid_get(grid, unusable, &
6668 end if
6769
6870 if (present (longitudes) .or. present (latitudes)) then
69- call GridGetCoordinates(grid, longitudes= lons, latitudes= lats, _RC)
70- if (present (longitudes)) then
71- longitudes = > lons
72- end if
73- if (present (latitudes)) then
74- latitudes = > lats
75- end if
71+ call GridGetCoordinates(grid, longitudes= longitudes, latitudes= latitudes, _RC)
7672 end if
73+
7774 _RETURN(_SUCCESS)
75+ _UNUSED_DUMMY(unusable)
7876 end subroutine grid_get
7977
8078 logical function grid_has_DE (grid ,rc ) result(has_DE)
@@ -128,7 +126,6 @@ subroutine grid_get_coordinates_r8(grid, longitudes, latitudes, rc)
128126 latitudes = ptr
129127
130128 _RETURN(_SUCCESS)
131-
132129 end subroutine grid_get_coordinates_r8
133130
134131end module mapl3g_GridGet
0 commit comments