Copies information from a dynamic (shared) horizontal grid type into an ocean_grid_type.
23 type(dyn_horgrid_type),
intent(in) :: dG
24 type(ocean_grid_type),
intent(inout) :: oG
25 type(unit_scale_type),
intent(in) :: US
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
129 call pass_var(og%areaT, og%Domain)
130 call pass_var(og%bathyT, og%Domain)
131 call pass_var(og%geoLonT, og%Domain)
132 call pass_var(og%geoLatT, og%Domain)
133 call pass_vector(og%dxT, og%dyT, og%Domain, to_all+scalar_pair, agrid)
134 call pass_vector(og%dF_dx, og%dF_dy, og%Domain, to_all, agrid)
135 call pass_vector(og%cos_rot, og%sin_rot, og%Domain, to_all, agrid)
136 call pass_var(og%mask2dT, og%Domain)
138 call pass_vector(og%areaCu, og%areaCv, og%Domain, to_all+scalar_pair, cgrid_ne)
139 call pass_vector(og%dyCu, og%dxCv, og%Domain, to_all+scalar_pair, cgrid_ne)
140 call pass_vector(og%dxCu, og%dyCv, og%Domain, to_all+scalar_pair, cgrid_ne)
141 call pass_vector(og%dy_Cu, og%dx_Cv, og%Domain, to_all+scalar_pair, cgrid_ne)
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)
150 call pass_vector(og%dxBu, og%dyBu, og%Domain, to_all+scalar_pair, bgrid_ne)
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)
159 call set_derived_metrics(og, us)