14 implicit none ;
private
27 integer :: isd, ied, jsd, jed
28 integer :: isdb, iedb, jsdb, jedb
29 integer :: ido, jdo, ido2, jdo2
37 ido = dg%idg_offset - og%idg_offset
38 jdo = dg%jdg_offset - og%jdg_offset
40 isd = max(og%isd, dg%isd+ido) ; jsd = max(og%jsd, dg%jsd+jdo)
41 ied = min(og%ied, dg%ied+ido) ; jed = min(og%jed, dg%jed+jdo)
42 isdb = max(og%IsdB, dg%IsdB+ido) ; jsdb = max(og%JsdB, dg%JsdB+jdo)
43 iedb = min(og%IedB, dg%IedB+ido) ; jedb = min(og%JedB, dg%JedB+jdo)
46 if ((isd > og%isc) .or. (ied < og%ied) .or. (jsd > og%jsc) .or. (jed > og%jed)) &
47 call mom_error(fatal,
"copy_dyngrid_to_MOM_grid called with incompatible grids.")
49 do i=isd,ied ;
do j=jsd,jed
50 og%geoLonT(i,j) = dg%geoLonT(i+ido,j+jdo)
51 og%geoLatT(i,j) = dg%geoLatT(i+ido,j+jdo)
52 og%dxT(i,j) = dg%dxT(i+ido,j+jdo)
53 og%dyT(i,j) = dg%dyT(i+ido,j+jdo)
54 og%areaT(i,j) = dg%areaT(i+ido,j+jdo)
55 og%bathyT(i,j) = dg%bathyT(i+ido,j+jdo)
57 og%dF_dx(i,j) = dg%dF_dx(i+ido,j+jdo)
58 og%dF_dy(i,j) = dg%dF_dy(i+ido,j+jdo)
59 og%sin_rot(i,j) = dg%sin_rot(i+ido,j+jdo)
60 og%cos_rot(i,j) = dg%cos_rot(i+ido,j+jdo)
61 og%mask2dT(i,j) = dg%mask2dT(i+ido,j+jdo)
64 do i=isdb,iedb ;
do j=jsd,jed
65 og%geoLonCu(i,j) = dg%geoLonCu(i+ido,j+jdo)
66 og%geoLatCu(i,j) = dg%geoLatCu(i+ido,j+jdo)
67 og%dxCu(i,j) = dg%dxCu(i+ido,j+jdo)
68 og%dyCu(i,j) = dg%dyCu(i+ido,j+jdo)
69 og%dy_Cu(i,j) = dg%dy_Cu(i+ido,j+jdo)
71 og%mask2dCu(i,j) = dg%mask2dCu(i+ido,j+jdo)
72 og%areaCu(i,j) = dg%areaCu(i+ido,j+jdo)
73 og%IareaCu(i,j) = dg%IareaCu(i+ido,j+jdo)
76 do i=isd,ied ;
do j=jsdb,jedb
77 og%geoLonCv(i,j) = dg%geoLonCv(i+ido,j+jdo)
78 og%geoLatCv(i,j) = dg%geoLatCv(i+ido,j+jdo)
79 og%dxCv(i,j) = dg%dxCv(i+ido,j+jdo)
80 og%dyCv(i,j) = dg%dyCv(i+ido,j+jdo)
81 og%dx_Cv(i,j) = dg%dx_Cv(i+ido,j+jdo)
83 og%mask2dCv(i,j) = dg%mask2dCv(i+ido,j+jdo)
84 og%areaCv(i,j) = dg%areaCv(i+ido,j+jdo)
85 og%IareaCv(i,j) = dg%IareaCv(i+ido,j+jdo)
88 do i=isdb,iedb ;
do j=jsdb,jedb
89 og%geoLonBu(i,j) = dg%geoLonBu(i+ido,j+jdo)
90 og%geoLatBu(i,j) = dg%geoLatBu(i+ido,j+jdo)
91 og%dxBu(i,j) = dg%dxBu(i+ido,j+jdo)
92 og%dyBu(i,j) = dg%dyBu(i+ido,j+jdo)
93 og%areaBu(i,j) = dg%areaBu(i+ido,j+jdo)
94 og%CoriolisBu(i,j) = dg%CoriolisBu(i+ido,j+jdo)
95 og%mask2dBu(i,j) = dg%mask2dBu(i+ido,j+jdo)
98 og%bathymetry_at_vel = dg%bathymetry_at_vel
99 if (og%bathymetry_at_vel)
then
100 do i=isdb,iedb ;
do j=jsd,jed
101 og%Dblock_u(i,j) = dg%Dblock_u(i+ido,j+jdo)
102 og%Dopen_u(i,j) = dg%Dopen_u(i+ido,j+jdo)
104 do i=isd,ied ;
do j=jsdb,jedb
105 og%Dblock_v(i,j) = dg%Dblock_v(i+ido,j+jdo)
106 og%Dopen_v(i,j) = dg%Dopen_v(i+ido,j+jdo)
110 og%gridLonT(og%isg:og%ieg) = dg%gridLonT(dg%isg:dg%ieg)
111 og%gridLatT(og%jsg:og%jeg) = dg%gridLatT(dg%jsg:dg%jeg)
116 ido2 = dg%IegB-og%IegB ; igst = max(og%IsgB, (dg%isg-1)-ido2)
117 jdo2 = dg%JegB-og%JegB ; jgst = max(og%JsgB, (dg%jsg-1)-jdo2)
118 do i=igst,og%IegB ; og%gridLonB(i) = dg%gridLonB(i+ido2) ;
enddo
119 do j=jgst,og%JegB ; og%gridLatB(j) = dg%gridLatB(j+jdo2) ;
enddo
122 og%x_axis_units = dg%x_axis_units ; og%y_axis_units = dg%y_axis_units
123 og%areaT_global = dg%areaT_global ; og%IareaT_global = dg%IareaT_global
124 og%south_lat = dg%south_lat ; og%west_lon = dg%west_lon
125 og%len_lat = dg%len_lat ; og%len_lon = dg%len_lon
126 og%Rad_Earth = dg%Rad_Earth ; og%max_depth = dg%max_depth
131 call pass_var(og%geoLonT, og%Domain)
132 call pass_var(og%geoLatT, og%Domain)
136 call pass_var(og%mask2dT, og%Domain)
142 call pass_vector(og%mask2dCu, og%mask2dCv, og%Domain,
to_all+scalar_pair, cgrid_ne)
143 call pass_vector(og%IareaCu, og%IareaCv, og%Domain,
to_all+scalar_pair, cgrid_ne)
144 call pass_vector(og%IareaCu, og%IareaCv, og%Domain,
to_all+scalar_pair, cgrid_ne)
145 call pass_vector(og%geoLatCu, og%geoLatCv, og%Domain,
to_all+scalar_pair, cgrid_ne)
147 call pass_var(og%areaBu, og%Domain, position=corner)
148 call pass_var(og%geoLonBu, og%Domain, position=corner, inner_halo=og%isc-isd)
149 call pass_var(og%geoLatBu, og%Domain, position=corner)
151 call pass_var(og%CoriolisBu, og%Domain, position=corner)
152 call pass_var(og%mask2dBu, og%Domain, position=corner)
154 if (og%bathymetry_at_vel)
then
155 call pass_vector(og%Dblock_u, og%Dblock_v, og%Domain,
to_all+scalar_pair, cgrid_ne)
156 call pass_vector(og%Dopen_u, og%Dopen_v, og%Domain,
to_all+scalar_pair, cgrid_ne)
171 integer :: isd, ied, jsd, jed
172 integer :: isdb, iedb, jsdb, jedb
173 integer :: ido, jdo, ido2, jdo2
174 integer :: igst, jgst
181 ido = og%idG_offset - dg%idG_offset
182 jdo = og%jdG_offset - dg%jdG_offset
184 isd = max(dg%isd, og%isd+ido) ; jsd = max(dg%jsd, og%jsd+jdo)
185 ied = min(dg%ied, og%ied+ido) ; jed = min(dg%jed, og%jed+jdo)
186 isdb = max(dg%IsdB, og%IsdB+ido) ; jsdb = max(dg%JsdB, og%JsdB+jdo)
187 iedb = min(dg%IedB, og%IedB+ido) ; jedb = min(dg%JedB, og%JedB+jdo)
190 if ((isd > dg%isc) .or. (ied < dg%ied) .or. (jsd > dg%jsc) .or. (jed > dg%jed)) &
191 call mom_error(fatal,
"copy_dyngrid_to_MOM_grid called with incompatible grids.")
193 do i=isd,ied ;
do j=jsd,jed
194 dg%geoLonT(i,j) = og%geoLonT(i+ido,j+jdo)
195 dg%geoLatT(i,j) = og%geoLatT(i+ido,j+jdo)
196 dg%dxT(i,j) = og%dxT(i+ido,j+jdo)
197 dg%dyT(i,j) = og%dyT(i+ido,j+jdo)
198 dg%areaT(i,j) = og%areaT(i+ido,j+jdo)
199 dg%bathyT(i,j) = og%bathyT(i+ido,j+jdo)
201 dg%dF_dx(i,j) = og%dF_dx(i+ido,j+jdo)
202 dg%dF_dy(i,j) = og%dF_dy(i+ido,j+jdo)
203 dg%sin_rot(i,j) = og%sin_rot(i+ido,j+jdo)
204 dg%cos_rot(i,j) = og%cos_rot(i+ido,j+jdo)
205 dg%mask2dT(i,j) = og%mask2dT(i+ido,j+jdo)
208 do i=isdb,iedb ;
do j=jsd,jed
209 dg%geoLonCu(i,j) = og%geoLonCu(i+ido,j+jdo)
210 dg%geoLatCu(i,j) = og%geoLatCu(i+ido,j+jdo)
211 dg%dxCu(i,j) = og%dxCu(i+ido,j+jdo)
212 dg%dyCu(i,j) = og%dyCu(i+ido,j+jdo)
213 dg%dy_Cu(i,j) = og%dy_Cu(i+ido,j+jdo)
215 dg%mask2dCu(i,j) = og%mask2dCu(i+ido,j+jdo)
216 dg%areaCu(i,j) = og%areaCu(i+ido,j+jdo)
217 dg%IareaCu(i,j) = og%IareaCu(i+ido,j+jdo)
220 do i=isd,ied ;
do j=jsdb,jedb
221 dg%geoLonCv(i,j) = og%geoLonCv(i+ido,j+jdo)
222 dg%geoLatCv(i,j) = og%geoLatCv(i+ido,j+jdo)
223 dg%dxCv(i,j) = og%dxCv(i+ido,j+jdo)
224 dg%dyCv(i,j) = og%dyCv(i+ido,j+jdo)
225 dg%dx_Cv(i,j) = og%dx_Cv(i+ido,j+jdo)
227 dg%mask2dCv(i,j) = og%mask2dCv(i+ido,j+jdo)
228 dg%areaCv(i,j) = og%areaCv(i+ido,j+jdo)
229 dg%IareaCv(i,j) = og%IareaCv(i+ido,j+jdo)
232 do i=isdb,iedb ;
do j=jsdb,jedb
233 dg%geoLonBu(i,j) = og%geoLonBu(i+ido,j+jdo)
234 dg%geoLatBu(i,j) = og%geoLatBu(i+ido,j+jdo)
235 dg%dxBu(i,j) = og%dxBu(i+ido,j+jdo)
236 dg%dyBu(i,j) = og%dyBu(i+ido,j+jdo)
237 dg%areaBu(i,j) = og%areaBu(i+ido,j+jdo)
238 dg%CoriolisBu(i,j) = og%CoriolisBu(i+ido,j+jdo)
239 dg%mask2dBu(i,j) = og%mask2dBu(i+ido,j+jdo)
242 dg%bathymetry_at_vel = og%bathymetry_at_vel
243 if (dg%bathymetry_at_vel)
then
244 do i=isdb,iedb ;
do j=jsd,jed
245 dg%Dblock_u(i,j) = og%Dblock_u(i+ido,j+jdo)
246 dg%Dopen_u(i,j) = og%Dopen_u(i+ido,j+jdo)
248 do i=isd,ied ;
do j=jsdb,jedb
249 dg%Dblock_v(i,j) = og%Dblock_v(i+ido,j+jdo)
250 dg%Dopen_v(i,j) = og%Dopen_v(i+ido,j+jdo)
254 dg%gridLonT(dg%isg:dg%ieg) = og%gridLonT(og%isg:og%ieg)
255 dg%gridLatT(dg%jsg:dg%jeg) = og%gridLatT(og%jsg:og%jeg)
261 ido2 = og%IegB-dg%IegB ; igst = max(dg%isg-1, og%IsgB-ido2)
262 jdo2 = og%JegB-dg%JegB ; jgst = max(dg%jsg-1, og%JsgB-jdo2)
263 do i=igst,dg%IegB ; dg%gridLonB(i) = og%gridLonB(i+ido2) ;
enddo
264 do j=jgst,dg%JegB ; dg%gridLatB(j) = og%gridLatB(j+jdo2) ;
enddo
267 dg%x_axis_units = og%x_axis_units ; dg%y_axis_units = og%y_axis_units
268 dg%areaT_global = og%areaT_global ; dg%IareaT_global = og%IareaT_global
269 dg%south_lat = og%south_lat ; dg%west_lon = og%west_lon
270 dg%len_lat = og%len_lat ; dg%len_lon = og%len_lon
271 dg%Rad_Earth = og%Rad_Earth ; dg%max_depth = og%max_depth
276 call pass_var(dg%geoLonT, dg%Domain)
277 call pass_var(dg%geoLatT, dg%Domain)
281 call pass_var(dg%mask2dT, dg%Domain)
287 call pass_vector(dg%mask2dCu, dg%mask2dCv, dg%Domain,
to_all+scalar_pair, cgrid_ne)
288 call pass_vector(dg%IareaCu, dg%IareaCv, dg%Domain,
to_all+scalar_pair, cgrid_ne)
289 call pass_vector(dg%IareaCu, dg%IareaCv, dg%Domain,
to_all+scalar_pair, cgrid_ne)
290 call pass_vector(dg%geoLatCu, dg%geoLatCv, dg%Domain,
to_all+scalar_pair, cgrid_ne)
292 call pass_var(dg%areaBu, dg%Domain, position=corner)
293 call pass_var(dg%geoLonBu, dg%Domain, position=corner, inner_halo=dg%isc-isd)
294 call pass_var(dg%geoLatBu, dg%Domain, position=corner)
296 call pass_var(dg%CoriolisBu, dg%Domain, position=corner)
297 call pass_var(dg%mask2dBu, dg%Domain, position=corner)
299 if (dg%bathymetry_at_vel)
then
300 call pass_vector(dg%Dblock_u, dg%Dblock_v, dg%Domain,
to_all+scalar_pair, cgrid_ne)
301 call pass_vector(dg%Dopen_u, dg%Dopen_v, dg%Domain,
to_all+scalar_pair, cgrid_ne)