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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 311 - (hide annotations)
Mon Dec 3 17:52:21 2018 UTC (5 years, 5 months ago) by guez
File size: 8242 byte(s)
Move file cv_thermo.f to directory CV30_routines since it is only used
there. Rename module cv_thermo_m to cv_thermo.

Named constants instead of variables in module suphec_m.

Rename dummy argument spechum of procedure interfsurf_hq to q1lay
(same as corresponding dummy argument in calcul_fluxs).

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

  ViewVC Help
Powered by ViewVC 1.1.21