SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_glt_snowice_r.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 !GLT_LIC The GELATO model is a seaice model used in stand-alone or embedded mode.
6 !GLT_LIC It has been developed by Meteo-France. The holder of GELATO is Meteo-France.
7 !GLT_LIC
8 !GLT_LIC This software is governed by the CeCILL-C license under French law and biding
9 !GLT_LIC by the rules of distribution of free software. See the CeCILL-C_V1-en.txt
10 !GLT_LIC (English) and CeCILL-C_V1-fr.txt (French) for details. The CeCILL is a free
11 !GLT_LIC software license, explicitly compatible with the GNU GPL
12 !GLT_LIC (see http://www.gnu.org/licenses/license-list.en.html#CeCILL)
13 !GLT_LIC
14 !GLT_LIC The CeCILL-C licence agreement grants users the right to modify and re-use the
15 !GLT_LIC software governed by this free software license. The exercising of this right
16 !GLT_LIC is conditional upon the obligation to make available to the community the
17 !GLT_LIC modifications made to the source code of the software so as to contribute to
18 !GLT_LIC its evolution.
19 !GLT_LIC
20 !GLT_LIC In consideration of access to the source code and the rights to copy, modify
21 !GLT_LIC and redistribute granted by the license, users are provided only with a limited
22 !GLT_LIC warranty and the software's author, the holder of the economic rights, and the
23 !GLT_LIC successive licensors only have limited liability. In this respect, the risks
24 !GLT_LIC associated with loading, using, modifying and/or developing or reproducing the
25 !GLT_LIC software by the user are brought to the user's attention, given its Free
26 !GLT_LIC Software status, which may make it complicated to use, with the result that its
27 !GLT_LIC use is reserved for developers and experienced professionals having in-depth
28 !GLT_LIC computer knowledge. Users are therefore encouraged to load and test the
29 !GLT_LIC suitability of the software as regards their requirements in conditions enabling
30 !GLT_LIC the security of their systems and/or data to be ensured and, more generally, to
31 !GLT_LIC use and operate it in the same conditions of security.
32 !GLT_LIC
33 !GLT_LIC The GELATO sofware is cureently distibuted with the SURFEX software, available at
34 !GLT_LIC http://www.cnrm.meteo.fr/surfex. The fact that you download the software deemed that
35 !GLT_LIC you had knowledge of the CeCILL-C license and that you accept its terms.
36 !GLT_LIC Attempts to use this software in a way not complying with CeCILL-C license
37 !GLT_LIC may lead to prosecution.
38 !GLT_LIC
39 ! =======================================================================
40 ! ======================== MODULE modi_glt_snowice_r ========================
41 ! =======================================================================
42 !
43 ! Goal:
44 ! -----
45 ! This module contains a subroutine that considers the formation of
46 ! snow ice. If snow accumulates over sea ice, part of the snow layer
47 ! will be invaded by sea water, creating snow ice.
48 !
49 ! Method:
50 ! -------
51 ! See Fichefet and Morales Maqueda, JGR (1997)
52 !
53 ! Created : 1998 (D. Salas y Melia)
54 ! Modified: 2002/09 (D. Salas y Melia) Better conservation of energy
55 ! Modified: 2009/06 (D. Salas y Melia) Reduced grid
56 ! Modified: 2011/12 (A. Voldoire) New formulation of the zdh change in
57 ! sea ice thickness + new ice/water fluxes interface CALL
58 ! Modified: 2012/02 (A. Voldoire) Former change revised, go back to former
59 ! formulation but with correct implementation of glt_updtfl
60 !
61 ! -------------------- BEGIN MODULE modi_glt_snowice_r ----------------------
62 !
63 !THXS_SFX!MODULE modi_glt_snowice_r
64 !THXS_SFX!INTERFACE
65 !THXS_SFX!!
66 !THXS_SFX!SUBROUTINE glt_snowice_r( tpmxl,tpsil,tptfl,tpsit,tpdia )
67 !THXS_SFX! USE modd_types_glt
68 !THXS_SFX! USE modd_glt_param
69 !THXS_SFX! TYPE(t_mxl), DIMENSION(np), INTENT(in) :: &
70 !THXS_SFX! tpmxl
71 !THXS_SFX! TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
72 !THXS_SFX! tpsil
73 !THXS_SFX! TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
74 !THXS_SFX! tptfl
75 !THXS_SFX! TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
76 !THXS_SFX! tpsit
77 !THXS_SFX! TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
78 !THXS_SFX! tpdia
79 !THXS_SFX!END SUBROUTINE glt_snowice_r
80 !THXS_SFX!!
81 !THXS_SFX!END INTERFACE
82 !THXS_SFX!END MODULE modi_glt_snowice_r
83 !
84 ! --------------------- END MODULE modi_glt_snowice_r -----------------------
85 !
86 !
87 !
88 ! -----------------------------------------------------------------------
89 ! ----------------------- SUBROUTINE glt_snowice_r --------------------------
90 !
91 ! * Subroutine which takes into account the formation of snow ice.
92 !
93 SUBROUTINE glt_snowice_r( tpmxl,tpsil,tptfl,tpsit,tpdia )
94 !
96  USE modd_types_glt
97  USE modd_glt_param
99  USE modi_glt_updtfl_r
100 !
101  IMPLICIT NONE
102 !
103  TYPE(t_mxl), DIMENSION(np), INTENT(in) :: &
104  tpmxl
105  TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
106  tpsil
107  TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
108  tptfl
109  TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
110  tpsit
111  TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
112  tpdia
113 !
114  INTEGER :: &
115  jl,jp,jk
116  REAL :: &
117  zenti,zentf,zssinew,zhsinew
118  REAL, DIMENSION(nt,np) :: &
119  zdh,zdmass,zdmsi,zdmsn,zentsi,zentsn,zsalt,ztmp
120 ! real,dimension(np) :: zei1,zes1,zei2,zes2
121 !
122 !
123 !
124 ! 1. Array initializations
125 ! ========================
126 !
127  zdh(:,:) = 0.
128 !call glt_aventh(tpsit,tpsil,zei1,zes1)
129 !print*,'enthalpie au debut =',zei1+zes1
130 !
131 !
132 !
133 ! 2. Compute the effects of snow ice formation
134 ! ============================================
135 !
136 ! 2.1. Criterion for snow ice formation
137 ! -------------------------------------
138 !
139  zdmass(:,:) = tpsit(:,:)%rsn*tpsit(:,:)%hsn - &
140  (rhosw-rhoice)*tpsit(:,:)%hsi
141 !! write(noutlu,*)'AAAAAAAAAAAAAA'
142 !! write(noutlu,*)'zdmass=',zdmass
143 !! write(noutlu,*)'rsn=',tpsit(:,:)%rsn
144 !! write(noutlu,*)'hsi=',tpsit(:,:)%hsi
145 !! write(noutlu,*)'hsn=',tpsit(:,:)%hsn
146 !
147  WHERE ( zdmass(:,:)<=0. )
148  zdmass(:,:) = 0.
149  ENDWHERE
150 !
151 !
152 ! 2.2. Change in ice thickness = change in snow thickness
153 ! -------------------------------
154 !
155 ! The "missing" mass is taken from the ocean
156  zdh(:,:) = zdmass(:,:) / &
157  ( tpsit(:,:)%rsn+rhosw-rhoice )
158 !
159 !
160 !
161 ! 3. Energy conservation
162 ! =======================
163 !
164 ! .. We consider here the snow ice transformation is equivalent to
165 ! incorporating a thickness zh of snow to the mix layer AND to freeze
166 ! the same thickness of ice.
167 ! We assume that the sea ice we form has a temperature t_f (sea
168 ! water freezing point).
169 !
170 !
171 ! 3.1. Compute involved masses of ice and snow
172 ! --------------------------------------------
173 !
174 ! .. Ice mass variation due to snow ice formation
175 !
176  zdmsi(:,:) = rhoice * tpsit(:,:)%fsi * zdh(:,:)
177 !! write(noutlu,*)'zdmsi=',zdmsi
178 !
179 ! .. Diagnostic in kg.m-2.s-1 (AR5)
180 !
181  tpdia(:)%sni = sum( zdmsi(:,:),dim=1 ) / dtt
182 !
183 ! .. Snow mass variation due to snow ice formation
184 !
185  zdmsn(:,:) = -tpsit(:,:)%rsn * tpsit(:,:)%fsi * zdh(:,:)
186 !! write(noutlu,*)'zdmsn=',zdmsn
187 !
188 !
189 ! 3.2. Massic gltools_enthalpy and salinity of created ice
190 ! -------------------------------------------------
191 !
192 ! .. Massic gltools_enthalpy and salt content
193 !
194  zentsi(:,:) = 0.
195  zsalt(:,:) = 0.
196  DO jp=1,np
197  DO jk=1,nt
198  IF ( zdh(jk,jp)>epsil1 ) THEN
199  zsalt(jk,jp) = tpmxl(jp)%sml*( 1. - tpsit(jk,jp)%rsn/rhoice )
200  zentsi(jk,jp) = glt_enthalpy0d( tpmxl(jp)%mlf,zsalt(jk,jp) )
201 !! print*,'zenti(',jk,')=',zentsi(jk,jp),' zsalt =', zsalt(jk,jp)
202 !! print*,'zrsn (',jk,')=',tpsit(jk,jp)%rsn
203  ENDIF
204  END DO
205  END DO
206 !
207 !
208 ! 3.3. Massic gltools_enthalpy of removed snow
209 ! -------------------------------------
210 !
211 ! .. Massic gltools_enthalpy
212 !
213  zentsn(:,:) = &
214  sum( tpsil(nilay+1:nl,:,:)%ent, dim=1 )/float(nslay)
215 !
216 !
217 ! 3.4. Update water, heat and salt fluxes affecting the ocean
218 ! ------------------------------------------------------------
219 !
220 ! .. This is the contribution of formed ice that is incorporated to the slab
221 ! The mass considered is the difference between the ice mass created and the
222 ! snow mass removed
223 ! but we give glt_updtfl the total change in ice mass with its actual salinity
224 ! this should be equivalent to providing zdmsi+zdmsn and psalt = tpmxl(jp)%sml
225 ! attention : this is not the case if salinity is fixed or if NEMO coupling of salt is made by a dilution flux!
226 !
227 !! write(noutlu,*)'(1) tio=',tptfl%tio
228 !! write(noutlu,*)'(1) wio=',tptfl%wio
229 !! write(noutlu,*)'(1) wlo=',tptfl%wlo
230 ! CALL glt_updtfl_r( 'I2O',tpmxl,tptfl,zdmsi,zentsi,psalt=zsalt)
231  DO jk=1,nt
232  ztmp(jk,:) = tpmxl(:)%sml
233  END DO
234  CALL glt_updtfl_r( 'I2O',tpmxl,tptfl,zdmsi+zdmsn,pent=zentsi,psalt=ztmp)
235 !
236 ! A recrire de facon plus logique apres recombinaison des 2 glt_updtfl_r
237  tptfl(:)%tio = tptfl(:)%tio - &
238  sum(zdmsi*zentsi,dim=1)/dtt - &
239  sum(zdmsn*zentsn,dim=1)/dtt
240 
241 !! write(noutlu,*)'(2) tio=',tptfl%tio
242 !! write(noutlu,*)'(2) wio=',tptfl%wio
243 !! write(noutlu,*)'(2) wlo=',tptfl%wlo
244 !
245 !
246 ! 3.5. Update water, heat and salt fluxes affecting the ocean
247 ! ------------------------------------------------------------
248 !
249 ! .. This is the contribution of snow that is removed from the slab
250 !
251 !! write(noutlu,*)'(3) tio=',tptfl%tio
252 !! write(noutlu,*)'(3) wio=',tptfl%wio
253 !! write(noutlu,*)'(3) wlo=',tptfl%wlo
254  CALL glt_updtfl_r( 'FW2I',tpmxl,tptfl,-1.*zdmsn,zentsn )
255 !! write(noutlu,*)'(4) tio=',tptfl%tio
256 !! write(noutlu,*)'(4) wio=',tptfl%wio
257 !! write(noutlu,*)'(4) wlo=',tptfl%wlo
258 !
259 !
260 ! 3.6. Final adjustment
261 ! ----------------------
262 !
263 ! .. Here, for simplicity, we suppose the ice slab has grown
264 ! vertically homothetically, keeping the vertical gltools_enthalpy
265 ! profile unchanged. However the ice slab has grown thicker, leading
266 ! to a change in vertically integrated enthalpy. This change, which
267 ! is rather small, will be delivered to the ocean to ensure energy
268 ! conservation.
269 ! The best way would be to alter frzvtp (called from updhsi, to
270 ! allow sea ice formation at the top of the slab.
271 !
272 !
273 !write(noutlu,*)'Avant enth. change'
274 !zenti=0.
275 !do jl=1,nilay
276 !zenti=zenti+sf3tinv(jl)*rhoice* &
277 ! SUM(tpsil(jl,:,:)%ent*tpsit%hsi*tpsit%fsi)/dtt
278 !end do
279 !write(noutlu,*)'Avant enth. change', zenti
280 !zenti=zenti+ &
281 ! SUM( tpsit%rsn*tpsit%hsn*tpsit%fsi*tpsil(nl,:,:)%ent)/dtt
282 !write(noutlu,*)'with snow', zenti
283  DO jp=1,np
284  DO jk=1,nt
285  IF ( zdh(jk,jp)>epsil1 ) THEN
286 !
287 ! .. Temporary new thickness
288  zhsinew = tpsit(jk,jp)%hsi + zdh(jk,jp)
289 !
290 ! .. Update gltools_enthalpy (zenti, zentf in J.m-3)
291  zenti = 0.
292  DO jl=1,nilay
293  zenti = zenti + sf3tinv(jl)*tpsil(jl,jk,jp)%ent
294  END DO
295 !! print*,'Enth. Glace avant (jk=',jk,')=', &
296 !! zenti*tpsit(jk,jp)%hsi/dtt*rhoice
297  zentf = ( zenti*tpsit(jk,jp)%hsi + zentsi(jk,jp)*zdh(jk,jp) ) / &
298  zhsinew
299 !! print*,'Enth. Glace apres (jk=',jk,')=', &
300 !! zentf*zhsinew/dtt*rhoice
301  IF ( zenti/=0. ) THEN
302  tpsil(1:nilay,jk,jp)%ent = &
303  tpsil(1:nilay,jk,jp)%ent * zentf/zenti
304  ELSE
305  tpsil(1:nilay,jk,jp)%ent = zentf
306  ENDIF
307 !
308 ! .. Update snow thickness
309  tpsit(jk,jp)%hsn = tpsit(jk,jp)%hsn - zdh(jk,jp)
310 !
311 ! .. Update sea ice salinity
312  tpsit(jk,jp)%ssi = &
313  ( tpsit(jk,jp)%ssi*tpsit(jk,jp)%hsi + zsalt(jk,jp)*zdh(jk,jp) ) / &
314  zhsinew
315 !
316 ! .. Update sea ice thickness
317  tpsit(jk,jp)%hsi = zhsinew
318 !
319  ENDIF
320  END DO
321  END DO
322 !print*,'calcul enthalpie (a la fin) =', &
323 !sum(rhoice*tpsit%fsi*zentsi*zdh,dim=1)/dtt - &
324 !sum(tpsit%fsi*tpsit%rsn*zentsn*zdh,dim=1)/dtt
325 !print*,'(1) calcul enthalpie=',sum(rhoice*tpsit%fsi*zentsi*zdh,dim=1)/dtt
326 !print*,'(2) calcul enthalpie=',sum(tpsit%fsi*tpsit%rsn*zentsn*zdh,dim=1)/dtt
327 !
328 ! .. The loss in sea ice gltools_enthalpy has to be compensated by an
329 ! energy flux sent to the ocean
330 !
331 ! tptfl(:)%tio = tptfl(:)%tio - &
332 ! rhoice/dtt * SUM( zentsi(:,:)*zdh(:,:)*tpsit(:,:)%fsi,DIM=1 )
333 ! print*,'ajout %tio =', &
334 ! - rhoice/dtt * SUM( zentsi(:,:)*zdh(:,:)*tpsit(:,:)%fsi,DIM=1 )
335 !
336 !! write(noutlu,*)'(6) tio=',tptfl%tio
337 !! write(noutlu,*)'(6) wio=',tptfl%wio
338 !! write(noutlu,*)'(6) wlo=',tptfl%wlo
339 ! write(noutlu,*)'hsn apres=',tpsit%hsn
340 !call glt_aventh(tpsit,tpsil,zei2,zes2)
341 !print*,'enthalpie a la fin =',zei2+zes2
342 !print*,'delta / dtt =',(zei2+zes2-zei1-zes1)/dtt
343 !zenti=0.
344 !do jl=1,nilay
345 !zenti=zenti+sf3tinv(jl)*rhoice* &
346 !SUM(tpsil(jl,:,:)%ent*tpsit%hsi*tpsit%fsi)/dtt
347 !end do
348 !write(noutlu,*)'Apres enth. change', zenti
349 !zenti=zenti+ &
350 !SUM( tpsit%rsn*tpsit%hsn*tpsit%fsi*tpsil(nl,:,:)%ent)/dtt
351 !write(noutlu,*)'with snow', zenti
352 !
353 END SUBROUTINE glt_snowice_r
354 !
355 ! ---------------------- END SUBROUTINE glt_snowice_r -----------------------
356 ! -----------------------------------------------------------------------
subroutine glt_updtfl_r(hflag, tpmxl, tptfl, pdmass, pent, psalt)
subroutine glt_snowice_r(tpmxl, tpsil, tptfl, tpsit, tpdia)