/[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 308 - (show annotations)
Tue Sep 18 15:14:40 2018 UTC (5 years, 7 months ago) by guez
File size: 8213 byte(s)
In procedure calcul_fluxs, rename coef1lay to cdragh (following
LMDZ). Use named constant min_wind_speed (following LMDZ).

Change name of NetCDF variable soll to CF standard rls.

1 module interfsurf_hq_m
2
3 implicit none
4
5 contains
6
7 SUBROUTINE interfsurf_hq(julien, mu0, nisurf, knindex, tsoil, qsol, u1lay, &
8 v1lay, temp_air, spechum, cdragh, tAcoef, qAcoef, tBcoef, qBcoef, &
9 rain_fall, snow_fall, rugos, rugoro, snow, qsurf, ts, p1lay, ps, &
10 radsol, evap, flux_t, fluxlat, dflux_l, dflux_s, tsurf_new, albedo, &
11 z0_new, pctsrf_new_sic, agesno, fqcalving, ffonte, run_off_lic_0, &
12 run_off_lic)
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 calcul_fluxs_m, ONLY: calcul_fluxs
24 USE fonte_neige_m, ONLY: fonte_neige
25 USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter
26 USE interfsur_lim_m, ONLY: interfsur_lim
27 use limit_read_sst_m, only: limit_read_sst
28 use soil_m, only: soil
29 USE suphec_m, ONLY: rcpd, rtt
30
31 integer, intent(IN):: julien ! jour dans l'annee en cours
32 real, intent(IN):: mu0(:) ! (knon) cosinus de l'angle solaire zenithal
33 integer, intent(IN):: nisurf ! index de la surface a traiter
34
35 integer, intent(in):: knindex(:) ! (knon)
36 ! index des points de la surface a traiter
37
38 REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx)
39
40 REAL, intent(INOUT):: qsol(:) ! (knon)
41 ! column-density of water in soil, in kg m-2
42
43 real, intent(IN):: u1lay(:), v1lay(:) ! (knon) vitesse 1ere couche
44
45 real, intent(IN):: temp_air(:) ! (knon) temperature de l'air 1ere couche
46 real, intent(IN):: spechum(:) ! (knon) humidite specifique 1ere couche
47 real, intent(IN):: cdragh(:) ! (knon) coefficient d'echange
48
49 real, intent(IN):: tAcoef(:), qAcoef(:) ! (knon)
50 ! coefficients A de la r\'esolution de la couche limite pour t et q
51
52 real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon)
53 ! coefficients B de la r\'esolution de la couche limite pour t et q
54
55 real, intent(IN):: rain_fall(:) ! (knon)
56 ! precipitation, liquid water mass flux (kg / m2 / s), positive down
57
58 real, intent(IN):: snow_fall(:) ! (knon)
59 ! precipitation, solid water mass flux (kg / m2 / s), positive down
60
61 real, intent(IN):: rugos(:) ! (knon) rugosite
62 real, intent(IN):: rugoro(:) ! (knon) rugosite orographique
63 real, intent(INOUT):: snow(:) ! (knon)
64 real, intent(OUT):: qsurf(:) ! (knon)
65 real, intent(IN):: ts(:) ! (knon) temp\'erature de surface
66 real, intent(IN):: p1lay(:) ! (knon) pression 1er niveau (milieu de couche)
67 real, intent(IN):: ps(:) ! (knon) pression au sol
68
69 REAL, INTENT(IN):: radsol(:) ! (knon)
70 ! surface net downward radiative flux, in W / m2
71
72 real, intent(OUT):: evap(:) ! (knon) evaporation totale
73
74 real, intent(OUT):: flux_t(:) ! (knon) flux de chaleur sensible
75 ! (Cp T) à la surface, positif vers le bas, W / m2
76
77 real, intent(OUT):: fluxlat(:) ! (knon) flux de chaleur latente
78 real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon)
79 real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol
80 real, intent(OUT):: albedo(:) ! (knon) albedo
81 real, intent(OUT):: z0_new(:) ! (knon) surface roughness
82
83 real, intent(in):: pctsrf_new_sic(:) ! (knon)
84 ! nouvelle repartition des surfaces
85
86 real, intent(INOUT):: agesno(:) ! (knon)
87
88 real, intent(OUT):: fqcalving(:) ! (knon)
89 ! Flux d'eau "perdue" par la surface et n\'ecessaire pour limiter la
90 ! hauteur de neige, en kg / m2 / s
91
92 real, intent(OUT):: ffonte(:) ! (knon)
93 ! flux thermique utilis\'e pour fondre la neige
94
95 real, intent(INOUT):: run_off_lic_0(:) ! (knon)
96 ! run_off_lic_0 runoff glacier du pas de temps precedent
97
98 REAL, intent(OUT):: run_off_lic(:) ! (knon) ruissellement total
99
100 ! Local:
101 REAL soilcap(size(knindex)) ! (knon)
102 REAL soilflux(size(knindex)) ! (knon)
103 integer ii
104 real cal(size(knindex)) ! (knon)
105 real beta(size(knindex)) ! (knon) evap reelle
106 real tsurf(size(knindex)) ! (knon)
107 real alb_neig(size(knindex)) ! (knon)
108 real zfra(size(knindex)) ! (knon)
109 REAL, PARAMETER:: fmagic = 1. ! facteur magique pour r\'egler l'alb\'edo
110 REAL, PARAMETER:: max_eau_sol = 150. ! in kg m-2
111 REAL, PARAMETER:: tau_gl = 86400. * 5.
112
113 !-------------------------------------------------------------
114
115 select case (nisurf)
116 case (is_ter)
117 ! Surface "terre", appel \`a l'interface avec les sols continentaux
118
119 ! Calcul age de la neige
120
121 ! Read albedo from the file containing boundary conditions then
122 ! add the albedo of snow:
123
124 call interfsur_lim(julien, knindex, albedo, z0_new)
125
126 beta = min(2. * qsol / max_eau_sol, 1.)
127 CALL soil(is_ter, snow, ts, tsoil, soilcap, soilflux)
128 cal = RCPD / soilcap
129
130 CALL calcul_fluxs(ts, p1lay, cal, beta, cdragh, ps, qsurf, &
131 radsol + soilflux, temp_air, spechum, u1lay, v1lay, tAcoef, &
132 qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &
133 dflux_l, dif_grnd = 0.)
134 CALL fonte_neige(is_ter, rain_fall, snow_fall, snow, qsol, &
135 tsurf_new, evap, fqcalving, ffonte, run_off_lic_0, run_off_lic)
136
137 call albsno(agesno, alb_neig, snow_fall)
138 where (snow < 0.0001) agesno = 0.
139 zfra = max(0., min(1., snow / (snow + 10.)))
140 albedo = alb_neig * zfra + albedo * (1. - zfra)
141 z0_new = sqrt(z0_new**2 + rugoro**2)
142 case (is_oce)
143 ! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean
144
145 ffonte = 0.
146 call limit_read_sst(julien, knindex, tsurf)
147 cal = 0.
148 beta = 1.
149 call calcul_fluxs(tsurf, p1lay, cal, beta, cdragh, ps, qsurf, radsol, &
150 temp_air, spechum, u1lay, v1lay, tAcoef, qAcoef, tBcoef, qBcoef, &
151 tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l, dif_grnd = 0.)
152 agesno = 0.
153 albedo = alboc_cd(mu0) * fmagic
154 z0_new = sqrt(rugos**2 + rugoro**2)
155 fqcalving = 0.
156 case (is_sic)
157 ! Surface "glace de mer" appel a l'interface avec l'ocean
158
159 DO ii = 1, size(knindex)
160 IF (pctsrf_new_sic(ii) < EPSFRA) then
161 snow(ii) = 0.
162 tsurf_new(ii) = RTT - 1.8
163 tsoil(ii, :) = RTT - 1.8
164 else
165 tsurf_new(ii) = ts(ii)
166 endif
167 enddo
168
169 CALL soil(is_sic, snow, tsurf_new, tsoil, soilcap, soilflux)
170 cal = RCPD / soilcap
171 tsurf = tsurf_new
172 beta = 1.
173 CALL calcul_fluxs(tsurf, p1lay, cal, beta, cdragh, ps, qsurf, &
174 radsol + soilflux, temp_air, spechum, u1lay, v1lay, tAcoef, &
175 qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &
176 dflux_l, dif_grnd = 1. / tau_gl)
177 CALL fonte_neige(is_sic, rain_fall, snow_fall, snow, qsol, &
178 tsurf_new, evap, fqcalving, ffonte, run_off_lic_0, run_off_lic)
179
180 ! Compute the albedo:
181
182 CALL albsno(agesno, alb_neig, snow_fall)
183 WHERE (snow < 0.0001) agesno = 0.
184 zfra = MAX(0., MIN(1., snow / (snow + 10.)))
185 albedo = alb_neig * zfra + 0.6 * (1. - zfra)
186
187 z0_new = SQRT(0.002**2 + rugoro**2)
188 case (is_lic)
189 ! Surface "glacier continentaux" appel a l'interface avec le sol
190
191 CALL soil(is_lic, snow, ts, tsoil, soilcap, soilflux)
192 cal = RCPD / soilcap
193 beta = 1.
194 call calcul_fluxs(ts, p1lay, cal, beta, cdragh, ps, qsurf, &
195 radsol + soilflux, temp_air, spechum, u1lay, v1lay, tAcoef, &
196 qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &
197 dflux_l, dif_grnd = 0.)
198 call fonte_neige(is_lic, rain_fall, snow_fall, snow, qsol, &
199 tsurf_new, evap, fqcalving, ffonte, run_off_lic_0, run_off_lic)
200
201 ! calcul albedo
202 CALL albsno(agesno, alb_neig, snow_fall)
203 WHERE (snow < 0.0001) agesno = 0.
204 albedo = 0.77
205
206 ! Rugosite
207 z0_new = rugoro
208 case default
209 print *, 'Index surface = ', nisurf
210 call abort_gcm("interfsurf_hq", 'Index surface non valable')
211 end select
212
213 END SUBROUTINE interfsurf_hq
214
215 end module interfsurf_hq_m

  ViewVC Help
Powered by ViewVC 1.1.21