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