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 | !! - ! 2014 (C. Rousset) add N/S initializations |
---|
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_oce ! ocean parameters |
---|
25 | USE limvar ! lim_var_salprof |
---|
26 | USE in_out_manager ! I/O manager |
---|
27 | USE lib_mpp ! MPP library |
---|
28 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
29 | USE wrk_nemo ! work arrays |
---|
30 | USE fldread ! read input fields |
---|
31 | USE iom |
---|
32 | |
---|
33 | !!!clem |
---|
34 | !! USE diawri |
---|
35 | !!! |
---|
36 | |
---|
37 | IMPLICIT NONE |
---|
38 | PRIVATE |
---|
39 | |
---|
40 | PUBLIC lim_istate ! routine called by lim_init.F90 |
---|
41 | |
---|
42 | INTEGER , PARAMETER :: jpfldi = 6 ! maximum number of files to read |
---|
43 | INTEGER , PARAMETER :: jp_hti = 1 ! index of ice thickness (m) at T-point |
---|
44 | INTEGER , PARAMETER :: jp_hts = 2 ! index of snow thicknes (m) at T-point |
---|
45 | INTEGER , PARAMETER :: jp_ati = 3 ! index of ice fraction (%) at T-point |
---|
46 | INTEGER , PARAMETER :: jp_tsu = 4 ! index of ice surface temp (K) at T-point |
---|
47 | INTEGER , PARAMETER :: jp_tmi = 5 ! index of ice temp at T-point |
---|
48 | INTEGER , PARAMETER :: jp_smi = 6 ! index of ice sali at T-point |
---|
49 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: si ! structure of input fields (file informations, fields read) |
---|
50 | !!---------------------------------------------------------------------- |
---|
51 | !! LIM 3.0, UCL-LOCEAN-IPSL (2008) |
---|
52 | !! $Id$ |
---|
53 | !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) |
---|
54 | !!---------------------------------------------------------------------- |
---|
55 | CONTAINS |
---|
56 | |
---|
57 | SUBROUTINE lim_istate |
---|
58 | !!------------------------------------------------------------------- |
---|
59 | !! *** ROUTINE lim_istate *** |
---|
60 | !! |
---|
61 | !! ** Purpose : defined the sea-ice initial state |
---|
62 | !! |
---|
63 | !! ** Method : |
---|
64 | !! This routine will put some ice where ocean |
---|
65 | !! is at the freezing point, then fill in ice |
---|
66 | !! state variables using prescribed initial |
---|
67 | !! values in the namelist |
---|
68 | !! |
---|
69 | !! ** Steps : |
---|
70 | !! 1) Read namelist |
---|
71 | !! 2) Basal temperature; ice and hemisphere masks |
---|
72 | !! 3) Fill in the ice thickness distribution using gaussian |
---|
73 | !! 4) Fill in space-dependent arrays for state variables |
---|
74 | !! 5) Diagnostic arrays |
---|
75 | !! 6) Lateral boundary conditions |
---|
76 | !! |
---|
77 | !! ** Notes : o_i, t_su, t_s, t_i, s_i must be filled everywhere, even |
---|
78 | !! where there is no ice (clem: I do not know why, is it mandatory?) |
---|
79 | !! |
---|
80 | !! History : |
---|
81 | !! 2.0 ! 01-04 (C. Ethe, G. Madec) Original code |
---|
82 | !! 3.0 ! 2007 (M. Vancoppenolle) Rewrite for ice cats |
---|
83 | !! 4.0 ! 09-11 (M. Vancoppenolle) Enhanced version for ice cats |
---|
84 | !!-------------------------------------------------------------------- |
---|
85 | |
---|
86 | !! * Local variables |
---|
87 | INTEGER :: ji, jj, jk, jl ! dummy loop indices |
---|
88 | REAL(wp) :: ztmelts, zdh |
---|
89 | INTEGER :: i_hemis, i_fill, jl0 |
---|
90 | REAL(wp) :: zarg, zV, zconv, zdv, z1_jpl |
---|
91 | REAL(wp), POINTER, DIMENSION(:,:) :: zswitch ! ice indicator |
---|
92 | REAL(wp), POINTER, DIMENSION(:,:) :: zht_i_ini, zat_i_ini, zvt_i_ini !data from namelist or nc file |
---|
93 | REAL(wp), POINTER, DIMENSION(:,:) :: zts_u_ini, zht_s_ini, zsm_i_ini, ztm_i_ini !data from namelist or nc file |
---|
94 | REAL(wp), POINTER, DIMENSION(:,:,:) :: zh_i_ini, za_i_ini !data by cattegories to fill |
---|
95 | INTEGER , POINTER, DIMENSION(:) :: itest |
---|
96 | !-------------------------------------------------------------------- |
---|
97 | |
---|
98 | CALL wrk_alloc( jpi, jpj, jpl, zh_i_ini, za_i_ini ) |
---|
99 | CALL wrk_alloc( jpi, jpj, zht_i_ini, zat_i_ini, zvt_i_ini, zts_u_ini, zht_s_ini, zsm_i_ini, ztm_i_ini ) |
---|
100 | CALL wrk_alloc( jpi, jpj, zswitch ) |
---|
101 | Call wrk_alloc( 4, itest ) |
---|
102 | |
---|
103 | IF(lwp) WRITE(numout,*) |
---|
104 | IF(lwp) WRITE(numout,*) 'lim_istate : Ice initialization ' |
---|
105 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' |
---|
106 | |
---|
107 | !-------------------------------------------------------------------- |
---|
108 | ! 1) Read namelist |
---|
109 | !-------------------------------------------------------------------- |
---|
110 | CALL lim_istate_init |
---|
111 | |
---|
112 | ! init surface temperature |
---|
113 | DO jl = 1, jpl |
---|
114 | t_su (:,:,jl) = rt0 * tmask(:,:,1) |
---|
115 | tn_ice(:,:,jl) = rt0 * tmask(:,:,1) |
---|
116 | END DO |
---|
117 | |
---|
118 | ! init basal temperature (considered at freezing point) |
---|
119 | CALL eos_fzp( sss_m(:,:), t_bo(:,:) ) |
---|
120 | t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) |
---|
121 | |
---|
122 | |
---|
123 | !-------------------------------------------------------------------- |
---|
124 | ! 2) Initialization of sea ice state variables |
---|
125 | !-------------------------------------------------------------------- |
---|
126 | IF( ln_limini ) THEN |
---|
127 | |
---|
128 | IF( ln_limini_file )THEN |
---|
129 | |
---|
130 | zht_i_ini(:,:) = si(jp_hti)%fnow(:,:,1) |
---|
131 | zht_s_ini(:,:) = si(jp_hts)%fnow(:,:,1) |
---|
132 | zat_i_ini(:,:) = si(jp_ati)%fnow(:,:,1) |
---|
133 | zts_u_ini(:,:) = si(jp_tsu)%fnow(:,:,1) |
---|
134 | ztm_i_ini(:,:) = si(jp_tmi)%fnow(:,:,1) |
---|
135 | zsm_i_ini(:,:) = si(jp_smi)%fnow(:,:,1) |
---|
136 | |
---|
137 | WHERE( zat_i_ini(:,:) > 0._wp ) ; zswitch(:,:) = tmask(:,:,1) |
---|
138 | ELSEWHERE ; zswitch(:,:) = 0._wp |
---|
139 | END WHERE |
---|
140 | |
---|
141 | ELSE ! ln_limini_file = F |
---|
142 | |
---|
143 | !-------------------------------------------------------------------- |
---|
144 | ! 3) Basal temperature, ice mask |
---|
145 | !-------------------------------------------------------------------- |
---|
146 | ! no ice if sst <= t-freez + ttest |
---|
147 | WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst ) ; zswitch(:,:) = 0._wp |
---|
148 | ELSEWHERE ; zswitch(:,:) = tmask(:,:,1) |
---|
149 | END WHERE |
---|
150 | |
---|
151 | !----------------------------- |
---|
152 | ! 3.1) Hemisphere-dependent arrays |
---|
153 | !----------------------------- |
---|
154 | ! assign initial thickness, concentration, snow depth and salinity to an hemisphere-dependent array |
---|
155 | DO jj = 1, jpj |
---|
156 | DO ji = 1, jpi |
---|
157 | IF( ff(ji,jj) >= 0._wp ) THEN |
---|
158 | zht_i_ini(ji,jj) = rn_hti_ini_n * zswitch(ji,jj) |
---|
159 | zht_s_ini(ji,jj) = rn_hts_ini_n * zswitch(ji,jj) |
---|
160 | zat_i_ini(ji,jj) = rn_ati_ini_n * zswitch(ji,jj) |
---|
161 | zts_u_ini(ji,jj) = rn_tmi_ini_n * zswitch(ji,jj) |
---|
162 | zsm_i_ini(ji,jj) = rn_smi_ini_n * zswitch(ji,jj) |
---|
163 | ztm_i_ini(ji,jj) = rn_tmi_ini_n * zswitch(ji,jj) |
---|
164 | ELSE |
---|
165 | zht_i_ini(ji,jj) = rn_hti_ini_s * zswitch(ji,jj) |
---|
166 | zht_s_ini(ji,jj) = rn_hts_ini_s * zswitch(ji,jj) |
---|
167 | zat_i_ini(ji,jj) = rn_ati_ini_s * zswitch(ji,jj) |
---|
168 | zts_u_ini(ji,jj) = rn_tmi_ini_s * zswitch(ji,jj) |
---|
169 | zsm_i_ini(ji,jj) = rn_smi_ini_s * zswitch(ji,jj) |
---|
170 | ztm_i_ini(ji,jj) = rn_tmi_ini_s * zswitch(ji,jj) |
---|
171 | ENDIF |
---|
172 | END DO |
---|
173 | END DO |
---|
174 | |
---|
175 | ENDIF ! ln_limini_file |
---|
176 | |
---|
177 | zvt_i_ini(:,:) = zht_i_ini(:,:) * zat_i_ini(:,:) ! ice volume |
---|
178 | !--------------------------------------------------------------------- |
---|
179 | ! 3.2) Distribute ice concentration and thickness into the categories |
---|
180 | !--------------------------------------------------------------------- |
---|
181 | ! a gaussian distribution for ice concentration is used |
---|
182 | ! then we check whether the distribution fullfills |
---|
183 | ! volume and area conservation, positivity and ice categories bounds |
---|
184 | zh_i_ini(:,:,:) = 0._wp |
---|
185 | za_i_ini(:,:,:) = 0._wp |
---|
186 | |
---|
187 | DO jj = 1, jpj |
---|
188 | DO ji = 1, jpi |
---|
189 | |
---|
190 | IF( zat_i_ini(ji,jj) > 0._wp .AND. zht_i_ini(ji,jj) > 0._wp )THEN |
---|
191 | |
---|
192 | !--- jl0: most likely index where cc will be maximum |
---|
193 | jl0 = jpl |
---|
194 | DO jl = 1, jpl |
---|
195 | IF ( ( zht_i_ini(ji,jj) > hi_max(jl-1) ) .AND. ( zht_i_ini(ji,jj) <= hi_max(jl) ) ) THEN |
---|
196 | jl0 = jl |
---|
197 | CYCLE |
---|
198 | ENDIF |
---|
199 | END DO |
---|
200 | |
---|
201 | ! initialisation of tests |
---|
202 | itest(:) = 0 |
---|
203 | |
---|
204 | i_fill = jpl + 1 !==================================== |
---|
205 | DO WHILE ( ( SUM( itest(:) ) /= 4 ) .AND. ( i_fill >= 2 ) ) ! iterative loop on i_fill categories |
---|
206 | ! iteration !==================================== |
---|
207 | i_fill = i_fill - 1 |
---|
208 | |
---|
209 | ! initialisation of ice variables for each try |
---|
210 | zh_i_ini(ji,jj,:) = 0._wp |
---|
211 | za_i_ini(ji,jj,:) = 0._wp |
---|
212 | itest(:) = 0 |
---|
213 | |
---|
214 | ! *** case very thin ice: fill only category 1 |
---|
215 | IF ( i_fill == 1 ) THEN |
---|
216 | zh_i_ini(ji,jj,1) = zht_i_ini(ji,jj) |
---|
217 | za_i_ini(ji,jj,1) = zat_i_ini(ji,jj) |
---|
218 | |
---|
219 | ! *** case ice is thicker: fill categories >1 |
---|
220 | ELSE |
---|
221 | |
---|
222 | ! Fill ice thicknesses in the (i_fill-1) cat by hmean |
---|
223 | DO jl = 1, i_fill-1 |
---|
224 | zh_i_ini(ji,jj,jl) = hi_mean(jl) |
---|
225 | END DO |
---|
226 | |
---|
227 | !--- Concentrations |
---|
228 | za_i_ini(ji,jj,jl0) = zat_i_ini(ji,jj) / SQRT(REAL(jpl)) |
---|
229 | DO jl = 1, i_fill - 1 |
---|
230 | IF( jl /= jl0 )THEN |
---|
231 | zarg = ( zh_i_ini(ji,jj,jl) - zht_i_ini(ji,jj) ) / ( 0.5_wp * zht_i_ini(ji,jj) ) |
---|
232 | za_i_ini(ji,jj,jl) = za_i_ini(ji,jj,jl0) * EXP(-zarg**2) |
---|
233 | ENDIF |
---|
234 | END DO |
---|
235 | |
---|
236 | ! Concentration in the last (i_fill) category |
---|
237 | za_i_ini(ji,jj,i_fill) = zat_i_ini(ji,jj) - SUM( za_i_ini(ji,jj,1:i_fill-1) ) |
---|
238 | |
---|
239 | ! Ice thickness in the last (i_fill) category |
---|
240 | zV = SUM( za_i_ini(ji,jj,1:i_fill-1) * zh_i_ini(ji,jj,1:i_fill-1) ) |
---|
241 | zh_i_ini(ji,jj,i_fill) = ( zvt_i_ini(ji,jj) - zV ) / MAX( za_i_ini(ji,jj,i_fill), epsi10 ) |
---|
242 | |
---|
243 | ! clem: correction if concentration of upper cat is greater than lower cat |
---|
244 | ! (it should be a gaussian around jl0 but sometimes it is not) |
---|
245 | IF ( jl0 /= jpl ) THEN |
---|
246 | DO jl = jpl, jl0+1, -1 |
---|
247 | IF ( za_i_ini(ji,jj,jl) > za_i_ini(ji,jj,jl-1) ) THEN |
---|
248 | zdv = zh_i_ini(ji,jj,jl) * za_i_ini(ji,jj,jl) |
---|
249 | zh_i_ini(ji,jj,jl ) = 0._wp |
---|
250 | za_i_ini(ji,jj,jl ) = 0._wp |
---|
251 | za_i_ini(ji,jj,1:jl-1) = za_i_ini(ji,jj,1:jl-1) & |
---|
252 | & + zdv / MAX( REAL(jl-1) * zht_i_ini(ji,jj), epsi10 ) |
---|
253 | END IF |
---|
254 | ENDDO |
---|
255 | ENDIF |
---|
256 | |
---|
257 | ENDIF ! case ice is thick or thin |
---|
258 | |
---|
259 | !--------------------- |
---|
260 | ! Compatibility tests |
---|
261 | !--------------------- |
---|
262 | ! Test 1: area conservation |
---|
263 | zconv = ABS( zat_i_ini(ji,jj) - SUM( za_i_ini(ji,jj,1:jpl) ) ) |
---|
264 | IF ( zconv < epsi06 ) itest(1) = 1 |
---|
265 | |
---|
266 | ! Test 2: volume conservation |
---|
267 | zconv = ABS( zat_i_ini(ji,jj) * zht_i_ini(ji,jj) & |
---|
268 | & - SUM( za_i_ini (ji,jj,1:jpl) * zh_i_ini (ji,jj,1:jpl) ) ) |
---|
269 | IF ( zconv < epsi06 ) itest(2) = 1 |
---|
270 | |
---|
271 | ! Test 3: thickness of the last category is in-bounds ? |
---|
272 | IF ( zh_i_ini(ji,jj,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1 |
---|
273 | |
---|
274 | ! Test 4: positivity of ice concentrations |
---|
275 | itest(4) = 1 |
---|
276 | DO jl = 1, i_fill |
---|
277 | IF ( za_i_ini(ji,jj,jl) < 0._wp ) itest(4) = 0 |
---|
278 | END DO |
---|
279 | ! !============================ |
---|
280 | END DO ! end iteration on categories |
---|
281 | ! !============================ |
---|
282 | |
---|
283 | IF( lwp .AND. SUM(itest) /= 4 ) THEN |
---|
284 | WRITE(numout,*) |
---|
285 | WRITE(numout,*) ' !!!! ALERT itest is not equal to 4 !!! ' |
---|
286 | WRITE(numout,*) ' !!!! Something is wrong in the LIM3 initialization procedure ' |
---|
287 | WRITE(numout,*) |
---|
288 | WRITE(numout,*) ' *** itest_i (i=1,4) = ', itest(:) |
---|
289 | WRITE(numout,*) ' zat_i_ini : ', zat_i_ini(ji,jj) |
---|
290 | WRITE(numout,*) ' zht_i_ini : ', zht_i_ini(ji,jj) |
---|
291 | ENDIF |
---|
292 | |
---|
293 | ENDIF ! zat_i_ini(ji,jj) > 0._wp .AND. zht_i_ini(ji,jj) > 0._wp |
---|
294 | |
---|
295 | ENDDO |
---|
296 | ENDDO |
---|
297 | |
---|
298 | !--------------------------------------------------------------------- |
---|
299 | ! 3.3) Space-dependent arrays for ice state variables |
---|
300 | !--------------------------------------------------------------------- |
---|
301 | |
---|
302 | ! Ice concentration, thickness and volume, ice salinity, ice age, surface temperature |
---|
303 | DO jl = 1, jpl ! loop over categories |
---|
304 | DO jj = 1, jpj |
---|
305 | DO ji = 1, jpi |
---|
306 | a_i(ji,jj,jl) = zswitch(ji,jj) * za_i_ini(ji,jj,jl) ! concentration |
---|
307 | ht_i(ji,jj,jl) = zswitch(ji,jj) * zh_i_ini(ji,jj,jl) ! ice thickness |
---|
308 | sm_i(ji,jj,jl) = zswitch(ji,jj) * zsm_i_ini(ji,jj) ! salinity |
---|
309 | o_i(ji,jj,jl) = zswitch(ji,jj) * 1._wp ! age (1 day) |
---|
310 | t_su(ji,jj,jl) = zswitch(ji,jj) * zts_u_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rt0 ! surf temp |
---|
311 | |
---|
312 | IF( zht_i_ini(ji,jj) > 0._wp )THEN |
---|
313 | ht_s(ji,jj,jl)= ht_i(ji,jj,jl) * ( zht_s_ini(ji,jj) / zht_i_ini(ji,jj) ) ! snow depth |
---|
314 | ELSE |
---|
315 | ht_s(ji,jj,jl)= 0._wp |
---|
316 | ENDIF |
---|
317 | |
---|
318 | ! This case below should not be used if (ht_s/ht_i) is ok in namelist |
---|
319 | ! In case snow load is in excess that would lead to transformation from snow to ice |
---|
320 | ! Then, transfer the snow excess into the ice (different from limthd_dh) |
---|
321 | zdh = MAX( 0._wp, ( rhosn * ht_s(ji,jj,jl) + ( rhoic - rau0 ) * ht_i(ji,jj,jl) ) * r1_rau0 ) |
---|
322 | ! recompute ht_i, ht_s avoiding out of bounds values |
---|
323 | ht_i(ji,jj,jl) = MIN( hi_max(jl), ht_i(ji,jj,jl) + zdh ) |
---|
324 | ht_s(ji,jj,jl) = MAX( 0._wp, ht_s(ji,jj,jl) - zdh * rhoic * r1_rhosn ) |
---|
325 | |
---|
326 | ! ice volume, salt content, age content |
---|
327 | v_i(ji,jj,jl) = ht_i(ji,jj,jl) * a_i(ji,jj,jl) ! ice volume |
---|
328 | v_s(ji,jj,jl) = ht_s(ji,jj,jl) * a_i(ji,jj,jl) ! snow volume |
---|
329 | smv_i(ji,jj,jl) = MIN( sm_i(ji,jj,jl) , sss_m(ji,jj) ) * v_i(ji,jj,jl) ! salt content |
---|
330 | oa_i(ji,jj,jl) = o_i(ji,jj,jl) * a_i(ji,jj,jl) ! age content |
---|
331 | END DO |
---|
332 | END DO |
---|
333 | END DO |
---|
334 | |
---|
335 | ! for constant salinity in time |
---|
336 | IF( nn_icesal == 1 .OR. nn_icesal == 3 ) THEN |
---|
337 | CALL lim_var_salprof |
---|
338 | smv_i = sm_i * v_i |
---|
339 | ENDIF |
---|
340 | |
---|
341 | ! Snow temperature and heat content |
---|
342 | DO jk = 1, nlay_s |
---|
343 | DO jl = 1, jpl ! loop over categories |
---|
344 | DO jj = 1, jpj |
---|
345 | DO ji = 1, jpi |
---|
346 | t_s(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rt0 |
---|
347 | ! Snow energy of melting |
---|
348 | e_s(ji,jj,jk,jl) = zswitch(ji,jj) * rhosn * ( cpic * ( rt0 - t_s(ji,jj,jk,jl) ) + lfus ) |
---|
349 | |
---|
350 | ! Mutliply by volume, and divide by number of layers to get heat content in J/m2 |
---|
351 | e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * v_s(ji,jj,jl) * r1_nlay_s |
---|
352 | END DO |
---|
353 | END DO |
---|
354 | END DO |
---|
355 | END DO |
---|
356 | |
---|
357 | ! Ice salinity, temperature and heat content |
---|
358 | DO jk = 1, nlay_i |
---|
359 | DO jl = 1, jpl ! loop over categories |
---|
360 | DO jj = 1, jpj |
---|
361 | DO ji = 1, jpi |
---|
362 | t_i(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rt0 |
---|
363 | s_i(ji,jj,jk,jl) = zswitch(ji,jj) * zsm_i_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rn_simin |
---|
364 | ztmelts = - tmut * s_i(ji,jj,jk,jl) + rt0 !Melting temperature in K |
---|
365 | |
---|
366 | ! heat content per unit volume |
---|
367 | e_i(ji,jj,jk,jl) = zswitch(ji,jj) * rhoic * ( cpic * ( ztmelts - t_i(ji,jj,jk,jl) ) & |
---|
368 | + lfus * ( 1._wp - (ztmelts-rt0) / MIN((t_i(ji,jj,jk,jl)-rt0),-epsi20) ) & |
---|
369 | - rcp * ( ztmelts - rt0 ) ) |
---|
370 | |
---|
371 | ! Mutliply by ice volume, and divide by number of layers to get heat content in J/m2 |
---|
372 | e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * v_i(ji,jj,jl) * r1_nlay_i |
---|
373 | END DO |
---|
374 | END DO |
---|
375 | END DO |
---|
376 | END DO |
---|
377 | |
---|
378 | tn_ice (:,:,:) = t_su (:,:,:) |
---|
379 | |
---|
380 | ! MV MP 2016 |
---|
381 | ! Melt pond volume and fraction |
---|
382 | |
---|
383 | z1_jpl = 1. / REAL(jpl) |
---|
384 | |
---|
385 | SELECT CASE ( nn_pnd_scheme ) |
---|
386 | |
---|
387 | CASE ( 0 ) !--- Prescribed melt ponds |
---|
388 | |
---|
389 | DO jl = 1, jpl |
---|
390 | |
---|
391 | a_ip(:,:,jl) = rn_apnd * z1_jpl * zswitch(:,:) |
---|
392 | v_ip(:,:,jl) = 0.1 * zswitch(:,:) * a_ip(:,:,jl) |
---|
393 | |
---|
394 | END DO |
---|
395 | |
---|
396 | CASE ( 1, 2 ) !--- Prognostic melt ponds |
---|
397 | |
---|
398 | DO jl = 1, jpl |
---|
399 | |
---|
400 | a_ip(:,:,jl) = 0.1 * zswitch(:,:) |
---|
401 | v_ip(:,:,jl) = 0.1 * zswitch(:,:) * a_ip(:,:,jl) |
---|
402 | |
---|
403 | END DO |
---|
404 | |
---|
405 | END SELECT |
---|
406 | |
---|
407 | ! END MV MP 2016 |
---|
408 | |
---|
409 | ELSE ! if ln_limini=false |
---|
410 | a_i (:,:,:) = 0._wp |
---|
411 | v_i (:,:,:) = 0._wp |
---|
412 | v_s (:,:,:) = 0._wp |
---|
413 | smv_i(:,:,:) = 0._wp |
---|
414 | oa_i (:,:,:) = 0._wp |
---|
415 | ht_i (:,:,:) = 0._wp |
---|
416 | ht_s (:,:,:) = 0._wp |
---|
417 | sm_i (:,:,:) = 0._wp |
---|
418 | o_i (:,:,:) = 0._wp |
---|
419 | |
---|
420 | e_i(:,:,:,:) = 0._wp |
---|
421 | e_s(:,:,:,:) = 0._wp |
---|
422 | |
---|
423 | DO jl = 1, jpl |
---|
424 | DO jk = 1, nlay_i |
---|
425 | t_i(:,:,jk,jl) = rt0 * tmask(:,:,1) |
---|
426 | END DO |
---|
427 | DO jk = 1, nlay_s |
---|
428 | t_s(:,:,jk,jl) = rt0 * tmask(:,:,1) |
---|
429 | END DO |
---|
430 | END DO |
---|
431 | |
---|
432 | ! MV MP 2016 |
---|
433 | a_ip(:,:,:) = 0._wp |
---|
434 | v_ip(:,:,:) = 0._wp |
---|
435 | h_ip(:,:,:) = 0._wp |
---|
436 | a_ip_frac(:,:,:) = 0._wp |
---|
437 | ! END MV MP 2016 |
---|
438 | |
---|
439 | ENDIF ! ln_limini |
---|
440 | |
---|
441 | at_i (:,:) = 0.0_wp |
---|
442 | DO jl = 1, jpl |
---|
443 | at_i (:,:) = at_i (:,:) + a_i (:,:,jl) |
---|
444 | END DO |
---|
445 | |
---|
446 | !-------------------------------------------------------------------- |
---|
447 | ! 4) Global ice variables for output diagnostics | |
---|
448 | !-------------------------------------------------------------------- |
---|
449 | u_ice (:,:) = 0._wp |
---|
450 | v_ice (:,:) = 0._wp |
---|
451 | stress1_i(:,:) = 0._wp |
---|
452 | stress2_i(:,:) = 0._wp |
---|
453 | stress12_i(:,:) = 0._wp |
---|
454 | |
---|
455 | !-------------------------------------------------------------------- |
---|
456 | ! 5) Moments for advection |
---|
457 | !-------------------------------------------------------------------- |
---|
458 | |
---|
459 | sxopw (:,:) = 0._wp |
---|
460 | syopw (:,:) = 0._wp |
---|
461 | sxxopw(:,:) = 0._wp |
---|
462 | syyopw(:,:) = 0._wp |
---|
463 | sxyopw(:,:) = 0._wp |
---|
464 | |
---|
465 | sxice (:,:,:) = 0._wp ; sxsn (:,:,:) = 0._wp ; sxa (:,:,:) = 0._wp |
---|
466 | syice (:,:,:) = 0._wp ; sysn (:,:,:) = 0._wp ; sya (:,:,:) = 0._wp |
---|
467 | sxxice(:,:,:) = 0._wp ; sxxsn(:,:,:) = 0._wp ; sxxa (:,:,:) = 0._wp |
---|
468 | syyice(:,:,:) = 0._wp ; syysn(:,:,:) = 0._wp ; syya (:,:,:) = 0._wp |
---|
469 | sxyice(:,:,:) = 0._wp ; sxysn(:,:,:) = 0._wp ; sxya (:,:,:) = 0._wp |
---|
470 | |
---|
471 | sxc0 (:,:,:) = 0._wp ; sxe (:,:,:,:)= 0._wp |
---|
472 | syc0 (:,:,:) = 0._wp ; sye (:,:,:,:)= 0._wp |
---|
473 | sxxc0 (:,:,:) = 0._wp ; sxxe (:,:,:,:)= 0._wp |
---|
474 | syyc0 (:,:,:) = 0._wp ; syye (:,:,:,:)= 0._wp |
---|
475 | sxyc0 (:,:,:) = 0._wp ; sxye (:,:,:,:)= 0._wp |
---|
476 | |
---|
477 | sxsal (:,:,:) = 0._wp |
---|
478 | sysal (:,:,:) = 0._wp |
---|
479 | sxxsal (:,:,:) = 0._wp |
---|
480 | syysal (:,:,:) = 0._wp |
---|
481 | sxysal (:,:,:) = 0._wp |
---|
482 | |
---|
483 | sxage (:,:,:) = 0._wp |
---|
484 | syage (:,:,:) = 0._wp |
---|
485 | sxxage (:,:,:) = 0._wp |
---|
486 | syyage (:,:,:) = 0._wp |
---|
487 | sxyage (:,:,:) = 0._wp |
---|
488 | |
---|
489 | ! MV MP 2016 |
---|
490 | IF ( nn_pnd_scheme >= 1 ) THEN |
---|
491 | sxap (:,:,:) = 0._wp ; sxvp (:,:,:) = 0._wp |
---|
492 | syap (:,:,:) = 0._wp ; syvp (:,:,:) = 0._wp |
---|
493 | sxxap (:,:,:) = 0._wp ; sxxvp (:,:,:) = 0._wp |
---|
494 | syyap (:,:,:) = 0._wp ; syyvp (:,:,:) = 0._wp |
---|
495 | sxyap (:,:,:) = 0._wp ; sxyvp (:,:,:) = 0._wp |
---|
496 | ENDIF |
---|
497 | ! END MV MP 2016 |
---|
498 | |
---|
499 | !!!clem |
---|
500 | !! ! Output the initial state and forcings |
---|
501 | !! CALL dia_wri_state( 'output.init', nit000 ) |
---|
502 | !!! |
---|
503 | |
---|
504 | CALL wrk_dealloc( jpi, jpj, jpl, zh_i_ini, za_i_ini ) |
---|
505 | CALL wrk_dealloc( jpi, jpj, zht_i_ini, zat_i_ini, zvt_i_ini, zts_u_ini, zht_s_ini, zsm_i_ini, ztm_i_ini ) |
---|
506 | CALL wrk_dealloc( jpi, jpj, zswitch ) |
---|
507 | Call wrk_dealloc( 4, itest ) |
---|
508 | |
---|
509 | END SUBROUTINE lim_istate |
---|
510 | |
---|
511 | SUBROUTINE lim_istate_init |
---|
512 | !!------------------------------------------------------------------- |
---|
513 | !! *** ROUTINE lim_istate_init *** |
---|
514 | !! |
---|
515 | !! ** Purpose : Definition of initial state of the ice |
---|
516 | !! |
---|
517 | !! ** Method : Read the namiceini namelist and check the parameter |
---|
518 | !! values called at the first timestep (nit000) |
---|
519 | !! |
---|
520 | !! ** input : |
---|
521 | !! Namelist namiceini |
---|
522 | !! |
---|
523 | !! history : |
---|
524 | !! 8.5 ! 03-08 (C. Ethe) original code |
---|
525 | !! 8.5 ! 07-11 (M. Vancoppenolle) rewritten initialization |
---|
526 | !!----------------------------------------------------------------------------- |
---|
527 | ! |
---|
528 | INTEGER :: ios,ierr,inum_ice ! Local integer output status for namelist read |
---|
529 | INTEGER :: ji,jj |
---|
530 | INTEGER :: ifpr, ierror |
---|
531 | ! |
---|
532 | CHARACTER(len=100) :: cn_dir ! Root directory for location of ice files |
---|
533 | TYPE(FLD_N) :: sn_hti, sn_hts, sn_ati, sn_tsu, sn_tmi, sn_smi |
---|
534 | TYPE(FLD_N), DIMENSION(jpfldi) :: slf_i ! array of namelist informations on the fields to read |
---|
535 | ! |
---|
536 | NAMELIST/namiceini/ ln_limini, ln_limini_file, rn_thres_sst, rn_hts_ini_n, rn_hts_ini_s, & |
---|
537 | & rn_hti_ini_n, rn_hti_ini_s, rn_ati_ini_n, rn_ati_ini_s, rn_smi_ini_n, & |
---|
538 | & rn_smi_ini_s, rn_tmi_ini_n, rn_tmi_ini_s, & |
---|
539 | & sn_hti, sn_hts, sn_ati, sn_tsu, sn_tmi, sn_smi, cn_dir |
---|
540 | !!----------------------------------------------------------------------------- |
---|
541 | ! |
---|
542 | REWIND( numnam_ice_ref ) ! Namelist namiceini in reference namelist : Ice initial state |
---|
543 | READ ( numnam_ice_ref, namiceini, IOSTAT = ios, ERR = 901) |
---|
544 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in reference namelist', lwp ) |
---|
545 | |
---|
546 | REWIND( numnam_ice_cfg ) ! Namelist namiceini in configuration namelist : Ice initial state |
---|
547 | READ ( numnam_ice_cfg, namiceini, IOSTAT = ios, ERR = 902 ) |
---|
548 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in configuration namelist', lwp ) |
---|
549 | IF(lwm) WRITE ( numoni, namiceini ) |
---|
550 | |
---|
551 | slf_i(jp_hti) = sn_hti ; slf_i(jp_hts) = sn_hts |
---|
552 | slf_i(jp_ati) = sn_ati ; slf_i(jp_tsu) = sn_tsu |
---|
553 | slf_i(jp_tmi) = sn_tmi ; slf_i(jp_smi) = sn_smi |
---|
554 | |
---|
555 | ! Define the initial parameters |
---|
556 | ! ------------------------- |
---|
557 | |
---|
558 | IF(lwp) THEN |
---|
559 | WRITE(numout,*) |
---|
560 | WRITE(numout,*) 'lim_istate_init : ice parameters inititialisation ' |
---|
561 | WRITE(numout,*) '~~~~~~~~~~~~~~~' |
---|
562 | WRITE(numout,*) ' initialization with ice (T) or not (F) ln_limini = ', ln_limini |
---|
563 | WRITE(numout,*) ' ice initialization from a netcdf file ln_limini_file = ', ln_limini_file |
---|
564 | WRITE(numout,*) ' threshold water temp. for initial sea-ice rn_thres_sst = ', rn_thres_sst |
---|
565 | WRITE(numout,*) ' initial snow thickness in the north rn_hts_ini_n = ', rn_hts_ini_n |
---|
566 | WRITE(numout,*) ' initial snow thickness in the south rn_hts_ini_s = ', rn_hts_ini_s |
---|
567 | WRITE(numout,*) ' initial ice thickness in the north rn_hti_ini_n = ', rn_hti_ini_n |
---|
568 | WRITE(numout,*) ' initial ice thickness in the south rn_hti_ini_s = ', rn_hti_ini_s |
---|
569 | WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_n = ', rn_ati_ini_n |
---|
570 | WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_s = ', rn_ati_ini_s |
---|
571 | WRITE(numout,*) ' initial ice salinity in the north rn_smi_ini_n = ', rn_smi_ini_n |
---|
572 | WRITE(numout,*) ' initial ice salinity in the south rn_smi_ini_s = ', rn_smi_ini_s |
---|
573 | WRITE(numout,*) ' initial ice/snw temp in the north rn_tmi_ini_n = ', rn_tmi_ini_n |
---|
574 | WRITE(numout,*) ' initial ice/snw temp in the south rn_tmi_ini_s = ', rn_tmi_ini_s |
---|
575 | ENDIF |
---|
576 | |
---|
577 | IF( ln_limini_file ) THEN ! Ice initialization using input file |
---|
578 | ! |
---|
579 | ! set si structure |
---|
580 | ALLOCATE( si(jpfldi), STAT=ierror ) |
---|
581 | IF( ierror > 0 ) THEN |
---|
582 | CALL ctl_stop( 'Ice_ini in limistate: unable to allocate si structure' ) ; RETURN |
---|
583 | ENDIF |
---|
584 | |
---|
585 | DO ifpr = 1, jpfldi |
---|
586 | ALLOCATE( si(ifpr)%fnow(jpi,jpj,1) ) |
---|
587 | ALLOCATE( si(ifpr)%fdta(jpi,jpj,1,2) ) |
---|
588 | END DO |
---|
589 | |
---|
590 | ! fill si with slf_i and control print |
---|
591 | CALL fld_fill( si, slf_i, cn_dir, 'lim_istate', 'lim istate ini', 'numnam_ice' ) |
---|
592 | |
---|
593 | CALL fld_read( nit000, 1, si ) ! input fields provided at the current time-step |
---|
594 | |
---|
595 | ENDIF |
---|
596 | |
---|
597 | END SUBROUTINE lim_istate_init |
---|
598 | |
---|
599 | #else |
---|
600 | !!---------------------------------------------------------------------- |
---|
601 | !! Default option : Empty module NO LIM sea-ice model |
---|
602 | !!---------------------------------------------------------------------- |
---|
603 | CONTAINS |
---|
604 | SUBROUTINE lim_istate ! Empty routine |
---|
605 | END SUBROUTINE lim_istate |
---|
606 | #endif |
---|
607 | |
---|
608 | !!====================================================================== |
---|
609 | END MODULE limistate |
---|