SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_glt_salflx_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_salflx_r =========================
41 ! =======================================================================
42 !
43 ! Goal:
44 ! -----
45 ! This module contains a subroutine that is computes the
46 ! concentration / dilution flux, due to desalination processes (ice
47 ! mass flux = 0) or freezing / melting of sea ice (ice mass flux /= 0)
48 !
49 ! Method:
50 ! --------
51 ! Three different methods can be used:
52 ! - simple, approximated method
53 ! - exact calculation, ocean surface salinity is the true salinity
54 ! - exact calculation, ocean surface salinity is the ref. salinity
55 !
56 ! Input:
57 ! ------
58 ! pdmass (the provided mass of melted ice or snow) is in kg.m-2.
59 ! In the case of sea ice:
60 ! (sea ice density) * (fraction) * (thickness variation)
61 ! pqsalt (the provided salt flux) is in g.m-2.
62 ! In the case of sea ice melting / freezing, it is:
63 ! pdmass * ( ice salinity )
64 ! In the case of sea ice desalination:
65 ! (sea ice density) * (fraction) * (thickness) * (salinity variation)
66 !
67 ! Created : 2010/03 (D. Salas y Melia)
68 ! Modified: 2010/07 (D. Salas y Melia) Take ssh into account
69 ! Modified: 2011/12 (A. Voldoire) New formulation of the %cio flux
70 ! (method 4)
71 !
72 ! --------------------- BEGIN MODULE modi_glt_salflx_r ----------------------
73 !
74 !THXS_SFX!MODULE modi_glt_salflx_r
75 !THXS_SFX!INTERFACE
76 !THXS_SFX!!
77 !THXS_SFX!SUBROUTINE glt_salflx_r( pqsalt,tpmxl,tptfl,pdmass,psalt )
78 !THXS_SFX! USE modd_types_glt
79 !THXS_SFX! USE modd_glt_param
80 !THXS_SFX! REAL, DIMENSION(nt,np), INTENT(in) :: &
81 !THXS_SFX! pqsalt
82 !THXS_SFX! TYPE(t_mxl), DIMENSION(np), INTENT(in) :: &
83 !THXS_SFX! tpmxl
84 !THXS_SFX! TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
85 !THXS_SFX! tptfl
86 !THXS_SFX! REAL, DIMENSION(nt,np),OPTIONAL, INTENT(in) :: &
87 !THXS_SFX! pdmass,psalt
88 !THXS_SFX!END SUBROUTINE glt_salflx_r
89 !THXS_SFX!!
90 !THXS_SFX!END INTERFACE
91 !THXS_SFX!END MODULE modi_glt_salflx_r
92 !
93 ! ---------------------- END MODULE modi_glt_salflx_r -----------------------
94 !
95 !
96 !
97 ! -----------------------------------------------------------------------
98 ! ------------------------- SUBROUTINE glt_salflx_r -------------------------
99 !
100 SUBROUTINE glt_salflx_r( pqsalt,tpmxl,tptfl,pdmass,psalt )
101 !
103  USE modd_types_glt
104  USE modd_glt_param
105 !
106  IMPLICIT NONE
107 !
108  REAL, DIMENSION(nt,np), INTENT(in) :: &
109  pqsalt
110  TYPE(t_mxl), DIMENSION(np), INTENT(in) :: &
111  tpmxl
112  TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
113  tptfl
114  REAL, DIMENSION(nt,np),OPTIONAL, INTENT(in) :: &
115  pdmass,psalt
116 !
117 ! .. Local variables
118 !
119  REAL, DIMENSION(nt,np) :: &
120  zaux,zsml,zssh,zdmass,zsalt
121  REAL, parameter :: ssmr=34.
122 !
123 !
124 !
125 ! 1. Initialisations
126 ! ===================
127 !
128  IF ( present(pdmass) ) THEN
129  zdmass(:,:) = pdmass(:,:)
130  ELSE
131  zdmass(:,:) = 0.
132  ENDIF
133 !
134  IF ( present(psalt) ) THEN
135  zsalt(:,:) = psalt(:,:)
136  ELSE
137  zsalt(:,:) = 0.
138  ENDIF
139 !
140 !
141 !
142 ! 2. Compute virtual water flux (concentration/dilution)
143 ! -------------------------------------------------------
144 !
145 ! Method 1:
146 ! -> we suppose that the change in ice thickness during a time step is
147 ! negligible compared to the thickness of the uppermost ocean level
148 !
149  zsml(:,:) = spread( tpmxl(:)%sml,1,nt )
150  IF ( ncdlssh==1 ) THEN
151  zssh(:,:) = spread( tpmxl(:)%ssh,1,nt )
152  ELSE
153  zssh(:,:) = 0.
154  ENDIF
155 !
156  IF ( nsalflx==1 ) THEN
157  tptfl(:)%cio = tptfl(:)%cio - &
158  sum( zdmass(:,:) - pqsalt(:,:)/amax1( zsml(:,:),epsil1 ), &
159  dim=1) / dtt
160 !
161 ! Method 2:
162 ! -> we do not make the approximation that the change in ice thickness
163 ! during a time step is negligible compared to the thickness of the uppermost
164 ! ocean level
165 !
166  ELSE IF ( nsalflx==2 ) THEN
167  zaux(:,:) = 1. / ( rhofw + zsalt(:,:) )
168  tptfl(:)%cio = tptfl(:)%cio - &
169  sum( ( rhoice*zdmass(:,:)*zaux(:,:) - &
170  rhoice/rhosw * pqsalt(:,:)/amax1( zsml(:,:),epsil1 ) ) / &
171  ( 1. - zaux(:,:)*zdmass(:,:)/( rn_htopoc+zssh(:,:) ) ), &
172  dim=1 ) / dtt
173 !
174 ! Method 3:
175 ! -> we use a reference salinity to describe ocean salinity (and still do not
176 ! make the approximation from the nsalflx==1 case)
177 !
178  ELSE IF ( nsalflx==3 ) THEN
179  zaux(:,:) = 1. / ( rhofw + zsalt(:,:) )
180  tptfl(:)%cio = tptfl(:)%cio - &
181  sum( ( rhoice*zdmass(:,:)*zaux(:,:) - &
182  rhoice/rhosw * pqsalt(:,:)/ssw0 ) / &
183  ( 1. - zaux(:,:)*zdmass(:,:)/( rn_htopoc+zssh(:,:) ) ), &
184  dim=1 ) / dtt
185 !
186 ! Method 4:
187 ! -> As method 1 but salinity is considered as fixed.
188 ! Method 1 may be the more "accurate", since pqsalt should be taken into account
189  ELSE IF ( nsalflx==4 ) THEN
190  tptfl(:)%cio = tptfl(:)%cio - &
191  sum( zdmass(:,:) * (ssmr - sice)/amax1( zsml(:,:),epsil1 ), &
192  dim=1) / dtt
193 !
194 ! Method 5:
195  ELSE IF ( nsalflx==5 ) THEN
196  tptfl(:)%cio = tptfl(:)%cio - &
197  sum( zdmass(:,:), dim=1) / dtt
198 !
199  ENDIF
200 !
201 END SUBROUTINE glt_salflx_r
202 !
203 ! ---------------------- END SUBROUTINE glt_salflx_r ------------------------
204 ! -----------------------------------------------------------------------
subroutine glt_salflx_r(pqsalt, tpmxl, tptfl, pdmass, psalt)