/[lmdze]/trunk/phylmd/Interface_surf/interfsurf_hq.f
ViewVC logotype

Contents of /trunk/phylmd/Interface_surf/interfsurf_hq.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 223 - (show annotations)
Fri Apr 28 13:22:36 2017 UTC (7 years ago) by guez
Original Path: trunk/Sources/phylmd/Interface_surf/interfsurf_hq.f
File size: 11165 byte(s)
In clmain, local variable yfder was computed but not used. I think it
was useful for coupling only. Variable fder_print of pbl_surface in
LMDZ, which is output by LMDZ, corresponds to variable fder of physiq
in LMDZ and LMDZE.

1 module interfsurf_hq_m
2
3 implicit none
4
5 contains
6
7 SUBROUTINE interfsurf_hq(dtime, julien, rmu0, nisurf, knindex, debut, &
8 tsoil, qsol, u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, &
9 peqAcoef, petBcoef, peqBcoef, precip_rain, precip_snow, rugos, rugoro, &
10 snow, qsurf, ts, p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, &
11 dflux_s, tsurf_new, albedo, z0_new, pctsrf_new_sic, agesno, fqcalving, &
12 ffonte, run_off_lic_0)
13
14 ! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface
15 ! en g\'en\'eral (sols continentaux, oc\'eans, glaces) pour les flux de
16 ! chaleur et d'humidit\'e.
17
18 ! Laurent Fairhead, February 2000
19
20 USE abort_gcm_m, ONLY: abort_gcm
21 use alboc_cd_m, only: alboc_cd
22 USE albsno_m, ONLY: albsno
23 use calbeta_m, only: calbeta
24 USE calcul_fluxs_m, ONLY: calcul_fluxs
25 use clesphys2, only: soil_model
26 USE dimphy, ONLY: klon
27 USE fonte_neige_m, ONLY: fonte_neige
28 USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter
29 USE interface_surf, ONLY: conf_interface
30 USE interfsur_lim_m, ONLY: interfsur_lim
31 use read_sst_m, only: read_sst
32 use soil_m, only: soil
33 USE suphec_m, ONLY: rcpd, rtt
34
35 real, intent(IN):: dtime ! pas de temps de la physique (en s)
36 integer, intent(IN):: julien ! jour dans l'annee en cours
37 real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal
38 integer, intent(IN):: nisurf ! index de la surface a traiter
39
40 integer, intent(in):: knindex(:) ! (knon)
41 ! index des points de la surface a traiter
42
43 logical, intent(IN):: debut ! 1er appel a la physique
44 ! (si false calcul simplifie des fluxs sur les continents)
45
46 REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx)
47
48 REAL, intent(INOUT):: qsol(klon)
49 ! column-density of water in soil, in kg m-2
50
51 real, dimension(klon), intent(IN):: u1_lay, v1_lay
52 ! u1_lay vitesse u 1ere couche
53 ! v1_lay vitesse v 1ere couche
54 real, dimension(klon), intent(IN):: temp_air, spechum
55 ! temp_air temperature de l'air 1ere couche
56 ! spechum humidite specifique 1ere couche
57 real, dimension(klon), intent(INOUT):: tq_cdrag ! coefficient d'echange
58
59 real, dimension(klon), intent(IN):: petAcoef, peqAcoef
60 ! coefficients A de la r\'esolution de la couche limite pour t et q
61
62 real, dimension(klon), intent(IN):: petBcoef, peqBcoef
63 ! coefficients B de la r\'esolution de la couche limite pour t et q
64
65 real, intent(IN):: precip_rain(klon)
66 ! precipitation, liquid water mass flux (kg / m2 / s), positive down
67
68 real, intent(IN):: precip_snow(klon)
69 ! precipitation, solid water mass flux (kg / m2 / s), positive down
70
71 real, intent(IN):: rugos(klon) ! rugosite
72 real, intent(IN):: rugoro(klon) ! rugosite orographique
73 real, intent(INOUT):: snow(:) ! (knon)
74 real, intent(INOUT):: qsurf(klon)
75 real, intent(IN):: ts(:) ! (knon) temp\'erature de surface
76 real, intent(IN):: p1lay(klon) ! pression 1er niveau (milieu de couche)
77 real, dimension(klon), intent(IN):: ps ! pression au sol
78 REAL, INTENT(INOUT):: radsol(:) ! (knon) rayonnement net au sol (LW + SW)
79 real, intent(OUT):: evap(:) ! (knon) evaporation totale
80
81 real, intent(OUT):: flux_t(:) ! (knon) flux de chaleur sensible
82 ! (Cp T) à la surface, positif vers le bas, W / m2
83
84 real, intent(OUT):: fluxlat(:) ! (knon) flux de chaleur latente
85 real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon)
86 real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol
87 real, intent(OUT):: albedo(:) ! (knon) albedo
88 real, intent(OUT):: z0_new(klon) ! surface roughness
89
90 real, intent(in):: pctsrf_new_sic(:) ! (klon)
91 ! nouvelle repartition des surfaces
92
93 real, intent(INOUT):: agesno(:) ! (knon)
94
95 ! Flux d'eau "perdue" par la surface et n\'ecessaire pour limiter la
96 ! hauteur de neige, en kg / m2 / s
97 real, dimension(klon), intent(INOUT):: fqcalving
98
99 ! Flux thermique utiliser pour fondre la neige
100 real, dimension(klon), intent(INOUT):: ffonte
101
102 real, dimension(klon), intent(INOUT):: run_off_lic_0
103 ! run_off_lic_0 runoff glacier du pas de temps precedent
104
105 ! Local:
106 integer knon ! nombre de points de la surface a traiter
107 REAL soilcap(size(knindex)) ! (knon)
108 REAL soilflux(size(knindex)) ! (knon)
109 logical:: first_call = .true.
110 integer ii
111 real cal(size(knindex)) ! (knon)
112 real beta(size(knindex)) ! (knon) evap reelle
113 real dif_grnd(klon), capsol(klon)
114 real, parameter:: calice = 1. / (5.1444e6 * 0.15), tau_gl = 86400. * 5.
115 real, parameter:: calsno = 1. / (2.3867e6 * 0.15)
116 real tsurf(size(knindex)) ! (knon)
117 real alb_neig(size(knindex)) ! (knon)
118 real zfra(size(knindex)) ! (knon)
119 REAL, PARAMETER:: fmagic = 1. ! facteur magique pour r\'egler l'alb\'edo
120
121 !-------------------------------------------------------------
122
123 knon = size(knindex)
124
125 ! On doit commencer par appeler les schemas de surfaces continentales
126 ! car l'ocean a besoin du ruissellement qui est y calcule
127
128 if (first_call) then
129 call conf_interface
130
131 if (nisurf /= is_ter .and. klon > 1) then
132 print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter
133 print *, 'or on doit commencer par les surfaces continentales'
134 call abort_gcm("interfsurf_hq", &
135 'On doit commencer par les surfaces continentales')
136 endif
137
138 if (is_oce > is_sic) then
139 print *, 'is_oce = ', is_oce, '> is_sic = ', is_sic
140 call abort_gcm("interfsurf_hq", &
141 "L'ocean doit etre traite avant la banquise")
142 endif
143
144 first_call = .false.
145 endif
146
147 ! Initialisations diverses
148
149 ffonte(1:knon) = 0.
150 fqcalving(1:knon) = 0.
151 dif_grnd = 999999.
152 capsol = 999999.
153 z0_new = 999999.
154
155 ! Aiguillage vers les differents schemas de surface
156
157 select case (nisurf)
158 case (is_ter)
159 ! Surface "terre", appel \`a l'interface avec les sols continentaux
160
161 ! Calcul age de la neige
162
163 ! Read albedo from the file containing boundary conditions then
164 ! add the albedo of snow:
165
166 call interfsur_lim(dtime, julien, knindex, debut, albedo, z0_new)
167
168 ! Calcul de snow et qsurf, hydrologie adapt\'ee
169 CALL calbeta(is_ter, snow, qsol(:knon), beta, capsol(:knon), &
170 dif_grnd(:knon))
171
172 IF (soil_model) THEN
173 CALL soil(dtime, is_ter, snow, ts, tsoil, soilcap, soilflux)
174 cal = RCPD / soilcap
175 radsol = radsol + soilflux
176 ELSE
177 cal = RCPD * capsol(:knon)
178 ENDIF
179
180 CALL calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag(:knon), &
181 ps(:knon), qsurf(:knon), radsol, dif_grnd(:knon), &
182 temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), &
183 petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &
184 peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)
185 CALL fonte_neige(is_ter, dtime, precip_rain(:knon), &
186 precip_snow(:knon), snow, qsol(:knon), tsurf_new, evap, &
187 fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))
188
189 call albsno(dtime, agesno, alb_neig, precip_snow(:knon))
190 where (snow < 0.0001) agesno = 0.
191 zfra = max(0., min(1., snow / (snow + 10.)))
192 albedo = alb_neig * zfra + albedo * (1. - zfra)
193 z0_new = sqrt(z0_new**2 + rugoro**2)
194 case (is_oce)
195 ! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean
196
197 call read_sst(julien, knindex, tsurf)
198 cal = 0.
199 beta = 1.
200 dif_grnd = 0.
201 call calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, &
202 tq_cdrag(:knon), ps(:knon), qsurf(:knon), radsol, &
203 dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay(:knon), &
204 v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &
205 peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)
206 agesno = 0.
207 albedo = alboc_cd(rmu0(knindex)) * fmagic
208 z0_new = sqrt(rugos**2 + rugoro**2)
209 case (is_sic)
210 ! Surface "glace de mer" appel a l'interface avec l'ocean
211
212 DO ii = 1, knon
213 IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then
214 snow(ii) = 0.
215 tsurf_new(ii) = RTT - 1.8
216 IF (soil_model) tsoil(ii, :) = RTT - 1.8
217 else
218 tsurf_new(ii) = ts(ii)
219 endif
220 enddo
221
222 CALL calbeta(is_sic, snow, qsol(:knon), beta, capsol(:knon), &
223 dif_grnd(:knon))
224
225 IF (soil_model) THEN
226 CALL soil(dtime, is_sic, snow, tsurf_new, tsoil, soilcap, &
227 soilflux)
228 cal = RCPD / soilcap
229 radsol = radsol + soilflux
230 dif_grnd = 0.
231 ELSE
232 dif_grnd = 1. / tau_gl
233 cal = RCPD * calice
234 WHERE (snow > 0.) cal = RCPD * calsno
235 ENDIF
236 tsurf = tsurf_new
237 beta = 1.
238
239 CALL calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, &
240 tq_cdrag(:knon), ps(:knon), qsurf(:knon), radsol, &
241 dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay(:knon), &
242 v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &
243 peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)
244 CALL fonte_neige(is_sic, dtime, precip_rain(:knon), &
245 precip_snow(:knon), snow, qsol(:knon), tsurf_new, evap, &
246 fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))
247
248 ! Compute the albedo:
249
250 CALL albsno(dtime, agesno, alb_neig, precip_snow(:knon))
251 WHERE (snow < 0.0001) agesno = 0.
252 zfra = MAX(0., MIN(1., snow / (snow + 10.)))
253 albedo = alb_neig * zfra + 0.6 * (1. - zfra)
254
255 z0_new = SQRT(0.002**2 + rugoro**2)
256 case (is_lic)
257 ! Surface "glacier continentaux" appel a l'interface avec le sol
258
259 IF (soil_model) THEN
260 CALL soil(dtime, is_lic, snow, ts, tsoil, soilcap, soilflux)
261 cal = RCPD / soilcap
262 radsol = radsol + soilflux
263 ELSE
264 cal = RCPD * calice
265 WHERE (snow > 0.) cal = RCPD * calsno
266 ENDIF
267 beta = 1.
268 dif_grnd = 0.
269
270 call calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag(:knon), &
271 ps(:knon), qsurf(:knon), radsol, dif_grnd(:knon), &
272 temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), &
273 petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &
274 peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)
275 call fonte_neige(is_lic, dtime, precip_rain(:knon), &
276 precip_snow(:knon), snow, qsol(:knon), tsurf_new, evap, &
277 fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))
278
279 ! calcul albedo
280 CALL albsno(dtime, agesno, alb_neig, precip_snow(:knon))
281 WHERE (snow < 0.0001) agesno = 0.
282 albedo = 0.77
283
284 ! Rugosite
285 z0_new = rugoro
286 case default
287 print *, 'Index surface = ', nisurf
288 call abort_gcm("interfsurf_hq", 'Index surface non valable')
289 end select
290
291 END SUBROUTINE interfsurf_hq
292
293 end module interfsurf_hq_m

  ViewVC Help
Powered by ViewVC 1.1.21