1 | MODULE bdydta |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE bdydta *** |
---|
4 | !! Open boundary data : read the data for the unstructured open boundaries. |
---|
5 | !!====================================================================== |
---|
6 | !! History : 1.0 ! 2005-01 (J. Chanut, A. Sellar) Original code |
---|
7 | !! - ! 2007-01 (D. Storkey) Update to use IOM module |
---|
8 | !! - ! 2007-07 (D. Storkey) add bdy_dta_fla |
---|
9 | !! 3.0 ! 2008-04 (NEMO team) add in the reference version |
---|
10 | !! 3.3 ! 2010-09 (E.O'Dea) modifications for Shelf configurations |
---|
11 | !! 3.3 ! 2010-09 (D.Storkey) add ice boundary conditions |
---|
12 | !! 3.4 ! 2011 (D. Storkey) rewrite in preparation for OBC-BDY merge |
---|
13 | !! 3.6 ! 2012-01 (C. Rousset) add ice boundary conditions for sea ice |
---|
14 | !! 4.0 ! 2018 (C. Rousset) SI3 compatibility |
---|
15 | !!---------------------------------------------------------------------- |
---|
16 | |
---|
17 | !!---------------------------------------------------------------------- |
---|
18 | !! bdy_dta : read external data along open boundaries from file |
---|
19 | !! bdy_dta_init : initialise arrays etc for reading of external data |
---|
20 | !!---------------------------------------------------------------------- |
---|
21 | USE oce ! ocean dynamics and tracers |
---|
22 | USE dom_oce ! ocean space and time domain |
---|
23 | USE phycst ! physical constants |
---|
24 | USE sbcapr ! atmospheric pressure forcing |
---|
25 | USE sbctide ! Tidal forcing or not |
---|
26 | USE bdy_oce ! ocean open boundary conditions |
---|
27 | USE bdytides ! tidal forcing at boundaries |
---|
28 | #if defined key_si3 |
---|
29 | USE ice ! sea-ice variables |
---|
30 | USE icevar ! redistribute ice input into categories |
---|
31 | #endif |
---|
32 | ! |
---|
33 | USE lib_mpp, ONLY: ctl_stop, ctl_nam |
---|
34 | USE fldread ! read input fields |
---|
35 | USE iom ! IOM library |
---|
36 | USE in_out_manager ! I/O logical units |
---|
37 | USE timing ! Timing |
---|
38 | |
---|
39 | IMPLICIT NONE |
---|
40 | PRIVATE |
---|
41 | |
---|
42 | PUBLIC bdy_dta ! routine called by step.F90 and dynspg_ts.F90 |
---|
43 | PUBLIC bdy_dta_init ! routine called by nemogcm.F90 |
---|
44 | |
---|
45 | INTEGER , PARAMETER :: jpbdyfld = 16 ! maximum number of files to read |
---|
46 | INTEGER , PARAMETER :: jp_bdyssh = 1 ! |
---|
47 | INTEGER , PARAMETER :: jp_bdyu2d = 2 ! |
---|
48 | INTEGER , PARAMETER :: jp_bdyv2d = 3 ! |
---|
49 | INTEGER , PARAMETER :: jp_bdyu3d = 4 ! |
---|
50 | INTEGER , PARAMETER :: jp_bdyv3d = 5 ! |
---|
51 | INTEGER , PARAMETER :: jp_bdytem = 6 ! |
---|
52 | INTEGER , PARAMETER :: jp_bdysal = 7 ! |
---|
53 | INTEGER , PARAMETER :: jp_bdya_i = 8 ! |
---|
54 | INTEGER , PARAMETER :: jp_bdyh_i = 9 ! |
---|
55 | INTEGER , PARAMETER :: jp_bdyh_s = 10 ! |
---|
56 | INTEGER , PARAMETER :: jp_bdyt_i = 11 ! |
---|
57 | INTEGER , PARAMETER :: jp_bdyt_s = 12 ! |
---|
58 | INTEGER , PARAMETER :: jp_bdytsu = 13 ! |
---|
59 | INTEGER , PARAMETER :: jp_bdys_i = 14 ! |
---|
60 | INTEGER , PARAMETER :: jp_bdyaip = 15 ! |
---|
61 | INTEGER , PARAMETER :: jp_bdyhip = 16 ! |
---|
62 | #if ! defined key_si3 |
---|
63 | INTEGER , PARAMETER :: jpl = 1 |
---|
64 | #endif |
---|
65 | |
---|
66 | !$AGRIF_DO_NOT_TREAT |
---|
67 | TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:,:), TARGET :: bf ! structure of input fields (file informations, fields read) |
---|
68 | !$AGRIF_END_DO_NOT_TREAT |
---|
69 | |
---|
70 | !!---------------------------------------------------------------------- |
---|
71 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
72 | !! $Id$ |
---|
73 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
74 | !!---------------------------------------------------------------------- |
---|
75 | CONTAINS |
---|
76 | |
---|
77 | SUBROUTINE bdy_dta( kt, kit, kt_offset ) |
---|
78 | !!---------------------------------------------------------------------- |
---|
79 | !! *** SUBROUTINE bdy_dta *** |
---|
80 | !! |
---|
81 | !! ** Purpose : Update external data for open boundary conditions |
---|
82 | !! |
---|
83 | !! ** Method : Use fldread.F90 |
---|
84 | !! |
---|
85 | !!---------------------------------------------------------------------- |
---|
86 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
87 | INTEGER, INTENT(in), OPTIONAL :: kit ! subcycle time-step index (for timesplitting option) |
---|
88 | INTEGER, INTENT(in), OPTIONAL :: kt_offset ! time offset in units of timesteps. NB. if kit |
---|
89 | ! ! is present then units = subcycle timesteps. |
---|
90 | ! ! kt_offset = 0 => get data at "now" time level |
---|
91 | ! ! kt_offset = -1 => get data at "before" time level |
---|
92 | ! ! kt_offset = +1 => get data at "after" time level |
---|
93 | ! ! etc. |
---|
94 | ! |
---|
95 | INTEGER :: jbdy, jfld, jstart, jend, ib, jl ! dummy loop indices |
---|
96 | INTEGER :: ii, ij, ik, igrd, ipl ! local integers |
---|
97 | INTEGER, DIMENSION(jpbgrd) :: ilen1 |
---|
98 | TYPE(OBC_DATA) , POINTER :: dta_alias ! short cut |
---|
99 | TYPE(FLD), DIMENSION(:), POINTER :: bf_alias |
---|
100 | !!--------------------------------------------------------------------------- |
---|
101 | ! |
---|
102 | IF( ln_timing ) CALL timing_start('bdy_dta') |
---|
103 | ! |
---|
104 | ! Initialise data arrays once for all from initial conditions where required |
---|
105 | !--------------------------------------------------------------------------- |
---|
106 | IF( kt == nit000 .AND. .NOT.PRESENT(kit) ) THEN |
---|
107 | |
---|
108 | ! Calculate depth-mean currents |
---|
109 | !----------------------------- |
---|
110 | |
---|
111 | DO jbdy = 1, nb_bdy |
---|
112 | ! |
---|
113 | IF( nn_dyn2d_dta(jbdy) == 0 ) THEN |
---|
114 | IF( dta_bdy(jbdy)%lneed_ssh ) THEN |
---|
115 | igrd = 1 |
---|
116 | DO ib = 1, idx_bdy(jbdy)%nblenrim(igrd) ! ssh is allocated and used only on the rim |
---|
117 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
118 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
119 | dta_bdy(jbdy)%ssh(ib) = sshn(ii,ij) * tmask(ii,ij,1) |
---|
120 | END DO |
---|
121 | ENDIF |
---|
122 | IF( dta_bdy(jbdy)%lneed_dyn2d) THEN |
---|
123 | igrd = 2 |
---|
124 | DO ib = 1, SIZE(dta_bdy(jbdy)%u2d) ! u2d is used only on the rim except if ln_full_vel = T, see bdy_dta_init |
---|
125 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
126 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
127 | dta_bdy(jbdy)%u2d(ib) = un_b(ii,ij) * umask(ii,ij,1) |
---|
128 | END DO |
---|
129 | igrd = 3 |
---|
130 | DO ib = 1, SIZE(dta_bdy(jbdy)%v2d) ! v2d is used only on the rim except if ln_full_vel = T, see bdy_dta_init |
---|
131 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
132 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
133 | dta_bdy(jbdy)%v2d(ib) = vn_b(ii,ij) * vmask(ii,ij,1) |
---|
134 | END DO |
---|
135 | ENDIF |
---|
136 | ENDIF |
---|
137 | ! |
---|
138 | IF( nn_dyn3d_dta(jbdy) == 0 ) THEN |
---|
139 | IF( dta_bdy(jbdy)%lneed_dyn3d ) THEN |
---|
140 | igrd = 2 |
---|
141 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
142 | DO ik = 1, jpkm1 |
---|
143 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
144 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
145 | dta_bdy(jbdy)%u3d(ib,ik) = ( un(ii,ij,ik) - un_b(ii,ij) ) * umask(ii,ij,ik) |
---|
146 | END DO |
---|
147 | END DO |
---|
148 | igrd = 3 |
---|
149 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
150 | DO ik = 1, jpkm1 |
---|
151 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
152 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
153 | dta_bdy(jbdy)%v3d(ib,ik) = ( vn(ii,ij,ik) - vn_b(ii,ij) ) * vmask(ii,ij,ik) |
---|
154 | END DO |
---|
155 | END DO |
---|
156 | ENDIF |
---|
157 | ENDIF |
---|
158 | |
---|
159 | IF( nn_tra_dta(jbdy) == 0 ) THEN |
---|
160 | IF( dta_bdy(jbdy)%lneed_tra ) THEN |
---|
161 | igrd = 1 |
---|
162 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
163 | DO ik = 1, jpkm1 |
---|
164 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
165 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
166 | dta_bdy(jbdy)%tem(ib,ik) = tsn(ii,ij,ik,jp_tem) * tmask(ii,ij,ik) |
---|
167 | dta_bdy(jbdy)%sal(ib,ik) = tsn(ii,ij,ik,jp_sal) * tmask(ii,ij,ik) |
---|
168 | END DO |
---|
169 | END DO |
---|
170 | ENDIF |
---|
171 | ENDIF |
---|
172 | |
---|
173 | #if defined key_si3 |
---|
174 | IF( nn_ice_dta(jbdy) == 0 ) THEN ! set ice to initial values |
---|
175 | IF( dta_bdy(jbdy)%lneed_ice ) THEN |
---|
176 | igrd = 1 |
---|
177 | DO jl = 1, jpl |
---|
178 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
179 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
180 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
181 | dta_bdy(jbdy)%a_i(ib,jl) = a_i (ii,ij,jl) * tmask(ii,ij,1) |
---|
182 | dta_bdy(jbdy)%h_i(ib,jl) = h_i (ii,ij,jl) * tmask(ii,ij,1) |
---|
183 | dta_bdy(jbdy)%h_s(ib,jl) = h_s (ii,ij,jl) * tmask(ii,ij,1) |
---|
184 | dta_bdy(jbdy)%t_i(ib,jl) = SUM(t_i (ii,ij,:,jl)) * r1_nlay_i * tmask(ii,ij,1) |
---|
185 | dta_bdy(jbdy)%t_s(ib,jl) = SUM(t_s (ii,ij,:,jl)) * r1_nlay_s * tmask(ii,ij,1) |
---|
186 | dta_bdy(jbdy)%tsu(ib,jl) = t_su(ii,ij,jl) * tmask(ii,ij,1) |
---|
187 | dta_bdy(jbdy)%s_i(ib,jl) = s_i (ii,ij,jl) * tmask(ii,ij,1) |
---|
188 | ! melt ponds |
---|
189 | dta_bdy(jbdy)%aip(ib,jl) = a_ip(ii,ij,jl) * tmask(ii,ij,1) |
---|
190 | dta_bdy(jbdy)%hip(ib,jl) = h_ip(ii,ij,jl) * tmask(ii,ij,1) |
---|
191 | END DO |
---|
192 | END DO |
---|
193 | ENDIF |
---|
194 | ENDIF |
---|
195 | #endif |
---|
196 | END DO ! jbdy |
---|
197 | ! |
---|
198 | ENDIF ! kt == nit000 |
---|
199 | |
---|
200 | ! update external data from files |
---|
201 | !-------------------------------- |
---|
202 | |
---|
203 | DO jbdy = 1, nb_bdy |
---|
204 | |
---|
205 | dta_alias => dta_bdy(jbdy) |
---|
206 | bf_alias => bf(:,jbdy) |
---|
207 | |
---|
208 | ! read/update all bdy data |
---|
209 | ! ------------------------ |
---|
210 | CALL fld_read( kt, 1, bf_alias, kit = kit, kt_offset = kt_offset ) |
---|
211 | |
---|
212 | ! apply some corrections in some specific cases... |
---|
213 | ! -------------------------------------------------- |
---|
214 | ! |
---|
215 | ! if runoff condition: change river flow we read (in m3/s) into barotropic velocity (m/s) |
---|
216 | IF( cn_tra(jbdy) == 'runoff' .AND. TRIM(bf_alias(jp_bdyu2d)%clrootname) /= 'NOT USED' ) THEN ! runoff and we read u/v2d |
---|
217 | ! |
---|
218 | igrd = 2 ! zonal flow (m3/s) to barotropic zonal velocity (m/s) |
---|
219 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
220 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
221 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
222 | dta_alias%u2d(ib) = dta_alias%u2d(ib) / ( e2u(ii,ij) * hu_0(ii,ij) ) |
---|
223 | END DO |
---|
224 | igrd = 3 ! meridional flow (m3/s) to barotropic meridional velocity (m/s) |
---|
225 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
226 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
227 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
228 | dta_alias%v2d(ib) = dta_alias%v2d(ib) / ( e1v(ii,ij) * hv_0(ii,ij) ) |
---|
229 | END DO |
---|
230 | ENDIF |
---|
231 | |
---|
232 | ! tidal harmonic forcing ONLY: initialise arrays |
---|
233 | IF( nn_dyn2d_dta(jbdy) == 2 ) THEN ! we did not read ssh, u/v2d |
---|
234 | IF( dta_alias%lneed_ssh ) dta_alias%ssh(:) = 0._wp |
---|
235 | IF( dta_alias%lneed_dyn2d ) dta_alias%u2d(:) = 0._wp |
---|
236 | IF( dta_alias%lneed_dyn2d ) dta_alias%v2d(:) = 0._wp |
---|
237 | ENDIF |
---|
238 | |
---|
239 | ! If full velocities in boundary data, then split it into barotropic and baroclinic component |
---|
240 | IF( bf_alias(jp_bdyu3d)%ltotvel ) THEN ! if we read 3D total velocity (can be true only if u3d was read) |
---|
241 | ! |
---|
242 | igrd = 2 ! zonal velocity |
---|
243 | dta_alias%u2d(:) = 0._wp ! compute barotrope zonal velocity and put it in u2d |
---|
244 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
245 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
246 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
247 | DO ik = 1, jpkm1 |
---|
248 | dta_alias%u2d(ib) = dta_alias%u2d(ib) + e3u_n(ii,ij,ik) * umask(ii,ij,ik) * dta_alias%u3d(ib,ik) |
---|
249 | END DO |
---|
250 | dta_alias%u2d(ib) = dta_alias%u2d(ib) * r1_hu_n(ii,ij) |
---|
251 | DO ik = 1, jpkm1 ! compute barocline zonal velocity and put it in u3d |
---|
252 | dta_alias%u3d(ib,ik) = dta_alias%u3d(ib,ik) - dta_alias%u2d(ib) |
---|
253 | END DO |
---|
254 | END DO |
---|
255 | igrd = 3 ! meridional velocity |
---|
256 | dta_alias%v2d(:) = 0._wp ! compute barotrope meridional velocity and put it in v2d |
---|
257 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
258 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
259 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
260 | DO ik = 1, jpkm1 |
---|
261 | dta_alias%v2d(ib) = dta_alias%v2d(ib) + e3v_n(ii,ij,ik) * vmask(ii,ij,ik) * dta_alias%v3d(ib,ik) |
---|
262 | END DO |
---|
263 | dta_alias%v2d(ib) = dta_alias%v2d(ib) * r1_hv_n(ii,ij) |
---|
264 | DO ik = 1, jpkm1 ! compute barocline meridional velocity and put it in v3d |
---|
265 | dta_alias%v3d(ib,ik) = dta_alias%v3d(ib,ik) - dta_alias%v2d(ib) |
---|
266 | END DO |
---|
267 | END DO |
---|
268 | ENDIF ! ltotvel |
---|
269 | |
---|
270 | ! update tidal harmonic forcing |
---|
271 | IF( PRESENT(kit) .AND. nn_dyn2d_dta(jbdy) .GE. 2 ) THEN |
---|
272 | CALL bdytide_update( kt = kt, idx = idx_bdy(jbdy), dta = dta_alias, td = tides(jbdy), & |
---|
273 | & kit = kit, kt_offset = kt_offset ) |
---|
274 | ENDIF |
---|
275 | |
---|
276 | ! atm surface pressure : add inverted barometer effect to ssh if it was read |
---|
277 | IF ( ln_apr_obc .AND. TRIM(bf_alias(jp_bdyssh)%clrootname) /= 'NOT USED' ) THEN |
---|
278 | igrd = 1 |
---|
279 | DO ib = 1, idx_bdy(jbdy)%nblenrim(igrd) ! ssh is used only on the rim |
---|
280 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
281 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
282 | dta_alias%ssh(ib) = dta_alias%ssh(ib) + ssh_ib(ii,ij) |
---|
283 | END DO |
---|
284 | ENDIF |
---|
285 | |
---|
286 | #if defined key_si3 |
---|
287 | IF( dta_alias%lneed_ice ) THEN |
---|
288 | ! fill temperature and salinity arrays |
---|
289 | IF( TRIM(bf_alias(jp_bdyt_i)%clrootname) == 'NOT USED' ) bf_alias(jp_bdyt_i)%fnow(:,1,:) = rice_tem (jbdy) |
---|
290 | IF( TRIM(bf_alias(jp_bdyt_s)%clrootname) == 'NOT USED' ) bf_alias(jp_bdyt_s)%fnow(:,1,:) = rice_tem (jbdy) |
---|
291 | IF( TRIM(bf_alias(jp_bdytsu)%clrootname) == 'NOT USED' ) bf_alias(jp_bdytsu)%fnow(:,1,:) = rice_tem (jbdy) |
---|
292 | IF( TRIM(bf_alias(jp_bdys_i)%clrootname) == 'NOT USED' ) bf_alias(jp_bdys_i)%fnow(:,1,:) = rice_sal (jbdy) |
---|
293 | IF( TRIM(bf_alias(jp_bdyaip)%clrootname) == 'NOT USED' ) bf_alias(jp_bdyaip)%fnow(:,1,:) = rice_apnd(jbdy) * & ! rice_apnd is the pond fraction |
---|
294 | & bf_alias(jp_bdya_i)%fnow(:,1,:) ! ( a_ip = rice_apnd * a_i ) |
---|
295 | IF( TRIM(bf_alias(jp_bdyhip)%clrootname) == 'NOT USED' ) bf_alias(jp_bdyhip)%fnow(:,1,:) = rice_hpnd(jbdy) |
---|
296 | |
---|
297 | ! if T_i is read and not T_su, set T_su = T_i |
---|
298 | IF( TRIM(bf_alias(jp_bdyt_i)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdytsu)%clrootname) == 'NOT USED' ) & |
---|
299 | & bf_alias(jp_bdytsu)%fnow(:,1,:) = bf_alias(jp_bdyt_i)%fnow(:,1,:) |
---|
300 | ! if T_s is read and not T_su, set T_su = T_s |
---|
301 | IF( TRIM(bf_alias(jp_bdyt_s)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdytsu)%clrootname) == 'NOT USED' ) & |
---|
302 | & bf_alias(jp_bdytsu)%fnow(:,1,:) = bf_alias(jp_bdyt_s)%fnow(:,1,:) |
---|
303 | ! if T_i is read and not T_s, set T_s = T_i |
---|
304 | IF( TRIM(bf_alias(jp_bdyt_i)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdyt_s)%clrootname) == 'NOT USED' ) & |
---|
305 | & bf_alias(jp_bdyt_s)%fnow(:,1,:) = bf_alias(jp_bdyt_i)%fnow(:,1,:) |
---|
306 | ! if T_su is read and not T_s, set T_s = T_su |
---|
307 | IF( TRIM(bf_alias(jp_bdytsu)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdyt_s)%clrootname) == 'NOT USED' ) & |
---|
308 | & bf_alias(jp_bdyt_s)%fnow(:,1,:) = bf_alias(jp_bdytsu)%fnow(:,1,:) |
---|
309 | ! if T_su is read and not T_i, set T_i = (T_su + T_freeze)/2 |
---|
310 | IF( TRIM(bf_alias(jp_bdytsu)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdyt_i)%clrootname) == 'NOT USED' ) & |
---|
311 | & bf_alias(jp_bdyt_i)%fnow(:,1,:) = 0.5_wp * ( bf_alias(jp_bdytsu)%fnow(:,1,:) + 271.15 ) |
---|
312 | ! if T_s is read and not T_i, set T_i = (T_s + T_freeze)/2 |
---|
313 | IF( TRIM(bf_alias(jp_bdyt_s)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdyt_i)%clrootname) == 'NOT USED' ) & |
---|
314 | & bf_alias(jp_bdyt_i)%fnow(:,1,:) = 0.5_wp * ( bf_alias(jp_bdyt_s)%fnow(:,1,:) + 271.15 ) |
---|
315 | |
---|
316 | ! make sure ponds = 0 if no ponds scheme |
---|
317 | IF ( .NOT.ln_pnd ) THEN |
---|
318 | bf_alias(jp_bdyaip)%fnow(:,1,:) = 0._wp |
---|
319 | bf_alias(jp_bdyhip)%fnow(:,1,:) = 0._wp |
---|
320 | ENDIF |
---|
321 | |
---|
322 | ! convert N-cat fields (input) into jpl-cat (output) |
---|
323 | ipl = SIZE(bf_alias(jp_bdya_i)%fnow, 3) |
---|
324 | IF( ipl /= jpl ) THEN ! ice: convert N-cat fields (input) into jpl-cat (output) |
---|
325 | CALL ice_var_itd( bf_alias(jp_bdyh_i)%fnow(:,1,:), bf_alias(jp_bdyh_s)%fnow(:,1,:), bf_alias(jp_bdya_i)%fnow(:,1,:), & |
---|
326 | & dta_alias%h_i , dta_alias%h_s , dta_alias%a_i , & |
---|
327 | & bf_alias(jp_bdyt_i)%fnow(:,1,:), bf_alias(jp_bdyt_s)%fnow(:,1,:), & |
---|
328 | & bf_alias(jp_bdytsu)%fnow(:,1,:), bf_alias(jp_bdys_i)%fnow(:,1,:), & |
---|
329 | & bf_alias(jp_bdyaip)%fnow(:,1,:), bf_alias(jp_bdyhip)%fnow(:,1,:), & |
---|
330 | & dta_alias%t_i , dta_alias%t_s , & |
---|
331 | & dta_alias%tsu , dta_alias%s_i , & |
---|
332 | & dta_alias%aip , dta_alias%hip ) |
---|
333 | ENDIF |
---|
334 | ENDIF |
---|
335 | #endif |
---|
336 | END DO ! jbdy |
---|
337 | |
---|
338 | IF ( ln_tide ) THEN |
---|
339 | IF (ln_dynspg_ts) THEN ! Fill temporary arrays with slow-varying bdy data |
---|
340 | DO jbdy = 1, nb_bdy ! Tidal component added in ts loop |
---|
341 | IF ( nn_dyn2d_dta(jbdy) .GE. 2 ) THEN |
---|
342 | IF( cn_dyn2d(jbdy) == 'frs' ) THEN ; ilen1(:)=idx_bdy(jbdy)%nblen(:) |
---|
343 | ELSE ; ilen1(:)=idx_bdy(jbdy)%nblenrim(:) |
---|
344 | ENDIF |
---|
345 | IF ( dta_bdy(jbdy)%lneed_ssh ) dta_bdy_s(jbdy)%ssh(1:ilen1(1)) = dta_bdy(jbdy)%ssh(1:ilen1(1)) |
---|
346 | IF ( dta_bdy(jbdy)%lneed_dyn2d ) dta_bdy_s(jbdy)%u2d(1:ilen1(2)) = dta_bdy(jbdy)%u2d(1:ilen1(2)) |
---|
347 | IF ( dta_bdy(jbdy)%lneed_dyn2d ) dta_bdy_s(jbdy)%v2d(1:ilen1(3)) = dta_bdy(jbdy)%v2d(1:ilen1(3)) |
---|
348 | ENDIF |
---|
349 | END DO |
---|
350 | ELSE ! Add tides if not split-explicit free surface else this is done in ts loop |
---|
351 | ! |
---|
352 | CALL bdy_dta_tides( kt=kt, kt_offset=kt_offset ) |
---|
353 | ENDIF |
---|
354 | ENDIF |
---|
355 | ! |
---|
356 | IF( ln_timing ) CALL timing_stop('bdy_dta') |
---|
357 | ! |
---|
358 | END SUBROUTINE bdy_dta |
---|
359 | |
---|
360 | |
---|
361 | SUBROUTINE bdy_dta_init |
---|
362 | !!---------------------------------------------------------------------- |
---|
363 | !! *** SUBROUTINE bdy_dta_init *** |
---|
364 | !! |
---|
365 | !! ** Purpose : Initialise arrays for reading of external data |
---|
366 | !! for open boundary conditions |
---|
367 | !! |
---|
368 | !! ** Method : |
---|
369 | !! |
---|
370 | !!---------------------------------------------------------------------- |
---|
371 | INTEGER :: jbdy, jfld ! Local integers |
---|
372 | INTEGER :: ierror, ios ! |
---|
373 | ! |
---|
374 | CHARACTER(len=3) :: cl3 ! |
---|
375 | CHARACTER(len=100) :: cn_dir ! Root directory for location of data files |
---|
376 | LOGICAL :: ln_full_vel ! =T => full velocities in 3D boundary data |
---|
377 | ! ! =F => baroclinic velocities in 3D boundary data |
---|
378 | LOGICAL :: ln_zinterp ! =T => requires a vertical interpolation of the bdydta |
---|
379 | REAL(wp) :: rn_ice_tem, rn_ice_sal, rn_ice_age, rn_ice_apnd, rn_ice_hpnd |
---|
380 | INTEGER :: ipk,ipl ! |
---|
381 | INTEGER :: idvar ! variable ID |
---|
382 | INTEGER :: indims ! number of dimensions of the variable |
---|
383 | INTEGER :: iszdim ! number of dimensions of the variable |
---|
384 | INTEGER, DIMENSION(4) :: i4dimsz ! size of variable dimensions |
---|
385 | INTEGER :: igrd ! index for grid type (1,2,3 = T,U,V) |
---|
386 | LOGICAL :: lluld ! is the variable using the unlimited dimension |
---|
387 | LOGICAL :: llneed ! |
---|
388 | LOGICAL :: llread ! |
---|
389 | TYPE(FLD_N), DIMENSION(1), TARGET :: bn_tem, bn_sal, bn_u3d, bn_v3d ! must be an array to be used with fld_fill |
---|
390 | TYPE(FLD_N), DIMENSION(1), TARGET :: bn_ssh, bn_u2d, bn_v2d ! informations about the fields to be read |
---|
391 | TYPE(FLD_N), DIMENSION(1), TARGET :: bn_a_i, bn_h_i, bn_h_s, bn_t_i, bn_t_s, bn_tsu, bn_s_i, bn_aip, bn_hip |
---|
392 | TYPE(FLD_N), DIMENSION(:), POINTER :: bn_alias ! must be an array to be used with fld_fill |
---|
393 | TYPE(FLD ), DIMENSION(:), POINTER :: bf_alias |
---|
394 | ! |
---|
395 | NAMELIST/nambdy_dta/ cn_dir, bn_tem, bn_sal, bn_u3d, bn_v3d, bn_ssh, bn_u2d, bn_v2d |
---|
396 | NAMELIST/nambdy_dta/ bn_a_i, bn_h_i, bn_h_s, bn_t_i, bn_t_s, bn_tsu, bn_s_i, bn_aip, bn_hip |
---|
397 | NAMELIST/nambdy_dta/ rn_ice_tem, rn_ice_sal, rn_ice_age, rn_ice_apnd, rn_ice_hpnd |
---|
398 | NAMELIST/nambdy_dta/ ln_full_vel, ln_zinterp |
---|
399 | !!--------------------------------------------------------------------------- |
---|
400 | ! |
---|
401 | IF(lwp) WRITE(numout,*) |
---|
402 | IF(lwp) WRITE(numout,*) 'bdy_dta_ini : initialization of data at the open boundaries' |
---|
403 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~' |
---|
404 | IF(lwp) WRITE(numout,*) '' |
---|
405 | |
---|
406 | ALLOCATE( bf(jpbdyfld,nb_bdy), STAT=ierror ) |
---|
407 | IF( ierror > 0 ) THEN |
---|
408 | CALL ctl_stop( 'bdy_dta: unable to allocate bf structure' ) ; RETURN |
---|
409 | ENDIF |
---|
410 | bf(:,:)%clrootname = 'NOT USED' ! default definition used as a flag in fld_read to do nothing. |
---|
411 | bf(:,:)%lzint = .FALSE. ! default definition |
---|
412 | bf(:,:)%ltotvel = .FALSE. ! default definition |
---|
413 | |
---|
414 | ! Read namelists |
---|
415 | ! -------------- |
---|
416 | REWIND(numnam_cfg) |
---|
417 | DO jbdy = 1, nb_bdy |
---|
418 | |
---|
419 | WRITE(ctmp1, '(a,i2)') 'BDY number ', jbdy |
---|
420 | WRITE(ctmp2, '(a,i2)') 'block nambdy_dta number ', jbdy |
---|
421 | |
---|
422 | ! There is only one nambdy_dta block in namelist_ref -> use it for each bdy so we do a rewind |
---|
423 | REWIND(numnam_ref) |
---|
424 | READ ( numnam_ref, nambdy_dta, IOSTAT = ios, ERR = 901) |
---|
425 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_dta in reference namelist' ) |
---|
426 | |
---|
427 | ! by-pass nambdy_dta reading if no input data used in this bdy |
---|
428 | IF( ( dta_bdy(jbdy)%lneed_dyn2d .AND. MOD(nn_dyn2d_dta(jbdy),2) == 1 ) & |
---|
429 | & .OR. ( dta_bdy(jbdy)%lneed_dyn3d .AND. nn_dyn3d_dta(jbdy) == 1 ) & |
---|
430 | & .OR. ( dta_bdy(jbdy)%lneed_tra .AND. nn_tra_dta(jbdy) == 1 ) & |
---|
431 | & .OR. ( dta_bdy(jbdy)%lneed_ice .AND. nn_ice_dta(jbdy) == 1 ) ) THEN |
---|
432 | ! WARNING: we don't do a rewind here, each bdy reads its own nambdy_dta block one after another |
---|
433 | READ ( numnam_cfg, nambdy_dta, IOSTAT = ios, ERR = 902 ) |
---|
434 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'nambdy_dta in configuration namelist' ) |
---|
435 | IF(lwm) WRITE( numond, nambdy_dta ) |
---|
436 | ENDIF |
---|
437 | |
---|
438 | ! get the number of ice categories in bdy data file (use a_i information to do this) |
---|
439 | ipl = jpl ! default definition |
---|
440 | IF( dta_bdy(jbdy)%lneed_ice ) THEN ! if we need ice bdy data |
---|
441 | IF( nn_ice_dta(jbdy) == 1 ) THEN ! if we get ice bdy data from netcdf file |
---|
442 | CALL fld_fill( bf(jp_bdya_i,jbdy:jbdy), bn_a_i, cn_dir, 'bdy_dta', 'a_i'//' '//ctmp1, ctmp2 ) ! use namelist info |
---|
443 | CALL fld_clopn( bf(jp_bdya_i,jbdy), nyear, nmonth, nday ) ! not a problem when we call it again after |
---|
444 | idvar = iom_varid( bf(jp_bdya_i,jbdy)%num, bf(jp_bdya_i,jbdy)%clvar, kndims=indims, kdimsz=i4dimsz, lduld=lluld ) |
---|
445 | IF( indims == 4 .OR. ( indims == 3 .AND. .NOT. lluld ) ) THEN ; ipl = i4dimsz(3) ! xylt or xyl |
---|
446 | ELSE ; ipl = 1 ! xy or xyt |
---|
447 | ENDIF |
---|
448 | bf(jp_bdya_i,jbdy)%clrootname = 'NOT USED' ! reset to default value as this subdomain may not need to read this bdy |
---|
449 | ENDIF |
---|
450 | ENDIF |
---|
451 | |
---|
452 | #if defined key_si3 |
---|
453 | IF( .NOT.ln_pnd ) THEN |
---|
454 | rn_ice_apnd = 0. ; rn_ice_hpnd = 0. |
---|
455 | CALL ctl_warn( 'rn_ice_apnd & rn_ice_hpnd = 0 when no ponds' ) |
---|
456 | ENDIF |
---|
457 | #endif |
---|
458 | |
---|
459 | ! temp, salt, age and ponds of incoming ice |
---|
460 | rice_tem (jbdy) = rn_ice_tem |
---|
461 | rice_sal (jbdy) = rn_ice_sal |
---|
462 | rice_age (jbdy) = rn_ice_age |
---|
463 | rice_apnd(jbdy) = rn_ice_apnd |
---|
464 | rice_hpnd(jbdy) = rn_ice_hpnd |
---|
465 | |
---|
466 | |
---|
467 | DO jfld = 1, jpbdyfld |
---|
468 | |
---|
469 | ! ===================== |
---|
470 | ! ssh |
---|
471 | ! ===================== |
---|
472 | IF( jfld == jp_bdyssh ) THEN |
---|
473 | cl3 = 'ssh' |
---|
474 | igrd = 1 ! T point |
---|
475 | ipk = 1 ! surface data |
---|
476 | llneed = dta_bdy(jbdy)%lneed_ssh ! dta_bdy(jbdy)%ssh will be needed |
---|
477 | llread = MOD(nn_dyn2d_dta(jbdy),2) == 1 ! get data from NetCDF file |
---|
478 | bf_alias => bf(jp_bdyssh,jbdy:jbdy) ! alias for ssh structure of bdy number jbdy |
---|
479 | bn_alias => bn_ssh ! alias for ssh structure of nambdy_dta |
---|
480 | iszdim = idx_bdy(jbdy)%nblenrim(igrd) ! length of this bdy on this MPI processus : used only on the rim |
---|
481 | ENDIF |
---|
482 | ! ===================== |
---|
483 | ! dyn2d |
---|
484 | ! ===================== |
---|
485 | IF( jfld == jp_bdyu2d ) THEN |
---|
486 | cl3 = 'u2d' |
---|
487 | igrd = 2 ! U point |
---|
488 | ipk = 1 ! surface data |
---|
489 | llneed = dta_bdy(jbdy)%lneed_dyn2d ! dta_bdy(jbdy)%ssh will be needed |
---|
490 | llread = .NOT. ln_full_vel .AND. MOD(nn_dyn2d_dta(jbdy),2) == 1 ! don't get u2d from u3d and read NetCDF file |
---|
491 | bf_alias => bf(jp_bdyu2d,jbdy:jbdy) ! alias for u2d structure of bdy number jbdy |
---|
492 | bn_alias => bn_u2d ! alias for u2d structure of nambdy_dta |
---|
493 | IF( ln_full_vel ) THEN ; iszdim = idx_bdy(jbdy)%nblen(igrd) ! will be computed from u3d -> need on the full bdy |
---|
494 | ELSE ; iszdim = idx_bdy(jbdy)%nblenrim(igrd) ! used only on the rim |
---|
495 | ENDIF |
---|
496 | ENDIF |
---|
497 | IF( jfld == jp_bdyv2d ) THEN |
---|
498 | cl3 = 'v2d' |
---|
499 | igrd = 3 ! V point |
---|
500 | ipk = 1 ! surface data |
---|
501 | llneed = dta_bdy(jbdy)%lneed_dyn2d ! dta_bdy(jbdy)%ssh will be needed |
---|
502 | llread = .NOT. ln_full_vel .AND. MOD(nn_dyn2d_dta(jbdy),2) == 1 ! don't get v2d from v3d and read NetCDF file |
---|
503 | bf_alias => bf(jp_bdyv2d,jbdy:jbdy) ! alias for v2d structure of bdy number jbdy |
---|
504 | bn_alias => bn_v2d ! alias for v2d structure of nambdy_dta |
---|
505 | IF( ln_full_vel ) THEN ; iszdim = idx_bdy(jbdy)%nblen(igrd) ! will be computed from v3d -> need on the full bdy |
---|
506 | ELSE ; iszdim = idx_bdy(jbdy)%nblenrim(igrd) ! used only on the rim |
---|
507 | ENDIF |
---|
508 | ENDIF |
---|
509 | ! ===================== |
---|
510 | ! dyn3d |
---|
511 | ! ===================== |
---|
512 | IF( jfld == jp_bdyu3d ) THEN |
---|
513 | cl3 = 'u3d' |
---|
514 | igrd = 2 ! U point |
---|
515 | ipk = jpk ! 3d data |
---|
516 | llneed = dta_bdy(jbdy)%lneed_dyn3d .OR. & ! dta_bdy(jbdy)%u3d will be needed |
---|
517 | & ( dta_bdy(jbdy)%lneed_dyn2d .AND. ln_full_vel ) ! u3d needed to compute u2d |
---|
518 | llread = nn_dyn3d_dta(jbdy) == 1 ! get data from NetCDF file |
---|
519 | bf_alias => bf(jp_bdyu3d,jbdy:jbdy) ! alias for u3d structure of bdy number jbdy |
---|
520 | bn_alias => bn_u3d ! alias for u3d structure of nambdy_dta |
---|
521 | iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus |
---|
522 | ENDIF |
---|
523 | IF( jfld == jp_bdyv3d ) THEN |
---|
524 | cl3 = 'v3d' |
---|
525 | igrd = 3 ! V point |
---|
526 | ipk = jpk ! 3d data |
---|
527 | llneed = dta_bdy(jbdy)%lneed_dyn3d .OR. & ! dta_bdy(jbdy)%v3d will be needed |
---|
528 | & ( dta_bdy(jbdy)%lneed_dyn2d .AND. ln_full_vel ) ! v3d needed to compute v2d |
---|
529 | llread = nn_dyn3d_dta(jbdy) == 1 ! get data from NetCDF file |
---|
530 | bf_alias => bf(jp_bdyv3d,jbdy:jbdy) ! alias for v3d structure of bdy number jbdy |
---|
531 | bn_alias => bn_v3d ! alias for v3d structure of nambdy_dta |
---|
532 | iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus |
---|
533 | ENDIF |
---|
534 | |
---|
535 | ! ===================== |
---|
536 | ! tra |
---|
537 | ! ===================== |
---|
538 | IF( jfld == jp_bdytem ) THEN |
---|
539 | cl3 = 'tem' |
---|
540 | igrd = 1 ! T point |
---|
541 | ipk = jpk ! 3d data |
---|
542 | llneed = dta_bdy(jbdy)%lneed_tra ! dta_bdy(jbdy)%tem will be needed |
---|
543 | llread = nn_tra_dta(jbdy) == 1 ! get data from NetCDF file |
---|
544 | bf_alias => bf(jp_bdytem,jbdy:jbdy) ! alias for ssh structure of bdy number jbdy |
---|
545 | bn_alias => bn_tem ! alias for ssh structure of nambdy_dta |
---|
546 | iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus |
---|
547 | ENDIF |
---|
548 | IF( jfld == jp_bdysal ) THEN |
---|
549 | cl3 = 'sal' |
---|
550 | igrd = 1 ! T point |
---|
551 | ipk = jpk ! 3d data |
---|
552 | llneed = dta_bdy(jbdy)%lneed_tra ! dta_bdy(jbdy)%sal will be needed |
---|
553 | llread = nn_tra_dta(jbdy) == 1 ! get data from NetCDF file |
---|
554 | bf_alias => bf(jp_bdysal,jbdy:jbdy) ! alias for ssh structure of bdy number jbdy |
---|
555 | bn_alias => bn_sal ! alias for ssh structure of nambdy_dta |
---|
556 | iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus |
---|
557 | ENDIF |
---|
558 | |
---|
559 | ! ===================== |
---|
560 | ! ice |
---|
561 | ! ===================== |
---|
562 | IF( jfld == jp_bdya_i .OR. jfld == jp_bdyh_i .OR. jfld == jp_bdyh_s .OR. & |
---|
563 | & jfld == jp_bdyt_i .OR. jfld == jp_bdyt_s .OR. jfld == jp_bdytsu .OR. & |
---|
564 | & jfld == jp_bdys_i .OR. jfld == jp_bdyaip .OR. jfld == jp_bdyhip ) THEN |
---|
565 | igrd = 1 ! T point |
---|
566 | ipk = ipl ! jpl-cat data |
---|
567 | llneed = dta_bdy(jbdy)%lneed_ice ! ice will be needed |
---|
568 | llread = nn_ice_dta(jbdy) == 1 ! get data from NetCDF file |
---|
569 | iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus |
---|
570 | ENDIF |
---|
571 | IF( jfld == jp_bdya_i ) THEN |
---|
572 | cl3 = 'a_i' |
---|
573 | bf_alias => bf(jp_bdya_i,jbdy:jbdy) ! alias for a_i structure of bdy number jbdy |
---|
574 | bn_alias => bn_a_i ! alias for a_i structure of nambdy_dta |
---|
575 | ENDIF |
---|
576 | IF( jfld == jp_bdyh_i ) THEN |
---|
577 | cl3 = 'h_i' |
---|
578 | bf_alias => bf(jp_bdyh_i,jbdy:jbdy) ! alias for h_i structure of bdy number jbdy |
---|
579 | bn_alias => bn_h_i ! alias for h_i structure of nambdy_dta |
---|
580 | ENDIF |
---|
581 | IF( jfld == jp_bdyh_s ) THEN |
---|
582 | cl3 = 'h_s' |
---|
583 | bf_alias => bf(jp_bdyh_s,jbdy:jbdy) ! alias for h_s structure of bdy number jbdy |
---|
584 | bn_alias => bn_h_s ! alias for h_s structure of nambdy_dta |
---|
585 | ENDIF |
---|
586 | IF( jfld == jp_bdyt_i ) THEN |
---|
587 | cl3 = 't_i' |
---|
588 | bf_alias => bf(jp_bdyt_i,jbdy:jbdy) ! alias for t_i structure of bdy number jbdy |
---|
589 | bn_alias => bn_t_i ! alias for t_i structure of nambdy_dta |
---|
590 | ENDIF |
---|
591 | IF( jfld == jp_bdyt_s ) THEN |
---|
592 | cl3 = 't_s' |
---|
593 | bf_alias => bf(jp_bdyt_s,jbdy:jbdy) ! alias for t_s structure of bdy number jbdy |
---|
594 | bn_alias => bn_t_s ! alias for t_s structure of nambdy_dta |
---|
595 | ENDIF |
---|
596 | IF( jfld == jp_bdytsu ) THEN |
---|
597 | cl3 = 'tsu' |
---|
598 | bf_alias => bf(jp_bdytsu,jbdy:jbdy) ! alias for tsu structure of bdy number jbdy |
---|
599 | bn_alias => bn_tsu ! alias for tsu structure of nambdy_dta |
---|
600 | ENDIF |
---|
601 | IF( jfld == jp_bdys_i ) THEN |
---|
602 | cl3 = 's_i' |
---|
603 | bf_alias => bf(jp_bdys_i,jbdy:jbdy) ! alias for s_i structure of bdy number jbdy |
---|
604 | bn_alias => bn_s_i ! alias for s_i structure of nambdy_dta |
---|
605 | ENDIF |
---|
606 | IF( jfld == jp_bdyaip ) THEN |
---|
607 | cl3 = 'aip' |
---|
608 | bf_alias => bf(jp_bdyaip,jbdy:jbdy) ! alias for aip structure of bdy number jbdy |
---|
609 | bn_alias => bn_aip ! alias for aip structure of nambdy_dta |
---|
610 | ENDIF |
---|
611 | IF( jfld == jp_bdyhip ) THEN |
---|
612 | cl3 = 'hip' |
---|
613 | bf_alias => bf(jp_bdyhip,jbdy:jbdy) ! alias for hip structure of bdy number jbdy |
---|
614 | bn_alias => bn_hip ! alias for hip structure of nambdy_dta |
---|
615 | ENDIF |
---|
616 | |
---|
617 | IF( llneed .AND. iszdim > 0 ) THEN ! dta_bdy(jbdy)%xxx will be needed |
---|
618 | ! ! -> must be associated with an allocated target |
---|
619 | ALLOCATE( bf_alias(1)%fnow( iszdim, 1, ipk ) ) ! allocate the target |
---|
620 | ! |
---|
621 | IF( llread ) THEN ! get data from NetCDF file |
---|
622 | CALL fld_fill( bf_alias, bn_alias, cn_dir, 'bdy_dta', cl3//' '//ctmp1, ctmp2 ) ! use namelist info |
---|
623 | IF( bf_alias(1)%ln_tint ) ALLOCATE( bf_alias(1)%fdta( iszdim, 1, ipk, 2 ) ) |
---|
624 | bf_alias(1)%imap => idx_bdy(jbdy)%nbmap(1:iszdim,igrd) ! associate the mapping used for this bdy |
---|
625 | bf_alias(1)%igrd = igrd ! used only for vertical integration of 3D arrays |
---|
626 | bf_alias(1)%ibdy = jbdy ! " " " " " " " " |
---|
627 | bf_alias(1)%ltotvel = ln_full_vel ! T if u3d is full velocity |
---|
628 | bf_alias(1)%lzint = ln_zinterp ! T if it requires a vertical interpolation |
---|
629 | ENDIF |
---|
630 | |
---|
631 | ! associate the pointer and get rid of the dimensions with a size equal to 1 |
---|
632 | IF( jfld == jp_bdyssh ) dta_bdy(jbdy)%ssh => bf_alias(1)%fnow(:,1,1) |
---|
633 | IF( jfld == jp_bdyu2d ) dta_bdy(jbdy)%u2d => bf_alias(1)%fnow(:,1,1) |
---|
634 | IF( jfld == jp_bdyv2d ) dta_bdy(jbdy)%v2d => bf_alias(1)%fnow(:,1,1) |
---|
635 | IF( jfld == jp_bdyu3d ) dta_bdy(jbdy)%u3d => bf_alias(1)%fnow(:,1,:) |
---|
636 | IF( jfld == jp_bdyv3d ) dta_bdy(jbdy)%v3d => bf_alias(1)%fnow(:,1,:) |
---|
637 | IF( jfld == jp_bdytem ) dta_bdy(jbdy)%tem => bf_alias(1)%fnow(:,1,:) |
---|
638 | IF( jfld == jp_bdysal ) dta_bdy(jbdy)%sal => bf_alias(1)%fnow(:,1,:) |
---|
639 | IF( jfld == jp_bdya_i ) THEN |
---|
640 | IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%a_i => bf_alias(1)%fnow(:,1,:) |
---|
641 | ELSE ; ALLOCATE( dta_bdy(jbdy)%a_i(iszdim,jpl) ) |
---|
642 | ENDIF |
---|
643 | ENDIF |
---|
644 | IF( jfld == jp_bdyh_i ) THEN |
---|
645 | IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%h_i => bf_alias(1)%fnow(:,1,:) |
---|
646 | ELSE ; ALLOCATE( dta_bdy(jbdy)%h_i(iszdim,jpl) ) |
---|
647 | ENDIF |
---|
648 | ENDIF |
---|
649 | IF( jfld == jp_bdyh_s ) THEN |
---|
650 | IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%h_s => bf_alias(1)%fnow(:,1,:) |
---|
651 | ELSE ; ALLOCATE( dta_bdy(jbdy)%h_s(iszdim,jpl) ) |
---|
652 | ENDIF |
---|
653 | ENDIF |
---|
654 | IF( jfld == jp_bdyt_i ) THEN |
---|
655 | IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%t_i => bf_alias(1)%fnow(:,1,:) |
---|
656 | ELSE ; ALLOCATE( dta_bdy(jbdy)%t_i(iszdim,jpl) ) |
---|
657 | ENDIF |
---|
658 | ENDIF |
---|
659 | IF( jfld == jp_bdyt_s ) THEN |
---|
660 | IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%t_s => bf_alias(1)%fnow(:,1,:) |
---|
661 | ELSE ; ALLOCATE( dta_bdy(jbdy)%t_s(iszdim,jpl) ) |
---|
662 | ENDIF |
---|
663 | ENDIF |
---|
664 | IF( jfld == jp_bdytsu ) THEN |
---|
665 | IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%tsu => bf_alias(1)%fnow(:,1,:) |
---|
666 | ELSE ; ALLOCATE( dta_bdy(jbdy)%tsu(iszdim,jpl) ) |
---|
667 | ENDIF |
---|
668 | ENDIF |
---|
669 | IF( jfld == jp_bdys_i ) THEN |
---|
670 | IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%s_i => bf_alias(1)%fnow(:,1,:) |
---|
671 | ELSE ; ALLOCATE( dta_bdy(jbdy)%s_i(iszdim,jpl) ) |
---|
672 | ENDIF |
---|
673 | ENDIF |
---|
674 | IF( jfld == jp_bdyaip ) THEN |
---|
675 | IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%aip => bf_alias(1)%fnow(:,1,:) |
---|
676 | ELSE ; ALLOCATE( dta_bdy(jbdy)%aip(iszdim,jpl) ) |
---|
677 | ENDIF |
---|
678 | ENDIF |
---|
679 | IF( jfld == jp_bdyhip ) THEN |
---|
680 | IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%hip => bf_alias(1)%fnow(:,1,:) |
---|
681 | ELSE ; ALLOCATE( dta_bdy(jbdy)%hip(iszdim,jpl) ) |
---|
682 | ENDIF |
---|
683 | ENDIF |
---|
684 | ENDIF |
---|
685 | |
---|
686 | END DO ! jpbdyfld |
---|
687 | ! |
---|
688 | END DO ! jbdy |
---|
689 | ! |
---|
690 | END SUBROUTINE bdy_dta_init |
---|
691 | |
---|
692 | !!============================================================================== |
---|
693 | END MODULE bdydta |
---|