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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 344 - (show annotations)
Tue Nov 12 15:18:14 2019 UTC (4 years, 6 months ago) by guez
File size: 8219 byte(s)
Replace pi / 180 by `deg_to_rad`

In procedure etat0, rename variable tsoil to ftsoil, which is the
corresponding name in the gcm program.

In `laplacien_gam`, replace call to scopy by array assignment.

Replace pi / 180 by `deg_to_rad` in `start_init_phys`.

Encapsulate diagcld1 and orolift in modules.

Avoid duplicated computation in `interfsurf_hq`.

Promote internal function fz of procedure soil to function of module
`soil_m`.  Use `new_unit` in procedure soil.

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

  ViewVC Help
Powered by ViewVC 1.1.21