SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_gltools_mixice.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_gltools_mixice ======================
41 ! =======================================================================
42 !
43 ! Goal:
44 ! -----
45 ! This module contains functions and subroutines which are used as
46 ! tools in the rest of the Gelato model. Some of them are purely
47 ! thermodynamic functions, others are used to have some input and
48 ! glt_output of interest displayed in a convenient way.
49 !
50 ! Created : 1996/04 (D. Salas y Melia)
51 ! Case of a 1-D model at one point
52 ! Modified: 1997/03 (D. Salas y Melia)
53 ! Adapted to a 2-D model and rewritten to follow the DOCTOR
54 ! norm.
55 ! Modified: 2007/11 (D. Salas y Melia)
56 ! Merger should be done for surface temperature also
57 ! (or it is subsequently set to melting point in the
58 ! particular case of an ice class change, creating problems)
59 !
60 ! ------------------- BEGIN MODULE modi_gltools_mixice --------------------
61 !
62 !THXS_SFX!MODULE modi_gltools_mixice
63 !THXS_SFX!INTERFACE
64 !THXS_SFX!!
65 !THXS_SFX!SUBROUTINE gltools_mixice( tpmxl,tplsit,tplsil,tpsit,tpsil )
66 !THXS_SFX! USE modd_types_glt
67 !THXS_SFX! USE modd_glt_param
68 !THXS_SFX! TYPE(t_mxl),DIMENSION(nx,ny), INTENT(in) :: &
69 !THXS_SFX! tpmxl
70 !THXS_SFX! TYPE(t_sit), DIMENSION(:,:,:,:), INTENT(in) :: &
71 !THXS_SFX! tplsit
72 !THXS_SFX! TYPE(t_vtp), DIMENSION(:,:,:,:,:), INTENT(in) :: &
73 !THXS_SFX! tplsil
74 !THXS_SFX! TYPE(t_sit), DIMENSION(nt,nx,ny), INTENT(inout) :: &
75 !THXS_SFX! tpsit
76 !THXS_SFX! TYPE(t_vtp), DIMENSION(nl,nt,nx,ny), INTENT(inout) :: &
77 !THXS_SFX! tpsil
78 !THXS_SFX!END SUBROUTINE gltools_mixice
79 !THXS_SFX!!
80 !THXS_SFX!END INTERFACE
81 !THXS_SFX!END MODULE modi_gltools_mixice
82 !
83 ! -------------------- END MODULE modi_gltools_mixice ---------------------
84 !
85 !
86 !
87 ! -----------------------------------------------------------------------
88 ! ------------------------- SUBROUTINE gltools_mixice ---------------------------
89 !
90 ! This subroutine is used for merging several ice classes together,
91 ! given their areal fractions, overlying snow layers thickness and
92 ! density, and vertical temperature profiles.
93 !
94 SUBROUTINE gltools_mixice( tpmxl,tplsit,tplsil,tpsit,tpsil )
95 !
96  USE modd_types_glt
98  USE modd_glt_param
99 !
100  IMPLICIT NONE
101 !
102  TYPE(t_mxl),DIMENSION(nx,ny), INTENT(in) :: &
103  tpmxl
104  TYPE(t_sit), DIMENSION(:,:,:,:), INTENT(in) :: &
105  tplsit
106  TYPE(t_vtp), DIMENSION(:,:,:,:,:), INTENT(in) :: &
107  tplsil
108  TYPE(t_sit), DIMENSION(nt,nx,ny), INTENT(inout) :: &
109  tpsit
110  TYPE(t_vtp), DIMENSION(nl,nt,nx,ny), INTENT(inout) :: &
111  tpsil
112  INTEGER :: &
113  jl,jt
114  REAL, DIMENSION(nt,nx,ny) :: &
115  zmlf3,zvsi,zvsn,zmsn,zagevsi,zssivsi,zaux,zvmpvsi
116 !
117 !
118 !
119 ! 1. Compute auxiliary array
120 ! ==========================
121 !
122 ! .. Expanded mixed layer freezing point
123 !
124  zmlf3(:,:,:) = spread(tpmxl(:,:)%mlf,1,nt)
125 !
126 ! .. For every ice category, volume of ice per sq. meter
127 !
128  zvsi(:,:,:) = sum( tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%hsi,dim=1 )
129 !
130 ! .. For every ice category, volume and mass of snow cover per sq. meter
131 !
132  zvsn(:,:,:) = sum( tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%hsn,dim=1 )
133  zmsn(:,:,:) = sum( tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%hsn* &
134  tplsit(:,:,:,:)%rsn,dim=1 )
135 !
136 ! .. For every ice category, volume x age
137 !
138  IF ( niceage==1 ) &
139  zagevsi(:,:,:) = sum( tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%hsi* &
140  tplsit(:,:,:,:)%age,dim=1 )
141 !
142 ! .. For every ice category, volume x ssi
143 !
144  IF ( nicesal==1 ) &
145  zssivsi(:,:,:) = sum( tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%hsi* &
146  tplsit(:,:,:,:)%ssi,dim=1 )
147 !
148 !
149 ! .. For every ice category, volume x vmp
150 !
151  IF ( nmponds==1 ) &
152  zvmpvsi(:,:,:) = sum( tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%hsi* &
153  tplsit(:,:,:,:)%vmp,dim=1 )
154 !
155 !
156 ! 2. Compute all ice state variables
157 ! ==================================
158 !
159 ! 2.1. Compute merged sea ice fraction
160 ! ------------------------------------
161 !
162 ! .. Compute merged sea ice fractions. It is simply the sum of the
163 ! concentrations of the different ice types_glt that fell into the same
164 ! thickness category.
165 !
166  tpsit(:,:,:)%fsi = sum(tplsit(:,:,:,:)%fsi,dim=1)
167 !
168 !
169 ! 2.2. Compute other merged 3D quantities
170 ! ---------------------------------------
171 !
172 ! .. Compute existence boolean, merged sea ice thicknesses, snow
173 ! thickness, surface temperature:
174 !
175  WHERE ( tpsit(:,:,:)%fsi>epsil1 )
176  tpsit(:,:,:)%esi = .true.
177  tpsit(:,:,:)%hsi = zvsi(:,:,:) / tpsit(:,:,:)%fsi
178  tpsit(:,:,:)%hsn = zvsn(:,:,:) / tpsit(:,:,:)%fsi
179  tpsit(:,:,:)%tsf = sum( &
180  tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%tsf, dim=1 ) / &
181  tpsit(:,:,:)%fsi
182  tpsit(:,:,:)%asn = sum( &
183  tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%asn, dim=1 ) / &
184  tpsit(:,:,:)%fsi
185  ENDWHERE
186  WHERE ( tpsit(:,:,:)%fsi<=epsil1 )
187  tpsit(:,:,:)%esi = .false.
188  tpsit(:,:,:)%hsi = 0.
189  tpsit(:,:,:)%hsn = 0.
190  tpsit(:,:,:)%tsf = zmlf3(:,:,:)
191  tpsit(:,:,:)%asn = albw
192  ENDWHERE
193 !
194 ! .. Compute snow density:
195 !
196  WHERE ( tpsit(:,:,:)%fsi>epsil1 .AND. tpsit(:,:,:)%hsn>epsil1 )
197  tpsit(:,:,:)%rsn = zmsn(:,:,:) / &
198  ( tpsit(:,:,:)%fsi*tpsit(:,:,:)%hsn )
199  ENDWHERE
200  WHERE ( tpsit(:,:,:)%fsi<=epsil1 .OR. tpsit(:,:,:)%hsn<=epsil1 )
201  tpsit(:,:,:)%rsn = rhosnwmin
202  ENDWHERE
203 !
204 ! .. Compute ice age:
205 !
206  IF ( niceage==1 ) THEN
207  WHERE ( tpsit(:,:,:)%fsi>epsil1 .AND. tpsit(:,:,:)%hsi>epsil1 )
208  tpsit(:,:,:)%age = zagevsi(:,:,:) / &
209  ( tpsit(:,:,:)%fsi*tpsit(:,:,:)%hsi )
210  ENDWHERE
211  WHERE ( tpsit(:,:,:)%fsi<=epsil1 .OR. tpsit(:,:,:)%hsi<=epsil1 )
212  tpsit(:,:,:)%age = 0.
213  ENDWHERE
214  ELSE
215  tpsit(:,:,:)%age = 0.
216  ENDIF
217 !
218 ! .. Compute ice salinity
219 !
220  IF ( nicesal==1 ) THEN
221  WHERE ( tpsit(:,:,:)%fsi>epsil1 .AND. tpsit(:,:,:)%hsi>epsil1 )
222  tpsit(:,:,:)%ssi = zssivsi(:,:,:) / &
223  ( tpsit(:,:,:)%fsi*tpsit(:,:,:)%hsi )
224  ENDWHERE
225  WHERE ( tpsit(:,:,:)%fsi<=epsil1 .OR. tpsit(:,:,:)%hsi<=epsil1 )
226  tpsit(:,:,:)%ssi = 0.
227  ENDWHERE
228  ENDIF
229 !
230 ! .. Compute melt pond volume:
231 !
232  IF ( nmponds==1 ) THEN
233  WHERE ( tpsit(:,:,:)%fsi>epsil1 .AND. tpsit(:,:,:)%hsi>epsil1 )
234  tpsit(:,:,:)%vmp = zvmpvsi(:,:,:) / &
235  ( tpsit(:,:,:)%fsi*tpsit(:,:,:)%hsi )
236  ENDWHERE
237  WHERE ( tpsit(:,:,:)%fsi<=epsil1 .OR. tpsit(:,:,:)%hsi<=epsil1 )
238  tpsit(:,:,:)%vmp = 0.
239  ENDWHERE
240  ELSE
241  tpsit(:,:,:)%vmp = 0.
242  ENDIF
243 !
244 !
245 ! 2.3. Compute merged 4D quantities
246 ! ---------------------------------
247 !
248 ! .. For the time being, only the temperature is concerned.
249 !
250 ! Ice
251 !
252  DO jl = 1,nilay
253  zaux(:,:,:) = sum( tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%hsi* &
254  tplsil(:,jl,:,:,:)%ent,dim=1 )
255  WHERE ( tpsit(:,:,:)%fsi>epsil1 .AND. tpsit(:,:,:)%hsi>epsil1 )
256  tpsil(jl,:,:,:)%ent = zaux(:,:,:) / &
257  ( tpsit(:,:,:)%fsi*tpsit(:,:,:)%hsi )
258  ENDWHERE
259  END DO
260 !
261 ! Snow
262 !
263  DO jl = nilay+1,nl
264  zaux(:,:,:) = sum( tplsit(:,:,:,:)%fsi*tplsit(:,:,:,:)%hsn* &
265  tplsit(:,:,:,:)%rsn*tplsil(:,jl,:,:,:)%ent,dim=1 )
266  WHERE ( tpsit(:,:,:)%fsi>epsil1 .AND. tpsit(:,:,:)%hsn>epsil1 .AND. &
267  tpsit(:,:,:)%rsn>epsil1 )
268  tpsil(jl,:,:,:)%ent = zaux(:,:,:) / &
269  ( tpsit(:,:,:)%fsi*tpsit(:,:,:)%hsn*tpsit(:,:,:)%rsn )
270  ENDWHERE
271  END DO
272 !
273  DO jl = 1,nl
274  WHERE ( tpsit(:,:,:)%fsi<=epsil1 .OR. tpsit(:,:,:)%hsi<=epsil1 )
275  tpsil(jl,:,:,:)%ent = 0.
276  ENDWHERE
277  END DO
278 !
279 END SUBROUTINE gltools_mixice
280 !
281 ! ------------------------ END SUBROUTINE gltools_mixice ------------------------
282 ! -----------------------------------------------------------------------
subroutine gltools_mixice(tpmxl, tplsit, tplsil, tpsit, tpsil)