SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_glt_updtfl.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_updtfl ==========================
41 ! =======================================================================
42 !
43 ! Goal:
44 ! -----
45 ! Transform sea ice ablation/accretion or snow ablation into salt,
46 ! water and heat fluxes directed to the ocean.
47 !
48 ! Method:
49 ! -------
50 ! For every category of ice or snow involved in melting / freezing
51 ! in the grid cell, the following quantities are needed:
52 ! - mass (kg.m-2)
53 ! - massic gltools_enthalpy (J.kg-1)
54 ! - salt (g.kg-1)
55 ! As Gelato can be coupled to rigid lid models (that need a virtual
56 ! freshwater flux) or a free-surface model (that need a virtual
57 ! freshwater flux and a water mass flux). A heat flux is also
58 ! computed
59 !
60 ! Remarks:
61 ! --------
62 ! Note that dmass (the provided mass of melted ice or snow) are
63 ! in kg.m-2. In the case of sea ice:
64 ! (sea ice density) * (fraction) * (thickness variation).
65 !
66 !
67 ! Created : 2001/07 (D. Salas y Melia)
68 ! Taken out from imod_thermo_ice.f90 routine (rigid lid
69 ! assumption is made).
70 !
71 ! Modified: 2002/10 (D. Salas y Melia)
72 ! Introduction of free surface approach.
73 !
74 ! Modified: 2009/06 (D. Salas y Melia) reduced grid
75 !
76 ! Modified: 2009/12 (D. Salas y Melia) make glt_updtfl consistent with the
77 ! new gltools_enthalpy formulation in Gelato.
78 !
79 ! Modified: 2010/06 (D. Salas y Melia) this version works on full grid
80 !
81 ! Modified: 2011/12 (A. Voldoire) Re-formulation of this ice/water fluxes
82 ! interface, depending on the source and target media involved.
83 !
84 ! ----------------------- BEGIN MODULE modi_glt_updtfl ----------------------
85 !
86 !THXS_SFX!MODULE modi_glt_updtfl
87 !THXS_SFX!INTERFACE
88 !THXS_SFX!!
89 !THXS_SFX!SUBROUTINE glt_updtfl( hflag,tpmxl,tptfl,pdmass,pent,psalt )
90 !THXS_SFX!!
91 !THXS_SFX! USE modd_types_glt
92 !THXS_SFX! USE modd_glt_param
93 !THXS_SFX! CHARACTER(*), INTENT(in) :: &
94 !THXS_SFX! hflag
95 !THXS_SFX! TYPE(t_mxl), DIMENSION(nx,ny), INTENT(in) :: &
96 !THXS_SFX! tpmxl
97 !THXS_SFX! TYPE(t_tfl), DIMENSION(nx,ny), INTENT(inout) :: &
98 !THXS_SFX! tptfl
99 !THXS_SFX! REAL, DIMENSION(nt,nx,ny), INTENT(in) :: &
100 !THXS_SFX! pdmass
101 !THXS_SFX! REAL, DIMENSION(nt,nx,ny), INTENT(in), OPTIONAL :: &
102 !THXS_SFX! psalt,pent
103 !THXS_SFX!END SUBROUTINE glt_updtfl
104 !THXS_SFX!!
105 !THXS_SFX!END INTERFACE
106 !THXS_SFX!END MODULE modi_glt_updtfl
107 !
108 ! ----------------------- END MODULE modi_glt_updtfl ------------------------
109 !
110 !
111 !
112 ! -----------------------------------------------------------------------
113 ! -------------------------- SUBROUTINE glt_updtfl --------------------------
114 !
115 SUBROUTINE glt_updtfl( hflag,tpmxl,tptfl,pdmass,pent,psalt )
116 !
118  USE modd_types_glt
119  USE modd_glt_param
120  USE modi_glt_salflx
121 !
122  IMPLICIT NONE
123 !
124 ! .. Arguments
125 !
126  CHARACTER(*), INTENT(in) :: &
127  hflag
128  TYPE(t_mxl), DIMENSION(nx,ny), INTENT(in) :: &
129  tpmxl
130  TYPE(t_tfl), DIMENSION(nx,ny), INTENT(inout) :: &
131  tptfl
132  REAL, DIMENSION(nt,nx,ny), INTENT(in) :: &
133  pdmass
134  REAL, DIMENSION(nt,nx,ny), INTENT(in), OPTIONAL :: &
135  psalt,pent
136 !
137 ! .. Local variables
138 !
139  REAL, DIMENSION(nx,ny) :: &
140  zqm,zqsalt,zqent
141  REAL, DIMENSION(nt,nx,ny) :: &
142  zsalt,zaux,zsml,zqsalt2,zent
143 !
144 !
145 !
146 ! 1. Case of sea ice volume variation
147 ! ===================================
148 !
149 ! 1.1. Compute agregated mass flux
150 ! ---------------------------------
151 !
152 ! .. zqm is in kg.m-2.s-1
153 !
154  zqm(:,:) = sum( pdmass(:,:,:),dim=1 ) / dtt
155 !
156 ! .. Salinity of considered medium (in g.kg-1)
157 !
158 !
159 ! 1.2. Compute agregated salt flux
160 ! ---------------------------------
161 !
162 ! .. zsalt is in g.kg-1
163 !
164  IF ( present( psalt ) ) THEN
165  zsalt(:,:,:) = psalt(:,:,:)
166  ELSE
167  zsalt(:,:,:) = 0.
168  ENDIF
169  IF ( present( pent ) ) THEN
170  zent(:,:,:) = pent(:,:,:)
171  ELSE
172  zent(:,:,:) = 0.
173  ENDIF
174 !
175 ! .. The salt flux is expressed in g.m-2.s-1
176 !
177  zqsalt2(:,:,:) = pdmass(:,:,:)*zsalt(:,:,:) ! For glt_salflx routine
178  zqsalt(:,:) = sum( zqsalt2(:,:,:),dim=1 ) / dtt
179 !
180 !
181 ! 1.2. Compute agregated gltools_enthalpy flux
182 ! -------------------------------------
183 !
184 ! .. Note there is no gltools_enthalpy exchange if sea ice / snow mass increases
185 !
186  zqent(:,:) = sum( amin1( pdmass(:,:,:),0. )*zent(:,:,:),dim=1 ) / dtt
187 !
188 !
189 !
190 ! 2. Compute glt_output fluxes
191 ! =========================
192 ! 3 types_glt of exchanges :
193 ! 'FW2O' - between fresh water and ocean
194 ! only a wlo flux
195 ! 'I2O' - between ice and the ocean
196 ! only a cio flux
197 ! 'FW2I' - between fresh water and ice
198 ! a wio and a cio flux (cio=-wio)
199 !
200 ! Ice <-> Ocean
201  IF ( hflag=='I2O' ) THEN
202  IF ( nleviti==1 ) THEN
203 ! .. Update virtual water flux (concentration/dilution) in kg.m-2.s-1
204 !
205  CALL glt_salflx( zqsalt2,tpmxl,tptfl,pdmass=pdmass,psalt=zsalt )
206  tptfl(:,:)%sio = tptfl(:,:)%sio - 1.e-3 * zqsalt(:,:)
207  ENDIF
208 ! Fresh Water <-> Ocean
209  ELSE IF ( hflag=='FW2O') THEN
210  tptfl(:,:)%wlo = tptfl(:,:)%wlo - zqm(:,:)
211 ! Fresh Water <-> Ice
212  ELSE IF ( hflag=='FW2I') THEN
213  tptfl(:,:)%wio = tptfl(:,:)%wio + zqm(:,:)
214  IF ( nleviti==1 ) THEN
215  tptfl(:,:)%cio = tptfl(:,:)%cio - zqm(:,:)
216  ENDIF
217  ENDIF
218 
219 !
220 ! .. Heat flux in W.m-2
221 !
222  tptfl(:,:)%tio = tptfl(:,:)%tio - zqent(:,:)
223 !
224 !
225 END SUBROUTINE glt_updtfl
226 !
227 ! ------------------------ END SUBROUTINE glt_updtfl ------------------------
228 ! -----------------------------------------------------------------------
subroutine glt_updtfl(hflag, tpmxl, tptfl, pdmass, pent, psalt)
subroutine glt_salflx(pqsalt, tpmxl, tptfl, pdmass, psalt)