SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_glt_salflx.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 ==========================
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/06 (D. Salas y Melia) glt_salflx on full grid
69 ! Modified: 2010/07 (D. Salas y Melia) Take ssh into account
70 ! Modified: 2011/12 (A. Voldoire) New formulation of the %cio flux
71 ! (method 4)
72 !
73 ! ---------------------- BEGIN MODULE modi_glt_salflx -----------------------
74 !
75 !THXS_SFX!MODULE modi_glt_salflx
76 !THXS_SFX!INTERFACE
77 !THXS_SFX!!
78 !THXS_SFX!SUBROUTINE glt_salflx( pqsalt,tpmxl,tptfl,pdmass,psalt )
79 !THXS_SFX! USE modd_types_glt
80 !THXS_SFX! USE modd_glt_param
81 !THXS_SFX! REAL, DIMENSION(nt,nx,ny), INTENT(in) :: &
82 !THXS_SFX! pqsalt
83 !THXS_SFX! TYPE(t_mxl), DIMENSION(nx,ny), INTENT(in) :: &
84 !THXS_SFX! tpmxl
85 !THXS_SFX! TYPE(t_tfl), DIMENSION(nx,ny), INTENT(inout) :: &
86 !THXS_SFX! tptfl
87 !THXS_SFX! REAL, DIMENSION(nt,nx,ny),OPTIONAL, INTENT(in) :: &
88 !THXS_SFX! pdmass,psalt
89 !THXS_SFX!END SUBROUTINE glt_salflx
90 !THXS_SFX!!
91 !THXS_SFX!END INTERFACE
92 !THXS_SFX!END MODULE modi_glt_salflx
93 !
94 ! ----------------------- END MODULE modi_glt_salflx ------------------------
95 !
96 !
97 !
98 ! -----------------------------------------------------------------------
99 ! -------------------------- SUBROUTINE glt_salflx --------------------------
100 !
101 SUBROUTINE glt_salflx( pqsalt,tpmxl,tptfl,pdmass,psalt )
102 !
104  USE modd_types_glt
105  USE modd_glt_param
106 !
107  IMPLICIT NONE
108 !
109  REAL, DIMENSION(nt,nx,ny), INTENT(in) :: &
110  pqsalt
111  TYPE(t_mxl), DIMENSION(nx,ny), INTENT(in) :: &
112  tpmxl
113  TYPE(t_tfl), DIMENSION(nx,ny), INTENT(inout) :: &
114  tptfl
115  REAL, DIMENSION(nt,nx,ny),OPTIONAL, INTENT(in) :: &
116  pdmass,psalt
117 !
118 ! .. Local variables
119 !
120  REAL, DIMENSION(nt,nx,ny) :: &
121  zaux,zsml,zssh,zdmass,zsalt
122  REAL, parameter :: ssmr=34.
123 !
124 !
125 !
126 ! 1. Initialisations
127 ! ===================
128 !
129  IF ( present(pdmass) ) THEN
130  zdmass(:,:,:) = pdmass(:,:,:)
131  ELSE
132  zdmass(:,:,:) = 0.
133  ENDIF
134 !
135  IF ( present(psalt) ) THEN
136  zsalt(:,:,:) = psalt(:,:,:)
137  ELSE
138  zsalt(:,:,:) = 0.
139  ENDIF
140 !
141 !
142 !
143 ! 2. Compute virtual water flux (concentration/dilution)
144 ! -------------------------------------------------------
145 !
146 ! Method 1:
147 ! -> we suppose that the change in ice thickness during a time step is
148 ! negligible compared to the thickness of the uppermost ocean level
149 !
150  zsml(:,:,:) = spread( tpmxl(:,:)%sml,1,nt )
151  IF ( ncdlssh==1 ) THEN
152  zssh(:,:,:) = spread( tpmxl(:,:)%ssh,1,nt )
153  ELSE
154  zssh(:,:,:) = 0.
155  ENDIF
156 !
157  IF ( nsalflx==1 ) THEN
158  tptfl(:,:)%cio = tptfl(:,:)%cio - &
159  sum( zdmass(:,:,:) - pqsalt(:,:,:)/amax1( zsml(:,:,:),epsil1 ), &
160  dim=1) / dtt
161 !
162 ! Method 2:
163 ! -> we do not make the approximation that the change in ice thickness
164 ! during a time step is negligible compared to the thickness of the uppermost
165 ! ocean level
166 !
167  ELSE IF ( nsalflx==2 ) THEN
168  zaux(:,:,:) = 1. / ( rhofw + zsalt(:,:,:) )
169  tptfl(:,:)%cio = tptfl(:,:)%cio - &
170  sum( ( rhoice*zdmass(:,:,:)*zaux(:,:,:) - &
171  rhoice/rhosw * pqsalt(:,:,:)/amax1( zsml(:,:,:),epsil1 ) ) / &
172  ( 1. - zaux(:,:,:)*zdmass(:,:,:)/( rn_htopoc+zssh(:,:,:) ) ), &
173  dim=1 ) / dtt
174 !
175 ! Method 3:
176 ! -> we use a reference salinity to describe ocean salinity (and still do not
177 ! make the approximation from the nsalflx==1 case)
178 !
179  ELSE IF ( nsalflx==3 ) THEN
180  zaux(:,:,:) = 1. / ( rhofw + zsalt(:,:,:) )
181  tptfl(:,:)%cio = tptfl(:,:)%cio - &
182  sum( ( rhoice*zdmass(:,:,:)*zaux(:,:,:) - &
183  rhoice/rhosw * pqsalt(:,:,:)/ssw0 ) / &
184  ( 1. - zaux(:,:,:)*zdmass(:,:,:)/( rn_htopoc+zssh(:,:,:) ) ), &
185  dim=1 ) / dtt
186 !
187 ! Method 4:
188 ! -> As method 1 but salinity is considered as fixed.
189  ELSE IF ( nsalflx==4 ) THEN
190  tptfl(:,:)%cio = tptfl(:,:)%cio - &
191  sum( zdmass(:,:,:) * (ssmr - sice)/amax1( zsml(:,:,:),epsil1 ), &
192  dim=1) / dtt
193  ENDIF
194 !
195 END SUBROUTINE glt_salflx
196 !
197 ! ----------------------- END SUBROUTINE glt_salflx -------------------------
198 ! -----------------------------------------------------------------------
subroutine glt_salflx(pqsalt, tpmxl, tptfl, pdmass, psalt)