MOM6
MOM_transcribe_grid.F90
1 !> Module with routines for copying information from a shared dynamic horizontal
2 !! grid to an ocean-specific horizontal grid and the reverse.
4 
5 ! This file is part of MOM6. See LICENSE.md for the license.
6 
9 use mom_domains, only : to_all, scalar_pair, cgrid_ne, agrid, bgrid_ne, corner
10 use mom_dyn_horgrid, only : dyn_horgrid_type, set_derived_dyn_horgrid
11 use mom_error_handler, only : mom_error, mom_mesg, fatal, warning
12 use mom_grid, only : ocean_grid_type, set_derived_metrics
14 
15 
16 implicit none ; private
17 
18 public copy_dyngrid_to_mom_grid, copy_mom_grid_to_dyngrid, rotate_dyngrid
19 
20 contains
21 
22 !> Copies information from a dynamic (shared) horizontal grid type into an
23 !! ocean_grid_type.
24 subroutine copy_dyngrid_to_mom_grid(dG, oG, US)
25  type(dyn_horgrid_type), intent(in) :: dg !< Common horizontal grid type
26  type(ocean_grid_type), intent(inout) :: og !< Ocean grid type
27  type(unit_scale_type), intent(in) :: us !< A dimensional unit scaling type
28 
29  integer :: isd, ied, jsd, jed ! Common data domains.
30  integer :: isdb, iedb, jsdb, jedb ! Common data domains.
31  integer :: ido, jdo, ido2, jdo2 ! Indexing offsets between the grids.
32  integer :: igst, jgst ! Global starting indices.
33  integer :: i, j
34 
35  ! MOM_grid_init and create_dyn_horgrid are called outside of this routine.
36  ! This routine copies over the fields that were set by MOM_initialized_fixed.
37 
38  ! Determine the indexing offsets between the grids.
39  ido = dg%idg_offset - og%idg_offset
40  jdo = dg%jdg_offset - og%jdg_offset
41 
42  isd = max(og%isd, dg%isd+ido) ; jsd = max(og%jsd, dg%jsd+jdo)
43  ied = min(og%ied, dg%ied+ido) ; jed = min(og%jed, dg%jed+jdo)
44  isdb = max(og%IsdB, dg%IsdB+ido) ; jsdb = max(og%JsdB, dg%JsdB+jdo)
45  iedb = min(og%IedB, dg%IedB+ido) ; jedb = min(og%JedB, dg%JedB+jdo)
46 
47  ! Check that the grids conform.
48  if ((isd > og%isc) .or. (ied < og%ied) .or. (jsd > og%jsc) .or. (jed > og%jed)) &
49  call mom_error(fatal, "copy_dyngrid_to_MOM_grid called with incompatible grids.")
50 
51  do i=isd,ied ; do j=jsd,jed
52  og%geoLonT(i,j) = dg%geoLonT(i+ido,j+jdo)
53  og%geoLatT(i,j) = dg%geoLatT(i+ido,j+jdo)
54  og%dxT(i,j) = dg%dxT(i+ido,j+jdo)
55  og%dyT(i,j) = dg%dyT(i+ido,j+jdo)
56  og%areaT(i,j) = dg%areaT(i+ido,j+jdo)
57  og%bathyT(i,j) = dg%bathyT(i+ido,j+jdo)
58 
59  og%dF_dx(i,j) = dg%dF_dx(i+ido,j+jdo)
60  og%dF_dy(i,j) = dg%dF_dy(i+ido,j+jdo)
61  og%sin_rot(i,j) = dg%sin_rot(i+ido,j+jdo)
62  og%cos_rot(i,j) = dg%cos_rot(i+ido,j+jdo)
63  og%mask2dT(i,j) = dg%mask2dT(i+ido,j+jdo)
64  enddo ; enddo
65 
66  do i=isdb,iedb ; do j=jsd,jed
67  og%geoLonCu(i,j) = dg%geoLonCu(i+ido,j+jdo)
68  og%geoLatCu(i,j) = dg%geoLatCu(i+ido,j+jdo)
69  og%dxCu(i,j) = dg%dxCu(i+ido,j+jdo)
70  og%dyCu(i,j) = dg%dyCu(i+ido,j+jdo)
71  og%dy_Cu(i,j) = dg%dy_Cu(i+ido,j+jdo)
72 
73  og%mask2dCu(i,j) = dg%mask2dCu(i+ido,j+jdo)
74  og%areaCu(i,j) = dg%areaCu(i+ido,j+jdo)
75  og%IareaCu(i,j) = dg%IareaCu(i+ido,j+jdo)
76  enddo ; enddo
77 
78  do i=isd,ied ; do j=jsdb,jedb
79  og%geoLonCv(i,j) = dg%geoLonCv(i+ido,j+jdo)
80  og%geoLatCv(i,j) = dg%geoLatCv(i+ido,j+jdo)
81  og%dxCv(i,j) = dg%dxCv(i+ido,j+jdo)
82  og%dyCv(i,j) = dg%dyCv(i+ido,j+jdo)
83  og%dx_Cv(i,j) = dg%dx_Cv(i+ido,j+jdo)
84 
85  og%mask2dCv(i,j) = dg%mask2dCv(i+ido,j+jdo)
86  og%areaCv(i,j) = dg%areaCv(i+ido,j+jdo)
87  og%IareaCv(i,j) = dg%IareaCv(i+ido,j+jdo)
88  enddo ; enddo
89 
90  do i=isdb,iedb ; do j=jsdb,jedb
91  og%geoLonBu(i,j) = dg%geoLonBu(i+ido,j+jdo)
92  og%geoLatBu(i,j) = dg%geoLatBu(i+ido,j+jdo)
93  og%dxBu(i,j) = dg%dxBu(i+ido,j+jdo)
94  og%dyBu(i,j) = dg%dyBu(i+ido,j+jdo)
95  og%areaBu(i,j) = dg%areaBu(i+ido,j+jdo)
96  og%CoriolisBu(i,j) = dg%CoriolisBu(i+ido,j+jdo)
97  og%mask2dBu(i,j) = dg%mask2dBu(i+ido,j+jdo)
98  enddo ; enddo
99 
100  og%bathymetry_at_vel = dg%bathymetry_at_vel
101  if (og%bathymetry_at_vel) then
102  do i=isdb,iedb ; do j=jsd,jed
103  og%Dblock_u(i,j) = dg%Dblock_u(i+ido,j+jdo)
104  og%Dopen_u(i,j) = dg%Dopen_u(i+ido,j+jdo)
105  enddo ; enddo
106  do i=isd,ied ; do j=jsdb,jedb
107  og%Dblock_v(i,j) = dg%Dblock_v(i+ido,j+jdo)
108  og%Dopen_v(i,j) = dg%Dopen_v(i+ido,j+jdo)
109  enddo ; enddo
110  endif
111 
112  og%gridLonT(og%isg:og%ieg) = dg%gridLonT(dg%isg:dg%ieg)
113  og%gridLatT(og%jsg:og%jeg) = dg%gridLatT(dg%jsg:dg%jeg)
114  ! The more complicated logic here avoids segmentation faults if one grid uses
115  ! global symmetric memory while the other does not. Because a northeast grid
116  ! convention is being used, the upper bounds for each array correspond.
117  ! Note that the dynamic grid always uses symmetric memory.
118  ido2 = dg%IegB-og%IegB ; igst = max(og%IsgB, (dg%isg-1)-ido2)
119  jdo2 = dg%JegB-og%JegB ; jgst = max(og%JsgB, (dg%jsg-1)-jdo2)
120  do i=igst,og%IegB ; og%gridLonB(i) = dg%gridLonB(i+ido2) ; enddo
121  do j=jgst,og%JegB ; og%gridLatB(j) = dg%gridLatB(j+jdo2) ; enddo
122 
123  ! Copy various scalar variables and strings.
124  og%x_axis_units = dg%x_axis_units ; og%y_axis_units = dg%y_axis_units
125  og%areaT_global = dg%areaT_global ; og%IareaT_global = dg%IareaT_global
126  og%south_lat = dg%south_lat ; og%west_lon = dg%west_lon
127  og%len_lat = dg%len_lat ; og%len_lon = dg%len_lon
128  og%Rad_Earth = dg%Rad_Earth ; og%max_depth = dg%max_depth
129 
130 ! Update the halos in case the dynamic grid has smaller halos than the ocean grid.
131  call pass_var(og%areaT, og%Domain)
132  call pass_var(og%bathyT, og%Domain)
133  call pass_var(og%geoLonT, og%Domain)
134  call pass_var(og%geoLatT, og%Domain)
135  call pass_vector(og%dxT, og%dyT, og%Domain, to_all+scalar_pair, agrid)
136  call pass_vector(og%dF_dx, og%dF_dy, og%Domain, to_all, agrid)
137  call pass_vector(og%cos_rot, og%sin_rot, og%Domain, to_all, agrid)
138  call pass_var(og%mask2dT, og%Domain)
139 
140  call pass_vector(og%areaCu, og%areaCv, og%Domain, to_all+scalar_pair, cgrid_ne)
141  call pass_vector(og%dyCu, og%dxCv, og%Domain, to_all+scalar_pair, cgrid_ne)
142  call pass_vector(og%dxCu, og%dyCv, og%Domain, to_all+scalar_pair, cgrid_ne)
143  call pass_vector(og%dy_Cu, og%dx_Cv, og%Domain, to_all+scalar_pair, cgrid_ne)
144  call pass_vector(og%mask2dCu, og%mask2dCv, og%Domain, to_all+scalar_pair, cgrid_ne)
145  call pass_vector(og%IareaCu, og%IareaCv, og%Domain, to_all+scalar_pair, cgrid_ne)
146  call pass_vector(og%IareaCu, og%IareaCv, og%Domain, to_all+scalar_pair, cgrid_ne)
147  call pass_vector(og%geoLatCu, og%geoLatCv, og%Domain, to_all+scalar_pair, cgrid_ne)
148 
149  call pass_var(og%areaBu, og%Domain, position=corner)
150  call pass_var(og%geoLonBu, og%Domain, position=corner, inner_halo=og%isc-isd)
151  call pass_var(og%geoLatBu, og%Domain, position=corner)
152  call pass_vector(og%dxBu, og%dyBu, og%Domain, to_all+scalar_pair, bgrid_ne)
153  call pass_var(og%CoriolisBu, og%Domain, position=corner)
154  call pass_var(og%mask2dBu, og%Domain, position=corner)
155 
156  if (og%bathymetry_at_vel) then
157  call pass_vector(og%Dblock_u, og%Dblock_v, og%Domain, to_all+scalar_pair, cgrid_ne)
158  call pass_vector(og%Dopen_u, og%Dopen_v, og%Domain, to_all+scalar_pair, cgrid_ne)
159  endif
160 
161  call set_derived_metrics(og, us)
162 
163 end subroutine copy_dyngrid_to_mom_grid
164 
165 
166 !> Copies information from an ocean_grid_type into a dynamic (shared)
167 !! horizontal grid type.
168 subroutine copy_mom_grid_to_dyngrid(oG, dG, US)
169  type(ocean_grid_type), intent(in) :: og !< Ocean grid type
170  type(dyn_horgrid_type), intent(inout) :: dg !< Common horizontal grid type
171  type(unit_scale_type), optional, intent(in) :: us !< A dimensional unit scaling type
172 
173  integer :: isd, ied, jsd, jed ! Common data domains.
174  integer :: isdb, iedb, jsdb, jedb ! Common data domains.
175  integer :: ido, jdo, ido2, jdo2 ! Indexing offsets between the grids.
176  integer :: igst, jgst ! Global starting indices.
177  integer :: i, j
178 
179  ! MOM_grid_init and create_dyn_horgrid are called outside of this routine.
180  ! This routine copies over the fields that were set by MOM_initialized_fixed.
181 
182  ! Determine the indexing offsets between the grids.
183  ido = og%idG_offset - dg%idG_offset
184  jdo = og%jdG_offset - dg%jdG_offset
185 
186  isd = max(dg%isd, og%isd+ido) ; jsd = max(dg%jsd, og%jsd+jdo)
187  ied = min(dg%ied, og%ied+ido) ; jed = min(dg%jed, og%jed+jdo)
188  isdb = max(dg%IsdB, og%IsdB+ido) ; jsdb = max(dg%JsdB, og%JsdB+jdo)
189  iedb = min(dg%IedB, og%IedB+ido) ; jedb = min(dg%JedB, og%JedB+jdo)
190 
191  ! Check that the grids conform.
192  if ((isd > dg%isc) .or. (ied < dg%ied) .or. (jsd > dg%jsc) .or. (jed > dg%jed)) &
193  call mom_error(fatal, "copy_dyngrid_to_MOM_grid called with incompatible grids.")
194 
195  do i=isd,ied ; do j=jsd,jed
196  dg%geoLonT(i,j) = og%geoLonT(i+ido,j+jdo)
197  dg%geoLatT(i,j) = og%geoLatT(i+ido,j+jdo)
198  dg%dxT(i,j) = og%dxT(i+ido,j+jdo)
199  dg%dyT(i,j) = og%dyT(i+ido,j+jdo)
200  dg%areaT(i,j) = og%areaT(i+ido,j+jdo)
201  dg%bathyT(i,j) = og%bathyT(i+ido,j+jdo)
202 
203  dg%dF_dx(i,j) = og%dF_dx(i+ido,j+jdo)
204  dg%dF_dy(i,j) = og%dF_dy(i+ido,j+jdo)
205  dg%sin_rot(i,j) = og%sin_rot(i+ido,j+jdo)
206  dg%cos_rot(i,j) = og%cos_rot(i+ido,j+jdo)
207  dg%mask2dT(i,j) = og%mask2dT(i+ido,j+jdo)
208  enddo ; enddo
209 
210  do i=isdb,iedb ; do j=jsd,jed
211  dg%geoLonCu(i,j) = og%geoLonCu(i+ido,j+jdo)
212  dg%geoLatCu(i,j) = og%geoLatCu(i+ido,j+jdo)
213  dg%dxCu(i,j) = og%dxCu(i+ido,j+jdo)
214  dg%dyCu(i,j) = og%dyCu(i+ido,j+jdo)
215  dg%dy_Cu(i,j) = og%dy_Cu(i+ido,j+jdo)
216 
217  dg%mask2dCu(i,j) = og%mask2dCu(i+ido,j+jdo)
218  dg%areaCu(i,j) = og%areaCu(i+ido,j+jdo)
219  dg%IareaCu(i,j) = og%IareaCu(i+ido,j+jdo)
220  enddo ; enddo
221 
222  do i=isd,ied ; do j=jsdb,jedb
223  dg%geoLonCv(i,j) = og%geoLonCv(i+ido,j+jdo)
224  dg%geoLatCv(i,j) = og%geoLatCv(i+ido,j+jdo)
225  dg%dxCv(i,j) = og%dxCv(i+ido,j+jdo)
226  dg%dyCv(i,j) = og%dyCv(i+ido,j+jdo)
227  dg%dx_Cv(i,j) = og%dx_Cv(i+ido,j+jdo)
228 
229  dg%mask2dCv(i,j) = og%mask2dCv(i+ido,j+jdo)
230  dg%areaCv(i,j) = og%areaCv(i+ido,j+jdo)
231  dg%IareaCv(i,j) = og%IareaCv(i+ido,j+jdo)
232  enddo ; enddo
233 
234  do i=isdb,iedb ; do j=jsdb,jedb
235  dg%geoLonBu(i,j) = og%geoLonBu(i+ido,j+jdo)
236  dg%geoLatBu(i,j) = og%geoLatBu(i+ido,j+jdo)
237  dg%dxBu(i,j) = og%dxBu(i+ido,j+jdo)
238  dg%dyBu(i,j) = og%dyBu(i+ido,j+jdo)
239  dg%areaBu(i,j) = og%areaBu(i+ido,j+jdo)
240  dg%CoriolisBu(i,j) = og%CoriolisBu(i+ido,j+jdo)
241  dg%mask2dBu(i,j) = og%mask2dBu(i+ido,j+jdo)
242  enddo ; enddo
243 
244  dg%bathymetry_at_vel = og%bathymetry_at_vel
245  if (dg%bathymetry_at_vel) then
246  do i=isdb,iedb ; do j=jsd,jed
247  dg%Dblock_u(i,j) = og%Dblock_u(i+ido,j+jdo)
248  dg%Dopen_u(i,j) = og%Dopen_u(i+ido,j+jdo)
249  enddo ; enddo
250  do i=isd,ied ; do j=jsdb,jedb
251  dg%Dblock_v(i,j) = og%Dblock_v(i+ido,j+jdo)
252  dg%Dopen_v(i,j) = og%Dopen_v(i+ido,j+jdo)
253  enddo ; enddo
254  endif
255 
256  dg%gridLonT(dg%isg:dg%ieg) = og%gridLonT(og%isg:og%ieg)
257  dg%gridLatT(dg%jsg:dg%jeg) = og%gridLatT(og%jsg:og%jeg)
258 
259  ! The more complicated logic here avoids segmentation faults if one grid uses
260  ! global symmetric memory while the other does not. Because a northeast grid
261  ! convention is being used, the upper bounds for each array correspond.
262  ! Note that the dynamic grid always uses symmetric memory.
263  ido2 = og%IegB-dg%IegB ; igst = max(dg%isg-1, og%IsgB-ido2)
264  jdo2 = og%JegB-dg%JegB ; jgst = max(dg%jsg-1, og%JsgB-jdo2)
265  do i=igst,dg%IegB ; dg%gridLonB(i) = og%gridLonB(i+ido2) ; enddo
266  do j=jgst,dg%JegB ; dg%gridLatB(j) = og%gridLatB(j+jdo2) ; enddo
267 
268  ! Copy various scalar variables and strings.
269  dg%x_axis_units = og%x_axis_units ; dg%y_axis_units = og%y_axis_units
270  dg%areaT_global = og%areaT_global ; dg%IareaT_global = og%IareaT_global
271  dg%south_lat = og%south_lat ; dg%west_lon = og%west_lon
272  dg%len_lat = og%len_lat ; dg%len_lon = og%len_lon
273  dg%Rad_Earth = og%Rad_Earth ; dg%max_depth = og%max_depth
274 
275 ! Update the halos in case the dynamic grid has smaller halos than the ocean grid.
276  call pass_var(dg%areaT, dg%Domain)
277  call pass_var(dg%bathyT, dg%Domain)
278  call pass_var(dg%geoLonT, dg%Domain)
279  call pass_var(dg%geoLatT, dg%Domain)
280  call pass_vector(dg%dxT, dg%dyT, dg%Domain, to_all+scalar_pair, agrid)
281  call pass_vector(dg%dF_dx, dg%dF_dy, dg%Domain, to_all, agrid)
282  call pass_vector(dg%cos_rot, dg%sin_rot, dg%Domain, to_all, agrid)
283  call pass_var(dg%mask2dT, dg%Domain)
284 
285  call pass_vector(dg%areaCu, dg%areaCv, dg%Domain, to_all+scalar_pair, cgrid_ne)
286  call pass_vector(dg%dyCu, dg%dxCv, dg%Domain, to_all+scalar_pair, cgrid_ne)
287  call pass_vector(dg%dxCu, dg%dyCv, dg%Domain, to_all+scalar_pair, cgrid_ne)
288  call pass_vector(dg%dy_Cu, dg%dx_Cv, dg%Domain, to_all+scalar_pair, cgrid_ne)
289  call pass_vector(dg%mask2dCu, dg%mask2dCv, dg%Domain, to_all+scalar_pair, cgrid_ne)
290  call pass_vector(dg%IareaCu, dg%IareaCv, dg%Domain, to_all+scalar_pair, cgrid_ne)
291  call pass_vector(dg%IareaCu, dg%IareaCv, dg%Domain, to_all+scalar_pair, cgrid_ne)
292  call pass_vector(dg%geoLatCu, dg%geoLatCv, dg%Domain, to_all+scalar_pair, cgrid_ne)
293 
294  call pass_var(dg%areaBu, dg%Domain, position=corner)
295  call pass_var(dg%geoLonBu, dg%Domain, position=corner, inner_halo=dg%isc-isd)
296  call pass_var(dg%geoLatBu, dg%Domain, position=corner)
297  call pass_vector(dg%dxBu, dg%dyBu, dg%Domain, to_all+scalar_pair, bgrid_ne)
298  call pass_var(dg%CoriolisBu, dg%Domain, position=corner)
299  call pass_var(dg%mask2dBu, dg%Domain, position=corner)
300 
301  if (dg%bathymetry_at_vel) then
302  call pass_vector(dg%Dblock_u, dg%Dblock_v, dg%Domain, to_all+scalar_pair, cgrid_ne)
303  call pass_vector(dg%Dopen_u, dg%Dopen_v, dg%Domain, to_all+scalar_pair, cgrid_ne)
304  endif
305 
306  call set_derived_dyn_horgrid(dg, us)
307 
308 end subroutine copy_mom_grid_to_dyngrid
309 
310 subroutine rotate_dyngrid(G_in, G, US, turns)
311  type(dyn_horgrid_type), intent(in) :: g_in !< Common horizontal grid type
312  type(dyn_horgrid_type), intent(inout) :: g !< Ocean grid type
313  type(unit_scale_type), intent(in) :: us !< A dimensional unit scaling type
314  integer, intent(in) :: turns !< Number of quarter turns
315 
316  integer :: jsc, jec, jscb, jecb
317  integer :: qturn
318 
319  ! Center point
320  call rotate_array(g_in%geoLonT, turns, g%geoLonT)
321  call rotate_array(g_in%geoLatT, turns, g%geoLatT)
322  call rotate_array_pair(g_in%dxT, g_in%dyT, turns, g%dxT, g%dyT)
323  call rotate_array(g_in%areaT, turns, g%areaT)
324  call rotate_array(g_in%bathyT, turns, g%bathyT)
325 
326  call rotate_array_pair(g_in%df_dx, g_in%df_dy, turns, g%df_dx, g%df_dy)
327  call rotate_array(g_in%sin_rot, turns, g%sin_rot)
328  call rotate_array(g_in%cos_rot, turns, g%cos_rot)
329  call rotate_array(g_in%mask2dT, turns, g%mask2dT)
330 
331  ! Face point
332  call rotate_array_pair(g_in%geoLonCu, g_in%geoLonCv, turns, &
333  g%geoLonCu, g%geoLonCv)
334  call rotate_array_pair(g_in%geoLatCu, g_in%geoLatCv, turns, &
335  g%geoLatCu, g%geoLatCv)
336  call rotate_array_pair(g_in%dxCu, g_in%dyCv, turns, g%dxCu, g%dyCv)
337  call rotate_array_pair(g_in%dxCv, g_in%dyCu, turns, g%dxCv, g%dyCu)
338  call rotate_array_pair(g_in%dx_Cv, g_in%dy_Cu, turns, g%dx_Cv, g%dy_Cu)
339 
340  call rotate_array_pair(g_in%mask2dCu, g_in%mask2dCv, turns, &
341  g%mask2dCu, g%mask2dCv)
342  call rotate_array_pair(g_in%areaCu, g_in%areaCv, turns, &
343  g%areaCu, g%areaCv)
344  call rotate_array_pair(g_in%IareaCu, g_in%IareaCv, turns, &
345  g%IareaCu, g%IareaCv)
346 
347  ! Vertex point
348  call rotate_array(g_in%geoLonBu, turns, g%geoLonBu)
349  call rotate_array(g_in%geoLatBu, turns, g%geoLatBu)
350  call rotate_array_pair(g_in%dxBu, g_in%dyBu, turns, g%dxBu, g%dyBu)
351  call rotate_array(g_in%areaBu, turns, g%areaBu)
352  call rotate_array(g_in%CoriolisBu, turns, g%CoriolisBu)
353  call rotate_array(g_in%mask2dBu, turns, g%mask2dBu)
354 
355  ! Topographic
356  g%bathymetry_at_vel = g_in%bathymetry_at_vel
357  if (g%bathymetry_at_vel) then
358  call rotate_array_pair(g_in%Dblock_u, g_in%Dblock_v, turns, &
359  g%Dblock_u, g%Dblock_v)
360  call rotate_array_pair(g_in%Dopen_u, g_in%Dopen_v, turns, &
361  g%Dopen_u, g%Dopen_v)
362  endif
363 
364  ! Nominal grid axes
365  ! TODO: We should not assign lat values to the lon axis, and vice versa.
366  ! We temporarily copy lat <-> lon since several components still expect
367  ! lat and lon sizes to match the first and second dimension sizes.
368  ! But we ought to instead leave them unchanged and adjust the references to
369  ! these axes.
370  if (modulo(turns, 2) /= 0) then
371  g%gridLonT(:) = g_in%gridLatT(g_in%jeg:g_in%jsg:-1)
372  g%gridLatT(:) = g_in%gridLonT(:)
373  g%gridLonB(:) = g_in%gridLatB(g_in%jeg:(g_in%jsg-1):-1)
374  g%gridLatB(:) = g_in%gridLonB(:)
375  else
376  g%gridLonT(:) = g_in%gridLonT(:)
377  g%gridLatT(:) = g_in%gridLatT(:)
378  g%gridLonB(:) = g_in%gridLonB(:)
379  g%gridLatB(:) = g_in%gridLatB(:)
380  endif
381 
382  g%x_axis_units = g_in%y_axis_units
383  g%y_axis_units = g_in%x_axis_units
384  g%south_lat = g_in%south_lat
385  g%west_lon = g_in%west_lon
386  g%len_lat = g_in%len_lat
387  g%len_lon = g_in%len_lon
388 
389  ! Rotation-invariant fields
390  g%areaT_global = g_in%areaT_global
391  g%IareaT_global = g_in%IareaT_global
392  g%Rad_Earth = g_in%Rad_Earth
393  g%max_depth = g_in%max_depth
394 
395  call set_derived_dyn_horgrid(g, us)
396 end subroutine rotate_dyngrid
397 
398 end module mom_transcribe_grid
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:26
Provides the ocean grid type.
Definition: MOM_grid.F90:2
Describes the horizontal ocean grid with only dynamic memory arrays.
Do a halo update on a pair of arrays representing the two components of a vector. ...
Definition: MOM_domains.F90:59
Describes various unit conversion factors.
Module for supporting the rotation of a field&#39;s index map. The implementation of each angle is descri...
Provides a transparent unit rescaling type to facilitate dimensional consistency testing.
Describes the decomposed MOM domain and has routines for communications across PEs.
Definition: MOM_domains.F90:2
Routines for error handling and I/O management.
Rotate the elements of an array to the rotated set of indices. Rotation is applied across the first a...
Module with routines for copying information from a shared dynamic horizontal grid to an ocean-specif...
Contains a shareable dynamic type for describing horizontal grids and metric data and utilty routines...
Do a halo update on an array.
Definition: MOM_domains.F90:54
Rotate a pair of arrays which map to a rotated set of indices. Rotation is applied across the first a...