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, ALLOCATABLE, DIMENSION(:) :: nb_bdy_fld ! Number of fields to update for each boundary set. |
---|
46 | INTEGER :: nb_bdy_fld_sum ! Total number of fields to update for all boundary sets. |
---|
47 | LOGICAL, DIMENSION(jp_bdy) :: ln_full_vel_array ! =T => full velocities in 3D boundary conditions |
---|
48 | ! =F => baroclinic velocities in 3D boundary conditions |
---|
49 | !$AGRIF_DO_NOT_TREAT |
---|
50 | TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:), TARGET :: bf ! structure of input fields (file informations, fields read) |
---|
51 | !$AGRIF_END_DO_NOT_TREAT |
---|
52 | TYPE(MAP_POINTER), ALLOCATABLE, DIMENSION(:) :: nbmap_ptr ! array of pointers to nbmap |
---|
53 | |
---|
54 | #if defined key_si3 |
---|
55 | INTEGER :: nice_cat ! number of categories in the input file |
---|
56 | INTEGER :: jfld_hti, jfld_hts, jfld_ai ! indices of ice thickness, snow thickness and concentration in bf structure |
---|
57 | INTEGER, DIMENSION(jp_bdy) :: jfld_htit, jfld_htst, jfld_ait |
---|
58 | #endif |
---|
59 | |
---|
60 | !!---------------------------------------------------------------------- |
---|
61 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
62 | !! $Id$ |
---|
63 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
64 | !!---------------------------------------------------------------------- |
---|
65 | CONTAINS |
---|
66 | |
---|
67 | SUBROUTINE bdy_dta( kt, Kmm, time_offset ) |
---|
68 | !!---------------------------------------------------------------------- |
---|
69 | !! *** SUBROUTINE bdy_dta *** |
---|
70 | !! |
---|
71 | !! ** Purpose : Update external data for open boundary conditions |
---|
72 | !! |
---|
73 | !! ** Method : Use fldread.F90 |
---|
74 | !! |
---|
75 | !!---------------------------------------------------------------------- |
---|
76 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
77 | INTEGER, INTENT(in) :: Kmm ! ocean time level index |
---|
78 | INTEGER, INTENT(in), OPTIONAL :: time_offset ! time offset in units of timesteps. NB. if jit |
---|
79 | ! ! is present then units = subcycle timesteps. |
---|
80 | ! ! time_offset = 0 => get data at "now" time level |
---|
81 | ! ! time_offset = -1 => get data at "before" time level |
---|
82 | ! ! time_offset = +1 => get data at "after" time level |
---|
83 | ! ! etc. |
---|
84 | ! |
---|
85 | INTEGER :: jbdy, jfld, jstart, jend, ib, jl ! dummy loop indices |
---|
86 | INTEGER :: ii, ij, ik, igrd ! local integers |
---|
87 | INTEGER, DIMENSION(jpbgrd) :: ilen1 |
---|
88 | INTEGER, POINTER, DIMENSION(:) :: nblen, nblenrim ! short cuts |
---|
89 | TYPE(OBC_DATA), POINTER :: dta ! short cut |
---|
90 | !!--------------------------------------------------------------------------- |
---|
91 | ! |
---|
92 | IF( ln_timing ) CALL timing_start('bdy_dta') |
---|
93 | ! |
---|
94 | ! Initialise data arrays once for all from initial conditions where required |
---|
95 | !--------------------------------------------------------------------------- |
---|
96 | IF( kt == nit000 ) THEN |
---|
97 | |
---|
98 | ! Calculate depth-mean currents |
---|
99 | !----------------------------- |
---|
100 | |
---|
101 | DO jbdy = 1, nb_bdy |
---|
102 | ! |
---|
103 | nblen => idx_bdy(jbdy)%nblen |
---|
104 | nblenrim => idx_bdy(jbdy)%nblenrim |
---|
105 | dta => dta_bdy(jbdy) |
---|
106 | ! |
---|
107 | IF( nn_dyn2d_dta(jbdy) == 0 ) THEN |
---|
108 | ilen1(:) = nblen(:) |
---|
109 | IF( dta%ll_ssh ) THEN |
---|
110 | igrd = 1 |
---|
111 | DO ib = 1, ilen1(igrd) |
---|
112 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
113 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
114 | dta_bdy(jbdy)%ssh(ib) = ssh(ii,ij,Kmm) * tmask(ii,ij,1) |
---|
115 | END DO |
---|
116 | ENDIF |
---|
117 | IF( dta%ll_u2d ) THEN |
---|
118 | igrd = 2 |
---|
119 | DO ib = 1, ilen1(igrd) |
---|
120 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
121 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
122 | dta_bdy(jbdy)%u2d(ib) = uu_b(ii,ij,Kmm) * umask(ii,ij,1) |
---|
123 | END DO |
---|
124 | ENDIF |
---|
125 | IF( dta%ll_v2d ) THEN |
---|
126 | igrd = 3 |
---|
127 | DO ib = 1, ilen1(igrd) |
---|
128 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
129 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
130 | dta_bdy(jbdy)%v2d(ib) = vv_b(ii,ij,Kmm) * vmask(ii,ij,1) |
---|
131 | END DO |
---|
132 | ENDIF |
---|
133 | ENDIF |
---|
134 | ! |
---|
135 | IF( nn_dyn3d_dta(jbdy) == 0 ) THEN |
---|
136 | ilen1(:) = nblen(:) |
---|
137 | IF( dta%ll_u3d ) THEN |
---|
138 | igrd = 2 |
---|
139 | DO ib = 1, ilen1(igrd) |
---|
140 | DO ik = 1, jpkm1 |
---|
141 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
142 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
143 | dta_bdy(jbdy)%u3d(ib,ik) = ( uu(ii,ij,ik,Kmm) - uu_b(ii,ij,Kmm) ) * umask(ii,ij,ik) |
---|
144 | END DO |
---|
145 | END DO |
---|
146 | ENDIF |
---|
147 | IF( dta%ll_v3d ) THEN |
---|
148 | igrd = 3 |
---|
149 | DO ib = 1, ilen1(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) = ( vv(ii,ij,ik,Kmm) - vv_b(ii,ij,Kmm) ) * vmask(ii,ij,ik) |
---|
154 | END DO |
---|
155 | END DO |
---|
156 | ENDIF |
---|
157 | ENDIF |
---|
158 | |
---|
159 | IF( nn_tra_dta(jbdy) == 0 ) THEN |
---|
160 | ilen1(:) = nblen(:) |
---|
161 | IF( dta%ll_tem ) THEN |
---|
162 | igrd = 1 |
---|
163 | DO ib = 1, ilen1(igrd) |
---|
164 | DO ik = 1, jpkm1 |
---|
165 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
166 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
167 | dta_bdy(jbdy)%tem(ib,ik) = ts(ii,ij,ik,jp_tem,Kmm) * tmask(ii,ij,ik) |
---|
168 | END DO |
---|
169 | END DO |
---|
170 | ENDIF |
---|
171 | IF( dta%ll_sal ) THEN |
---|
172 | igrd = 1 |
---|
173 | DO ib = 1, ilen1(igrd) |
---|
174 | DO ik = 1, jpkm1 |
---|
175 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
176 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
177 | dta_bdy(jbdy)%sal(ib,ik) = ts(ii,ij,ik,jp_sal,Kmm) * tmask(ii,ij,ik) |
---|
178 | END DO |
---|
179 | END DO |
---|
180 | ENDIF |
---|
181 | ENDIF |
---|
182 | |
---|
183 | #if defined key_si3 |
---|
184 | IF( nn_ice_dta(jbdy) == 0 ) THEN ! set ice to initial values |
---|
185 | ilen1(:) = nblen(:) |
---|
186 | IF( dta%ll_a_i ) THEN |
---|
187 | igrd = 1 |
---|
188 | DO jl = 1, jpl |
---|
189 | DO ib = 1, ilen1(igrd) |
---|
190 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
191 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
192 | dta_bdy(jbdy)%a_i (ib,jl) = a_i(ii,ij,jl) * tmask(ii,ij,1) |
---|
193 | END DO |
---|
194 | END DO |
---|
195 | ENDIF |
---|
196 | IF( dta%ll_h_i ) THEN |
---|
197 | igrd = 1 |
---|
198 | DO jl = 1, jpl |
---|
199 | DO ib = 1, ilen1(igrd) |
---|
200 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
201 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
202 | dta_bdy(jbdy)%h_i (ib,jl) = h_i(ii,ij,jl) * tmask(ii,ij,1) |
---|
203 | END DO |
---|
204 | END DO |
---|
205 | ENDIF |
---|
206 | IF( dta%ll_h_s ) THEN |
---|
207 | igrd = 1 |
---|
208 | DO jl = 1, jpl |
---|
209 | DO ib = 1, ilen1(igrd) |
---|
210 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
211 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
212 | dta_bdy(jbdy)%h_s (ib,jl) = h_s(ii,ij,jl) * tmask(ii,ij,1) |
---|
213 | END DO |
---|
214 | END DO |
---|
215 | ENDIF |
---|
216 | ENDIF |
---|
217 | #endif |
---|
218 | END DO ! jbdy |
---|
219 | ! |
---|
220 | ENDIF ! kt == nit000 |
---|
221 | |
---|
222 | ! update external data from files |
---|
223 | !-------------------------------- |
---|
224 | |
---|
225 | jstart = 1 |
---|
226 | DO jbdy = 1, nb_bdy |
---|
227 | dta => dta_bdy(jbdy) |
---|
228 | IF( nn_dta(jbdy) == 1 ) THEN ! skip this bit if no external data required |
---|
229 | IF (cn_tra(jbdy) == 'runoff') then ! runoff condition |
---|
230 | jend = nb_bdy_fld(jbdy) |
---|
231 | CALL fld_read( kt=kt, kn_fsbc=1, sd=bf(jstart:jend), & |
---|
232 | & map=nbmap_ptr(jstart:jend), kt_offset=time_offset ) |
---|
233 | ! |
---|
234 | igrd = 2 ! zonal velocity |
---|
235 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
236 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
237 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
238 | dta%u2d(ib) = dta%u2d(ib) / ( e2u(ii,ij) * hu_0(ii,ij) ) |
---|
239 | END DO |
---|
240 | ! |
---|
241 | igrd = 3 ! meridional velocity |
---|
242 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
243 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
244 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
245 | dta%v2d(ib) = dta%v2d(ib) / ( e1v(ii,ij) * hv_0(ii,ij) ) |
---|
246 | END DO |
---|
247 | ELSE |
---|
248 | IF( nn_dyn2d_dta(jbdy) == 2 ) THEN ! tidal harmonic forcing ONLY: initialise arrays |
---|
249 | IF( dta%ll_ssh ) dta%ssh(:) = 0._wp |
---|
250 | IF( dta%ll_u2d ) dta%u2d(:) = 0._wp |
---|
251 | IF( dta%ll_v2d ) dta%v2d(:) = 0._wp |
---|
252 | ENDIF |
---|
253 | IF( dta%nread(1) .gt. 0 ) THEN ! update external data |
---|
254 | jend = jstart + dta%nread(1) - 1 |
---|
255 | CALL fld_read( kt=kt, kn_fsbc=1, sd=bf(jstart:jend), & |
---|
256 | & map=nbmap_ptr(jstart:jend), kt_offset=time_offset, jpk_bdy=nb_jpk_bdy, & |
---|
257 | & fvl=ln_full_vel_array(jbdy) ) |
---|
258 | ENDIF |
---|
259 | ! If full velocities in boundary data then split into barotropic and baroclinic data |
---|
260 | IF( ln_full_vel_array(jbdy) .and. & |
---|
261 | & ( nn_dyn2d_dta(jbdy) == 1 .OR. nn_dyn2d_dta(jbdy) == 3 .OR. & |
---|
262 | & nn_dyn3d_dta(jbdy) == 1 ) ) THEN |
---|
263 | igrd = 2 ! zonal velocity |
---|
264 | dta%u2d(:) = 0._wp |
---|
265 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
266 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
267 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
268 | DO ik = 1, jpkm1 |
---|
269 | dta%u2d(ib) = dta%u2d(ib) & |
---|
270 | & + e3u(ii,ij,ik,Kmm) * umask(ii,ij,ik) * dta%u3d(ib,ik) |
---|
271 | END DO |
---|
272 | dta%u2d(ib) = dta%u2d(ib) * r1_hu_n(ii,ij) |
---|
273 | DO ik = 1, jpkm1 |
---|
274 | dta%u3d(ib,ik) = dta%u3d(ib,ik) - dta%u2d(ib) |
---|
275 | END DO |
---|
276 | END DO |
---|
277 | igrd = 3 ! meridional velocity |
---|
278 | dta%v2d(:) = 0._wp |
---|
279 | DO ib = 1, idx_bdy(jbdy)%nblen(igrd) |
---|
280 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
281 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
282 | DO ik = 1, jpkm1 |
---|
283 | dta%v2d(ib) = dta%v2d(ib) & |
---|
284 | & + e3v(ii,ij,ik,Kmm) * vmask(ii,ij,ik) * dta%v3d(ib,ik) |
---|
285 | END DO |
---|
286 | dta%v2d(ib) = dta%v2d(ib) * r1_hv_n(ii,ij) |
---|
287 | DO ik = 1, jpkm1 |
---|
288 | dta%v3d(ib,ik) = dta%v3d(ib,ik) - dta%v2d(ib) |
---|
289 | END DO |
---|
290 | END DO |
---|
291 | ENDIF |
---|
292 | |
---|
293 | ENDIF |
---|
294 | #if defined key_si3 |
---|
295 | ! convert N-cat fields (input) into jpl-cat (output) |
---|
296 | IF( cn_ice(jbdy) /= 'none' .AND. nn_ice_dta(jbdy) == 1 ) THEN |
---|
297 | jfld_hti = jfld_htit(jbdy) |
---|
298 | jfld_hts = jfld_htst(jbdy) |
---|
299 | jfld_ai = jfld_ait(jbdy) |
---|
300 | IF ( jpl /= 1 .AND. nice_cat == 1 ) THEN ! case input cat = 1 |
---|
301 | CALL ice_var_itd ( bf(jfld_hti)%fnow(:,1,1), bf(jfld_hts)%fnow(:,1,1), bf(jfld_ai)%fnow(:,1,1), & |
---|
302 | & dta_bdy(jbdy)%h_i , dta_bdy(jbdy)%h_s , dta_bdy(jbdy)%a_i ) |
---|
303 | ELSEIF( jpl /= 1 .AND. nice_cat /= 1 .AND. nice_cat /= jpl ) THEN ! case input cat /=1 and /=jpl |
---|
304 | CALL ice_var_itd2( bf(jfld_hti)%fnow(:,1,:), bf(jfld_hts)%fnow(:,1,:), bf(jfld_ai)%fnow(:,1,:), & |
---|
305 | & dta_bdy(jbdy)%h_i , dta_bdy(jbdy)%h_s , dta_bdy(jbdy)%a_i ) |
---|
306 | ENDIF |
---|
307 | ENDIF |
---|
308 | #endif |
---|
309 | jstart = jstart + dta%nread(1) |
---|
310 | ENDIF ! nn_dta(jbdy) = 1 |
---|
311 | END DO ! jbdy |
---|
312 | |
---|
313 | IF ( ln_apr_obc ) THEN |
---|
314 | DO jbdy = 1, nb_bdy |
---|
315 | IF (cn_tra(jbdy) /= 'runoff')THEN |
---|
316 | igrd = 1 ! meridional velocity |
---|
317 | DO ib = 1, idx_bdy(jbdy)%nblenrim(igrd) |
---|
318 | ii = idx_bdy(jbdy)%nbi(ib,igrd) |
---|
319 | ij = idx_bdy(jbdy)%nbj(ib,igrd) |
---|
320 | dta_bdy(jbdy)%ssh(ib) = dta_bdy(jbdy)%ssh(ib) + ssh_ib(ii,ij) |
---|
321 | END DO |
---|
322 | ENDIF |
---|
323 | END DO |
---|
324 | ENDIF |
---|
325 | |
---|
326 | IF ( ln_tide ) THEN |
---|
327 | IF (ln_dynspg_ts) THEN ! Fill temporary arrays with slow-varying bdy data |
---|
328 | DO jbdy = 1, nb_bdy ! Tidal component added in ts loop |
---|
329 | IF ( nn_dyn2d_dta(jbdy) .ge. 2 ) THEN |
---|
330 | nblen => idx_bdy(jbdy)%nblen |
---|
331 | nblenrim => idx_bdy(jbdy)%nblenrim |
---|
332 | IF( cn_dyn2d(jbdy) == 'frs' ) THEN; ilen1(:)=nblen(:) ; ELSE ; ilen1(:)=nblenrim(:) ; ENDIF |
---|
333 | IF ( dta_bdy(jbdy)%ll_ssh ) dta_bdy_s(jbdy)%ssh(1:ilen1(1)) = dta_bdy(jbdy)%ssh(1:ilen1(1)) |
---|
334 | IF ( dta_bdy(jbdy)%ll_u2d ) dta_bdy_s(jbdy)%u2d(1:ilen1(2)) = dta_bdy(jbdy)%u2d(1:ilen1(2)) |
---|
335 | IF ( dta_bdy(jbdy)%ll_v2d ) dta_bdy_s(jbdy)%v2d(1:ilen1(3)) = dta_bdy(jbdy)%v2d(1:ilen1(3)) |
---|
336 | ENDIF |
---|
337 | END DO |
---|
338 | ELSE ! Add tides if not split-explicit free surface else this is done in ts loop |
---|
339 | ! |
---|
340 | CALL bdy_dta_tides( kt=kt, time_offset=time_offset ) |
---|
341 | ENDIF |
---|
342 | ENDIF |
---|
343 | |
---|
344 | ! |
---|
345 | IF( ln_timing ) CALL timing_stop('bdy_dta') |
---|
346 | ! |
---|
347 | END SUBROUTINE bdy_dta |
---|
348 | |
---|
349 | |
---|
350 | SUBROUTINE bdy_dta_init |
---|
351 | !!---------------------------------------------------------------------- |
---|
352 | !! *** SUBROUTINE bdy_dta_init *** |
---|
353 | !! |
---|
354 | !! ** Purpose : Initialise arrays for reading of external data |
---|
355 | !! for open boundary conditions |
---|
356 | !! |
---|
357 | !! ** Method : |
---|
358 | !! |
---|
359 | !!---------------------------------------------------------------------- |
---|
360 | INTEGER :: jbdy, jfld, jstart, jend, ierror, ios ! Local integers |
---|
361 | ! |
---|
362 | CHARACTER(len=100) :: cn_dir ! Root directory for location of data files |
---|
363 | CHARACTER(len=100), DIMENSION(nb_bdy) :: cn_dir_array ! Root directory for location of data files |
---|
364 | CHARACTER(len = 256):: clname ! temporary file name |
---|
365 | LOGICAL :: ln_full_vel ! =T => full velocities in 3D boundary data |
---|
366 | ! ! =F => baroclinic velocities in 3D boundary data |
---|
367 | INTEGER :: ilen_global ! Max length required for global bdy dta arrays |
---|
368 | INTEGER, ALLOCATABLE, DIMENSION(:) :: ilen1, ilen3 ! size of 1st and 3rd dimensions of local arrays |
---|
369 | INTEGER, ALLOCATABLE, DIMENSION(:) :: ibdy ! bdy set for a particular jfld |
---|
370 | INTEGER, ALLOCATABLE, DIMENSION(:) :: igrid ! index for grid type (1,2,3 = T,U,V) |
---|
371 | INTEGER, POINTER, DIMENSION(:) :: nblen, nblenrim ! short cuts |
---|
372 | TYPE(OBC_DATA), POINTER :: dta ! short cut |
---|
373 | #if defined key_si3 |
---|
374 | INTEGER :: kndims ! number of dimensions in an array (i.e. 3 = wo ice cat; 4 = w ice cat) |
---|
375 | INTEGER, DIMENSION(4) :: kdimsz ! size of dimensions |
---|
376 | INTEGER :: inum,id1 ! local integer |
---|
377 | #endif |
---|
378 | TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) :: blf_i ! array of namelist information structures |
---|
379 | TYPE(FLD_N) :: bn_tem, bn_sal, bn_u3d, bn_v3d ! |
---|
380 | TYPE(FLD_N) :: bn_ssh, bn_u2d, bn_v2d ! informations about the fields to be read |
---|
381 | #if defined key_si3 |
---|
382 | TYPE(FLD_N) :: bn_a_i, bn_h_i, bn_h_s |
---|
383 | #endif |
---|
384 | NAMELIST/nambdy_dta/ cn_dir, bn_tem, bn_sal, bn_u3d, bn_v3d, bn_ssh, bn_u2d, bn_v2d |
---|
385 | #if defined key_si3 |
---|
386 | NAMELIST/nambdy_dta/ bn_a_i, bn_h_i, bn_h_s |
---|
387 | #endif |
---|
388 | NAMELIST/nambdy_dta/ ln_full_vel, nb_jpk_bdy |
---|
389 | !!--------------------------------------------------------------------------- |
---|
390 | ! |
---|
391 | IF(lwp) WRITE(numout,*) |
---|
392 | IF(lwp) WRITE(numout,*) 'bdy_dta_ini : initialization of data at the open boundaries' |
---|
393 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~' |
---|
394 | IF(lwp) WRITE(numout,*) '' |
---|
395 | |
---|
396 | ! Set nn_dta |
---|
397 | DO jbdy = 1, nb_bdy |
---|
398 | nn_dta(jbdy) = MAX( nn_dyn2d_dta (jbdy) & |
---|
399 | & , nn_dyn3d_dta (jbdy) & |
---|
400 | & , nn_tra_dta (jbdy) & |
---|
401 | #if defined key_si3 |
---|
402 | & , nn_ice_dta (jbdy) & |
---|
403 | #endif |
---|
404 | ) |
---|
405 | IF(nn_dta(jbdy) > 1) nn_dta(jbdy) = 1 |
---|
406 | END DO |
---|
407 | |
---|
408 | ! Work out upper bound of how many fields there are to read in and allocate arrays |
---|
409 | ! --------------------------------------------------------------------------- |
---|
410 | ALLOCATE( nb_bdy_fld(nb_bdy) ) |
---|
411 | nb_bdy_fld(:) = 0 |
---|
412 | DO jbdy = 1, nb_bdy |
---|
413 | IF( cn_dyn2d(jbdy) /= 'none' .AND. ( nn_dyn2d_dta(jbdy) == 1 .or. nn_dyn2d_dta(jbdy) == 3 ) ) THEN |
---|
414 | nb_bdy_fld(jbdy) = nb_bdy_fld(jbdy) + 3 |
---|
415 | ENDIF |
---|
416 | IF( cn_dyn3d(jbdy) /= 'none' .AND. nn_dyn3d_dta(jbdy) == 1 ) THEN |
---|
417 | nb_bdy_fld(jbdy) = nb_bdy_fld(jbdy) + 2 |
---|
418 | ENDIF |
---|
419 | IF( cn_tra(jbdy) /= 'none' .AND. nn_tra_dta(jbdy) == 1 ) THEN |
---|
420 | nb_bdy_fld(jbdy) = nb_bdy_fld(jbdy) + 2 |
---|
421 | ENDIF |
---|
422 | #if defined key_si3 |
---|
423 | IF( cn_ice(jbdy) /= 'none' .AND. nn_ice_dta(jbdy) == 1 ) THEN |
---|
424 | nb_bdy_fld(jbdy) = nb_bdy_fld(jbdy) + 3 |
---|
425 | ENDIF |
---|
426 | #endif |
---|
427 | IF(lwp) WRITE(numout,*) 'Maximum number of files to open =', nb_bdy_fld(jbdy) |
---|
428 | END DO |
---|
429 | |
---|
430 | nb_bdy_fld_sum = SUM( nb_bdy_fld ) |
---|
431 | |
---|
432 | ALLOCATE( bf(nb_bdy_fld_sum), STAT=ierror ) |
---|
433 | IF( ierror > 0 ) THEN |
---|
434 | CALL ctl_stop( 'bdy_dta: unable to allocate bf structure' ) ; RETURN |
---|
435 | ENDIF |
---|
436 | ALLOCATE( blf_i(nb_bdy_fld_sum), STAT=ierror ) |
---|
437 | IF( ierror > 0 ) THEN |
---|
438 | CALL ctl_stop( 'bdy_dta: unable to allocate blf_i structure' ) ; RETURN |
---|
439 | ENDIF |
---|
440 | ALLOCATE( nbmap_ptr(nb_bdy_fld_sum), STAT=ierror ) |
---|
441 | IF( ierror > 0 ) THEN |
---|
442 | CALL ctl_stop( 'bdy_dta: unable to allocate nbmap_ptr structure' ) ; RETURN |
---|
443 | ENDIF |
---|
444 | ALLOCATE( ilen1(nb_bdy_fld_sum), ilen3(nb_bdy_fld_sum) ) |
---|
445 | ALLOCATE( ibdy(nb_bdy_fld_sum) ) |
---|
446 | ALLOCATE( igrid(nb_bdy_fld_sum) ) |
---|
447 | |
---|
448 | ! Read namelists |
---|
449 | ! -------------- |
---|
450 | REWIND(numnam_ref) |
---|
451 | REWIND(numnam_cfg) |
---|
452 | jfld = 0 |
---|
453 | DO jbdy = 1, nb_bdy |
---|
454 | IF( nn_dta(jbdy) == 1 ) THEN |
---|
455 | READ ( numnam_ref, nambdy_dta, IOSTAT = ios, ERR = 901) |
---|
456 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_dta in reference namelist', lwp ) |
---|
457 | READ ( numnam_cfg, nambdy_dta, IOSTAT = ios, ERR = 902 ) |
---|
458 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'nambdy_dta in configuration namelist', lwp ) |
---|
459 | IF(lwm) WRITE( numond, nambdy_dta ) |
---|
460 | |
---|
461 | cn_dir_array(jbdy) = cn_dir |
---|
462 | ln_full_vel_array(jbdy) = ln_full_vel |
---|
463 | |
---|
464 | nblen => idx_bdy(jbdy)%nblen |
---|
465 | nblenrim => idx_bdy(jbdy)%nblenrim |
---|
466 | dta => dta_bdy(jbdy) |
---|
467 | dta%nread(2) = 0 |
---|
468 | |
---|
469 | ! Only read in necessary fields for this set. |
---|
470 | ! Important that barotropic variables come first. |
---|
471 | IF( nn_dyn2d_dta(jbdy) == 1 .or. nn_dyn2d_dta(jbdy) == 3 ) THEN |
---|
472 | |
---|
473 | IF( dta%ll_ssh ) THEN |
---|
474 | if(lwp) write(numout,*) '++++++ reading in ssh field' |
---|
475 | jfld = jfld + 1 |
---|
476 | blf_i(jfld) = bn_ssh |
---|
477 | ibdy(jfld) = jbdy |
---|
478 | igrid(jfld) = 1 |
---|
479 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
480 | ilen3(jfld) = 1 |
---|
481 | dta%nread(2) = dta%nread(2) + 1 |
---|
482 | ENDIF |
---|
483 | |
---|
484 | IF( dta%ll_u2d .and. .not. ln_full_vel_array(jbdy) ) THEN |
---|
485 | if(lwp) write(numout,*) '++++++ reading in u2d field' |
---|
486 | jfld = jfld + 1 |
---|
487 | blf_i(jfld) = bn_u2d |
---|
488 | ibdy(jfld) = jbdy |
---|
489 | igrid(jfld) = 2 |
---|
490 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
491 | ilen3(jfld) = 1 |
---|
492 | dta%nread(2) = dta%nread(2) + 1 |
---|
493 | ENDIF |
---|
494 | |
---|
495 | IF( dta%ll_v2d .and. .not. ln_full_vel_array(jbdy) ) THEN |
---|
496 | if(lwp) write(numout,*) '++++++ reading in v2d field' |
---|
497 | jfld = jfld + 1 |
---|
498 | blf_i(jfld) = bn_v2d |
---|
499 | ibdy(jfld) = jbdy |
---|
500 | igrid(jfld) = 3 |
---|
501 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
502 | ilen3(jfld) = 1 |
---|
503 | dta%nread(2) = dta%nread(2) + 1 |
---|
504 | ENDIF |
---|
505 | |
---|
506 | ENDIF |
---|
507 | |
---|
508 | ! read 3D velocities if baroclinic velocities require OR if |
---|
509 | ! barotropic velocities required and ln_full_vel set to .true. |
---|
510 | IF( nn_dyn3d_dta(jbdy) == 1 .OR. & |
---|
511 | & ( ln_full_vel_array(jbdy) .AND. ( nn_dyn2d_dta(jbdy) == 1 .OR. nn_dyn2d_dta(jbdy) == 3 ) ) ) THEN |
---|
512 | |
---|
513 | IF( dta%ll_u3d .OR. ( ln_full_vel_array(jbdy) .and. dta%ll_u2d ) ) THEN |
---|
514 | if(lwp) write(numout,*) '++++++ reading in u3d field' |
---|
515 | jfld = jfld + 1 |
---|
516 | blf_i(jfld) = bn_u3d |
---|
517 | ibdy(jfld) = jbdy |
---|
518 | igrid(jfld) = 2 |
---|
519 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
520 | ilen3(jfld) = jpk |
---|
521 | IF( ln_full_vel_array(jbdy) .and. dta%ll_u2d ) dta%nread(2) = dta%nread(2) + 1 |
---|
522 | ENDIF |
---|
523 | |
---|
524 | IF( dta%ll_v3d .OR. ( ln_full_vel_array(jbdy) .and. dta%ll_v2d ) ) THEN |
---|
525 | if(lwp) write(numout,*) '++++++ reading in v3d field' |
---|
526 | jfld = jfld + 1 |
---|
527 | blf_i(jfld) = bn_v3d |
---|
528 | ibdy(jfld) = jbdy |
---|
529 | igrid(jfld) = 3 |
---|
530 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
531 | ilen3(jfld) = jpk |
---|
532 | IF( ln_full_vel_array(jbdy) .and. dta%ll_v2d ) dta%nread(2) = dta%nread(2) + 1 |
---|
533 | ENDIF |
---|
534 | |
---|
535 | ENDIF |
---|
536 | |
---|
537 | ! temperature and salinity |
---|
538 | IF( nn_tra_dta(jbdy) == 1 ) THEN |
---|
539 | |
---|
540 | IF( dta%ll_tem ) THEN |
---|
541 | if(lwp) write(numout,*) '++++++ reading in tem field' |
---|
542 | jfld = jfld + 1 |
---|
543 | blf_i(jfld) = bn_tem |
---|
544 | ibdy(jfld) = jbdy |
---|
545 | igrid(jfld) = 1 |
---|
546 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
547 | ilen3(jfld) = jpk |
---|
548 | ENDIF |
---|
549 | |
---|
550 | IF( dta%ll_sal ) THEN |
---|
551 | if(lwp) write(numout,*) '++++++ reading in sal field' |
---|
552 | jfld = jfld + 1 |
---|
553 | blf_i(jfld) = bn_sal |
---|
554 | ibdy(jfld) = jbdy |
---|
555 | igrid(jfld) = 1 |
---|
556 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
557 | ilen3(jfld) = jpk |
---|
558 | ENDIF |
---|
559 | |
---|
560 | ENDIF |
---|
561 | |
---|
562 | #if defined key_si3 |
---|
563 | ! sea ice |
---|
564 | IF( nn_ice_dta(jbdy) == 1 ) THEN |
---|
565 | ! Test for types of ice input (1cat or Xcat) |
---|
566 | ! Build file name to find dimensions |
---|
567 | clname=TRIM( cn_dir )//TRIM(bn_a_i%clname) |
---|
568 | IF( .NOT. bn_a_i%ln_clim ) THEN |
---|
569 | WRITE(clname, '(a,"_y",i4.4)' ) TRIM( clname ), nyear ! add year |
---|
570 | IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"m" ,i2.2)' ) TRIM( clname ), nmonth ! add month |
---|
571 | ELSE |
---|
572 | IF( bn_a_i%cltype /= 'yearly' ) WRITE(clname, '(a,"_m",i2.2)' ) TRIM( clname ), nmonth ! add month |
---|
573 | ENDIF |
---|
574 | IF( bn_a_i%cltype == 'daily' .OR. bn_a_i%cltype(1:4) == 'week' ) & |
---|
575 | & WRITE(clname, '(a,"d" ,i2.2)' ) TRIM( clname ), nday ! add day |
---|
576 | ! |
---|
577 | CALL iom_open ( clname, inum ) |
---|
578 | id1 = iom_varid( inum, bn_a_i%clvar, kdimsz=kdimsz, kndims=kndims, ldstop = .FALSE. ) |
---|
579 | CALL iom_close ( inum ) |
---|
580 | |
---|
581 | IF ( kndims == 4 ) THEN |
---|
582 | nice_cat = kdimsz(4) ! Xcat input |
---|
583 | ELSE |
---|
584 | nice_cat = 1 ! 1cat input |
---|
585 | ENDIF |
---|
586 | ! End test |
---|
587 | |
---|
588 | IF( dta%ll_a_i ) THEN |
---|
589 | jfld = jfld + 1 |
---|
590 | blf_i(jfld) = bn_a_i |
---|
591 | ibdy(jfld) = jbdy |
---|
592 | igrid(jfld) = 1 |
---|
593 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
594 | ilen3(jfld) = nice_cat |
---|
595 | ENDIF |
---|
596 | |
---|
597 | IF( dta%ll_h_i ) THEN |
---|
598 | jfld = jfld + 1 |
---|
599 | blf_i(jfld) = bn_h_i |
---|
600 | ibdy(jfld) = jbdy |
---|
601 | igrid(jfld) = 1 |
---|
602 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
603 | ilen3(jfld) = nice_cat |
---|
604 | ENDIF |
---|
605 | |
---|
606 | IF( dta%ll_h_s ) THEN |
---|
607 | jfld = jfld + 1 |
---|
608 | blf_i(jfld) = bn_h_s |
---|
609 | ibdy(jfld) = jbdy |
---|
610 | igrid(jfld) = 1 |
---|
611 | ilen1(jfld) = nblen(igrid(jfld)) |
---|
612 | ilen3(jfld) = nice_cat |
---|
613 | ENDIF |
---|
614 | |
---|
615 | ENDIF |
---|
616 | #endif |
---|
617 | ! Recalculate field counts |
---|
618 | !------------------------- |
---|
619 | IF( jbdy == 1 ) THEN |
---|
620 | nb_bdy_fld_sum = 0 |
---|
621 | nb_bdy_fld(jbdy) = jfld |
---|
622 | nb_bdy_fld_sum = jfld |
---|
623 | ELSE |
---|
624 | nb_bdy_fld(jbdy) = jfld - nb_bdy_fld_sum |
---|
625 | nb_bdy_fld_sum = nb_bdy_fld_sum + nb_bdy_fld(jbdy) |
---|
626 | ENDIF |
---|
627 | |
---|
628 | dta%nread(1) = nb_bdy_fld(jbdy) |
---|
629 | |
---|
630 | ENDIF ! nn_dta == 1 |
---|
631 | ENDDO ! jbdy |
---|
632 | |
---|
633 | DO jfld = 1, nb_bdy_fld_sum |
---|
634 | ALLOCATE( bf(jfld)%fnow(ilen1(jfld),1,ilen3(jfld)) ) |
---|
635 | IF( blf_i(jfld)%ln_tint ) ALLOCATE( bf(jfld)%fdta(ilen1(jfld),1,ilen3(jfld),2) ) |
---|
636 | nbmap_ptr(jfld)%ptr => idx_bdy(ibdy(jfld))%nbmap(:,igrid(jfld)) |
---|
637 | nbmap_ptr(jfld)%ll_unstruc = ln_coords_file(ibdy(jfld)) |
---|
638 | ENDDO |
---|
639 | |
---|
640 | ! fill bf with blf_i and control print |
---|
641 | !------------------------------------- |
---|
642 | jstart = 1 |
---|
643 | DO jbdy = 1, nb_bdy |
---|
644 | jend = jstart - 1 + nb_bdy_fld(jbdy) |
---|
645 | CALL fld_fill( bf(jstart:jend), blf_i(jstart:jend), cn_dir_array(jbdy), 'bdy_dta', & |
---|
646 | & 'open boundary conditions', 'nambdy_dta' ) |
---|
647 | jstart = jend + 1 |
---|
648 | ENDDO |
---|
649 | |
---|
650 | DO jfld = 1, nb_bdy_fld_sum |
---|
651 | bf(jfld)%igrd = igrid(jfld) |
---|
652 | bf(jfld)%ibdy = ibdy(jfld) |
---|
653 | ENDDO |
---|
654 | |
---|
655 | ! Initialise local boundary data arrays |
---|
656 | ! nn_xxx_dta=0 : allocate space - will be filled from initial conditions later |
---|
657 | ! nn_xxx_dta=1 : point to "fnow" arrays |
---|
658 | !------------------------------------- |
---|
659 | |
---|
660 | jfld = 0 |
---|
661 | DO jbdy=1, nb_bdy |
---|
662 | |
---|
663 | nblen => idx_bdy(jbdy)%nblen |
---|
664 | dta => dta_bdy(jbdy) |
---|
665 | |
---|
666 | if(lwp) then |
---|
667 | write(numout,*) '++++++ dta%ll_ssh = ',dta%ll_ssh |
---|
668 | write(numout,*) '++++++ dta%ll_u2d = ',dta%ll_u2d |
---|
669 | write(numout,*) '++++++ dta%ll_v2d = ',dta%ll_v2d |
---|
670 | write(numout,*) '++++++ dta%ll_u3d = ',dta%ll_u3d |
---|
671 | write(numout,*) '++++++ dta%ll_v3d = ',dta%ll_v3d |
---|
672 | write(numout,*) '++++++ dta%ll_tem = ',dta%ll_tem |
---|
673 | write(numout,*) '++++++ dta%ll_sal = ',dta%ll_sal |
---|
674 | endif |
---|
675 | |
---|
676 | IF ( nn_dyn2d_dta(jbdy) == 0 .or. nn_dyn2d_dta(jbdy) == 2 ) THEN |
---|
677 | if(lwp) write(numout,*) '++++++ dta%ssh/u2d/u3d allocated space' |
---|
678 | IF( dta%ll_ssh ) ALLOCATE( dta%ssh(nblen(1)) ) |
---|
679 | IF( dta%ll_u2d ) ALLOCATE( dta%u2d(nblen(2)) ) |
---|
680 | IF( dta%ll_v2d ) ALLOCATE( dta%v2d(nblen(3)) ) |
---|
681 | ENDIF |
---|
682 | IF ( nn_dyn2d_dta(jbdy) == 1 .or. nn_dyn2d_dta(jbdy) == 3 ) THEN |
---|
683 | IF( dta%ll_ssh ) THEN |
---|
684 | if(lwp) write(numout,*) '++++++ dta%ssh pointing to fnow' |
---|
685 | jfld = jfld + 1 |
---|
686 | dta%ssh => bf(jfld)%fnow(:,1,1) |
---|
687 | ENDIF |
---|
688 | IF ( dta%ll_u2d ) THEN |
---|
689 | IF ( ln_full_vel_array(jbdy) ) THEN |
---|
690 | if(lwp) write(numout,*) '++++++ dta%u2d allocated space' |
---|
691 | ALLOCATE( dta%u2d(nblen(2)) ) |
---|
692 | ELSE |
---|
693 | if(lwp) write(numout,*) '++++++ dta%u2d pointing to fnow' |
---|
694 | jfld = jfld + 1 |
---|
695 | dta%u2d => bf(jfld)%fnow(:,1,1) |
---|
696 | ENDIF |
---|
697 | ENDIF |
---|
698 | IF ( dta%ll_v2d ) THEN |
---|
699 | IF ( ln_full_vel_array(jbdy) ) THEN |
---|
700 | if(lwp) write(numout,*) '++++++ dta%v2d allocated space' |
---|
701 | ALLOCATE( dta%v2d(nblen(3)) ) |
---|
702 | ELSE |
---|
703 | if(lwp) write(numout,*) '++++++ dta%v2d pointing to fnow' |
---|
704 | jfld = jfld + 1 |
---|
705 | dta%v2d => bf(jfld)%fnow(:,1,1) |
---|
706 | ENDIF |
---|
707 | ENDIF |
---|
708 | ENDIF |
---|
709 | |
---|
710 | IF ( nn_dyn3d_dta(jbdy) == 0 ) THEN |
---|
711 | if(lwp) write(numout,*) '++++++ dta%u3d/v3d allocated space' |
---|
712 | IF( dta%ll_u3d ) ALLOCATE( dta_bdy(jbdy)%u3d(nblen(2),jpk) ) |
---|
713 | IF( dta%ll_v3d ) ALLOCATE( dta_bdy(jbdy)%v3d(nblen(3),jpk) ) |
---|
714 | ENDIF |
---|
715 | IF ( nn_dyn3d_dta(jbdy) == 1 .or. & |
---|
716 | & ( ln_full_vel_array(jbdy) .and. ( nn_dyn2d_dta(jbdy) == 1 .or. nn_dyn2d_dta(jbdy) == 3 ) ) ) THEN |
---|
717 | IF ( dta%ll_u3d .or. ( ln_full_vel_array(jbdy) .and. dta%ll_u2d ) ) THEN |
---|
718 | if(lwp) write(numout,*) '++++++ dta%u3d pointing to fnow' |
---|
719 | jfld = jfld + 1 |
---|
720 | dta_bdy(jbdy)%u3d => bf(jfld)%fnow(:,1,:) |
---|
721 | ENDIF |
---|
722 | IF ( dta%ll_v3d .or. ( ln_full_vel_array(jbdy) .and. dta%ll_v2d ) ) THEN |
---|
723 | if(lwp) write(numout,*) '++++++ dta%v3d pointing to fnow' |
---|
724 | jfld = jfld + 1 |
---|
725 | dta_bdy(jbdy)%v3d => bf(jfld)%fnow(:,1,:) |
---|
726 | ENDIF |
---|
727 | ENDIF |
---|
728 | |
---|
729 | IF( nn_tra_dta(jbdy) == 0 ) THEN |
---|
730 | if(lwp) write(numout,*) '++++++ dta%tem/sal allocated space' |
---|
731 | IF( dta%ll_tem ) ALLOCATE( dta_bdy(jbdy)%tem(nblen(1),jpk) ) |
---|
732 | IF( dta%ll_sal ) ALLOCATE( dta_bdy(jbdy)%sal(nblen(1),jpk) ) |
---|
733 | ELSE |
---|
734 | IF( dta%ll_tem ) THEN |
---|
735 | if(lwp) write(numout,*) '++++++ dta%tem pointing to fnow' |
---|
736 | jfld = jfld + 1 |
---|
737 | dta_bdy(jbdy)%tem => bf(jfld)%fnow(:,1,:) |
---|
738 | ENDIF |
---|
739 | IF( dta%ll_sal ) THEN |
---|
740 | if(lwp) write(numout,*) '++++++ dta%sal pointing to fnow' |
---|
741 | jfld = jfld + 1 |
---|
742 | dta_bdy(jbdy)%sal => bf(jfld)%fnow(:,1,:) |
---|
743 | ENDIF |
---|
744 | ENDIF |
---|
745 | |
---|
746 | #if defined key_si3 |
---|
747 | IF (cn_ice(jbdy) /= 'none') THEN |
---|
748 | IF( nn_ice_dta(jbdy) == 0 ) THEN |
---|
749 | ALLOCATE( dta_bdy(jbdy)%a_i(nblen(1),jpl) ) |
---|
750 | ALLOCATE( dta_bdy(jbdy)%h_i(nblen(1),jpl) ) |
---|
751 | ALLOCATE( dta_bdy(jbdy)%h_s(nblen(1),jpl) ) |
---|
752 | ELSE |
---|
753 | IF ( nice_cat == jpl ) THEN ! case input cat = jpl |
---|
754 | jfld = jfld + 1 |
---|
755 | dta_bdy(jbdy)%a_i => bf(jfld)%fnow(:,1,:) |
---|
756 | jfld = jfld + 1 |
---|
757 | dta_bdy(jbdy)%h_i => bf(jfld)%fnow(:,1,:) |
---|
758 | jfld = jfld + 1 |
---|
759 | dta_bdy(jbdy)%h_s => bf(jfld)%fnow(:,1,:) |
---|
760 | ELSE ! case input cat = 1 OR (/=1 and /=jpl) |
---|
761 | jfld_ait(jbdy) = jfld + 1 |
---|
762 | jfld_htit(jbdy) = jfld + 2 |
---|
763 | jfld_htst(jbdy) = jfld + 3 |
---|
764 | jfld = jfld + 3 |
---|
765 | ALLOCATE( dta_bdy(jbdy)%a_i(nblen(1),jpl) ) |
---|
766 | ALLOCATE( dta_bdy(jbdy)%h_i(nblen(1),jpl) ) |
---|
767 | ALLOCATE( dta_bdy(jbdy)%h_s(nblen(1),jpl) ) |
---|
768 | dta_bdy(jbdy)%a_i(:,:) = 0._wp |
---|
769 | dta_bdy(jbdy)%h_i(:,:) = 0._wp |
---|
770 | dta_bdy(jbdy)%h_s(:,:) = 0._wp |
---|
771 | ENDIF |
---|
772 | |
---|
773 | ENDIF |
---|
774 | ENDIF |
---|
775 | #endif |
---|
776 | ! |
---|
777 | END DO ! jbdy |
---|
778 | ! |
---|
779 | END SUBROUTINE bdy_dta_init |
---|
780 | |
---|
781 | !!============================================================================== |
---|
782 | END MODULE bdydta |
---|