@@ -35,7 +35,6 @@ module MAPL_Base
3535 ! public MAPL_ConnectCoupling
3636 public MAPL_GRID_INTERIOR
3737 public MAPL_Interp_Fac ! re-exported from MAPL_TimeInterpolation (base3g)
38- public MAPL_LatLonGridCreate ! Creates regular Lat/Lon ESMF Grids
3938 public MAPL_GetHorzIJIndex
4039 public MAPL_GetGlobalHorzIJIndex
4140 public MAPL_Reverse_Schmidt
@@ -66,142 +65,6 @@ module subroutine MAPL_PICKEM(II,JJ,IM,JM,COUNT)
6665 end subroutine MAPL_PICKEM
6766
6867
69- ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
70- ! >
71- ! `MAPL_LatLonGridCreate` --- Create regular Lat/Lon Grid
72- !
73- ! This routine creates a distributed ESMF grid where the horizontal
74- ! coordinates are regular longitudes and latitudes. The grid is
75- ! created on the user specified **VM**, or on the current VM if the user
76- ! does not specify one. The layout and the coordinate information can
77- ! be provided with a `ESMF_Config attribute, a resource file name
78- ! or specified through the argument list.
79- !
80- ! ### Using resource files
81- ! The **resource file** has a syntax similar to a GrADS
82- ! control file. Here is an example defining a typical GEOS-5 1x1.25
83- ! grid with 72 layers:
84- !
85- ! ```
86- ! GDEF: LatLon
87- ! IDEF: 32
88- ! JDEF: 16
89- ! LDEF: 1
90- ! XDEF: 288 LINEAR -180. 1.25
91- ! YDEF: 181 LINEAR -90. 1.
92- ! ZDEF: 72 LINEAR 1 1
93- ! ```
94- ! More generally,
95- ! ```
96- ! GDEF: LatLon
97- ! IDEF: Nx
98- ! JDEF: Ny
99- ! LDEF: Nz
100- ! XDEF: IM_World XCoordType BegLon, DelLon
101- ! YDEF: JM_World YCoordType BegLat, DelLat
102- ! ZDEF: LM_World ZCoordType 1 1
103- ! ```
104- !
105- ! The attribute **GDEF** must always be `LatLon` for Lat/Lon grids.
106- ! The remaining parameters are:
107- !- **Nx** is the number of processors used to decompose the X dimension
108- !- **Ny** is the number of processors used to decompose the Y dimension
109- !- **Nz** is the number of processors used to decompose the Z dimension;
110- ! must be 1 for now.
111- !- **IM_World** is the number of longitudinal grid points; if `IM_World=0` then
112- ! the grid has no zonal dimension.
113- !- **XCoordType** must be set to LINEAR
114- !- **BegLon** is the longitude (in degrees) of the {\em center} of the first gridbox
115- !- **DelLon** is the constant mesh size (in degrees); if `DelLon<1` then a
116- ! global grid is assumed.
117- !- **JM_World** is the number of meridional grid points; if `JM_World=0` then
118- ! the grid has no meridional dimension.
119- !- **YCoordType** must be set to LINEAR
120- !- **BegLat** s the latitude (in degrees) of the *center* of the first gridbox
121- !- **DelLat** s the constant mesh size (in degrees); if `DelLat<1` then a
122- ! global grid is assumed.
123- !- **LM_World** is the number of vertical grid points; `LM_World=0` then the grid has no
124- ! vertical dimension.
125- !
126- ! As of this writing, only the size of the vertical grid `LM_World` needs to be specified.
127- !
128- ! ### Passing an ESMF Config
129- ! The `ESMF_Config` object `Config`, when specified, must
130- ! contain the same information as the resource file above.
131- !
132- ! ### Providing parameters explicitly through the argument list
133- ! Alternatively, one can specify coordinate information in the argument
134- ! list; their units and meaning is as in the resource file above. In
135- ! this case you must specify at least `Nx, Ny, IM_World, JM_World`, and
136- ! `LM_World`. The other parameters have default values
137- !- **BegLon** defaults to -180. (the date line)
138- !- **DelLon** defaults to -1. (meaning a global grid)
139- !- **BegLat** defaults to -90. (the south pole)
140- !- **DelLat** deaults to -1. (meaning a global grid)
141- !
142- ! ### Restrictions
143- ! The current implementation imposes the following restrictions:
144- ! 1. Only uniform longitude/latitude grids are supported (no Gaussian grids).
145- ! 2. Only 2D Lon-Lat or 3D Lon-Lat-Lev grids are currently supported
146- ! (no Lat-Lev or Lon-Lev grids supprted yet).
147- ! 3. No vertical decomposition yet (`Nz=1`).
148- !
149- ! ### Future enhancements
150- ! The `IDEF/JDEF/LDEF` records in the resource file should be
151- ! extended as to allow specification of a more general distribution.
152- ! For consistency with the `XDEF/YDEF/ZDEF` records a similar
153- ! syntax could be adopted. For example,
154- !
155- ! ```
156- ! IDEF 4 LEVELS 22 50 50 22
157- ! XDEF 144 LINEAR -180 2.5
158- ! ```
159- ! would indicate that longitudes would be decomposed in 4 PETs,
160- ! with the first PET having 22 grid points, the second 50 gridpoints,
161- ! and so on.
162- !
163- module function MAPL_LatLonGridCreate (Name , vm , &
164- Config , ConfigFile , &
165- Nx , Ny , &
166- IM_World , BegLon , DelLon , &
167- JM_World , BegLat , DelLat , &
168- LM_World , &
169- rc ) &
170- result(Grid)
171- use ESMF, only: ESMF_VM, ESMF_Config, ESMF_Grid
172-
173- ! !INPUT PARAMETERS:
174-
175- character (len=* ), intent (in ) :: Name
176- type (ESMF_VM), OPTIONAL , target , &
177- intent (in ) :: VM
178-
179-
180- ! There are 3 possibilities to provide the coordinate information:
181-
182- ! 1) Thru Config object:
183- type (ESMF_Config), OPTIONAL , target , &
184- intent (in ) :: Config
185-
186- ! 2) Thru a resource file:
187- character (len=* ), OPTIONAL , intent (in ) :: ConfigFile
188-
189-
190- ! 3) Thru argument list:
191- integer , OPTIONAL , intent (in ) :: Nx, Ny ! Layout
192- integer , OPTIONAL , intent (in ) :: IM_World ! Zonal
193- real , OPTIONAL , intent (in ) :: BegLon, DelLon ! in degrees
194-
195- integer , OPTIONAL , intent (in ) :: JM_World ! Meridional
196- real , OPTIONAL , intent (in ) :: BegLat, DelLat ! in degrees
197-
198- integer , OPTIONAL , intent (in ) :: LM_World ! Vertical
199-
200- ! !OUTPUT PARAMETERS:
201-
202- type (ESMF_Grid) :: Grid ! Distributed grid
203- integer , OPTIONAL , intent (out ) :: rc ! return code
204- end function MAPL_LatLonGridCreate
20568
20669 ! ............................................................................
20770
0 commit comments