1 |
C $Header: /u/gcmpack/MITgcm/pkg/streamice/streamice_init_varia.F,v 1.12 2014/09/09 23:10:22 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
c#ifdef ALLOW_COST |
5 |
c# include "COST_OPTIONS.h" |
6 |
c#endif |
7 |
#include "STREAMICE_OPTIONS.h" |
8 |
|
9 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
10 |
|
11 |
CBOP |
12 |
SUBROUTINE STREAMICE_INIT_VARIA( myThid ) |
13 |
C /============================================================\ |
14 |
C | SUBROUTINE STREAMICE_INIT_VARIA | |
15 |
C | o Routine to initialize STREAMICE variables. | |
16 |
C |============================================================| |
17 |
C | Initialize STREAMICE parameters and variables. | |
18 |
C \============================================================/ |
19 |
IMPLICIT NONE |
20 |
|
21 |
C === Global variables === |
22 |
#include "SIZE.h" |
23 |
#include "GRID.h" |
24 |
#include "SET_GRID.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
#include "STREAMICE.h" |
28 |
#include "STREAMICE_CG.h" |
29 |
#include "STREAMICE_ADV.h" |
30 |
|
31 |
C === Routine arguments === |
32 |
C myThid - Number of this instance of STREAMICE_INIT_VARIA |
33 |
INTEGER myThid |
34 |
CEndOfInterface |
35 |
|
36 |
#ifdef ALLOW_STREAMICE |
37 |
C === Local variables === |
38 |
C I,J,bi,bj - Loop counters |
39 |
INTEGER i, j, k, bi, bj, Gi, Gj, r |
40 |
INTEGER col_y, col_x |
41 |
_RL slope_pos, c1, x, y, lenx, leny |
42 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
43 |
_RS dummyRS |
44 |
|
45 |
CEOP |
46 |
|
47 |
C ZERO OUT FLOATING POINT ARRAYS |
48 |
|
49 |
DO bj = myByLo(myThid), myByHi(myThid) |
50 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
51 |
DO j=1-OLy,sNy+OLy |
52 |
DO i=1-OLx,sNx+OLx |
53 |
H_streamIce(i,j,bi,bj) = 0. _d 0 |
54 |
U_streamice(i,j,bi,bj) = 0. _d 0 |
55 |
V_streamice(i,j,bi,bj) = 0. _d 0 |
56 |
visc_streamice(i,j,bi,bj) = 0. _d 0 |
57 |
tau_beta_eff_streamice(i,j,bi,bj) = 0. _d 0 |
58 |
float_frac_streamice(i,j,bi,bj) = 0. _d 0 |
59 |
base_el_streamice(i,j,bi,bj) = 0. _d 0 |
60 |
surf_el_streamice(i,j,bi,bj) = 0. _d 0 |
61 |
area_shelf_streamice(i,j,bi,bj) = 0. _d 0 |
62 |
mass_ice_streamice(i,j,bi,bj) = 0. _d 0 |
63 |
BDOT_streamice(i,j,bi,bj) = 0. _d 0 |
64 |
#ifdef ALLOW_STREAMICE_TIMEDEP_FORCING |
65 |
BDOT_streamice1(i,j,bi,bj) = 0. _d 0 |
66 |
#endif |
67 |
ADOT_streamice(i,j,bi,bj) = streamice_adot_uniform |
68 |
C_basal_friction(i,j,bi,bj) = C_basal_fric_const |
69 |
#ifndef STREAMICE_3D_GLEN_CONST |
70 |
B_glen(i,j,bi,bj) = B_glen_isothermal |
71 |
#else |
72 |
do k=1,Nr |
73 |
B_glen(i,j,k,bi,bj) = B_glen_isothermal |
74 |
enddo |
75 |
#endif |
76 |
H_streamice_prev(i,j,bi,bj) = 0. _d 0 |
77 |
#ifdef STREAMICE_STRESS_BOUNDARY_CONTROL |
78 |
STREAMICE_u_normal_pert(i,j,bi,bj) = 0. _d 0 |
79 |
STREAMICE_v_normal_pert(i,j,bi,bj) = 0. _d 0 |
80 |
STREAMICE_u_shear_pert(i,j,bi,bj) = 0. _d 0 |
81 |
STREAMICE_v_shear_pert(i,j,bi,bj) = 0. _d 0 |
82 |
STREAMICE_u_normal_stress(i,j,bi,bj) = 0. _d 0 |
83 |
STREAMICE_v_normal_stress(i,j,bi,bj) = 0. _d 0 |
84 |
STREAMICE_u_shear_stress(i,j,bi,bj) = 0. _d 0 |
85 |
STREAMICE_v_shear_stress(i,j,bi,bj) = 0. _d 0 |
86 |
#ifdef ALLOW_STREAMICE_TIMEDEP_FORCING |
87 |
STREAMICE_u_normal_stress1(i,j,bi,bj) = 0. _d 0 |
88 |
STREAMICE_v_normal_stress1(i,j,bi,bj) = 0. _d 0 |
89 |
STREAMICE_u_shear_stress1(i,j,bi,bj) = 0. _d 0 |
90 |
STREAMICE_v_shear_stress1(i,j,bi,bj) = 0. _d 0 |
91 |
#endif |
92 |
#endif |
93 |
#ifdef ALLOW_STREAMICE_2DTRACER |
94 |
#ifdef STREAMICE_TRACER_AB |
95 |
GAD_trac_2d (i,j,bi,bj) = 0. _d 0 |
96 |
! GAD_trac_2dNm1 (i,j,bi,bj) = 0. _d 0 |
97 |
#endif |
98 |
#endif |
99 |
#ifdef ALLOW_AUTODIFF |
100 |
ru_old_si(i,j,bi,bj) = 0. _d 0 |
101 |
rv_old_si(i,j,bi,bj) = 0. _d 0 |
102 |
zu_old_si(i,j,bi,bj) = 0. _d 0 |
103 |
zv_old_si(i,j,bi,bj) = 0. _d 0 |
104 |
! h_after_uflux_SI(i,j,bi,bj) = 0. _d 0 |
105 |
#endif |
106 |
#ifdef USE_ALT_RLOW |
107 |
R_low_si(i,j,bi,bj) = 0. _d 0 |
108 |
#endif |
109 |
|
110 |
#ifdef STREAMICE_HYBRID_STRESS |
111 |
do k=1,Nr |
112 |
visc_streamice_full(i,j,k,bi,bj) = |
113 |
& eps_glen_min**((1-n_glen)/n_glen) |
114 |
enddo |
115 |
streamice_taubx (i,j,bi,bj) = 0. _d 0 |
116 |
streamice_tauby (i,j,bi,bj) = 0. _d 0 |
117 |
#endif |
118 |
ENDDO |
119 |
ENDDO |
120 |
|
121 |
#ifdef ALLOW_COST_TEST |
122 |
cost_func1_streamice (bi,bj) = 0.0 |
123 |
cost_vel_streamice (bi,bj) = 0.0 |
124 |
cost_surf_streamice (bi,bj) = 0.0 |
125 |
#endif |
126 |
|
127 |
ENDDO |
128 |
ENDDO |
129 |
|
130 |
DO j = 1-oly, sNy+oly |
131 |
DO i = 1-olx, sNx+olx |
132 |
DO bj = myByLo(myThid), myByHi(myThid) |
133 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
134 |
cc DO k=1,4 |
135 |
DO col_x=-1,1 |
136 |
DO col_y=-1,1 |
137 |
streamice_cg_A1(i,j,bi,bj,col_x,col_y)=0.0 |
138 |
streamice_cg_A2(i,j,bi,bj,col_x,col_y)=0.0 |
139 |
streamice_cg_A3(i,j,bi,bj,col_x,col_y)=0.0 |
140 |
streamice_cg_A4(i,j,bi,bj,col_x,col_y)=0.0 |
141 |
ENDDO |
142 |
ENDDO |
143 |
cc ENDDO |
144 |
ENDDO |
145 |
ENDDO |
146 |
ENDDO |
147 |
ENDDO |
148 |
|
149 |
C INIT. INTEGER ARRAYS |
150 |
|
151 |
DO bj = myByLo(myThid), myByHi(myThid) |
152 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
153 |
DO j=1-OLy,sNy+OLy |
154 |
DO i=1-OLx,sNx+OLx |
155 |
STREAMICE_hmask(i,j,bi,bj) = -1.0 |
156 |
STREAMICE_umask(i,j,bi,bj) = 0.0 |
157 |
STREAMICE_vmask(i,j,bi,bj) = 0.0 |
158 |
STREAMICE_ufacemask(i,j,bi,bj) = 0.0 |
159 |
STREAMICE_vfacemask(i,j,bi,bj) = 0.0 |
160 |
STREAMICE_float_cond(i,j,bi,bj) = 0.0 |
161 |
ENDDO |
162 |
ENDDO |
163 |
ENDDO |
164 |
ENDDO |
165 |
|
166 |
#ifdef USE_ALT_RLOW |
167 |
! init alternate array for topog |
168 |
IF ( STREAMICEtopogFile .NE. ' ' ) THEN |
169 |
_BARRIER |
170 |
C The 0 is the "iteration" argument. The ' ' is an empty suffix |
171 |
CALL READ_FLD_XY_RL( STREAMICEtopogFile, '', |
172 |
& R_low_si, 0, myThid ) |
173 |
|
174 |
ELSE |
175 |
WRITE(msgBuf,'(A)') 'STREAMICE TOPOG - FILENAME MISSING' |
176 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
177 |
& SQUEEZE_RIGHT , 1) |
178 |
ENDIF |
179 |
#endif |
180 |
|
181 |
! initialize thickness |
182 |
|
183 |
#ifndef STREAMICE_GEOM_FILE_SETUP |
184 |
|
185 |
IF ( STREAMICEthickInit.EQ.'PARAM' ) THEN |
186 |
|
187 |
WRITE(msgBuf,'(A)') 'initializing analytic thickness' |
188 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
189 |
& SQUEEZE_RIGHT , 1) |
190 |
|
191 |
slope_pos = shelf_edge_pos - shelf_flat_width |
192 |
c1 = 0.0 |
193 |
IF (shelf_slope_scale .GT. 0.0) THEN |
194 |
c1 = 1.0 / shelf_slope_scale |
195 |
ENDIF |
196 |
|
197 |
DO bj = myByLo(myThid), myByHi(myThid) |
198 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
199 |
DO j=1,sNy |
200 |
DO i=1,sNx |
201 |
Gi = (myXGlobalLo-1)+(bi-1)*sNx+i |
202 |
Gj = (myYGlobalLo-1)+(bj-1)*sNy+j |
203 |
|
204 |
IF ((Gi.lt.Nx).and.(Gj.lt.Ny)) THEN |
205 |
|
206 |
C IF (flow_dir .EQ. 2.0) THEN |
207 |
IF (.TRUE.) THEN |
208 |
IF (xC(i-1,j,bi,bj).GE.shelf_edge_pos) THEN |
209 |
area_shelf_streamice(i,j,bi,bj) = 0. _d 0 |
210 |
STREAMICE_hmask(i,j,bi,bj) = 0. _d 0 |
211 |
ELSE |
212 |
|
213 |
IF (xC(i,j,bi,bj).GT.slope_pos) THEN |
214 |
H_streamice (i,j,bi,bj) = shelf_min_draft |
215 |
ELSE |
216 |
H_streamice (i,j,bi,bj) = (shelf_min_draft + |
217 |
& (shelf_max_draft - shelf_min_draft) * |
218 |
& min (oneRL, (c1*(slope_pos-xC(i,j,bi,bj)))**2)) |
219 |
ENDIF |
220 |
|
221 |
IF (xC(i,j,bi,bj).GT.shelf_edge_pos) THEN |
222 |
area_shelf_streamice(i,j,bi,bj) = rA(i,j,bi,bj) * |
223 |
& (shelf_edge_pos-xG(i,j,bi,bj)) / |
224 |
& (xG(i+1,j,bi,bj)-xG(i,j,bi,bj)) |
225 |
IF (area_shelf_streamice(i,j,bi,bj).gt. 0. _d 0) THEN |
226 |
STREAMICE_hmask(i,j,bi,bj) = 2.0 |
227 |
ELSE |
228 |
STREAMICE_hmask(i,j,bi,bj) = 0.0 |
229 |
H_streamice(i,j,bi,bj) = 0.0 |
230 |
ENDIF |
231 |
ELSE |
232 |
area_shelf_streamice(i,j,bi,bj) = rA(i,j,bi,bj) |
233 |
STREAMICE_hmask(i,j,bi,bj) = 1.0 |
234 |
ENDIF |
235 |
|
236 |
ENDIF |
237 |
ENDIF |
238 |
ENDIF |
239 |
ENDDO |
240 |
ENDDO |
241 |
ENDDO |
242 |
ENDDO |
243 |
|
244 |
ELSE IF ( STREAMICEthickInit.EQ.'FILE' ) THEN |
245 |
|
246 |
IF ( STREAMICEthickFile .NE. ' ' ) THEN |
247 |
_BARRIER |
248 |
C The 0 is the "iteration" argument. The ' ' is an empty suffix |
249 |
CALL READ_FLD_XY_RL( STREAMICEthickFile, ' ', H_streamice, |
250 |
& 0, myThid ) |
251 |
DO bj = myByLo(myThid), myByHi(myThid) |
252 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
253 |
DO j=1,sNy |
254 |
DO i=1,sNx |
255 |
Gi = (myXGlobalLo-1)+(bi-1)*sNx+i |
256 |
Gj = (myYGlobalLo-1)+(bj-1)*sNy+j |
257 |
IF ((Gi.lt.Nx.OR.STREAMICE_EW_periodic).and. |
258 |
& (Gj.lt.Ny.OR.STREAMICE_NS_periodic)) THEN |
259 |
IF (H_streamice(i,j,bi,bj).GT.0. _d 0) THEN |
260 |
area_shelf_streamice(i,j,bi,bj) = rA(i,j,bi,bj) |
261 |
STREAMICE_hmask(i,j,bi,bj) = 1.0 |
262 |
ELSE |
263 |
area_shelf_streamice(i,j,bi,bj) = 0. _d 0 |
264 |
STREAMICE_hmask(i,j,bi,bj) = 0. _d 0 |
265 |
ENDIF |
266 |
Do k=1,Nr |
267 |
STREAMICE_ctrl_mask(i,j,k,bi,bj) = 1. _d 0 |
268 |
enddo |
269 |
ENDIF |
270 |
ENDDO |
271 |
ENDDO |
272 |
ENDDO |
273 |
ENDDO |
274 |
ELSE |
275 |
WRITE(msgBuf,'(A)') 'INIT THICKNESS - FILENAME MISSING' |
276 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
277 |
& SQUEEZE_RIGHT , 1) |
278 |
ENDIF |
279 |
|
280 |
ELSE |
281 |
|
282 |
WRITE(msgBuf,'(A)') 'INIT THICKNESS - NOT IMPLENTED' |
283 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
284 |
& SQUEEZE_RIGHT , 1) |
285 |
ENDIF |
286 |
|
287 |
#else |
288 |
! STREAMICE_GEOM_FILE_SETUP - init thickness and hmask MUST come from file |
289 |
|
290 |
IF ( STREAMICEthickFile .NE. ' ' ) THEN |
291 |
_BARRIER |
292 |
C The 0 is the "iteration" argument. The ' ' is an empty suffix |
293 |
CALL READ_FLD_XY_RL( STREAMICEthickFile, ' ', H_streamice, |
294 |
& 0, myThid ) |
295 |
ELSE |
296 |
WRITE(msgBuf,'(A)') 'INIT THICKNESS - FILENAME MISSING' |
297 |
CALL PRINT_ERROR( msgBuf, myThid) |
298 |
ENDIF |
299 |
|
300 |
IF ( STREAMICEhMaskFile .NE. ' ' ) THEN |
301 |
_BARRIER |
302 |
C The 0 is the "iteration" argument. The ' ' is an empty suffix |
303 |
CALL READ_FLD_XY_RS( STREAMICEhMaskFile, ' ', STREAMICE_hmask, |
304 |
& 0, myThid ) |
305 |
ELSE |
306 |
WRITE(msgBuf,'(A)') 'INIT HMASK - FILENAME MISSING' |
307 |
CALL PRINT_ERROR( msgBuf, myThid) |
308 |
ENDIF |
309 |
|
310 |
#endif |
311 |
! STREAMICE_GEOM_FILE_SETUP |
312 |
|
313 |
IF ( .NOT. ( startTime .EQ. baseTime .AND. nIter0 .EQ. 0 |
314 |
& .AND. pickupSuff .EQ. ' ') ) THEN |
315 |
|
316 |
CALL STREAMICE_READ_PICKUP ( myThid ) |
317 |
|
318 |
ENDIF |
319 |
|
320 |
! finish initialize thickness |
321 |
|
322 |
! initialize glen constant |
323 |
|
324 |
IF ( STREAMICEGlenConstConfig.EQ.'FILE' ) THEN |
325 |
|
326 |
IF ( STREAMICEGlenConstFile .NE. ' ' ) THEN |
327 |
_BARRIER |
328 |
|
329 |
#ifdef STREAMICE_3D_GLEN_CONST |
330 |
|
331 |
CALL READ_FLD_XYZ_RL( STREAMICEGlenConstFile, ' ', |
332 |
& B_glen, 0, myThid ) |
333 |
|
334 |
#else |
335 |
|
336 |
CALL READ_FLD_XY_RL( STREAMICEGlenConstFile, ' ', |
337 |
& B_glen, 0, myThid ) |
338 |
|
339 |
#endif |
340 |
ELSE |
341 |
WRITE(msgBuf,'(A)') 'INIT GLEN - FILENAME MISSING' |
342 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
343 |
& SQUEEZE_RIGHT , 1) |
344 |
ENDIF |
345 |
|
346 |
ELSE IF (STREAMICEGlenConstConfig.EQ.'UNIFORM' ) THEN |
347 |
|
348 |
DO bj = myByLo(myThid), myByHi(myThid) |
349 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
350 |
DO j=1,sNy |
351 |
DO i=1,sNx |
352 |
#ifdef STREAMICE_3D_GLEN_CONST |
353 |
DO r=1,Nr |
354 |
B_glen(i,j,r,bi,bj) = B_glen_isothermal |
355 |
ENDDO |
356 |
#else |
357 |
B_glen(i,j,bi,bj) = B_glen_isothermal |
358 |
#endif |
359 |
ENDDO |
360 |
ENDDO |
361 |
ENDDO |
362 |
ENDDO |
363 |
|
364 |
ELSE |
365 |
|
366 |
WRITE(msgBuf,'(A)') 'INIT GLEN CONSTANT - NOT IMPLENTED' |
367 |
CALL PRINT_ERROR( msgBuf, myThid) |
368 |
STOP 'ABNORMAL END: S/R STREAMICE_INIT_VAR' |
369 |
ENDIF |
370 |
|
371 |
! finish initialize glen constant |
372 |
|
373 |
! initialize melt rates |
374 |
|
375 |
IF ( STREAMICEBdotConfig.EQ.'FILE' ) THEN |
376 |
|
377 |
IF ( STREAMICEBdotFile .NE. ' ' ) THEN |
378 |
_BARRIER |
379 |
|
380 |
CALL READ_FLD_XY_RL( STREAMICEBdotFile, ' ', |
381 |
& BDOT_streamice, 0, myThid ) |
382 |
|
383 |
ELSE |
384 |
WRITE(msgBuf,'(A)') 'INIT BDOT - FILENAME MISSING' |
385 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
386 |
& SQUEEZE_RIGHT , 1) |
387 |
ENDIF |
388 |
|
389 |
ENDIF |
390 |
|
391 |
! finish initialize melt rates |
392 |
|
393 |
! initialize basal traction |
394 |
|
395 |
IF ( STREAMICEbasalTracConfig.EQ.'FILE' ) THEN |
396 |
|
397 |
IF ( STREAMICEbasalTracFile .NE. ' ' ) THEN |
398 |
_BARRIER |
399 |
|
400 |
CALL READ_FLD_XY_RL( STREAMICEbasalTracFile, ' ', |
401 |
& C_basal_friction, 0, myThid ) |
402 |
|
403 |
ELSE |
404 |
WRITE(msgBuf,'(A)') 'INIT C_BASAL - FILENAME MISSING' |
405 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
406 |
& SQUEEZE_RIGHT , 1) |
407 |
ENDIF |
408 |
|
409 |
ELSE IF (STREAMICEbasalTracConfig.EQ.'UNIFORM' ) THEN |
410 |
|
411 |
DO bj = myByLo(myThid), myByHi(myThid) |
412 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
413 |
DO j=1,sNy |
414 |
DO i=1,sNx |
415 |
C_basal_friction(i,j,bi,bj) = C_basal_fric_const |
416 |
ENDDO |
417 |
ENDDO |
418 |
ENDDO |
419 |
ENDDO |
420 |
|
421 |
ELSE IF (STREAMICEbasalTracConfig.EQ.'2DPERIODIC' ) THEN |
422 |
|
423 |
lenx = sNx*nSx*nPx*delX(1) |
424 |
leny = sNy*nSy*nPy*delY(1) |
425 |
DO bj = myByLo(myThid), myByHi(myThid) |
426 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
427 |
DO j=1,sNy |
428 |
DO i=1,sNx |
429 |
x = xC(i,j,bi,bj) |
430 |
y = yC(i,j,bi,bj) |
431 |
C_basal_friction(i,j,bi,bj) = |
432 |
& sqrt(C_basal_fric_const**2* |
433 |
& (1+sin(2*streamice_kx_b_init*PI*x/lenx)* |
434 |
& sin(2*streamice_ky_b_init*PI*y/leny))) |
435 |
ENDDO |
436 |
ENDDO |
437 |
ENDDO |
438 |
ENDDO |
439 |
|
440 |
ELSE IF (STREAMICEbasalTracConfig.EQ.'1DPERIODIC' ) THEN |
441 |
|
442 |
lenx = sNx*nSx*nPx*delX(1) |
443 |
DO bj = myByLo(myThid), myByHi(myThid) |
444 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
445 |
DO j=1,sNy |
446 |
DO i=1,sNx |
447 |
x = xC(i,j,bi,bj) |
448 |
y = yC(i,j,bi,bj) |
449 |
C_basal_friction(i,j,bi,bj) = |
450 |
& sqrt(C_basal_fric_const**2*(1+ |
451 |
& sin(2*streamice_kx_b_init*PI*x/lenx))) |
452 |
ENDDO |
453 |
ENDDO |
454 |
ENDDO |
455 |
ENDDO |
456 |
|
457 |
ELSE |
458 |
|
459 |
WRITE(msgBuf,'(A)') 'INIT TRAC - NOT IMPLENTED' |
460 |
CALL PRINT_ERROR( msgBuf, myThid) |
461 |
STOP 'ABNORMAL END: S/R STREAMICE_INIT_VAR' |
462 |
ENDIF |
463 |
|
464 |
! finish initialize basal trac |
465 |
|
466 |
#ifdef ALLOW_STREAMICE_2DTRACER |
467 |
|
468 |
IF ( STREAMICETRAC2DINITFILE .NE. ' ' ) THEN |
469 |
_BARRIER |
470 |
|
471 |
CALL READ_FLD_XY_RL( STREAMICETRAC2dInitFile, ' ', |
472 |
& trac2d, 0, myThid ) |
473 |
|
474 |
ELSE |
475 |
WRITE(msgBuf,'(A)') 'TRAC2dInit - NO FILE SPECIFIED' |
476 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
477 |
& SQUEEZE_RIGHT , 1) |
478 |
DO bj = myByLo(myThid), myByHi(myThid) |
479 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
480 |
DO j=1,sNy |
481 |
DO i=1,sNx |
482 |
trac2d(i,j,bi,bj) = 0.0 |
483 |
ENDDO |
484 |
ENDDO |
485 |
ENDDO |
486 |
ENDDO |
487 |
|
488 |
ENDIF |
489 |
|
490 |
_EXCH_XY_RL (trac2d, myThid) |
491 |
|
492 |
#endif /*STREAMICE_ALLOW_2DTRACER*/ |
493 |
|
494 |
#ifdef STREAMICE_STRESS_BOUNDARY_CONTROL |
495 |
IF ( STREAMICEuNormalStressFile .NE. ' ') THEN |
496 |
_BARRIER |
497 |
CALL READ_FLD_XY_RL ( STREAMICEuNormalStressFile, ' ', |
498 |
& streamice_u_normal_stress, 0, myThid ) |
499 |
ELSE |
500 |
WRITE(msgBuf,'(A)') 'IMPOSED NORMAL U STRESS NOT SET' |
501 |
CALL PRINT_ERROR( msgBuf, myThid) |
502 |
ENDIF |
503 |
|
504 |
IF ( STREAMICEvNormalStressFile .NE. ' ') THEN |
505 |
_BARRIER |
506 |
CALL READ_FLD_XY_RL ( STREAMICEvNormalStressFile, ' ', |
507 |
& streamice_v_normal_stress, 0, myThid ) |
508 |
ELSE |
509 |
WRITE(msgBuf,'(A)') 'IMPOSED NORMAL V STRESS NOT SET' |
510 |
CALL PRINT_ERROR( msgBuf, myThid) |
511 |
ENDIF |
512 |
|
513 |
IF ( STREAMICEuShearStressFile .NE. ' ') THEN |
514 |
_BARRIER |
515 |
CALL READ_FLD_XY_RL ( STREAMICEuShearStressFile, ' ', |
516 |
& streamice_u_shear_stress, 0, myThid ) |
517 |
ELSE |
518 |
WRITE(msgBuf,'(A)') 'IMPOSED SHEAR U STRESS NOT SET' |
519 |
CALL PRINT_ERROR( msgBuf, myThid) |
520 |
ENDIF |
521 |
|
522 |
IF ( STREAMICEvShearStressFile .NE. ' ') THEN |
523 |
_BARRIER |
524 |
CALL READ_FLD_XY_RL ( STREAMICEvShearStressFile, ' ', |
525 |
& streamice_v_shear_stress, 0, myThid ) |
526 |
ELSE |
527 |
WRITE(msgBuf,'(A)') 'IMPOSED SHEAR V STRESS NOT SET' |
528 |
CALL PRINT_ERROR( msgBuf, myThid) |
529 |
ENDIF |
530 |
|
531 |
CALL EXCH_XY_RL |
532 |
& (streamice_v_shear_stress, myThid) |
533 |
CALL EXCH_XY_RL |
534 |
& (streamice_u_shear_stress, myThid) |
535 |
CALL EXCH_XY_RL |
536 |
& (streamice_v_normal_stress, myThid) |
537 |
CALL EXCH_XY_RL |
538 |
& (streamice_u_normal_stress, myThid) |
539 |
|
540 |
#endif /*STREAMICE_STRESS_BOUNDARY_CONTROL*/ |
541 |
|
542 |
CALL STREAMICE_UPD_FFRAC_UNCOUPLED ( myThid ) |
543 |
|
544 |
_EXCH_XY_RL(H_streamice, myThid ) |
545 |
_EXCH_XY_RS(STREAMICE_hmask, myThid ) |
546 |
_EXCH_XY_RL(area_shelf_streamice, myThid ) |
547 |
_EXCH_XY_RL(C_basal_friction, myThid ) |
548 |
#ifndef STREAMICE_3D_GLEN_CONST |
549 |
_EXCH_XY_RL(B_glen, myThid ) |
550 |
#else |
551 |
CALL EXCH_3D_RL(B_glen, Nr,myThid ) |
552 |
#endif |
553 |
|
554 |
#ifdef USE_ALT_RLOW |
555 |
_EXCH_XY_RL(R_low_si, myThid ) |
556 |
#endif |
557 |
|
558 |
!#ifdef STREAMICE_HYBRID_STRESS |
559 |
|
560 |
! CALL STREAMICE_VISC_BETA (myThid) |
561 |
|
562 |
! DNG THIS CALL IS TO INITIALISE VISCOSITY |
563 |
! TO AVOID POSSIBLE ADJOINT INSTABILITIES |
564 |
! IT IS WRITTEN OVER IN FIRST TIMESTEP |
565 |
|
566 |
#ifdef ALLOW_AUTODIFF |
567 |
|
568 |
CALL STREAMICE_UPD_FFRAC_UNCOUPLED ( myThid ) |
569 |
CALL STREAMICE_VELMASK_UPD (myThid) |
570 |
|
571 |
#ifdef ALLOW_OPENAD |
572 |
|
573 |
CALL STREAMICE_VEL_SOLVE_OPENAD ( myThid, |
574 |
& streamice_max_nl_iter, |
575 |
& streamice_max_cg_iter, |
576 |
& 0 ) |
577 |
|
578 |
#endif |
579 |
#endif |
580 |
|
581 |
!#endif |
582 |
|
583 |
CALL WRITE_FLD_XY_RL ( "C_basal_fric", "", |
584 |
& C_basal_friction, 0, myThid ) |
585 |
CALL WRITE_FLD_XY_RL ( "B_glen_sqrt", "", |
586 |
& B_glen, 0, myThid ) |
587 |
CALL WRITE_FLD_XY_RL ( "H_streamice", "init", |
588 |
& H_streamIce, 0, myThid ) |
589 |
#ifdef ALLOW_STREAMICE_2DTRACER |
590 |
CALL WRITE_FLD_XY_RL ( "2DTracer", "init", |
591 |
& trac2d, 0, myThid ) |
592 |
#endif |
593 |
CALL WRITE_FLD_XY_RL ( "area_shelf_streamice", "init", |
594 |
& area_shelf_streamice, 0, myThid ) |
595 |
CALL WRITE_FLD_XY_RS ( "STREAMICE_hmask", "init", |
596 |
& STREAMICE_hmask, 0, myThid ) |
597 |
#ifdef ALLOW_CTRL |
598 |
CALL ACTIVE_WRITE_GEN_RS( 'maskCtrlst', STREAMICE_ctrl_mask, |
599 |
& 'XY', Nr, 1, .FALSE., 0, myThid, dummyRS ) |
600 |
#endif |
601 |
! call active_write_xyz( 'maskCtrlS', STREAMICE_ctrl_mask, 1, 0, |
602 |
! & myThid, dummy) |
603 |
! CALL STREAMICE_VELMASK_UPD (myThid) |
604 |
! CALL STREAMICE_UPD_FFRAC_UNCOUPLED ( myThid ) |
605 |
! CALL STREAMICE_VEL_SOLVE( myThid ) |
606 |
|
607 |
CALL WRITE_FLD_XY_RL ( "U_init", "", |
608 |
& C_basal_friction, 0, myThid ) |
609 |
CALL WRITE_FLD_XY_RL ( "V_init", "", |
610 |
& V_streamice, 0, myThid ) |
611 |
#ifdef USE_ALT_RLOW |
612 |
CALL WRITE_FLD_XY_RL ( "R_low_si", "init", |
613 |
& R_low_si, 0, myThid ) |
614 |
#endif |
615 |
|
616 |
! CALL WRITE_FULLARRAY_RL ("H",H_streamice,1,0,0,1,0,myThid) |
617 |
! CALL WRITE_FULLARRAY_RS ("hmask",STREAMICE_hmask,1,0,0,1,0,myThid) |
618 |
! CALL WRITE_FULLARRAY_RL ("umask",STREAMICE_umask,1,0,0,1,0,myThid) |
619 |
|
620 |
#endif /* ALLOW_STREAMICE */ |
621 |
|
622 |
RETURN |
623 |
END |