1 | MODULE limistate |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE limistate *** |
---|
4 | !! Initialisation of diagnostics ice variables |
---|
5 | !!====================================================================== |
---|
6 | !! History : 2.0 ! 2004-01 (C. Ethe, G. Madec) Original code |
---|
7 | !! 4.0 ! 2011-02 (G. Madec) dynamical allocation |
---|
8 | !! - ! 2012 (C. Rousset) add par_oce (for jp_sal)...bug? |
---|
9 | !!---------------------------------------------------------------------- |
---|
10 | #if defined key_lim3 |
---|
11 | !!---------------------------------------------------------------------- |
---|
12 | !! 'key_lim3' : LIM3 sea-ice model |
---|
13 | !!---------------------------------------------------------------------- |
---|
14 | !! lim_istate : Initialisation of diagnostics ice variables |
---|
15 | !! lim_istate_init : initialization of ice state and namelist read |
---|
16 | !!---------------------------------------------------------------------- |
---|
17 | USE phycst ! physical constant |
---|
18 | USE oce ! dynamics and tracers variables |
---|
19 | USE dom_oce ! ocean domain |
---|
20 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
21 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
22 | USE eosbn2 ! equation of state |
---|
23 | USE ice ! sea-ice variables |
---|
24 | USE par_ice ! ice parameters |
---|
25 | USE par_oce ! ocean parameters |
---|
26 | USE dom_ice ! sea-ice domain |
---|
27 | USE in_out_manager ! I/O manager |
---|
28 | USE lib_mpp ! MPP library |
---|
29 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
30 | USE wrk_nemo ! work arrays |
---|
31 | USE cpl_oasis3, ONLY : lk_cpl |
---|
32 | |
---|
33 | IMPLICIT NONE |
---|
34 | PRIVATE |
---|
35 | |
---|
36 | PUBLIC lim_istate ! routine called by lim_init.F90 |
---|
37 | |
---|
38 | !! * Module variables |
---|
39 | ! !!** init namelist (namiceini) ** |
---|
40 | REAL(wp) :: thres_sst ! threshold water temperature for initial sea ice |
---|
41 | REAL(wp) :: hts_ini_n ! initial snow thickness in the north |
---|
42 | REAL(wp) :: hts_ini_s ! initial snow thickness in the south |
---|
43 | REAL(wp) :: hti_ini_n ! initial ice thickness in the north |
---|
44 | REAL(wp) :: hti_ini_s ! initial ice thickness in the south |
---|
45 | REAL(wp) :: ati_ini_n ! initial leads area in the north |
---|
46 | REAL(wp) :: ati_ini_s ! initial leads area in the south |
---|
47 | REAL(wp) :: smi_ini_n ! initial salinity |
---|
48 | REAL(wp) :: smi_ini_s ! initial salinity |
---|
49 | REAL(wp) :: tmi_ini_n ! initial temperature |
---|
50 | REAL(wp) :: tmi_ini_s ! initial temperature |
---|
51 | |
---|
52 | LOGICAL :: ln_limini ! initialization or not |
---|
53 | !!---------------------------------------------------------------------- |
---|
54 | !! LIM 3.0, UCL-LOCEAN-IPSL (2008) |
---|
55 | !! $Id: limistate.F90 4765 2014-09-16 12:55:11Z rblod $ |
---|
56 | !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) |
---|
57 | !!---------------------------------------------------------------------- |
---|
58 | |
---|
59 | CONTAINS |
---|
60 | |
---|
61 | SUBROUTINE lim_istate |
---|
62 | !!------------------------------------------------------------------- |
---|
63 | !! *** ROUTINE lim_istate *** |
---|
64 | !! |
---|
65 | !! ** Purpose : defined the sea-ice initial state |
---|
66 | !! |
---|
67 | !! ** Method : |
---|
68 | !! This routine will put some ice where ocean |
---|
69 | !! is at the freezing point, then fill in ice |
---|
70 | !! state variables using prescribed initial |
---|
71 | !! values in the namelist |
---|
72 | !! |
---|
73 | !! ** Steps : |
---|
74 | !! 1) Read namelist |
---|
75 | !! 2) Basal temperature; ice and hemisphere masks |
---|
76 | !! 3) Fill in the ice thickness distribution using gaussian |
---|
77 | !! 4) Fill in space-dependent arrays for state variables |
---|
78 | !! 5) Diagnostic arrays |
---|
79 | !! 6) Lateral boundary conditions |
---|
80 | !! |
---|
81 | !! ** Notes : o_i, t_su, t_s, t_i, s_i must be filled everywhere, even |
---|
82 | !! where there is no ice (clem: I do not know why but it is mandatory) |
---|
83 | !! |
---|
84 | !! History : |
---|
85 | !! 2.0 ! 01-04 (C. Ethe, G. Madec) Original code |
---|
86 | !! 3.0 ! 2007 (M. Vancoppenolle) Rewrite for ice cats |
---|
87 | !! 4.0 ! 09-11 (M. Vancoppenolle) Enhanced version for ice cats |
---|
88 | !!-------------------------------------------------------------------- |
---|
89 | |
---|
90 | !! * Local variables |
---|
91 | INTEGER :: ji, jj, jk, jl ! dummy loop indices |
---|
92 | REAL(wp) :: epsi20, ztmelts, zdh |
---|
93 | INTEGER :: i_hemis, i_fill, jl0 |
---|
94 | REAL(wp) :: ztest_1, ztest_2, ztest_3, ztest_4, ztests, zsigma, zarg, zA, zV, zA_cons, zV_cons, zconv |
---|
95 | REAL(wp), POINTER, DIMENSION(:) :: zht_i_ini, zat_i_ini, zvt_i_ini, zht_s_ini, zsm_i_ini, ztm_i_ini |
---|
96 | REAL(wp), POINTER, DIMENSION(:,:) :: zh_i_ini, za_i_ini, zv_i_ini |
---|
97 | REAL(wp), POINTER, DIMENSION(:,:) :: zswitch ! ice indicator |
---|
98 | INTEGER, POINTER, DIMENSION(:,:) :: zhemis ! hemispheric index |
---|
99 | !-------------------------------------------------------------------- |
---|
100 | |
---|
101 | CALL wrk_alloc( jpi, jpj, zswitch ) |
---|
102 | CALL wrk_alloc( jpi, jpj, zhemis ) |
---|
103 | CALL wrk_alloc( jpl, 2, zh_i_ini, za_i_ini, zv_i_ini ) |
---|
104 | CALL wrk_alloc( 2, zht_i_ini, zat_i_ini, zvt_i_ini, zht_s_ini, zsm_i_ini, ztm_i_ini ) |
---|
105 | |
---|
106 | epsi20 = 1.e-20_wp |
---|
107 | |
---|
108 | IF(lwp) WRITE(numout,*) |
---|
109 | IF(lwp) WRITE(numout,*) 'lim_istate : Ice initialization ' |
---|
110 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' |
---|
111 | |
---|
112 | !-------------------------------------------------------------------- |
---|
113 | ! 1) Read namelist |
---|
114 | !-------------------------------------------------------------------- |
---|
115 | |
---|
116 | CALL lim_istate_init ! reading the initials parameters of the ice |
---|
117 | |
---|
118 | ! surface temperature |
---|
119 | DO jl = 1, jpl ! loop over categories |
---|
120 | t_su (:,:,jl) = rtt * tms(:,:) |
---|
121 | tn_ice(:,:,jl) = rtt * tms(:,:) |
---|
122 | END DO |
---|
123 | ! Basal temperature is set to the freezing point of seawater in Kelvin |
---|
124 | t_bo(:,:) = ( tfreez( tsn(:,:,1,jp_sal) ) + rt0 ) * tms(:,:) |
---|
125 | |
---|
126 | IF( ln_limini ) THEN |
---|
127 | |
---|
128 | !-------------------------------------------------------------------- |
---|
129 | ! 2) Basal temperature, ice mask and hemispheric index |
---|
130 | !-------------------------------------------------------------------- |
---|
131 | ! ice if sst <= t-freez + thres_sst |
---|
132 | DO jj = 1, jpj |
---|
133 | DO ji = 1, jpi |
---|
134 | IF( ( tsn(ji,jj,1,jp_tem) - ( t_bo(ji,jj) - rt0 ) ) * tms(ji,jj) >= thres_sst ) THEN |
---|
135 | zswitch(ji,jj) = 0._wp * tms(ji,jj) ! no ice |
---|
136 | ELSE |
---|
137 | zswitch(ji,jj) = 1._wp * tms(ji,jj) ! ice |
---|
138 | ENDIF |
---|
139 | END DO |
---|
140 | END DO |
---|
141 | |
---|
142 | |
---|
143 | ! Hemispheric index |
---|
144 | ! MV 2011 new initialization |
---|
145 | DO jj = 1, jpj |
---|
146 | DO ji = 1, jpi |
---|
147 | IF( fcor(ji,jj) >= 0._wp ) THEN |
---|
148 | zhemis(ji,jj) = 1 ! Northern hemisphere |
---|
149 | ELSE |
---|
150 | zhemis(ji,jj) = 2 ! Southern hemisphere |
---|
151 | ENDIF |
---|
152 | END DO |
---|
153 | END DO |
---|
154 | ! END MV 2011 new initialization |
---|
155 | |
---|
156 | !-------------------------------------------------------------------- |
---|
157 | ! 3) Initialization of sea ice state variables |
---|
158 | !-------------------------------------------------------------------- |
---|
159 | |
---|
160 | !----------------------------- |
---|
161 | ! 3.1) Hemisphere-dependent arrays |
---|
162 | !----------------------------- |
---|
163 | ! assign initial thickness, concentration, snow depth and salinity to an hemisphere-dependent array |
---|
164 | zht_i_ini(1) = hti_ini_n ; zht_i_ini(2) = hti_ini_s ! ice thickness |
---|
165 | zht_s_ini(1) = hts_ini_n ; zht_s_ini(2) = hts_ini_s ! snow depth |
---|
166 | zat_i_ini(1) = ati_ini_n ; zat_i_ini(2) = ati_ini_s ! ice concentration |
---|
167 | zsm_i_ini(1) = smi_ini_n ; zsm_i_ini(2) = smi_ini_s ! bulk ice salinity |
---|
168 | ztm_i_ini(1) = tmi_ini_n ; ztm_i_ini(2) = tmi_ini_s ! temperature (ice and snow) |
---|
169 | |
---|
170 | zvt_i_ini(:) = zht_i_ini(:) * zat_i_ini(:) ! ice volume |
---|
171 | |
---|
172 | !--------------------------------------------------------------------- |
---|
173 | ! 3.2) Distribute ice concentration and thickness into the categories |
---|
174 | !--------------------------------------------------------------------- |
---|
175 | ! a gaussian distribution for ice concentration is used |
---|
176 | ! then we check whether the distribution fullfills |
---|
177 | ! volume and area conservation, positivity and ice categories bounds |
---|
178 | DO i_hemis = 1, 2 |
---|
179 | |
---|
180 | ztest_1 = 0 ; ztest_2 = 0 ; ztest_3 = 0 ; ztest_4 = 0 |
---|
181 | |
---|
182 | ! note for the great nemo engineers: |
---|
183 | ! only very few of the WRITE statements are necessary for the reference version |
---|
184 | ! they were one day useful, but now i personally doubt of their |
---|
185 | ! potential for bringing anything useful |
---|
186 | |
---|
187 | DO i_fill = jpl, 1, -1 |
---|
188 | IF ( ( ztest_1 + ztest_2 + ztest_3 + ztest_4 ) .NE. 4 ) THEN |
---|
189 | !---------------------------- |
---|
190 | ! fill the i_fill categories |
---|
191 | !---------------------------- |
---|
192 | ! *** 1 category to fill |
---|
193 | IF ( i_fill .EQ. 1 ) THEN |
---|
194 | zh_i_ini(1,i_hemis) = zht_i_ini(i_hemis) |
---|
195 | za_i_ini(1,i_hemis) = zat_i_ini(i_hemis) |
---|
196 | zh_i_ini(2:jpl,i_hemis) = 0._wp |
---|
197 | za_i_ini(2:jpl,i_hemis) = 0._wp |
---|
198 | ELSE |
---|
199 | |
---|
200 | ! *** >1 categores to fill |
---|
201 | !--- Ice thicknesses in the i_fill - 1 first categories |
---|
202 | DO jl = 1, i_fill - 1 |
---|
203 | zh_i_ini(jl,i_hemis) = 0.5 * ( hi_max(jl) + hi_max(jl-1) ) |
---|
204 | END DO |
---|
205 | |
---|
206 | !--- jl0: most likely index where cc will be maximum |
---|
207 | DO jl = 1, jpl |
---|
208 | IF ( ( zht_i_ini(i_hemis) .GT. hi_max(jl-1) ) .AND. & |
---|
209 | ( zht_i_ini(i_hemis) .LE. hi_max(jl) ) ) THEN |
---|
210 | jl0 = jl |
---|
211 | ENDIF |
---|
212 | END DO |
---|
213 | jl0 = MIN(jl0, i_fill) |
---|
214 | |
---|
215 | !--- Concentrations |
---|
216 | za_i_ini(jl0,i_hemis) = zat_i_ini(i_hemis) / SQRT(REAL(jpl)) |
---|
217 | DO jl = 1, i_fill - 1 |
---|
218 | IF ( jl .NE. jl0 ) THEN |
---|
219 | zsigma = 0.5 * zht_i_ini(i_hemis) |
---|
220 | zarg = ( zh_i_ini(jl,i_hemis) - zht_i_ini(i_hemis) ) / zsigma |
---|
221 | za_i_ini(jl,i_hemis) = za_i_ini(jl0,i_hemis) * EXP(-zarg**2) |
---|
222 | ENDIF |
---|
223 | END DO |
---|
224 | |
---|
225 | zA = 0. ! sum of the areas in the jpl categories |
---|
226 | DO jl = 1, i_fill - 1 |
---|
227 | zA = zA + za_i_ini(jl,i_hemis) |
---|
228 | END DO |
---|
229 | za_i_ini(i_fill,i_hemis) = zat_i_ini(i_hemis) - zA ! ice conc in the last category |
---|
230 | IF ( i_fill .LT. jpl ) za_i_ini(i_fill+1:jpl, i_hemis) = 0._wp |
---|
231 | |
---|
232 | !--- Ice thickness in the last category |
---|
233 | zV = 0. ! sum of the volumes of the N-1 categories |
---|
234 | DO jl = 1, i_fill - 1 |
---|
235 | zV = zV + za_i_ini(jl,i_hemis)*zh_i_ini(jl,i_hemis) |
---|
236 | END DO |
---|
237 | zh_i_ini(i_fill,i_hemis) = ( zvt_i_ini(i_hemis) - zV ) / za_i_ini(i_fill,i_hemis) |
---|
238 | IF ( i_fill .LT. jpl ) zh_i_ini(i_fill+1:jpl, i_hemis) = 0._wp |
---|
239 | |
---|
240 | !--- volumes |
---|
241 | zv_i_ini(:,i_hemis) = za_i_ini(:,i_hemis) * zh_i_ini(:,i_hemis) |
---|
242 | IF ( i_fill .LT. jpl ) zv_i_ini(i_fill+1:jpl, i_hemis) = 0._wp |
---|
243 | |
---|
244 | ENDIF ! i_fill |
---|
245 | |
---|
246 | !--------------------- |
---|
247 | ! Compatibility tests |
---|
248 | !--------------------- |
---|
249 | ! Test 1: area conservation |
---|
250 | zA_cons = SUM(za_i_ini(:,i_hemis)) ; zconv = ABS(zat_i_ini(i_hemis) - zA_cons ) |
---|
251 | IF ( zconv .LT. 1.0e-6 ) THEN |
---|
252 | ztest_1 = 1 |
---|
253 | ELSE |
---|
254 | ! this write is useful |
---|
255 | IF(lwp) WRITE(numout,*) ' * TEST1 AREA NOT CONSERVED *** zA_cons = ', zA_cons,' zat_i_ini = ',zat_i_ini(i_hemis) |
---|
256 | ztest_1 = 0 |
---|
257 | ENDIF |
---|
258 | |
---|
259 | ! Test 2: volume conservation |
---|
260 | zV_cons = SUM(zv_i_ini(:,i_hemis)) |
---|
261 | zconv = ABS(zvt_i_ini(i_hemis) - zV_cons) |
---|
262 | |
---|
263 | IF ( zconv .LT. 1.0e-6 ) THEN |
---|
264 | ztest_2 = 1 |
---|
265 | ELSE |
---|
266 | ! this write is useful |
---|
267 | IF(lwp) WRITE(numout,*) ' * TEST2 VOLUME NOT CONSERVED *** zV_cons = ', zV_cons, & |
---|
268 | ' zvt_i_ini = ', zvt_i_ini(i_hemis) |
---|
269 | ztest_2 = 0 |
---|
270 | ENDIF |
---|
271 | |
---|
272 | ! Test 3: thickness of the last category is in-bounds ? |
---|
273 | IF ( zh_i_ini(i_fill, i_hemis) .GT. hi_max(i_fill-1) ) THEN |
---|
274 | ztest_3 = 1 |
---|
275 | ELSE |
---|
276 | ! this write is useful |
---|
277 | IF(lwp) WRITE(numout,*) ' * TEST 3 THICKNESS OF THE LAST CATEGORY OUT OF BOUNDS *** zh_i_ini(i_fill,i_hemis) = ', & |
---|
278 | zh_i_ini(i_fill,i_hemis), ' hi_max(jpl-1) = ', hi_max(i_fill-1) |
---|
279 | ztest_3 = 0 |
---|
280 | ENDIF |
---|
281 | |
---|
282 | ! Test 4: positivity of ice concentrations |
---|
283 | ztest_4 = 1 |
---|
284 | DO jl = 1, jpl |
---|
285 | IF ( za_i_ini(jl,i_hemis) .LT. 0._wp ) THEN |
---|
286 | ! this write is useful |
---|
287 | IF(lwp) WRITE(numout,*) ' * TEST 4 POSITIVITY NOT OK FOR CAT ', jl, ' WITH A = ', za_i_ini(jl,i_hemis) |
---|
288 | ztest_4 = 0 |
---|
289 | ENDIF |
---|
290 | END DO |
---|
291 | |
---|
292 | ENDIF ! ztest_1 + ztest_2 + ztest_3 + ztest_4 |
---|
293 | |
---|
294 | ztests = ztest_1 + ztest_2 + ztest_3 + ztest_4 |
---|
295 | |
---|
296 | END DO ! i_fill |
---|
297 | |
---|
298 | IF(lwp) THEN |
---|
299 | WRITE(numout,*), ' ztests : ', ztests |
---|
300 | IF ( ztests .NE. 4 ) THEN |
---|
301 | WRITE(numout,*) |
---|
302 | WRITE(numout,*), ' !!!! ALERT !!! ' |
---|
303 | WRITE(numout,*), ' !!!! Something is wrong in the LIM3 initialization procedure ' |
---|
304 | WRITE(numout,*) |
---|
305 | WRITE(numout,*), ' *** ztests is not equal to 4 ' |
---|
306 | WRITE(numout,*), ' *** ztest_i (i=1,4) = ', ztest_1, ztest_2, ztest_3, ztest_4 |
---|
307 | WRITE(numout,*), ' zat_i_ini : ', zat_i_ini(i_hemis) |
---|
308 | WRITE(numout,*), ' zht_i_ini : ', zht_i_ini(i_hemis) |
---|
309 | ENDIF ! ztests .NE. 4 |
---|
310 | ENDIF |
---|
311 | |
---|
312 | END DO ! i_hemis |
---|
313 | |
---|
314 | !--------------------------------------------------------------------- |
---|
315 | ! 3.3) Space-dependent arrays for ice state variables |
---|
316 | !--------------------------------------------------------------------- |
---|
317 | |
---|
318 | ! Ice concentration, thickness and volume, ice salinity, ice age, surface temperature |
---|
319 | DO jl = 1, jpl ! loop over categories |
---|
320 | DO jj = 1, jpj |
---|
321 | DO ji = 1, jpi |
---|
322 | a_i(ji,jj,jl) = zswitch(ji,jj) * za_i_ini (jl,zhemis(ji,jj)) ! concentration |
---|
323 | ht_i(ji,jj,jl) = zswitch(ji,jj) * zh_i_ini(jl,zhemis(ji,jj)) ! ice thickness |
---|
324 | ht_s(ji,jj,jl) = ht_i(ji,jj,jl) * ( zht_s_ini( zhemis(ji,jj) ) / zht_i_ini( zhemis(ji,jj) ) ) ! snow depth |
---|
325 | sm_i(ji,jj,jl) = zswitch(ji,jj) * zsm_i_ini(zhemis(ji,jj)) !+ ( 1._wp - zswitch(ji,jj) ) * s_i_min ! salinity |
---|
326 | o_i(ji,jj,jl) = zswitch(ji,jj) * 1._wp + ( 1._wp - zswitch(ji,jj) ) ! age |
---|
327 | t_su(ji,jj,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rtt ! surf temp |
---|
328 | |
---|
329 | ! This case below should not be used if (ht_s/ht_i) is ok in namelist |
---|
330 | ! In case snow load is in excess that would lead to transformation from snow to ice |
---|
331 | ! Then, transfer the snow excess into the ice (different from limthd_dh) |
---|
332 | zdh = MAX( 0._wp, ( rhosn * ht_s(ji,jj,jl) + ( rhoic - rau0 ) * ht_i(ji,jj,jl) ) * r1_rau0 ) |
---|
333 | ! recompute ht_i, ht_s avoiding out of bounds values |
---|
334 | ht_i(ji,jj,jl) = MIN( hi_max(jl), ht_i(ji,jj,jl) + zdh ) |
---|
335 | ht_s(ji,jj,jl) = MAX( 0._wp, ht_s(ji,jj,jl) - zdh * rhoic / rhosn ) |
---|
336 | |
---|
337 | ! ice volume, salt content, age content |
---|
338 | v_i(ji,jj,jl) = ht_i(ji,jj,jl) * a_i(ji,jj,jl) ! ice volume |
---|
339 | v_s(ji,jj,jl) = ht_s(ji,jj,jl) * a_i(ji,jj,jl) ! snow volume |
---|
340 | smv_i(ji,jj,jl) = MIN( sm_i(ji,jj,jl) , sss_m(ji,jj) ) * v_i(ji,jj,jl) ! salt content |
---|
341 | oa_i(ji,jj,jl) = o_i(ji,jj,jl) * a_i(ji,jj,jl) ! age content |
---|
342 | END DO ! ji |
---|
343 | END DO ! jj |
---|
344 | END DO ! jl |
---|
345 | |
---|
346 | ! Snow temperature and heat content |
---|
347 | DO jk = 1, nlay_s |
---|
348 | DO jl = 1, jpl ! loop over categories |
---|
349 | DO jj = 1, jpj |
---|
350 | DO ji = 1, jpi |
---|
351 | t_s(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rtt |
---|
352 | ! Snow energy of melting |
---|
353 | e_s(ji,jj,jk,jl) = zswitch(ji,jj) * rhosn * ( cpic * ( rtt - t_s(ji,jj,jk,jl) ) + lfus ) |
---|
354 | ! Change dimensions |
---|
355 | e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) / unit_fac |
---|
356 | ! Multiply by volume, so that heat content in Joules |
---|
357 | e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * area(ji,jj) * v_s(ji,jj,jl) / nlay_s |
---|
358 | END DO ! ji |
---|
359 | END DO ! jj |
---|
360 | END DO ! jl |
---|
361 | END DO ! jk |
---|
362 | |
---|
363 | ! Ice salinity, temperature and heat content |
---|
364 | DO jk = 1, nlay_i |
---|
365 | DO jl = 1, jpl ! loop over categories |
---|
366 | DO jj = 1, jpj |
---|
367 | DO ji = 1, jpi |
---|
368 | t_i(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rtt |
---|
369 | s_i(ji,jj,jk,jl) = zswitch(ji,jj) * zsm_i_ini(zhemis(ji,jj)) !+ ( 1._wp - zswitch(ji,jj) ) * s_i_min |
---|
370 | ztmelts = - tmut * s_i(ji,jj,jk,jl) + rtt !Melting temperature in K |
---|
371 | |
---|
372 | ! heat content per unit volume |
---|
373 | e_i(ji,jj,jk,jl) = zswitch(ji,jj) * rhoic * ( cpic * ( ztmelts - t_i(ji,jj,jk,jl) ) & |
---|
374 | + lfus * ( 1._wp - (ztmelts-rtt) / MIN((t_i(ji,jj,jk,jl)-rtt),-epsi20) ) & |
---|
375 | - rcp * ( ztmelts - rtt ) ) |
---|
376 | |
---|
377 | ! Correct dimensions to avoid big values |
---|
378 | e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) / unit_fac |
---|
379 | |
---|
380 | ! Mutliply by ice volume, and divide by number of layers to get heat content in J |
---|
381 | e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * area(ji,jj) * v_i(ji,jj,jl) / nlay_i |
---|
382 | END DO ! ji |
---|
383 | END DO ! jj |
---|
384 | END DO ! jl |
---|
385 | END DO ! jk |
---|
386 | |
---|
387 | tn_ice (:,:,:) = t_su (:,:,:) |
---|
388 | |
---|
389 | ELSE |
---|
390 | ! if ln_limini=false |
---|
391 | a_i (:,:,:) = 0._wp |
---|
392 | v_i (:,:,:) = 0._wp |
---|
393 | v_s (:,:,:) = 0._wp |
---|
394 | smv_i(:,:,:) = 0._wp |
---|
395 | oa_i (:,:,:) = 0._wp |
---|
396 | ht_i (:,:,:) = 0._wp |
---|
397 | ht_s (:,:,:) = 0._wp |
---|
398 | sm_i (:,:,:) = 0._wp |
---|
399 | o_i (:,:,:) = 0._wp |
---|
400 | |
---|
401 | e_i(:,:,:,:) = 0._wp |
---|
402 | e_s(:,:,:,:) = 0._wp |
---|
403 | |
---|
404 | DO jl = 1, jpl |
---|
405 | DO jk = 1, nlay_i |
---|
406 | t_i(:,:,jk,jl) = rtt * tms(:,:) |
---|
407 | END DO |
---|
408 | DO jk = 1, nlay_s |
---|
409 | t_s(:,:,jk,jl) = rtt * tms(:,:) |
---|
410 | END DO |
---|
411 | END DO |
---|
412 | |
---|
413 | ENDIF ! ln_limini |
---|
414 | |
---|
415 | at_i (:,:) = 0.0_wp |
---|
416 | DO jl = 1, jpl |
---|
417 | at_i (:,:) = at_i (:,:) + a_i (:,:,jl) |
---|
418 | END DO |
---|
419 | ! |
---|
420 | !-------------------------------------------------------------------- |
---|
421 | ! 4) Global ice variables for output diagnostics | |
---|
422 | !-------------------------------------------------------------------- |
---|
423 | u_ice (:,:) = 0._wp |
---|
424 | v_ice (:,:) = 0._wp |
---|
425 | stress1_i(:,:) = 0._wp |
---|
426 | stress2_i(:,:) = 0._wp |
---|
427 | stress12_i(:,:) = 0._wp |
---|
428 | |
---|
429 | !-------------------------------------------------------------------- |
---|
430 | ! 5) Moments for advection |
---|
431 | !-------------------------------------------------------------------- |
---|
432 | |
---|
433 | sxopw (:,:) = 0._wp |
---|
434 | syopw (:,:) = 0._wp |
---|
435 | sxxopw(:,:) = 0._wp |
---|
436 | syyopw(:,:) = 0._wp |
---|
437 | sxyopw(:,:) = 0._wp |
---|
438 | |
---|
439 | sxice (:,:,:) = 0._wp ; sxsn (:,:,:) = 0._wp ; sxa (:,:,:) = 0._wp |
---|
440 | syice (:,:,:) = 0._wp ; sysn (:,:,:) = 0._wp ; sya (:,:,:) = 0._wp |
---|
441 | sxxice(:,:,:) = 0._wp ; sxxsn(:,:,:) = 0._wp ; sxxa (:,:,:) = 0._wp |
---|
442 | syyice(:,:,:) = 0._wp ; syysn(:,:,:) = 0._wp ; syya (:,:,:) = 0._wp |
---|
443 | sxyice(:,:,:) = 0._wp ; sxysn(:,:,:) = 0._wp ; sxya (:,:,:) = 0._wp |
---|
444 | |
---|
445 | sxc0 (:,:,:) = 0._wp ; sxe (:,:,:,:)= 0._wp |
---|
446 | syc0 (:,:,:) = 0._wp ; sye (:,:,:,:)= 0._wp |
---|
447 | sxxc0 (:,:,:) = 0._wp ; sxxe (:,:,:,:)= 0._wp |
---|
448 | syyc0 (:,:,:) = 0._wp ; syye (:,:,:,:)= 0._wp |
---|
449 | sxyc0 (:,:,:) = 0._wp ; sxye (:,:,:,:)= 0._wp |
---|
450 | |
---|
451 | sxsal (:,:,:) = 0._wp |
---|
452 | sysal (:,:,:) = 0._wp |
---|
453 | sxxsal (:,:,:) = 0._wp |
---|
454 | syysal (:,:,:) = 0._wp |
---|
455 | sxysal (:,:,:) = 0._wp |
---|
456 | |
---|
457 | sxage (:,:,:) = 0._wp |
---|
458 | syage (:,:,:) = 0._wp |
---|
459 | sxxage (:,:,:) = 0._wp |
---|
460 | syyage (:,:,:) = 0._wp |
---|
461 | sxyage (:,:,:) = 0._wp |
---|
462 | |
---|
463 | |
---|
464 | CALL wrk_dealloc( jpi, jpj, zswitch ) |
---|
465 | CALL wrk_dealloc( jpi, jpj, zhemis ) |
---|
466 | CALL wrk_dealloc( jpl, 2, zh_i_ini, za_i_ini, zv_i_ini ) |
---|
467 | CALL wrk_dealloc( 2, zht_i_ini, zat_i_ini, zvt_i_ini, zht_s_ini, zsm_i_ini, ztm_i_ini ) |
---|
468 | |
---|
469 | END SUBROUTINE lim_istate |
---|
470 | |
---|
471 | SUBROUTINE lim_istate_init |
---|
472 | !!------------------------------------------------------------------- |
---|
473 | !! *** ROUTINE lim_istate_init *** |
---|
474 | !! |
---|
475 | !! ** Purpose : Definition of initial state of the ice |
---|
476 | !! |
---|
477 | !! ** Method : Read the namiceini namelist and check the parameter |
---|
478 | !! values called at the first timestep (nit000) |
---|
479 | !! |
---|
480 | !! ** input : |
---|
481 | !! Namelist namiceini |
---|
482 | !! |
---|
483 | !! history : |
---|
484 | !! 8.5 ! 03-08 (C. Ethe) original code |
---|
485 | !! 8.5 ! 07-11 (M. Vancoppenolle) rewritten initialization |
---|
486 | !!----------------------------------------------------------------------------- |
---|
487 | NAMELIST/namiceini/ ln_limini, thres_sst, hts_ini_n, hts_ini_s, hti_ini_n, hti_ini_s, & |
---|
488 | & ati_ini_n, ati_ini_s, smi_ini_n, smi_ini_s, tmi_ini_n, tmi_ini_s |
---|
489 | INTEGER :: ios ! Local integer output status for namelist read |
---|
490 | !!----------------------------------------------------------------------------- |
---|
491 | ! |
---|
492 | REWIND( numnam_ice_ref ) ! Namelist namiceini in reference namelist : Ice initial state |
---|
493 | READ ( numnam_ice_ref, namiceini, IOSTAT = ios, ERR = 901) |
---|
494 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in reference namelist', lwp ) |
---|
495 | |
---|
496 | REWIND( numnam_ice_cfg ) ! Namelist namiceini in configuration namelist : Ice initial state |
---|
497 | READ ( numnam_ice_cfg, namiceini, IOSTAT = ios, ERR = 902 ) |
---|
498 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in configuration namelist', lwp ) |
---|
499 | IF(lwm) WRITE ( numoni, namiceini ) |
---|
500 | |
---|
501 | ! Define the initial parameters |
---|
502 | ! ------------------------- |
---|
503 | |
---|
504 | IF(lwp) THEN |
---|
505 | WRITE(numout,*) |
---|
506 | WRITE(numout,*) 'lim_istate_init : ice parameters inititialisation ' |
---|
507 | WRITE(numout,*) '~~~~~~~~~~~~~~~' |
---|
508 | WRITE(numout,*) ' initialization with ice (T) or not (F) ln_limini = ', ln_limini |
---|
509 | WRITE(numout,*) ' threshold water temp. for initial sea-ice thres_sst = ', thres_sst |
---|
510 | WRITE(numout,*) ' initial snow thickness in the north hts_ini_n = ', hts_ini_n |
---|
511 | WRITE(numout,*) ' initial snow thickness in the south hts_ini_s = ', hts_ini_s |
---|
512 | WRITE(numout,*) ' initial ice thickness in the north hti_ini_n = ', hti_ini_n |
---|
513 | WRITE(numout,*) ' initial ice thickness in the south hti_ini_s = ', hti_ini_s |
---|
514 | WRITE(numout,*) ' initial ice concentr. in the north ati_ini_n = ', ati_ini_n |
---|
515 | WRITE(numout,*) ' initial ice concentr. in the north ati_ini_s = ', ati_ini_s |
---|
516 | WRITE(numout,*) ' initial ice salinity in the north smi_ini_n = ', smi_ini_n |
---|
517 | WRITE(numout,*) ' initial ice salinity in the south smi_ini_s = ', smi_ini_s |
---|
518 | WRITE(numout,*) ' initial ice/snw temp in the north tmi_ini_n = ', tmi_ini_n |
---|
519 | WRITE(numout,*) ' initial ice/snw temp in the south tmi_ini_s = ', tmi_ini_s |
---|
520 | ENDIF |
---|
521 | |
---|
522 | END SUBROUTINE lim_istate_init |
---|
523 | |
---|
524 | #else |
---|
525 | !!---------------------------------------------------------------------- |
---|
526 | !! Default option : Empty module NO LIM sea-ice model |
---|
527 | !!---------------------------------------------------------------------- |
---|
528 | CONTAINS |
---|
529 | SUBROUTINE lim_istate ! Empty routine |
---|
530 | END SUBROUTINE lim_istate |
---|
531 | #endif |
---|
532 | |
---|
533 | !!====================================================================== |
---|
534 | END MODULE limistate |
---|