SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_glt_updhsn_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_updhsn_r =========================
41 ! =======================================================================
42 !
43 ! Goal:
44 ! -----
45 ! Update the thickness of a sea ice floe snow cover, knowing the
46 ! surface net ablation flux.
47 !
48 ! Created : 2001/07 (D. Salas)
49 ! Taken out from thermo_ice routine.
50 ! Modified: 2009/06 (D. Salas y Melia)
51 ! Reduced grid
52 ! Modified: (A. Voldoire)
53 ! new ice/water fluxes interface CALL
54 !
55 ! ---------------------- BEGIN MODULE modi_glt_updhsn_r ---------------------
56 !
57 !THXS_SFX!MODULE modi_glt_updhsn_r
58 !THXS_SFX!INTERFACE
59 !THXS_SFX!!
60 !THXS_SFX!SUBROUTINE glt_updhsn_r( gsmelt,pdhmelt,tpmxl,tptfl,tpsit,tpsil,tpdia )
61 !THXS_SFX! USE modd_types_glt
62 !THXS_SFX! USE modd_glt_param
63 !THXS_SFX! LOGICAL, DIMENSION(nt,np), INTENT(in) :: &
64 !THXS_SFX! gsmelt
65 !THXS_SFX! REAL, DIMENSION(nl,nt,np), INTENT(in) :: &
66 !THXS_SFX! pdhmelt
67 !THXS_SFX! TYPE(t_mxl), DIMENSION(np), INTENT(in) :: &
68 !THXS_SFX! tpmxl
69 !THXS_SFX! TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
70 !THXS_SFX! tptfl
71 !THXS_SFX! TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
72 !THXS_SFX! tpsit
73 !THXS_SFX! TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
74 !THXS_SFX! tpsil
75 !THXS_SFX! TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
76 !THXS_SFX! tpdia
77 !THXS_SFX!END SUBROUTINE glt_updhsn_r
78 !THXS_SFX!!
79 !THXS_SFX!END INTERFACE
80 !THXS_SFX!END MODULE modi_glt_updhsn_r
81 !
82 ! ---------------------- END MODULE modi_glt_updhsn_r -----------------------
83 !
84 !
85 !
86 ! -----------------------------------------------------------------------
87 ! ------------------------- SUBROUTINE glt_updhsn_r -------------------------
88 !
89 SUBROUTINE glt_updhsn_r( gsmelt,pdhmelt,tpmxl,tptfl,tpsit,tpsil,tpdia )
90 !
92  USE modd_types_glt
93  USE modd_glt_param
94  USE modi_glt_updtfl_r
96 !
97  IMPLICIT NONE
98 !
99 !* Arguments
100 !
101  LOGICAL, DIMENSION(nt,np), INTENT(in) :: &
102  gsmelt
103  REAL, DIMENSION(nl,nt,np), INTENT(in) :: &
104  pdhmelt
105  TYPE(t_mxl), DIMENSION(np), INTENT(in) :: &
106  tpmxl
107  TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
108  tptfl
109  TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
110  tpsit
111  TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
112  tpsil
113  TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
114  tpdia
115 !
116 !* Local variables
117 !
118  REAL, DIMENSION(nt,np) :: &
119  zqmelt,zhsn,zdmsn,zent
120 !real,dimension(np) :: zei1,zei2,zes1,zes2
121 !
122 !
123 !
124 ! 1. Initializations
125 ! ==================
126 !
127 ! .. Surface melting boolean
128 !
129  zqmelt = 0.
130 !
131 ! NOTE: here we assume there is only one snow layer
132 !
133 ! .. Take the overwhelming energy due to vertical diffusion + solar radiation
134 ! intake
135 !
136  WHERE ( pdhmelt(nl,:,:)>0. )
137  zqmelt(:,:) = pdhmelt(nl,:,:) / dtt
138  ENDWHERE
139 !
140 ! .. Snow thickness
141 !
142  zhsn(:,:) = tpsit(:,:)%hsn
143 !
144 !CALL glt_aventh(tpsit,tpsil,zei1,zes1)
145 !print*,'Enthalpie avant =',zei1+zes1
146 !
147 !
148 ! 2. Snow vertical melting
149 ! ========================
150 !
151 ! .. Compute new snow thickness
152 !
153  WHERE ( gsmelt(:,:) )
154  zhsn(:,:) = tpsit(:,:)%hsn - &
155  dtt*zqmelt(:,:) / ( tpsit(:,:)%rsn*xmhofusn0 )
156 !
157 ! .. If updated snow thickness is positive, it means that all zqmelt
158 ! has contributed to snow melting. Then it should be zeroed.
159 !
160  WHERE ( zhsn(:,:)>=0. )
161  zqmelt(:,:) = 0.
162 !
163 ! .. If updated snow thickness is negative, it means that only part of
164 ! zqmelt could be used for snow melting. In excess energy at the
165 ! top of the snow layer is computed :
166 !
167  ELSEWHERE
168  zqmelt(:,:) = -xmhofusn0*tpsit(:,:)%rsn*zhsn(:,:) / dtt
169  zhsn(:,:) = 0.
170  ENDWHERE
171 !
172  ENDWHERE
173 !
174 ! .. Compute snow mass variation
175 !
176  zdmsn(:,:) = tpsit(:,:)%rsn * tpsit(:,:)%fsi * &
177  ( zhsn(:,:)-tpsit(:,:)%hsn )
178 !
179 ! .. AR5 diagnostic
180 !
181  tpdia(:)%snm = sum( zdmsn(:,:), dim=1 ) / dtt
182 !
183 ! .. Update snow thickness and density
184 !
185  tpsit(:,:)%hsn = zhsn(:,:)
186 !
187 ! .. Note that if zqmelt is not equal to zero at this stage, it will be
188 ! transmitted to the ocean.
189 !
190 !
191 !
192 ! 3. Energy conservation
193 ! ======================
194 !
195 ! 3.1. Transmit remaining energy to the ocean
196 ! --------------------------------------------
197 !
198  tptfl(:)%tio = tptfl(:)%tio + &
199  sum( zqmelt(:,:)*tpsit(:,:)%fsi, dim=1 )
200 !
201 !
202 ! 3.2. Massic gltools_enthalpy of removed snow
203 ! -------------------------------------
204 !
205 ! .. Since the removed snow has a temperature of 0C (melting) its
206 ! gltools_enthalpy is also zero.
207 ! Not useful anymore, done directly in glt_updtfl
208 ! zent(:,:) = 0.
209 !
210 !
211 ! 3.3. Update water, heat and salt fluxes affecting the ocean
212 ! -----------------------------------------------------------
213 !
214 ! .. Water, heat and salt flux due to the inclusion of the water mass
215 ! generated by the melting of snow
216 !
217  CALL glt_updtfl_r( 'FW2O',tpmxl,tptfl,zdmsn)
218 !CALL glt_aventh(tpsit,tpsil,zei2,zes2)
219 !print*,'Enthalpie apres =',zei2+zes2
220 !print*,'Delta(Enthalpie) =',(zei2+zes2-zei1-zes1)/dtt
221 !print*,'qtio=',SUM( zqmelt(:,:)*tpsit(:,:)%fsi, DIM=1 )
222 !
223 END SUBROUTINE glt_updhsn_r
224 !
225 ! ----------------------- END SUBROUTINE glt_updhsn_r -----------------------
226 ! -----------------------------------------------------------------------
subroutine glt_updtfl_r(hflag, tpmxl, tptfl, pdmass, pent, psalt)
subroutine glt_updhsn_r(gsmelt, pdhmelt, tpmxl, tptfl, tpsit, tpsil, tpdia)