1 | MODULE limtrp |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE limtrp *** |
---|
4 | !! LIM transport ice model : sea-ice advection/diffusion |
---|
5 | !!====================================================================== |
---|
6 | !! History : LIM-2 ! 2000-01 (M.A. Morales Maqueda, H. Goosse, and T. Fichefet) Original code |
---|
7 | !! 3.0 ! 2005-11 (M. Vancoppenolle) Multi-layer sea ice, salinity variations |
---|
8 | !! 4.0 ! 2011-02 (G. Madec) dynamical allocation |
---|
9 | !!---------------------------------------------------------------------- |
---|
10 | #if defined key_lim3 |
---|
11 | !!---------------------------------------------------------------------- |
---|
12 | !! 'key_lim3' LIM3 sea-ice model |
---|
13 | !!---------------------------------------------------------------------- |
---|
14 | !! lim_trp : advection/diffusion process of sea ice |
---|
15 | !!---------------------------------------------------------------------- |
---|
16 | USE phycst ! physical constant |
---|
17 | USE dom_oce ! ocean domain |
---|
18 | USE sbc_oce ! ocean surface boundary condition |
---|
19 | USE dom_ice ! ice domain |
---|
20 | USE ice ! ice variables |
---|
21 | USE limadv ! ice advection |
---|
22 | USE limhdf ! ice horizontal diffusion |
---|
23 | USE limvar ! |
---|
24 | ! |
---|
25 | USE in_out_manager ! I/O manager |
---|
26 | USE lbclnk ! lateral boundary conditions -- MPP exchanges |
---|
27 | USE lib_mpp ! MPP library |
---|
28 | USE wrk_nemo ! work arrays |
---|
29 | USE prtctl ! Print control |
---|
30 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
31 | USE timing ! Timing |
---|
32 | USE limcons ! conservation tests |
---|
33 | USE limctl ! control prints |
---|
34 | |
---|
35 | IMPLICIT NONE |
---|
36 | PRIVATE |
---|
37 | |
---|
38 | PUBLIC lim_trp ! called by sbcice_lim |
---|
39 | |
---|
40 | INTEGER :: ncfl ! number of ice time step with CFL>1/2 |
---|
41 | |
---|
42 | !! * Substitution |
---|
43 | # include "vectopt_loop_substitute.h90" |
---|
44 | !!---------------------------------------------------------------------- |
---|
45 | !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011) |
---|
46 | !! $Id$ |
---|
47 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
48 | !!---------------------------------------------------------------------- |
---|
49 | CONTAINS |
---|
50 | |
---|
51 | SUBROUTINE lim_trp( kt ) |
---|
52 | !!------------------------------------------------------------------- |
---|
53 | !! *** ROUTINE lim_trp *** |
---|
54 | !! |
---|
55 | !! ** purpose : advection/diffusion process of sea ice |
---|
56 | !! |
---|
57 | !! ** method : variables included in the process are scalar, |
---|
58 | !! other values are considered as second order. |
---|
59 | !! For advection, a second order Prather scheme is used. |
---|
60 | !! |
---|
61 | !! ** action : |
---|
62 | !!--------------------------------------------------------------------- |
---|
63 | INTEGER, INTENT(in) :: kt ! number of iteration |
---|
64 | ! |
---|
65 | INTEGER :: ji, jj, jk, jm , jl, jt ! dummy loop indices |
---|
66 | INTEGER :: initad ! number of sub-timestep for the advection |
---|
67 | REAL(wp) :: zcfl , zusnit ! - - |
---|
68 | CHARACTER(len=80) :: cltmp |
---|
69 | ! |
---|
70 | REAL(wp), POINTER, DIMENSION(:,:) :: zsm |
---|
71 | REAL(wp), POINTER, DIMENSION(:,:,:) :: z0ice, z0snw, z0ai, z0es , z0smi , z0oi |
---|
72 | REAL(wp), POINTER, DIMENSION(:,:,:) :: z0opw |
---|
73 | REAL(wp), POINTER, DIMENSION(:,:,:,:) :: z0ei |
---|
74 | REAL(wp), POINTER, DIMENSION(:,:,:) :: zviold, zvsold, zsmvold ! old ice volume... |
---|
75 | REAL(wp), POINTER, DIMENSION(:,:,:) :: zhimax ! old ice thickness |
---|
76 | REAL(wp), POINTER, DIMENSION(:,:) :: zatold, zeiold, zesold ! old concentration, enthalpies |
---|
77 | REAL(wp), POINTER, DIMENSION(:,:,:) :: zhdfptab |
---|
78 | REAL(wp) :: zdv, zvi, zvs, zsmv, zes, zei |
---|
79 | REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b |
---|
80 | !!--------------------------------------------------------------------- |
---|
81 | INTEGER :: ihdf_vars = 6 !!Number of variables in which we apply horizontal diffusion |
---|
82 | !! inside limtrp for each ice category , not counting the |
---|
83 | !! variables corresponding to ice_layers |
---|
84 | !!--------------------------------------------------------------------- |
---|
85 | IF( nn_timing == 1 ) CALL timing_start('limtrp') |
---|
86 | |
---|
87 | CALL wrk_alloc( jpi,jpj, zsm, zatold, zeiold, zesold ) |
---|
88 | CALL wrk_alloc( jpi,jpj,jpl, z0ice, z0snw, z0ai, z0es , z0smi , z0oi ) |
---|
89 | CALL wrk_alloc( jpi,jpj,1, z0opw ) |
---|
90 | CALL wrk_alloc( jpi,jpj,nlay_i,jpl, z0ei ) |
---|
91 | CALL wrk_alloc( jpi,jpj,jpl, zhimax, zviold, zvsold, zsmvold ) |
---|
92 | CALL wrk_alloc( jpi,jpj,jpl*(ihdf_vars + nlay_i)+1,zhdfptab) |
---|
93 | |
---|
94 | IF( numit == nstart .AND. lwp ) THEN |
---|
95 | WRITE(numout,*) |
---|
96 | IF( ln_limdyn ) THEN ; WRITE(numout,*) 'lim_trp : Ice transport ' |
---|
97 | ELSE ; WRITE(numout,*) 'lim_trp : No ice advection as ln_limdyn = ', ln_limdyn |
---|
98 | ENDIF |
---|
99 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
100 | ncfl = 0 ! nb of time step with CFL > 1/2 |
---|
101 | ENDIF |
---|
102 | |
---|
103 | zsm(:,:) = e12t(:,:) |
---|
104 | |
---|
105 | ! !-------------------------------------! |
---|
106 | IF( ln_limdyn ) THEN ! Advection of sea ice properties ! |
---|
107 | ! !-------------------------------------! |
---|
108 | |
---|
109 | ! conservation test |
---|
110 | IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limtrp', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) |
---|
111 | |
---|
112 | ! mass and salt flux init |
---|
113 | zviold(:,:,:) = v_i(:,:,:) |
---|
114 | zvsold(:,:,:) = v_s(:,:,:) |
---|
115 | zsmvold(:,:,:) = smv_i(:,:,:) |
---|
116 | zeiold(:,:) = SUM( SUM( e_i(:,:,1:nlay_i,:), dim=4 ), dim=3 ) |
---|
117 | zesold(:,:) = SUM( SUM( e_s(:,:,1:nlay_s,:), dim=4 ), dim=3 ) |
---|
118 | |
---|
119 | !--- Thickness correction init. ------------------------------- |
---|
120 | zatold(:,:) = SUM( a_i(:,:,:), dim=3 ) |
---|
121 | DO jl = 1, jpl |
---|
122 | DO jj = 1, jpj |
---|
123 | DO ji = 1, jpi |
---|
124 | rswitch = MAX( 0._wp , SIGN( 1._wp, a_i(ji,jj,jl) - epsi20 ) ) |
---|
125 | ht_i (ji,jj,jl) = v_i (ji,jj,jl) / MAX( a_i(ji,jj,jl) , epsi20 ) * rswitch |
---|
126 | ht_s (ji,jj,jl) = v_s (ji,jj,jl) / MAX( a_i(ji,jj,jl) , epsi20 ) * rswitch |
---|
127 | END DO |
---|
128 | END DO |
---|
129 | END DO |
---|
130 | !--------------------------------------------------------------------- |
---|
131 | ! Record max of the surrounding ice thicknesses for correction |
---|
132 | ! in case advection creates ice too thick. |
---|
133 | !--------------------------------------------------------------------- |
---|
134 | zhimax(:,:,:) = ht_i(:,:,:) + ht_s(:,:,:) |
---|
135 | DO jl = 1, jpl |
---|
136 | DO jj = 2, jpjm1 |
---|
137 | DO ji = 2, jpim1 |
---|
138 | zhimax(ji,jj,jl) = MAXVAL( ht_i(ji-1:ji+1,jj-1:jj+1,jl) + ht_s(ji-1:ji+1,jj-1:jj+1,jl) ) |
---|
139 | END DO |
---|
140 | END DO |
---|
141 | CALL lbc_lnk(zhimax(:,:,jl),'T',1.) |
---|
142 | END DO |
---|
143 | |
---|
144 | !=============================! |
---|
145 | !== Prather scheme ==! |
---|
146 | !=============================! |
---|
147 | |
---|
148 | ! If ice drift field is too fast, use an appropriate time step for advection. |
---|
149 | zcfl = MAXVAL( ABS( u_ice(:,:) ) * rdt_ice * r1_e1u(:,:) ) ! CFL test for stability |
---|
150 | zcfl = MAX( zcfl, MAXVAL( ABS( v_ice(:,:) ) * rdt_ice * r1_e2v(:,:) ) ) |
---|
151 | IF(lk_mpp ) CALL mpp_max( zcfl ) |
---|
152 | |
---|
153 | IF( zcfl > 0.5 ) THEN ; initad = 2 ; zusnit = 0.5_wp |
---|
154 | ELSE ; initad = 1 ; zusnit = 1.0_wp |
---|
155 | ENDIF |
---|
156 | |
---|
157 | IF( zcfl > 0.5_wp .AND. lwp ) ncfl = ncfl + 1 |
---|
158 | !! IF( lwp ) THEN |
---|
159 | !! IF( ncfl > 0 ) THEN |
---|
160 | !! WRITE(cltmp,'(i6.1)') ncfl |
---|
161 | !! CALL ctl_warn( 'lim_trp: ncfl= ', TRIM(cltmp), 'advective ice time-step using a split in sub-time-step ') |
---|
162 | !! ELSE |
---|
163 | !! ! WRITE(numout,*) 'lim_trp : CFL criterion for ice advection is always smaller than 1/2 ' |
---|
164 | !! ENDIF |
---|
165 | !! ENDIF |
---|
166 | |
---|
167 | !------------------------- |
---|
168 | ! transported fields |
---|
169 | !------------------------- |
---|
170 | z0opw(:,:,1) = ato_i(:,:) * e12t(:,:) ! Open water area |
---|
171 | DO jl = 1, jpl |
---|
172 | z0snw (:,:,jl) = v_s (:,:,jl) * e12t(:,:) ! Snow volume |
---|
173 | z0ice(:,:,jl) = v_i (:,:,jl) * e12t(:,:) ! Ice volume |
---|
174 | z0ai (:,:,jl) = a_i (:,:,jl) * e12t(:,:) ! Ice area |
---|
175 | z0smi (:,:,jl) = smv_i(:,:,jl) * e12t(:,:) ! Salt content |
---|
176 | z0oi (:,:,jl) = oa_i (:,:,jl) * e12t(:,:) ! Age content |
---|
177 | z0es (:,:,jl) = e_s (:,:,1,jl) * e12t(:,:) ! Snow heat content |
---|
178 | DO jk = 1, nlay_i |
---|
179 | z0ei (:,:,jk,jl) = e_i (:,:,jk,jl) * e12t(:,:) ! Ice heat content |
---|
180 | END DO |
---|
181 | END DO |
---|
182 | |
---|
183 | |
---|
184 | IF( MOD( ( kt - 1) / nn_fsbc , 2 ) == 0 ) THEN !== odd ice time step: adv_x then adv_y ==! |
---|
185 | DO jt = 1, initad |
---|
186 | CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0opw (:,:,1), sxopw(:,:), & !--- ice open water area |
---|
187 | & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) ) |
---|
188 | CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0opw (:,:,1), sxopw(:,:), & |
---|
189 | & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) ) |
---|
190 | DO jl = 1, jpl |
---|
191 | ! SIMIP mass transport diags |
---|
192 | diag_dmtx_dyn(:,:) = diag_dmtx_dyn(:,:) - ( rhoic * z0ice(:,:,jl) + rhosn * z0snw(:,:,jl) ) * r1_e12t(:,:) |
---|
193 | CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0ice (:,:,jl), sxice(:,:,jl), & !--- ice volume --- |
---|
194 | & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) |
---|
195 | CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0snw (:,:,jl), sxsn (:,:,jl), & !--- snow volume --- |
---|
196 | & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) |
---|
197 | diag_dmtx_dyn(:,:) = diag_dmtx_dyn(:,:) + ( rhoic * z0ice(:,:,jl) + rhosn * z0snw(:,:,jl) ) * r1_e12t(:,:) |
---|
198 | |
---|
199 | diag_dmty_dyn(:,:) = diag_dmty_dyn(:,:) - ( rhoic * z0ice(:,:,jl) + rhosn * z0snw(:,:,jl) ) * r1_e12t(:,:) |
---|
200 | CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0ice (:,:,jl), sxice(:,:,jl), & !--- ice volume |
---|
201 | & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) |
---|
202 | CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0snw (:,:,jl), sxsn (:,:,jl), & !--- snow volume |
---|
203 | & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) |
---|
204 | diag_dmty_dyn(:,:) = diag_dmty_dyn(:,:) + ( rhoic * z0ice(:,:,jl) + rhosn * z0snw(:,:,jl) ) * r1_e12t(:,:) |
---|
205 | ! END SIMIP mass transport diags |
---|
206 | |
---|
207 | ! CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0ice (:,:,jl), sxice(:,:,jl), & !--- ice volume --- |
---|
208 | ! & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) |
---|
209 | ! CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0ice (:,:,jl), sxice(:,:,jl), & |
---|
210 | ! & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) |
---|
211 | ! CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0snw (:,:,jl), sxsn (:,:,jl), & !--- snow volume --- |
---|
212 | ! & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) |
---|
213 | ! CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0snw (:,:,jl), sxsn (:,:,jl), & |
---|
214 | ! & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) |
---|
215 | CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0smi (:,:,jl), sxsal(:,:,jl), & !--- ice salinity --- |
---|
216 | & sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl) ) |
---|
217 | CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0smi (:,:,jl), sxsal(:,:,jl), & |
---|
218 | & sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl) ) |
---|
219 | CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0oi (:,:,jl), sxage(:,:,jl), & !--- ice age --- |
---|
220 | & sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl) ) |
---|
221 | CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0oi (:,:,jl), sxage(:,:,jl), & |
---|
222 | & sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl) ) |
---|
223 | CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0ai (:,:,jl), sxa (:,:,jl), & !--- ice concentrations --- |
---|
224 | & sxxa (:,:,jl), sya (:,:,jl), syya (:,:,jl), sxya (:,:,jl) ) |
---|
225 | CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0ai (:,:,jl), sxa (:,:,jl), & |
---|
226 | & sxxa (:,:,jl), sya (:,:,jl), syya (:,:,jl), sxya (:,:,jl) ) |
---|
227 | CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0es (:,:,jl), sxc0 (:,:,jl), & !--- snow heat contents --- |
---|
228 | & sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl) ) |
---|
229 | CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0es (:,:,jl), sxc0 (:,:,jl), & |
---|
230 | & sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl) ) |
---|
231 | DO jk = 1, nlay_i !--- ice heat contents --- |
---|
232 | CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, z0ei(:,:,jk,jl), sxe (:,:,jk,jl), & |
---|
233 | & sxxe(:,:,jk,jl), sye (:,:,jk,jl), & |
---|
234 | & syye(:,:,jk,jl), sxye(:,:,jk,jl) ) |
---|
235 | CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, z0ei(:,:,jk,jl), sxe (:,:,jk,jl), & |
---|
236 | & sxxe(:,:,jk,jl), sye (:,:,jk,jl), & |
---|
237 | & syye(:,:,jk,jl), sxye(:,:,jk,jl) ) |
---|
238 | END DO |
---|
239 | END DO |
---|
240 | END DO |
---|
241 | ELSE |
---|
242 | DO jt = 1, initad |
---|
243 | CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0opw (:,:,1), sxopw(:,:), & !--- ice open water area |
---|
244 | & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) ) |
---|
245 | CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, z0opw (:,:,1), sxopw(:,:), & |
---|
246 | & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) ) |
---|
247 | DO jl = 1, jpl |
---|
248 | diag_dmty_dyn(:,:) = diag_dmty_dyn(:,:) - ( rhoic * z0ice(:,:,jl) + rhosn * z0snw(:,:,jl) ) * r1_e12t(:,:) |
---|
249 | CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0ice (:,:,jl), sxice(:,:,jl), & !--- ice volume --- |
---|
250 | & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) |
---|
251 | CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0snw (:,:,jl), sxsn (:,:,jl), & !--- snow volume --- |
---|
252 | & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) |
---|
253 | diag_dmty_dyn(:,:) = diag_dmty_dyn(:,:) + ( rhoic * z0ice(:,:,jl) + rhosn * z0snw(:,:,jl) ) * r1_e12t(:,:) |
---|
254 | |
---|
255 | diag_dmtx_dyn(:,:) = diag_dmtx_dyn(:,:) - ( rhoic * z0ice(:,:,jl) + rhosn * z0snw(:,:,jl) ) * r1_e12t(:,:) |
---|
256 | CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0snw (:,:,jl), sxsn (:,:,jl), & !--- snow volume --- |
---|
257 | & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) |
---|
258 | CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, z0snw (:,:,jl), sxsn (:,:,jl), & |
---|
259 | & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) |
---|
260 | diag_dmtx_dyn(:,:) = diag_dmtx_dyn(:,:) + ( rhoic * z0ice(:,:,jl) + rhosn * z0snw(:,:,jl) ) * r1_e12t(:,:) |
---|
261 | |
---|
262 | ! CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0ice (:,:,jl), sxice(:,:,jl), & !--- ice volume --- |
---|
263 | ! & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) |
---|
264 | ! CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, z0ice (:,:,jl), sxice(:,:,jl), & |
---|
265 | ! & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) |
---|
266 | ! CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0snw (:,:,jl), sxsn (:,:,jl), & !--- snow volume --- |
---|
267 | ! & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) |
---|
268 | ! CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, z0snw (:,:,jl), sxsn (:,:,jl), & |
---|
269 | ! & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) |
---|
270 | |
---|
271 | CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0smi (:,:,jl), sxsal(:,:,jl), & !--- ice salinity --- |
---|
272 | & sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl) ) |
---|
273 | CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, z0smi (:,:,jl), sxsal(:,:,jl), & |
---|
274 | & sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl) ) |
---|
275 | CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0oi (:,:,jl), sxage(:,:,jl), & !--- ice age --- |
---|
276 | & sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl) ) |
---|
277 | CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, z0oi (:,:,jl), sxage(:,:,jl), & |
---|
278 | & sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl) ) |
---|
279 | CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0ai (:,:,jl), sxa (:,:,jl), & !--- ice concentrations --- |
---|
280 | & sxxa (:,:,jl), sya (:,:,jl), syya (:,:,jl), sxya (:,:,jl) ) |
---|
281 | CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, z0ai (:,:,jl), sxa (:,:,jl), & |
---|
282 | & sxxa (:,:,jl), sya (:,:,jl), syya (:,:,jl), sxya (:,:,jl) ) |
---|
283 | CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0es (:,:,jl), sxc0 (:,:,jl), & !--- snow heat contents --- |
---|
284 | & sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl) ) |
---|
285 | CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, z0es (:,:,jl), sxc0 (:,:,jl), & |
---|
286 | & sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl) ) |
---|
287 | DO jk = 1, nlay_i !--- ice heat contents --- |
---|
288 | CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, z0ei(:,:,jk,jl), sxe (:,:,jk,jl), & |
---|
289 | & sxxe(:,:,jk,jl), sye (:,:,jk,jl), & |
---|
290 | & syye(:,:,jk,jl), sxye(:,:,jk,jl) ) |
---|
291 | CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, z0ei(:,:,jk,jl), sxe (:,:,jk,jl), & |
---|
292 | & sxxe(:,:,jk,jl), sye (:,:,jk,jl), & |
---|
293 | & syye(:,:,jk,jl), sxye(:,:,jk,jl) ) |
---|
294 | END DO |
---|
295 | END DO |
---|
296 | END DO |
---|
297 | ENDIF |
---|
298 | |
---|
299 | ! SIMIP diags |
---|
300 | diag_dmtx_dyn(:,:) = diag_dmtx_dyn(:,:) / ( rdt_ice * zusnit ) |
---|
301 | diag_dmty_dyn(:,:) = diag_dmty_dyn(:,:) / ( rdt_ice * zusnit ) |
---|
302 | |
---|
303 | !------------------------------------------- |
---|
304 | ! Recover the properties from their contents |
---|
305 | !------------------------------------------- |
---|
306 | ato_i(:,:) = z0opw(:,:,1) * r1_e12t(:,:) |
---|
307 | DO jl = 1, jpl |
---|
308 | v_i (:,:,jl) = z0ice(:,:,jl) * r1_e12t(:,:) |
---|
309 | v_s (:,:,jl) = z0snw(:,:,jl) * r1_e12t(:,:) |
---|
310 | smv_i(:,:,jl) = z0smi(:,:,jl) * r1_e12t(:,:) |
---|
311 | oa_i (:,:,jl) = z0oi (:,:,jl) * r1_e12t(:,:) |
---|
312 | a_i (:,:,jl) = z0ai (:,:,jl) * r1_e12t(:,:) |
---|
313 | e_s (:,:,1,jl) = z0es (:,:,jl) * r1_e12t(:,:) |
---|
314 | DO jk = 1, nlay_i |
---|
315 | e_i(:,:,jk,jl) = z0ei(:,:,jk,jl) * r1_e12t(:,:) |
---|
316 | END DO |
---|
317 | END DO |
---|
318 | |
---|
319 | at_i(:,:) = a_i(:,:,1) ! total ice fraction |
---|
320 | DO jl = 2, jpl |
---|
321 | at_i(:,:) = at_i(:,:) + a_i(:,:,jl) |
---|
322 | END DO |
---|
323 | |
---|
324 | !------------------------------------------------------------------------------! |
---|
325 | ! Diffusion of Ice fields |
---|
326 | !------------------------------------------------------------------------------! |
---|
327 | IF( nn_ahi0 /= -1 ) THEN |
---|
328 | |
---|
329 | ! --- Prepare diffusion for variables with categories --- ! |
---|
330 | ! mask eddy diffusivity coefficient at ocean U- and V-points |
---|
331 | jm=1 |
---|
332 | DO jl = 1, jpl |
---|
333 | DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row |
---|
334 | DO ji = 1 , fs_jpim1 ! vector opt. |
---|
335 | pahu3D(ji,jj,jl) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji ,jj, jl ) ) ) ) & |
---|
336 | & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji+1,jj, jl ) ) ) ) * ahiu(ji,jj) |
---|
337 | pahv3D(ji,jj,jl) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji, jj, jl ) ) ) ) & |
---|
338 | & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- a_i(ji, jj+1,jl ) ) ) ) * ahiv(ji,jj) |
---|
339 | END DO |
---|
340 | END DO |
---|
341 | |
---|
342 | zhdfptab(:,:,jm)= a_i (:,:, jl); jm = jm + 1 |
---|
343 | zhdfptab(:,:,jm)= v_i (:,:, jl); jm = jm + 1 |
---|
344 | zhdfptab(:,:,jm)= v_s (:,:, jl); jm = jm + 1 |
---|
345 | zhdfptab(:,:,jm)= smv_i(:,:, jl); jm = jm + 1 |
---|
346 | zhdfptab(:,:,jm)= oa_i (:,:, jl); jm = jm + 1 |
---|
347 | zhdfptab(:,:,jm)= e_s (:,:,1,jl); jm = jm + 1 |
---|
348 | ! Sample of adding more variables to apply lim_hdf (ihdf_vars must be increased) |
---|
349 | ! zhdfptab(:,:,jm) = variable_1 (:,:,1,jl); jm = jm + 1 |
---|
350 | ! zhdfptab(:,:,jm) = variable_2 (:,:,1,jl); jm = jm + 1 |
---|
351 | DO jk = 1, nlay_i |
---|
352 | zhdfptab(:,:,jm)=e_i(:,:,jk,jl); jm= jm+1 |
---|
353 | END DO |
---|
354 | END DO |
---|
355 | ! |
---|
356 | ! --- Prepare diffusion for open water area --- ! |
---|
357 | ! mask eddy diffusivity coefficient at ocean U- and V-points |
---|
358 | DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row |
---|
359 | DO ji = 1 , fs_jpim1 ! vector opt. |
---|
360 | pahu3D(ji,jj,jpl+1) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji ,jj) ) ) ) & |
---|
361 | & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji+1,jj) ) ) ) * ahiu(ji,jj) |
---|
362 | pahv3D(ji,jj,jpl+1) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji,jj ) ) ) ) & |
---|
363 | & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- at_i(ji,jj+1) ) ) ) * ahiv(ji,jj) |
---|
364 | END DO |
---|
365 | END DO |
---|
366 | ! |
---|
367 | zhdfptab(:,:,jm)= ato_i (:,:); |
---|
368 | |
---|
369 | ! --- Apply diffusion --- ! |
---|
370 | CALL lim_hdf( zhdfptab, ihdf_vars, jpl, nlay_i) |
---|
371 | |
---|
372 | ! --- Recover properties --- ! |
---|
373 | jm=1 |
---|
374 | DO jl = 1, jpl |
---|
375 | a_i (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 |
---|
376 | v_i (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 |
---|
377 | v_s (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 |
---|
378 | smv_i(:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 |
---|
379 | oa_i (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 |
---|
380 | e_s (:,:,1,jl) = zhdfptab(:,:,jm); jm = jm + 1 |
---|
381 | ! Sample of adding more variables to apply lim_hdf--------- |
---|
382 | ! variable_1 (:,:,1,jl) = zhdfptab(:,:, jm ) ; jm + 1 |
---|
383 | ! variable_2 (:,:,1,jl) = zhdfptab(:,:, jm ) ; jm + 1 |
---|
384 | DO jk = 1, nlay_i |
---|
385 | e_i(:,:,jk,jl) = zhdfptab(:,:,jm);jm= jm + 1 |
---|
386 | END DO |
---|
387 | END DO |
---|
388 | ato_i (:,:) = zhdfptab(:,:,jm) |
---|
389 | |
---|
390 | ENDIF |
---|
391 | |
---|
392 | ! --- diags --- |
---|
393 | DO jj = 1, jpj |
---|
394 | DO ji = 1, jpi |
---|
395 | diag_trp_ei(ji,jj) = ( SUM( e_i(ji,jj,1:nlay_i,:) ) - zeiold(ji,jj) ) * r1_rdtice |
---|
396 | diag_trp_es(ji,jj) = ( SUM( e_s(ji,jj,1:nlay_s,:) ) - zesold(ji,jj) ) * r1_rdtice |
---|
397 | |
---|
398 | diag_trp_vi (ji,jj) = SUM( v_i(ji,jj,:) - zviold(ji,jj,:) ) * r1_rdtice |
---|
399 | diag_trp_vs (ji,jj) = SUM( v_s(ji,jj,:) - zvsold(ji,jj,:) ) * r1_rdtice |
---|
400 | diag_trp_smv(ji,jj) = SUM( smv_i(ji,jj,:) - zsmvold(ji,jj,:) ) * r1_rdtice |
---|
401 | |
---|
402 | ! SIMIP diagnostics |
---|
403 | diag_dms_dyn(ji,jj) = rhosn * diag_trp_vs(ji,jj) |
---|
404 | diag_dmi_dyn(ji,jj) = rhoic * diag_trp_vi(ji,jj) |
---|
405 | END DO |
---|
406 | END DO |
---|
407 | |
---|
408 | ! zap small areas |
---|
409 | CALL lim_var_zapsmall |
---|
410 | |
---|
411 | !--- Thickness correction in case too high -------------------------------------------------------- |
---|
412 | DO jl = 1, jpl |
---|
413 | DO jj = 1, jpj |
---|
414 | DO ji = 1, jpi |
---|
415 | |
---|
416 | IF ( v_i(ji,jj,jl) > 0._wp ) THEN |
---|
417 | |
---|
418 | rswitch = MAX( 0._wp , SIGN( 1._wp, a_i(ji,jj,jl) - epsi20 ) ) |
---|
419 | ht_i (ji,jj,jl) = v_i (ji,jj,jl) / MAX( a_i(ji,jj,jl) , epsi20 ) * rswitch |
---|
420 | ht_s (ji,jj,jl) = v_s (ji,jj,jl) / MAX( a_i(ji,jj,jl) , epsi20 ) * rswitch |
---|
421 | |
---|
422 | zvi = v_i (ji,jj,jl) |
---|
423 | zvs = v_s (ji,jj,jl) |
---|
424 | zsmv = smv_i(ji,jj,jl) |
---|
425 | zes = e_s (ji,jj,1,jl) |
---|
426 | zei = SUM( e_i(ji,jj,1:nlay_i,jl) ) |
---|
427 | |
---|
428 | zdv = v_i(ji,jj,jl) + v_s(ji,jj,jl) - zviold(ji,jj,jl) - zvsold(ji,jj,jl) |
---|
429 | |
---|
430 | IF ( ( zdv > 0.0 .AND. (ht_i(ji,jj,jl)+ht_s(ji,jj,jl)) > zhimax(ji,jj,jl) .AND. zatold(ji,jj) < 0.80 ) .OR. & |
---|
431 | & ( zdv <= 0.0 .AND. (ht_i(ji,jj,jl)+ht_s(ji,jj,jl)) > zhimax(ji,jj,jl) ) ) THEN |
---|
432 | |
---|
433 | rswitch = MAX( 0._wp, SIGN( 1._wp, zhimax(ji,jj,jl) - epsi20 ) ) |
---|
434 | a_i(ji,jj,jl) = rswitch * ( v_i(ji,jj,jl) + v_s(ji,jj,jl) ) / MAX( zhimax(ji,jj,jl), epsi20 ) |
---|
435 | |
---|
436 | ! small correction due to *rswitch for a_i |
---|
437 | v_i (ji,jj,jl) = rswitch * v_i (ji,jj,jl) |
---|
438 | v_s (ji,jj,jl) = rswitch * v_s (ji,jj,jl) |
---|
439 | smv_i(ji,jj,jl) = rswitch * smv_i(ji,jj,jl) |
---|
440 | e_s(ji,jj,1,jl) = rswitch * e_s(ji,jj,1,jl) |
---|
441 | e_i(ji,jj,1:nlay_i,jl) = rswitch * e_i(ji,jj,1:nlay_i,jl) |
---|
442 | |
---|
443 | ! Update mass fluxes |
---|
444 | wfx_res(ji,jj) = wfx_res(ji,jj) - ( v_i(ji,jj,jl) - zvi ) * rhoic * r1_rdtice |
---|
445 | wfx_snw(ji,jj) = wfx_snw(ji,jj) - ( v_s(ji,jj,jl) - zvs ) * rhosn * r1_rdtice |
---|
446 | sfx_res(ji,jj) = sfx_res(ji,jj) - ( smv_i(ji,jj,jl) - zsmv ) * rhoic * r1_rdtice |
---|
447 | hfx_res(ji,jj) = hfx_res(ji,jj) + ( e_s(ji,jj,1,jl) - zes ) * r1_rdtice ! W.m-2 <0 |
---|
448 | hfx_res(ji,jj) = hfx_res(ji,jj) + ( SUM( e_i(ji,jj,1:nlay_i,jl) ) - zei ) * r1_rdtice ! W.m-2 <0 |
---|
449 | |
---|
450 | ! SIMIP diagnostic |
---|
451 | diag_dms_dyn(ji,jj) = diag_dms_dyn(ji,jj) + ( v_s(ji,jj,jl) - zvs ) * rhosn * r1_rdtice |
---|
452 | |
---|
453 | ENDIF |
---|
454 | |
---|
455 | ENDIF |
---|
456 | |
---|
457 | END DO |
---|
458 | END DO |
---|
459 | END DO |
---|
460 | ! ------------------------------------------------- |
---|
461 | |
---|
462 | !-------------------------------------- |
---|
463 | ! Impose a_i < amax in mono-category |
---|
464 | !-------------------------------------- |
---|
465 | ! |
---|
466 | IF ( ( nn_monocat == 2 ) .AND. ( jpl == 1 ) ) THEN ! simple conservative piling, comparable with LIM2 |
---|
467 | DO jj = 1, jpj |
---|
468 | DO ji = 1, jpi |
---|
469 | a_i(ji,jj,1) = MIN( a_i(ji,jj,1), rn_amax_2d(ji,jj) ) |
---|
470 | END DO |
---|
471 | END DO |
---|
472 | ENDIF |
---|
473 | |
---|
474 | ! --- agglomerate variables ----------------- |
---|
475 | vt_i (:,:) = 0._wp |
---|
476 | vt_s (:,:) = 0._wp |
---|
477 | at_i (:,:) = 0._wp |
---|
478 | DO jl = 1, jpl |
---|
479 | DO jj = 1, jpj |
---|
480 | DO ji = 1, jpi |
---|
481 | vt_i(ji,jj) = vt_i(ji,jj) + v_i(ji,jj,jl) |
---|
482 | vt_s(ji,jj) = vt_s(ji,jj) + v_s(ji,jj,jl) |
---|
483 | at_i(ji,jj) = at_i(ji,jj) + a_i(ji,jj,jl) |
---|
484 | END DO |
---|
485 | END DO |
---|
486 | END DO |
---|
487 | |
---|
488 | ! --- open water = 1 if at_i=0 -------------------------------- |
---|
489 | DO jj = 1, jpj |
---|
490 | DO ji = 1, jpi |
---|
491 | rswitch = MAX( 0._wp , SIGN( 1._wp, - at_i(ji,jj) ) ) |
---|
492 | ato_i(ji,jj) = rswitch + (1._wp - rswitch ) * ato_i(ji,jj) |
---|
493 | END DO |
---|
494 | END DO |
---|
495 | |
---|
496 | ! conservation test |
---|
497 | IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limtrp', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) |
---|
498 | |
---|
499 | ENDIF |
---|
500 | |
---|
501 | ! ------------------------------------------------- |
---|
502 | ! control prints |
---|
503 | ! ------------------------------------------------- |
---|
504 | IF( ln_icectl ) CALL lim_prt( kt, iiceprt, jiceprt,-1, ' - ice dyn & trp - ' ) |
---|
505 | ! |
---|
506 | CALL wrk_dealloc( jpi,jpj, zsm, zatold, zeiold, zesold ) |
---|
507 | CALL wrk_dealloc( jpi,jpj,jpl, z0ice, z0snw, z0ai, z0es , z0smi , z0oi ) |
---|
508 | CALL wrk_dealloc( jpi,jpj,1, z0opw ) |
---|
509 | CALL wrk_dealloc( jpi,jpj,nlay_i,jpl, z0ei ) |
---|
510 | CALL wrk_dealloc( jpi,jpj,jpl, zviold, zvsold, zhimax, zsmvold ) |
---|
511 | CALL wrk_dealloc( jpi,jpj,jpl*(ihdf_vars+nlay_i)+1,zhdfptab) |
---|
512 | ! |
---|
513 | IF( nn_timing == 1 ) CALL timing_stop('limtrp') |
---|
514 | |
---|
515 | END SUBROUTINE lim_trp |
---|
516 | |
---|
517 | #else |
---|
518 | !!---------------------------------------------------------------------- |
---|
519 | !! Default option Empty Module No sea-ice model |
---|
520 | !!---------------------------------------------------------------------- |
---|
521 | CONTAINS |
---|
522 | SUBROUTINE lim_trp ! Empty routine |
---|
523 | END SUBROUTINE lim_trp |
---|
524 | #endif |
---|
525 | !!====================================================================== |
---|
526 | END MODULE limtrp |
---|
527 | |
---|