4 |
|
|
5 |
contains |
contains |
6 |
|
|
7 |
SUBROUTINE interfsurf_hq(itime, dtime, jour, rmu0, klon, iim, jjm, & |
SUBROUTINE interfsurf_hq(itime, dtime, jour, rmu0, iim, jjm, nisurf, knon, & |
8 |
nisurf, knon, knindex, pctsrf, rlat, debut, & |
knindex, pctsrf, rlat, debut, soil_model, nsoilmx, tsoil, qsol, & |
9 |
ok_veget, soil_model, nsoilmx, tsoil, qsol, u1_lay, v1_lay, & |
u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, peqAcoef, & |
10 |
temp_air, spechum, tq_cdrag, petAcoef, peqAcoef, & |
petBcoef, peqBcoef, precip_rain, precip_snow, fder, rugos, rugoro, & |
11 |
petBcoef, peqBcoef, precip_rain, precip_snow, & |
snow, qsurf, tsurf, p1lay, ps, radsol, evap, fluxsens, fluxlat, & |
12 |
fder, rugos, rugoro, snow, qsurf, & |
dflux_l, dflux_s, tsurf_new, alb_new, alblw, z0_new, pctsrf_new, & |
13 |
tsurf, p1lay, ps, radsol, ocean, evap, fluxsens, & |
agesno, fqcalving, ffonte, run_off_lic_0, flux_o, flux_g, tslab, seaice) |
|
fluxlat, dflux_l, dflux_s, tsurf_new, alb_new, alblw, & |
|
|
z0_new, pctsrf_new, agesno, fqcalving, ffonte, & |
|
|
run_off_lic_0, flux_o, flux_g, tslab, seaice) |
|
14 |
|
|
15 |
! Cette routine sert d'aiguillage entre l'atmosphère et la surface |
! Cette routine sert d'aiguillage entre l'atmosphère et la surface |
16 |
! en général (sols continentaux, océans, glaces) pour les flux de |
! en général (sols continentaux, océans, glaces) pour les flux de |
17 |
! chaleur et d'humidité. En pratique l'interface se fait entre la |
! chaleur et d'humidité. |
|
! couche limite du modèle atmosphérique ("clmain.F") et les |
|
|
! routines de surface ("sechiba", "oasis"...). |
|
18 |
|
|
19 |
! Laurent Fairhead 02/2000 |
! Laurent Fairhead, 02/2000 |
20 |
|
|
21 |
USE abort_gcm_m, ONLY: abort_gcm |
USE abort_gcm_m, ONLY: abort_gcm |
22 |
USE albsno_m, ONLY: albsno |
USE albsno_m, ONLY: albsno |
23 |
USE calcul_fluxs_m, ONLY: calcul_fluxs |
USE calcul_fluxs_m, ONLY: calcul_fluxs |
24 |
|
USE dimphy, ONLY: klon |
25 |
USE fonte_neige_m, ONLY: fonte_neige |
USE fonte_neige_m, ONLY: fonte_neige |
|
USE gath_cpl, ONLY: gath2cpl |
|
26 |
USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf |
USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf |
27 |
USE interface_surf, ONLY: coastalflow, riverflow, run_off, & |
USE interface_surf, ONLY: coastalflow, riverflow, run_off, & |
28 |
run_off_lic, conf_interface, tmp_rcoa, tmp_rlic, tmp_rriv |
run_off_lic, conf_interface |
29 |
USE interfoce_lim_m, ONLY: interfoce_lim |
USE interfoce_lim_m, ONLY: interfoce_lim |
30 |
USE interfoce_slab_m, ONLY: interfoce_slab |
USE interfoce_slab_m, ONLY: interfoce_slab |
31 |
USE interfsur_lim_m, ONLY: interfsur_lim |
USE interfsur_lim_m, ONLY: interfsur_lim |
32 |
USE suphec_m, ONLY: rcpd, rlstt, rlvtt, rtt |
USE suphec_m, ONLY: rcpd, rlstt, rlvtt, rtt |
33 |
|
|
34 |
! Parametres d'entree |
integer, intent(IN):: itime ! numero du pas de temps |
35 |
! input: |
real, intent(IN):: dtime ! pas de temps de la physique (en s) |
36 |
! klon nombre total de points de grille |
integer, intent(IN):: jour ! jour dans l'annee en cours |
37 |
|
real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal |
38 |
|
integer, intent(IN):: iim, jjm |
39 |
! iim, jjm nbres de pts de grille |
! iim, jjm nbres de pts de grille |
40 |
! dtime pas de temps de la physique (en s) |
integer, intent(IN):: nisurf |
|
! jour jour dans l'annee en cours, |
|
|
! rmu0 cosinus de l'angle solaire zenithal |
|
41 |
! nisurf index de la surface a traiter (1 = sol continental) |
! nisurf index de la surface a traiter (1 = sol continental) |
42 |
|
integer, intent(IN):: knon |
43 |
! knon nombre de points de la surface a traiter |
! knon nombre de points de la surface a traiter |
44 |
|
integer, intent(in):: knindex(klon) |
45 |
! knindex index des points de la surface a traiter |
! knindex index des points de la surface a traiter |
46 |
|
real, intent(IN):: pctsrf(klon, nbsrf) |
47 |
! pctsrf tableau des pourcentages de surface de chaque maille |
! pctsrf tableau des pourcentages de surface de chaque maille |
48 |
|
real, dimension(klon), intent(IN):: rlat |
49 |
! rlat latitudes |
! rlat latitudes |
50 |
|
logical, intent(IN):: debut |
51 |
! debut logical: 1er appel a la physique |
! debut logical: 1er appel a la physique |
|
! ok_veget logical: appel ou non au schema de surface continental |
|
52 |
! (si false calcul simplifie des fluxs sur les continents) |
! (si false calcul simplifie des fluxs sur les continents) |
53 |
|
!! PB ajout pour soil |
54 |
|
logical, intent(in):: soil_model |
55 |
|
integer:: nsoilmx |
56 |
|
REAL, DIMENSION(klon, nsoilmx):: tsoil |
57 |
|
REAL, dimension(klon), intent(INOUT):: qsol |
58 |
|
real, dimension(klon), intent(IN):: u1_lay, v1_lay |
59 |
! u1_lay vitesse u 1ere couche |
! u1_lay vitesse u 1ere couche |
60 |
! v1_lay vitesse v 1ere couche |
! v1_lay vitesse v 1ere couche |
61 |
|
real, dimension(klon), intent(IN):: temp_air, spechum |
62 |
! temp_air temperature de l'air 1ere couche |
! temp_air temperature de l'air 1ere couche |
63 |
! spechum humidite specifique 1ere couche |
! spechum humidite specifique 1ere couche |
64 |
|
real, dimension(klon), intent(INOUT):: tq_cdrag |
65 |
! tq_cdrag cdrag |
! tq_cdrag cdrag |
66 |
|
real, dimension(klon), intent(IN):: petAcoef, peqAcoef |
67 |
! petAcoef coeff. A de la resolution de la CL pour t |
! petAcoef coeff. A de la resolution de la CL pour t |
68 |
! peqAcoef coeff. A de la resolution de la CL pour q |
! peqAcoef coeff. A de la resolution de la CL pour q |
69 |
|
real, dimension(klon), intent(IN):: petBcoef, peqBcoef |
70 |
! petBcoef coeff. B de la resolution de la CL pour t |
! petBcoef coeff. B de la resolution de la CL pour t |
71 |
! peqBcoef coeff. B de la resolution de la CL pour q |
! peqBcoef coeff. B de la resolution de la CL pour q |
72 |
|
real, dimension(klon), intent(IN):: precip_rain, precip_snow |
73 |
! precip_rain precipitation liquide |
! precip_rain precipitation liquide |
74 |
! precip_snow precipitation solide |
! precip_snow precipitation solide |
75 |
! tsurf temperature de surface |
REAL, DIMENSION(klon), INTENT(INOUT):: fder |
|
! tslab temperature slab ocean |
|
|
! pctsrf_slab pourcentages (0-1) des sous-surfaces dans le slab |
|
|
! tmp_pctsrf_slab = pctsrf_slab |
|
|
! p1lay pression 1er niveau (milieu de couche) |
|
|
! ps pression au sol |
|
|
! radsol rayonnement net aus sol (LW + SW) |
|
|
! ocean type d'ocean utilise ("force" ou "slab" mais pas "couple") |
|
76 |
! fder derivee des flux (pour le couplage) |
! fder derivee des flux (pour le couplage) |
77 |
|
real, dimension(klon), intent(IN):: rugos, rugoro |
78 |
! rugos rugosite |
! rugos rugosite |
79 |
! rugoro rugosite orographique |
! rugoro rugosite orographique |
80 |
! run_off_lic_0 runoff glacier du pas de temps precedent |
real, dimension(klon), intent(INOUT):: snow, qsurf |
|
integer, intent(IN):: itime ! numero du pas de temps |
|
|
integer, intent(IN):: iim, jjm |
|
|
integer, intent(IN):: klon |
|
|
real, intent(IN):: dtime |
|
|
integer, intent(IN):: jour |
|
|
real, intent(IN):: rmu0(klon) |
|
|
integer, intent(IN):: nisurf |
|
|
integer, intent(IN):: knon |
|
|
integer, dimension(klon), intent(in):: knindex |
|
|
real, intent(IN):: pctsrf(klon, nbsrf) |
|
|
logical, intent(IN):: debut, ok_veget |
|
|
real, dimension(klon), intent(IN):: rlat |
|
|
real, dimension(klon), intent(INOUT):: tq_cdrag |
|
|
real, dimension(klon), intent(IN):: u1_lay, v1_lay |
|
|
real, dimension(klon), intent(IN):: temp_air, spechum |
|
|
real, dimension(klon), intent(IN):: petAcoef, peqAcoef |
|
|
real, dimension(klon), intent(IN):: petBcoef, peqBcoef |
|
|
real, dimension(klon), intent(IN):: precip_rain, precip_snow |
|
|
real, dimension(klon), intent(IN):: ps |
|
81 |
real, dimension(klon), intent(IN):: tsurf, p1lay |
real, dimension(klon), intent(IN):: tsurf, p1lay |
82 |
!IM: "slab" ocean |
! tsurf temperature de surface |
83 |
real, dimension(klon), intent(INOUT):: tslab |
! p1lay pression 1er niveau (milieu de couche) |
84 |
real, allocatable, dimension(:), save:: tmp_tslab |
real, dimension(klon), intent(IN):: ps |
85 |
real, dimension(klon), intent(OUT):: flux_o, flux_g |
! ps pression au sol |
86 |
real, dimension(klon), intent(INOUT):: seaice ! glace de mer (kg/m2) |
REAL, DIMENSION(klon), INTENT(INOUT):: radsol |
87 |
REAL, DIMENSION(klon), INTENT(INOUT):: radsol, fder |
! radsol rayonnement net aus sol (LW + SW) |
88 |
real, dimension(klon), intent(IN):: rugos, rugoro |
real, dimension(klon), intent(INOUT):: evap |
|
character(len=*), intent(IN):: ocean |
|
|
real, dimension(klon), intent(INOUT):: evap, snow, qsurf |
|
|
!! PB ajout pour soil |
|
|
logical, intent(in):: soil_model |
|
|
integer:: nsoilmx |
|
|
REAL, DIMENSION(klon, nsoilmx):: tsoil |
|
|
REAL, dimension(klon), intent(INOUT):: qsol |
|
|
REAL, dimension(klon):: soilcap |
|
|
REAL, dimension(klon):: soilflux |
|
|
|
|
|
! Parametres de sortie |
|
|
! output: |
|
89 |
! evap evaporation totale |
! evap evaporation totale |
90 |
|
real, dimension(klon), intent(OUT):: fluxsens, fluxlat |
91 |
! fluxsens flux de chaleur sensible |
! fluxsens flux de chaleur sensible |
92 |
! fluxlat flux de chaleur latente |
! fluxlat flux de chaleur latente |
93 |
|
real, dimension(klon), intent(OUT):: dflux_l, dflux_s |
94 |
|
real, dimension(klon), intent(OUT):: tsurf_new, alb_new |
95 |
! tsurf_new temperature au sol |
! tsurf_new temperature au sol |
96 |
! alb_new albedo |
! alb_new albedo |
|
! z0_new surface roughness |
|
|
! pctsrf_new nouvelle repartition des surfaces |
|
|
real, dimension(klon), intent(OUT):: fluxsens, fluxlat |
|
|
real, dimension(klon), intent(OUT):: tsurf_new, alb_new |
|
97 |
real, dimension(klon), intent(OUT):: alblw |
real, dimension(klon), intent(OUT):: alblw |
98 |
real, dimension(klon), intent(OUT):: z0_new |
real, dimension(klon), intent(OUT):: z0_new |
99 |
real, dimension(klon), intent(OUT):: dflux_l, dflux_s |
! z0_new surface roughness |
100 |
real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new |
real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new |
101 |
|
! pctsrf_new nouvelle repartition des surfaces |
102 |
real, dimension(klon), intent(INOUT):: agesno |
real, dimension(klon), intent(INOUT):: agesno |
|
real, dimension(klon), intent(INOUT):: run_off_lic_0 |
|
103 |
|
|
|
! Flux thermique utiliser pour fondre la neige |
|
|
!jld a rajouter real, dimension(klon), intent(INOUT):: ffonte |
|
|
real, dimension(klon), intent(INOUT):: ffonte |
|
104 |
! Flux d'eau "perdue" par la surface et nécessaire pour que limiter la |
! Flux d'eau "perdue" par la surface et nécessaire pour que limiter la |
105 |
! hauteur de neige, en kg/m2/s |
! hauteur de neige, en kg/m2/s |
106 |
!jld a rajouter real, dimension(klon), intent(INOUT):: fqcalving |
!jld a rajouter real, dimension(klon), intent(INOUT):: fqcalving |
107 |
real, dimension(klon), intent(INOUT):: fqcalving |
real, dimension(klon), intent(INOUT):: fqcalving |
108 |
!IM: "slab" ocean - Local |
|
109 |
|
! Flux thermique utiliser pour fondre la neige |
110 |
|
!jld a rajouter real, dimension(klon), intent(INOUT):: ffonte |
111 |
|
real, dimension(klon), intent(INOUT):: ffonte |
112 |
|
|
113 |
|
real, dimension(klon), intent(INOUT):: run_off_lic_0 |
114 |
|
! run_off_lic_0 runoff glacier du pas de temps precedent |
115 |
|
|
116 |
|
!IM: "slab" ocean |
117 |
|
real, dimension(klon), intent(OUT):: flux_o, flux_g |
118 |
|
real, dimension(klon), intent(INOUT):: tslab |
119 |
|
! tslab temperature slab ocean |
120 |
|
real, dimension(klon), intent(INOUT):: seaice ! glace de mer (kg/m2) |
121 |
|
|
122 |
|
! Local: |
123 |
|
|
124 |
|
real, allocatable, dimension(:), save:: tmp_tslab |
125 |
|
REAL, dimension(klon):: soilcap |
126 |
|
REAL, dimension(klon):: soilflux |
127 |
|
|
128 |
|
!IM: "slab" ocean |
129 |
real, parameter:: t_grnd=271.35 |
real, parameter:: t_grnd=271.35 |
130 |
real, dimension(klon):: zx_sl |
real, dimension(klon):: zx_sl |
131 |
integer i |
integer i |
132 |
real, allocatable, dimension(:), save:: tmp_flux_o, tmp_flux_g |
real, allocatable, dimension(:), save:: tmp_flux_o, tmp_flux_g |
133 |
real, allocatable, dimension(:), save:: tmp_radsol |
real, allocatable, dimension(:), save:: tmp_radsol |
134 |
real, allocatable, dimension(:, :), save:: tmp_pctsrf_slab |
real, allocatable, dimension(:, :), save:: tmp_pctsrf_slab |
135 |
|
! pctsrf_slab pourcentages (0-1) des sous-surfaces dans le slab |
136 |
|
! tmp_pctsrf_slab = pctsrf_slab |
137 |
real, allocatable, dimension(:), save:: tmp_seaice |
real, allocatable, dimension(:), save:: tmp_seaice |
138 |
|
|
|
! Local |
|
139 |
character (len = 20), save:: modname = 'interfsurf_hq' |
character (len = 20), save:: modname = 'interfsurf_hq' |
140 |
character (len = 80):: abort_message |
character (len = 80):: abort_message |
141 |
logical, save:: first_call = .true. |
logical, save:: first_call = .true. |
148 |
real, dimension(klon):: tsurf_temp |
real, dimension(klon):: tsurf_temp |
149 |
real, dimension(klon):: alb_neig, alb_eau |
real, dimension(klon):: alb_neig, alb_eau |
150 |
real, DIMENSION(klon):: zfra |
real, DIMENSION(klon):: zfra |
|
logical:: cumul = .false. |
|
151 |
INTEGER, dimension(1):: iloc |
INTEGER, dimension(1):: iloc |
152 |
real, dimension(klon):: fder_prev |
real, dimension(klon):: fder_prev |
153 |
REAL, dimension(klon):: bidule |
REAL, dimension(klon):: bidule |
168 |
abort_message='voir ci-dessus' |
abort_message='voir ci-dessus' |
169 |
call abort_gcm(modname, abort_message, 1) |
call abort_gcm(modname, abort_message, 1) |
170 |
endif |
endif |
|
if (ocean /= 'slab' .and. ocean /= 'force') then |
|
|
write(*, *)' *** Warning ***' |
|
|
write(*, *)'Option couplage pour l''ocean = ', ocean |
|
|
abort_message='option pour l''ocean non valable' |
|
|
call abort_gcm(modname, abort_message, 1) |
|
|
endif |
|
171 |
if ( is_oce > is_sic ) then |
if ( is_oce > is_sic ) then |
172 |
write(*, *)' *** Warning ***' |
write(*, *)' *** Warning ***' |
173 |
write(*, *)' Pour des raisons de sequencement dans le code' |
write(*, *)' Pour des raisons de sequencement dans le code' |
264 |
! Aiguillage vers les differents schemas de surface |
! Aiguillage vers les differents schemas de surface |
265 |
|
|
266 |
if (nisurf == is_ter) then |
if (nisurf == is_ter) then |
|
|
|
267 |
! Surface "terre" appel a l'interface avec les sols continentaux |
! Surface "terre" appel a l'interface avec les sols continentaux |
268 |
|
|
269 |
! allocation du run-off |
! allocation du run-off |
283 |
abort_message='Pb allocation run_off' |
abort_message='Pb allocation run_off' |
284 |
call abort_gcm(modname, abort_message, 1) |
call abort_gcm(modname, abort_message, 1) |
285 |
endif |
endif |
|
!cym |
|
|
run_off=0.0 |
|
|
!cym |
|
|
|
|
|
!!$PB |
|
|
ALLOCATE (tmp_rriv(iim, jjm+1), stat=error) |
|
|
if (error /= 0) then |
|
|
abort_message='Pb allocation tmp_rriv' |
|
|
call abort_gcm(modname, abort_message, 1) |
|
|
endif |
|
|
ALLOCATE (tmp_rcoa(iim, jjm+1), stat=error) |
|
|
if (error /= 0) then |
|
|
abort_message='Pb allocation tmp_rcoa' |
|
|
call abort_gcm(modname, abort_message, 1) |
|
|
endif |
|
|
ALLOCATE (tmp_rlic(iim, jjm+1), stat=error) |
|
|
if (error /= 0) then |
|
|
abort_message='Pb allocation tmp_rlic' |
|
|
call abort_gcm(modname, abort_message, 1) |
|
|
endif |
|
|
tmp_rriv = 0.0 |
|
|
tmp_rcoa = 0.0 |
|
|
tmp_rlic = 0.0 |
|
286 |
|
|
287 |
!!$ |
run_off=0.0 |
288 |
else if (size(coastalflow) /= knon) then |
else if (size(coastalflow) /= knon) then |
289 |
write(*, *)'Bizarre, le nombre de points continentaux' |
write(*, *)'Bizarre, le nombre de points continentaux' |
290 |
write(*, *)'a change entre deux appels. J''arrete ...' |
write(*, *)'a change entre deux appels. J''arrete ...' |
296 |
|
|
297 |
! Calcul age de la neige |
! Calcul age de la neige |
298 |
|
|
299 |
if (.not. ok_veget) then |
! calcul albedo: lecture albedo fichier boundary conditions |
300 |
! calcul albedo: lecture albedo fichier boundary conditions |
! puis ajout albedo neige |
301 |
! puis ajout albedo neige |
call interfsur_lim(itime, dtime, jour, nisurf, knon, knindex, & |
302 |
call interfsur_lim(itime, dtime, jour, klon, nisurf, knon, knindex, & |
debut, alb_new, z0_new) |
303 |
debut, alb_new, z0_new) |
|
304 |
|
! calcul snow et qsurf, hydrol adapté |
305 |
! calcul snow et qsurf, hydrol adapté |
CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd) |
306 |
CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd) |
|
307 |
|
IF (soil_model) THEN |
308 |
IF (soil_model) THEN |
CALL soil(dtime, nisurf, knon, snow, tsurf, tsoil, soilcap, & |
309 |
CALL soil(dtime, nisurf, knon, snow, tsurf, tsoil, soilcap, & |
soilflux) |
310 |
soilflux) |
cal(1:knon) = RCPD / soilcap(1:knon) |
311 |
cal(1:knon) = RCPD / soilcap(1:knon) |
radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) |
312 |
radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) |
ELSE |
313 |
ELSE |
cal = RCPD * capsol |
314 |
cal = RCPD * capsol |
ENDIF |
315 |
ENDIF |
CALL calcul_fluxs( klon, knon, nisurf, dtime, & |
316 |
CALL calcul_fluxs( klon, knon, nisurf, dtime, & |
tsurf, p1lay, cal, beta, tq_cdrag, ps, & |
317 |
tsurf, p1lay, cal, beta, tq_cdrag, ps, & |
precip_rain, precip_snow, snow, qsurf, & |
318 |
precip_rain, precip_snow, snow, qsurf, & |
radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
319 |
radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
petAcoef, peqAcoef, petBcoef, peqBcoef, & |
320 |
petAcoef, peqAcoef, petBcoef, peqBcoef, & |
tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) |
321 |
tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) |
|
322 |
|
CALL fonte_neige( klon, knon, nisurf, dtime, & |
323 |
CALL fonte_neige( klon, knon, nisurf, dtime, & |
tsurf, p1lay, cal, beta, tq_cdrag, ps, & |
324 |
tsurf, p1lay, cal, beta, tq_cdrag, ps, & |
precip_rain, precip_snow, snow, qsol, & |
325 |
precip_rain, precip_snow, snow, qsol, & |
radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
326 |
radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
petAcoef, peqAcoef, petBcoef, peqBcoef, & |
327 |
petAcoef, peqAcoef, petBcoef, peqBcoef, & |
tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l, & |
328 |
tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l, & |
fqcalving, ffonte, run_off_lic_0) |
329 |
fqcalving, ffonte, run_off_lic_0) |
|
330 |
|
call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow) |
331 |
call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow) |
where (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0. |
332 |
where (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0. |
zfra(1:knon) = max(0.0, min(1.0, snow(1:knon)/(snow(1:knon)+10.0))) |
333 |
zfra(1:knon) = max(0.0, min(1.0, snow(1:knon)/(snow(1:knon)+10.0))) |
alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + & |
334 |
alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + & |
alb_new(1 : knon)*(1.0-zfra(1:knon)) |
335 |
alb_new(1 : knon)*(1.0-zfra(1:knon)) |
z0_new = sqrt(z0_new**2+rugoro**2) |
336 |
z0_new = sqrt(z0_new**2+rugoro**2) |
alblw(1 : knon) = alb_new(1 : knon) |
|
alblw(1 : knon) = alb_new(1 : knon) |
|
|
endif |
|
337 |
|
|
338 |
! Remplissage des pourcentages de surface |
! Remplissage des pourcentages de surface |
339 |
pctsrf_new(:, nisurf) = pctsrf(:, nisurf) |
pctsrf_new(:, nisurf) = pctsrf(:, nisurf) |
340 |
else if (nisurf == is_oce) then |
else if (nisurf == is_oce) then |
341 |
! Surface "ocean" appel a l'interface avec l'ocean |
! Surface "ocean" appel a l'interface avec l'ocean |
342 |
if (ocean == 'slab') then |
! lecture conditions limites |
343 |
tsurf_new = tsurf |
call interfoce_lim(itime, dtime, jour, klon, nisurf, knon, knindex, & |
344 |
pctsrf_new = tmp_pctsrf_slab |
debut, tsurf_new, pctsrf_new) |
|
else |
|
|
! lecture conditions limites |
|
|
call interfoce_lim(itime, dtime, jour, klon, nisurf, knon, knindex, & |
|
|
debut, tsurf_new, pctsrf_new) |
|
|
endif |
|
345 |
|
|
346 |
tsurf_temp = tsurf_new |
tsurf_temp = tsurf_new |
347 |
cal = 0. |
cal = 0. |
377 |
tmp_radsol(knindex(i))=radsol(i) |
tmp_radsol(knindex(i))=radsol(i) |
378 |
ENDDO |
ENDDO |
379 |
|
|
|
! 2eme appel a interfoce pour le cumul des champs (en particulier |
|
|
! fluxsens et fluxlat calcules dans calcul_fluxs) |
|
|
|
|
|
if (ocean == 'slab ') then |
|
|
seaice=tmp_seaice |
|
|
cumul = .true. |
|
|
call interfoce_slab(klon, debut, itime, dtime, jour, & |
|
|
tmp_radsol, tmp_flux_o, tmp_flux_g, pctsrf, & |
|
|
tslab, seaice, pctsrf_new) |
|
|
|
|
|
tmp_pctsrf_slab=pctsrf_new |
|
|
DO i=1, knon |
|
|
tsurf_new(i)=tslab(knindex(i)) |
|
|
ENDDO |
|
|
endif |
|
|
|
|
380 |
! calcul albedo |
! calcul albedo |
381 |
if ( minval(rmu0) == maxval(rmu0) .and. minval(rmu0) == -999.999 ) then |
if ( minval(rmu0) == maxval(rmu0) .and. minval(rmu0) == -999.999 ) then |
382 |
CALL alboc(FLOAT(jour), rlat, alb_eau) |
CALL alboc(FLOAT(jour), rlat, alb_eau) |
394 |
|
|
395 |
! Surface "glace de mer" appel a l'interface avec l'ocean |
! Surface "glace de mer" appel a l'interface avec l'ocean |
396 |
|
|
397 |
|
! ! lecture conditions limites |
398 |
|
CALL interfoce_lim(itime, dtime, jour, & |
399 |
|
klon, nisurf, knon, knindex, & |
400 |
|
debut, & |
401 |
|
tsurf_new, pctsrf_new) |
402 |
|
|
403 |
|
!IM cf LF |
404 |
|
DO ii = 1, knon |
405 |
|
tsurf_new(ii) = tsurf(ii) |
406 |
|
!IMbad IF (pctsrf_new(ii, nisurf) < EPSFRA) then |
407 |
|
IF (pctsrf_new(knindex(ii), nisurf) < EPSFRA) then |
408 |
|
snow(ii) = 0.0 |
409 |
|
!IM cf LF/JLD tsurf(ii) = RTT - 1.8 |
410 |
|
tsurf_new(ii) = RTT - 1.8 |
411 |
|
IF (soil_model) tsoil(ii, :) = RTT -1.8 |
412 |
|
endif |
413 |
|
enddo |
414 |
|
|
415 |
if (ocean == 'slab ') then |
CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd) |
|
pctsrf_new=tmp_pctsrf_slab |
|
|
|
|
|
DO ii = 1, knon |
|
|
tsurf_new(ii) = tsurf(ii) |
|
|
IF (pctsrf_new(knindex(ii), nisurf) < EPSFRA) then |
|
|
snow(ii) = 0.0 |
|
|
tsurf_new(ii) = RTT - 1.8 |
|
|
IF (soil_model) tsoil(ii, :) = RTT -1.8 |
|
|
ENDIF |
|
|
ENDDO |
|
|
|
|
|
CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd) |
|
|
|
|
|
IF (soil_model) THEN |
|
|
CALL soil(dtime, nisurf, knon, snow, tsurf_new, tsoil, soilcap, & |
|
|
soilflux) |
|
|
cal(1:knon) = RCPD / soilcap(1:knon) |
|
|
radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) |
|
|
ELSE |
|
|
dif_grnd = 1.0 / tau_gl |
|
|
cal = RCPD * calice |
|
|
WHERE (snow > 0.0) cal = RCPD * calsno |
|
|
ENDIF |
|
|
tsurf_temp = tsurf_new |
|
|
beta = 1.0 |
|
416 |
|
|
417 |
|
IF (soil_model) THEN |
418 |
|
CALL soil(dtime, nisurf, knon, snow, tsurf_new, tsoil, soilcap, & |
419 |
|
soilflux) |
420 |
|
cal(1:knon) = RCPD / soilcap(1:knon) |
421 |
|
radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) |
422 |
|
dif_grnd = 0. |
423 |
ELSE |
ELSE |
424 |
! ! lecture conditions limites |
dif_grnd = 1.0 / tau_gl |
425 |
CALL interfoce_lim(itime, dtime, jour, & |
cal = RCPD * calice |
426 |
klon, nisurf, knon, knindex, & |
WHERE (snow > 0.0) cal = RCPD * calsno |
|
debut, & |
|
|
tsurf_new, pctsrf_new) |
|
|
|
|
|
!IM cf LF |
|
|
DO ii = 1, knon |
|
|
tsurf_new(ii) = tsurf(ii) |
|
|
!IMbad IF (pctsrf_new(ii, nisurf) < EPSFRA) then |
|
|
IF (pctsrf_new(knindex(ii), nisurf) < EPSFRA) then |
|
|
snow(ii) = 0.0 |
|
|
!IM cf LF/JLD tsurf(ii) = RTT - 1.8 |
|
|
tsurf_new(ii) = RTT - 1.8 |
|
|
IF (soil_model) tsoil(ii, :) = RTT -1.8 |
|
|
endif |
|
|
enddo |
|
|
|
|
|
CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd) |
|
|
|
|
|
IF (soil_model) THEN |
|
|
CALL soil(dtime, nisurf, knon, snow, tsurf_new, tsoil, soilcap, & |
|
|
soilflux) |
|
|
cal(1:knon) = RCPD / soilcap(1:knon) |
|
|
radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) |
|
|
dif_grnd = 0. |
|
|
ELSE |
|
|
dif_grnd = 1.0 / tau_gl |
|
|
cal = RCPD * calice |
|
|
WHERE (snow > 0.0) cal = RCPD * calsno |
|
|
ENDIF |
|
|
!IMbadtsurf_temp = tsurf |
|
|
tsurf_temp = tsurf_new |
|
|
beta = 1.0 |
|
427 |
ENDIF |
ENDIF |
428 |
|
!IMbadtsurf_temp = tsurf |
429 |
|
tsurf_temp = tsurf_new |
430 |
|
beta = 1.0 |
431 |
|
|
432 |
CALL calcul_fluxs( klon, knon, nisurf, dtime, & |
CALL calcul_fluxs( klon, knon, nisurf, dtime, & |
433 |
tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, & |
tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, & |
537 |
! passage du run-off des glaciers calcule dans fonte_neige au coupleur |
! passage du run-off des glaciers calcule dans fonte_neige au coupleur |
538 |
bidule=0. |
bidule=0. |
539 |
bidule(1:knon)= run_off_lic(1:knon) |
bidule(1:knon)= run_off_lic(1:knon) |
|
call gath2cpl(bidule, tmp_rlic, klon, knon, iim, jjm, knindex) |
|
540 |
|
|
541 |
! calcul albedo |
! calcul albedo |
542 |
|
|