SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
snow_heat_to_t_wliq.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 ! ########################
7 ! ########################
8 !
10 !
11 SUBROUTINE snow_heat_to_t_wliq_1d(PHEAT,PRHO,PT,PWLIQ)
12 REAL, DIMENSION(:), INTENT(IN) :: pheat ! snow heat density (J/m3)
13 REAL, DIMENSION(:), INTENT(IN) :: prho ! snow density (kg/m3)
14 REAL, DIMENSION(:), INTENT(OUT) :: pt ! snow temperature profile (K)
15 REAL, DIMENSION(:), INTENT(OUT), OPTIONAL:: pwliq ! liquid water profile (kg/m3)
16 END SUBROUTINE snow_heat_to_t_wliq_1d
17 !
18 SUBROUTINE snow_heat_to_t_wliq_2d(PHEAT,PRHO,PT,PWLIQ)
19 REAL, DIMENSION(:,:), INTENT(IN) :: pheat ! snow heat density (J/m3)
20 REAL, DIMENSION(:,:), INTENT(IN) :: prho ! snow density (kg/m3)
21 REAL, DIMENSION(:,:), INTENT(OUT) :: pt ! snow temperature profile (K)
22 REAL, DIMENSION(:,:), INTENT(OUT), OPTIONAL:: pwliq ! liquid water profile (kg/m3)
23 END SUBROUTINE snow_heat_to_t_wliq_2d
24 !
25 SUBROUTINE snow_heat_to_t_wliq_3d(PHEAT,PRHO,PT,PWLIQ)
26 REAL, DIMENSION(:,:,:), INTENT(IN) :: pheat ! snow heat density (J/m3)
27 REAL, DIMENSION(:,:,:), INTENT(IN) :: prho ! snow density (kg/m3)
28 REAL, DIMENSION(:,:,:), INTENT(OUT) :: pt ! snow temperature profile (K)
29 REAL, DIMENSION(:,:,:), INTENT(OUT), OPTIONAL:: pwliq ! liquid water profile (kg/m3)
30 END SUBROUTINE snow_heat_to_t_wliq_3d
31 !
32 END INTERFACE
33 !
34 END MODULE modi_snow_heat_to_t_wliq
35 !
36 ! ###########################################
37 SUBROUTINE snow_heat_to_t_wliq_1d(PHEAT,PRHO,PT,PWLIQ)
38 ! ###########################################
39 !
40 USE modd_surf_par, ONLY : xundef
41 USE modd_csts, ONLY : xtt, xlmtt
42 USE mode_snow3l
43 !
44 !
45 USE yomhook ,ONLY : lhook, dr_hook
46 USE parkind1 ,ONLY : jprb
47 !
48 IMPLICIT NONE
49 !
50 !
51 !
52 !* 0.1 declarations of arguments
53 !
54 REAL, DIMENSION(:), INTENT(IN) :: pheat ! snow heat density (J/m3)
55 REAL, DIMENSION(:), INTENT(IN) :: prho ! snow density (kg/m3)
56 REAL, DIMENSION(:), INTENT(OUT) :: pt ! snow temperature profile (K)
57 REAL, DIMENSION(:), INTENT(OUT), OPTIONAL:: pwliq ! liquid water profile (kg/m3)
58 REAL(KIND=JPRB) :: zhook_handle
59 !
60 !
61 !* 0.2 declarations of local variables
62 !
63 !---------------------------------------------------------------------------
64 !
65 IF (lhook) CALL dr_hook('MODI_SNOW_HEAT_TO_T_WLIQ:SNOW_HEAT_TO_T_WLIQ_1D',0,zhook_handle)
66 pt = xundef
67 IF (present(pwliq)) pwliq = xundef
68 !
69 !* temperature from heat
70 !
71 WHERE(prho/=xundef) pt = xtt + (pheat + xlmtt*prho) / snow3lscap(prho)
72 !
73 !* effect of liquid water
74 !
75 IF (present(pwliq)) THEN
76  WHERE(prho/=xundef) pwliq = (pt-xtt) * snow3lscap(prho) / xlmtt
77 END IF
78 !
79 !* physical limits
80 !
81 IF (present(pwliq)) THEN
82  pt = min(xtt,pt)
83  pwliq = max(0.,pwliq)
84  pwliq = min(snow3lwliqmax(prho),pwliq)
85 END IF
86 IF (lhook) CALL dr_hook('MODI_SNOW_HEAT_TO_T_WLIQ:SNOW_HEAT_TO_T_WLIQ_1D',1,zhook_handle)
87 !
88 !---------------------------------------------------------------------------
89 !
90 END SUBROUTINE snow_heat_to_t_wliq_1d
91 !
92 ! ###########################################
93 SUBROUTINE snow_heat_to_t_wliq_2d(PHEAT,PRHO,PT,PWLIQ)
94 ! ###########################################
95 !
96 USE modd_surf_par, ONLY : xundef
97 USE modd_csts, ONLY : xtt, xlmtt
98 USE mode_snow3l
99 !
100 !
101 USE yomhook ,ONLY : lhook, dr_hook
102 USE parkind1 ,ONLY : jprb
103 !
104 IMPLICIT NONE
105 !
106 !
107 !
108 !* 0.1 declarations of arguments
109 !
110 REAL, DIMENSION(:,:), INTENT(IN) :: pheat ! snow heat density (J/m3)
111 REAL, DIMENSION(:,:), INTENT(IN) :: prho ! snow density (kg/m3)
112 REAL, DIMENSION(:,:), INTENT(OUT) :: pt ! snow temperature profile (K)
113 REAL, DIMENSION(:,:), INTENT(OUT), OPTIONAL:: pwliq ! liquid water profile (kg/m3)
114 REAL(KIND=JPRB) :: zhook_handle
115 !
116 !
117 !* 0.2 declarations of local variables
118 !
119 !---------------------------------------------------------------------------
120 !
121 IF (lhook) CALL dr_hook('MODI_SNOW_HEAT_TO_T_WLIQ:SNOW_HEAT_TO_T_WLIQ_2D',0,zhook_handle)
122 pt = xundef
123 IF (present(pwliq)) pwliq = xundef
124 !
125 !* temperature from heat
126 !
127 WHERE(prho/=xundef) pt = xtt + (pheat + xlmtt*prho) / snow3lscap(prho)
128 !
129 !* effect of liquid water
130 !
131 IF (present(pwliq)) THEN
132  WHERE(prho/=xundef) pwliq = (pt-xtt) * snow3lscap(prho) / xlmtt
133 END IF
134 !
135 !* physical limits
136 !
137 IF (present(pwliq)) THEN
138  pt = min(xtt,pt)
139  pwliq = max(0.,pwliq)
140  pwliq = min(snow3lwliqmax(prho),pwliq)
141 END IF
142 IF (lhook) CALL dr_hook('MODI_SNOW_HEAT_TO_T_WLIQ:SNOW_HEAT_TO_T_WLIQ_2D',1,zhook_handle)
143 !
144 !---------------------------------------------------------------------------
145 !
146 END SUBROUTINE snow_heat_to_t_wliq_2d
147 !
148 ! ###########################################
149 SUBROUTINE snow_heat_to_t_wliq_3d(PHEAT,PRHO,PT,PWLIQ)
150 ! ###########################################
151 !
152 USE modd_surf_par, ONLY : xundef
153 USE modd_csts, ONLY : xtt, xlmtt
154 USE mode_snow3l
155 !
156 !
157 USE yomhook ,ONLY : lhook, dr_hook
158 USE parkind1 ,ONLY : jprb
159 !
160 IMPLICIT NONE
161 !
162 !
163 !
164 !* 0.1 declarations of arguments
165 !
166 REAL, DIMENSION(:,:,:), INTENT(IN) :: pheat ! snow heat density (J/m3)
167 REAL, DIMENSION(:,:,:), INTENT(IN) :: prho ! snow density (kg/m3)
168 REAL, DIMENSION(:,:,:), INTENT(OUT) :: pt ! snow temperature profile (K)
169 REAL, DIMENSION(:,:,:), INTENT(OUT), OPTIONAL:: pwliq ! liquid water profile (kg/m3)
170 REAL(KIND=JPRB) :: zhook_handle
171 !
172 !
173 !* 0.2 declarations of local variables
174 !
175 !---------------------------------------------------------------------------
176 !
177 IF (lhook) CALL dr_hook('MODI_SNOW_HEAT_TO_T_WLIQ:SNOW_HEAT_TO_T_WLIQ_3D',0,zhook_handle)
178 pt = xundef
179 IF (present(pwliq)) pwliq = xundef
180 !
181 !* temperature from heat
182 !
183 WHERE(prho/=xundef) pt = xtt + (pheat + xlmtt*prho) / snow3lscap(prho)
184 !
185 !* effect of liquid water
186 !
187 IF (present(pwliq)) THEN
188  WHERE(prho/=xundef) pwliq = (pt-xtt) * snow3lscap(prho) / xlmtt
189 END IF
190 !
191 !* physical limits
192 !
193 IF (present(pwliq)) THEN
194  pt = min(xtt,pt)
195  pwliq = max(0.,pwliq)
196  pwliq = min(snow3lwliqmax(prho),pwliq)
197 END IF
198 IF (lhook) CALL dr_hook('MODI_SNOW_HEAT_TO_T_WLIQ:SNOW_HEAT_TO_T_WLIQ_3D',1,zhook_handle)
199 !
200 !---------------------------------------------------------------------------
201 !
202 END SUBROUTINE snow_heat_to_t_wliq_3d
subroutine snow_heat_to_t_wliq_2d(PHEAT, PRHO, PT, PWLIQ)
subroutine snow_heat_to_t_wliq_3d(PHEAT, PRHO, PT, PWLIQ)
subroutine snow_heat_to_t_wliq_1d(PHEAT, PRHO, PT, PWLIQ)