SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_gltools_newice_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_gltools_newice_r ====================
41 ! =======================================================================
42 !
43 !
44 ! * Completely define a new ice category from input information
45 !
46 ! Created : 2012/03 (D. Salas y Melia)
47 ! Modified: No
48 !
49 ! ------------------- BEGIN MODULE modi_gltools_newice_r ------------------
50 !
51 !THXS_SFX!MODULE modi_gltools_newice_r
52 !THXS_SFX!INTERFACE
53 !THXS_SFX!!
54 !THXS_SFX!SUBROUTINE gltools_newice_r &
55 !THXS_SFX! ( pfsi,phsi,tpmxl,tpsit,tpsil, &
56 !THXS_SFX! ptsf,pssi,phsn,prsn,pasn,pent )
57 !THXS_SFX!!
58 !THXS_SFX! USE modd_types_glt
59 !THXS_SFX! USE modd_glt_param
60 !THXS_SFX!!
61 !THXS_SFX! REAL, DIMENSION(nt,np), INTENT(in) :: &
62 !THXS_SFX! pfsi,phsi
63 !THXS_SFX! TYPE(t_mxl), DIMENSION(np), INTENT(inout) :: &
64 !THXS_SFX! tpmxl
65 !THXS_SFX! TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
66 !THXS_SFX! tpsit
67 !THXS_SFX! TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
68 !THXS_SFX! tpsil
69 !THXS_SFX! REAL, DIMENSION(nt,np), OPTIONAL, INTENT(inout) :: &
70 !THXS_SFX! ptsf,pssi,phsn,prsn,pasn
71 !THXS_SFX! REAL, DIMENSION(nl,nt,np), OPTIONAL, INTENT(inout) :: &
72 !THXS_SFX! pent
73 !THXS_SFX!END SUBROUTINE gltools_newice_r
74 !THXS_SFX!!
75 !THXS_SFX!END INTERFACE
76 !THXS_SFX!END MODULE modi_gltools_newice_r
77 !
78 ! -------------------- END MODULE modi_gltools_newice_r -------------------
79 !
80 !
81 ! -----------------------------------------------------------------------
82 ! ------------------------- SUBROUTINE gltools_newice_r -------------------------
83 !
84 SUBROUTINE gltools_newice_r &
85  ( pfsi,phsi,tpmxl,tpsit,tpsil, &
86  ptsf,pssi,phsn,prsn,pasn,pent )
87 !
88 !
89 !
90 ! 1. Declarations
91 ! ===============
92 !
93 ! 1.1. Module declarations
94 ! ------------------------
95 !
96  USE modd_types_glt
97  USE modd_glt_param
100  USE mode_glt_info_r
101  USE mode_glt_stats_r
102 !
103  IMPLICIT NONE
104 !
105 !
106 ! 1.2. Dummy arguments declarations
107 ! ---------------------------------
108 !
109 ! .. INTENT(in) arguments.
110 !
111  REAL, DIMENSION(nt,np), INTENT(in) :: &
112  pfsi,phsi
113  TYPE(t_mxl), DIMENSION(np), INTENT(inout) :: &
114  tpmxl
115 !
116 ! .. INTENT(inout) arguments.
117 !
118  TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
119  tpsit
120  TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
121  tpsil
122 !
123 ! .. OPTIONAL, INTENT(in) arguments
124 !
125  REAL, DIMENSION(nt,np), OPTIONAL, INTENT(inout) :: &
126  ptsf,pssi,phsn,prsn,pasn
127  REAL, DIMENSION(nl,nt,np), OPTIONAL, INTENT(inout) :: &
128  pent
129 !
130 !
131 ! 1.3. Local variables declarations
132 ! ---------------------------------
133 !
134  INTEGER :: &
135  jl,jk,jp
136  REAL, DIMENSION(nt,np) :: &
137  ztsf,zssi,zhsn,zrsn,zasn
138  REAL, DIMENSION(nl,nt,np) :: &
139  zent
140 !
141 !
142 !
143 ! 2. Define new ice
144 ! ==================
145 !
146 ! 2.1. Handle missing arguments
147 ! ------------------------------
148 !
149  IF ( present(ptsf) ) THEN
150  ztsf(:,:) = ptsf(:,:)
151  ELSE
152  ztsf(:,:) = spread( tpmxl(:)%mlf,1,nt )
153  ENDIF
154  IF ( present(pssi) ) THEN
155  zssi(:,:) = pssi(:,:)
156  ELSE
157  zssi(:,:) = sice
158  ENDIF
159  IF ( present(phsn) ) THEN
160  zhsn(:,:) = phsn(:,:)
161  ELSE
162  zhsn(:,:) = 0.
163  ENDIF
164  IF ( present(prsn) ) THEN
165  zrsn(:,:) = prsn(:,:)
166  ELSE
167  zrsn(:,:) = rhosnwmin
168  ENDIF
169  IF ( present(pasn) ) THEN
170  zasn(:,:) = pasn(:,:)
171  ELSE
172  WHERE( zhsn(:,:) > epsil1 )
173  zasn(:,:) = rhosnwmax
174  ELSEWHERE
175  zasn(:,:) = albi
176  ENDWHERE
177  ENDIF
178 !
179 ! .. For enthalpy, assume that the temperature is equal to surface temperature
180 ! over the vertical
181  IF ( present(pent) ) THEN
182  zent(:,:,:) = pent(:,:,:)
183  ELSE
184  zent(:,:,:) = spread( glt_enthalpy2d( ztsf(:,:),zssi(:,:) ),1,nl )
185  ENDIF
186 
187 !
188 ! 2.2. Define lead sea ice state variable
189 ! ---------------------------------------
190 !
191 ! Compute all ice state variables for sea ice for
192 !
193 ! ..Sea ice 3D variables.
194 !
195  WHERE( pfsi(:,:)>=epsil1 .AND. tpsit(:,:)%fsi<=epsil1 )
196  tpsit(:,:)%esi = .true.
197  tpsit(:,:)%age = 0.
198  tpsit(:,:)%asn = zasn(:,:)
199  tpsit(:,:)%fsi = pfsi(:,:)
200  tpsit(:,:)%hsi = phsi(:,:)
201  tpsit(:,:)%ssi = zssi(:,:)
202  tpsit(:,:)%hsn = zhsn(:,:)
203  tpsit(:,:)%rsn = zrsn(:,:)
204  tpsit(:,:)%tsf = ztsf(:,:)
205  ENDWHERE
206 !
207 ! .. Sea ice 4D variables.
208 !
209  DO jl=1,nl
210  WHERE( pfsi(:,:)>=epsil1 .AND. tpsit(:,:)%fsi<=epsil1 )
211  tpsil(jl,:,:)%ent = zent(jl,:,:)
212  ENDWHERE
213  END DO
214 !
215 END SUBROUTINE gltools_newice_r
216 !
217 ! ---------------------- END SUBROUTINE gltools_newice_r ------------------------
218 ! -----------------------------------------------------------------------
subroutine gltools_newice_r(pfsi, phsi, tpmxl, tpsit, tpsil, ptsf, pssi, phsn, prsn, pasn, pent)