4 |
|
|
5 |
contains |
contains |
6 |
|
|
7 |
SUBROUTINE interfsurf_hq(itime, dtime, date0, jour, rmu0, klon, iim, jjm, & |
SUBROUTINE interfsurf_hq(itime, dtime, jour, rmu0, iim, jjm, nisurf, knon, & |
8 |
nisurf, knon, knindex, pctsrf, rlon, rlat, cufi, cvfi, debut, lafin, & |
knindex, pctsrf, rlat, debut, soil_model, nsoilmx, tsoil, qsol, & |
9 |
ok_veget, soil_model, nsoilmx, tsoil, qsol, zlev, u1_lay, v1_lay, & |
u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, peqAcoef, & |
10 |
temp_air, spechum, epot_air, ccanopy, tq_cdrag, petAcoef, peqAcoef, & |
petBcoef, peqBcoef, precip_rain, precip_snow, fder, rugos, rugoro, & |
11 |
petBcoef, peqBcoef, precip_rain, precip_snow, sollw, sollwdown, swnet, & |
snow, qsurf, tsurf, p1lay, ps, radsol, evap, fluxsens, fluxlat, & |
12 |
swdown, fder, taux, tauy, windsp, rugos, rugoro, albedo, snow, qsurf, & |
dflux_l, dflux_s, tsurf_new, alb_new, alblw, z0_new, pctsrf_new, & |
13 |
tsurf, p1lay, ps, radsol, ocean, npas, nexca, zmasq, evap, fluxsens, & |
agesno, fqcalving, ffonte, run_off_lic_0, flux_o, flux_g, tslab, seaice) |
|
fluxlat, dflux_l, dflux_s, tsol_rad, tsurf_new, alb_new, alblw, & |
|
|
emis_new, 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é. |
! chaleur et d'humidité. |
18 |
! En pratique l'interface se fait entre la couche limite du modèle |
|
19 |
! atmosphérique ("clmain.F") et les routines de surface |
! Laurent Fairhead, 02/2000 |
20 |
! ("sechiba", "oasis"...). |
|
21 |
|
USE abort_gcm_m, ONLY: abort_gcm |
22 |
! L.Fairhead 02/2000 |
USE albsno_m, ONLY: albsno |
23 |
|
USE calcul_fluxs_m, ONLY: calcul_fluxs |
24 |
use abort_gcm_m, only: abort_gcm |
USE dimphy, ONLY: klon |
25 |
use gath_cpl, only: gath2cpl |
USE fonte_neige_m, ONLY: fonte_neige |
26 |
use indicesol |
USE gath2cpl_m, ONLY: gath2cpl |
27 |
use SUPHEC_M |
USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf |
28 |
use albsno_m, only: albsno |
USE interface_surf, ONLY: coastalflow, riverflow, run_off, & |
29 |
use interface_surf |
run_off_lic, conf_interface, tmp_rlic |
30 |
use interfsur_lim_m, only: interfsur_lim |
USE interfoce_lim_m, ONLY: interfoce_lim |
31 |
use calcul_fluxs_m, only: calcul_fluxs |
USE interfoce_slab_m, ONLY: interfoce_slab |
32 |
use fonte_neige_m, only: fonte_neige |
USE interfsur_lim_m, ONLY: interfsur_lim |
33 |
use interfoce_lim_m, only: interfoce_lim |
USE suphec_m, ONLY: rcpd, rlstt, rlvtt, rtt |
34 |
use interfoce_slab_m, only: interfoce_slab |
|
35 |
|
integer, intent(IN):: itime ! numero du pas de temps |
36 |
! Parametres d'entree |
real, intent(IN):: dtime ! pas de temps de la physique (en s) |
37 |
! input: |
integer, intent(IN):: jour ! jour dans l'annee en cours |
38 |
! klon nombre total de points de grille |
real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal |
39 |
|
integer, intent(IN):: iim, jjm |
40 |
! iim, jjm nbres de pts de grille |
! iim, jjm nbres de pts de grille |
41 |
! dtime pas de temps de la physique (en s) |
integer, intent(IN):: nisurf |
|
! date0 jour initial |
|
|
! jour jour dans l'annee en cours, |
|
|
! rmu0 cosinus de l'angle solaire zenithal |
|
|
! nexca pas de temps couplage |
|
42 |
! nisurf index de la surface a traiter (1 = sol continental) |
! nisurf index de la surface a traiter (1 = sol continental) |
43 |
|
integer, intent(IN):: knon |
44 |
! knon nombre de points de la surface a traiter |
! knon nombre de points de la surface a traiter |
45 |
|
integer, intent(in):: knindex(klon) |
46 |
! knindex index des points de la surface a traiter |
! knindex index des points de la surface a traiter |
47 |
|
real, intent(IN):: pctsrf(klon, nbsrf) |
48 |
! pctsrf tableau des pourcentages de surface de chaque maille |
! pctsrf tableau des pourcentages de surface de chaque maille |
49 |
! rlon longitudes |
real, dimension(klon), intent(IN):: rlat |
50 |
! rlat latitudes |
! rlat latitudes |
51 |
! cufi, cvfi resolution des mailles en x et y (m) |
logical, intent(IN):: debut |
52 |
! debut logical: 1er appel a la physique |
! debut logical: 1er appel a la physique |
|
! lafin logical: dernier appel a la physique |
|
|
! ok_veget logical: appel ou non au schema de surface continental |
|
53 |
! (si false calcul simplifie des fluxs sur les continents) |
! (si false calcul simplifie des fluxs sur les continents) |
54 |
! zlev hauteur de la premiere couche |
!! PB ajout pour soil |
55 |
|
logical, intent(in):: soil_model |
56 |
|
integer:: nsoilmx |
57 |
|
REAL, DIMENSION(klon, nsoilmx):: tsoil |
58 |
|
REAL, dimension(klon), intent(INOUT):: qsol |
59 |
|
real, dimension(klon), intent(IN):: u1_lay, v1_lay |
60 |
! u1_lay vitesse u 1ere couche |
! u1_lay vitesse u 1ere couche |
61 |
! v1_lay vitesse v 1ere couche |
! v1_lay vitesse v 1ere couche |
62 |
|
real, dimension(klon), intent(IN):: temp_air, spechum |
63 |
! temp_air temperature de l'air 1ere couche |
! temp_air temperature de l'air 1ere couche |
64 |
! spechum humidite specifique 1ere couche |
! spechum humidite specifique 1ere couche |
65 |
! epot_air temp potentielle de l'air |
real, dimension(klon), intent(INOUT):: tq_cdrag |
|
! ccanopy concentration CO2 canopee |
|
66 |
! tq_cdrag cdrag |
! tq_cdrag cdrag |
67 |
|
real, dimension(klon), intent(IN):: petAcoef, peqAcoef |
68 |
! petAcoef coeff. A de la resolution de la CL pour t |
! petAcoef coeff. A de la resolution de la CL pour t |
69 |
! peqAcoef coeff. A de la resolution de la CL pour q |
! peqAcoef coeff. A de la resolution de la CL pour q |
70 |
|
real, dimension(klon), intent(IN):: petBcoef, peqBcoef |
71 |
! petBcoef coeff. B de la resolution de la CL pour t |
! petBcoef coeff. B de la resolution de la CL pour t |
72 |
! peqBcoef coeff. B de la resolution de la CL pour q |
! peqBcoef coeff. B de la resolution de la CL pour q |
73 |
|
real, dimension(klon), intent(IN):: precip_rain, precip_snow |
74 |
! precip_rain precipitation liquide |
! precip_rain precipitation liquide |
75 |
! precip_snow precipitation solide |
! precip_snow precipitation solide |
76 |
! sollw flux IR net a la surface |
REAL, DIMENSION(klon), INTENT(INOUT):: fder |
77 |
! sollwdown flux IR descendant a la surface |
! fder derivee des flux (pour le couplage) |
78 |
! swnet flux solaire net |
real, dimension(klon), intent(IN):: rugos, rugoro |
79 |
! swdown flux solaire entrant a la surface |
! rugos rugosite |
80 |
! albedo albedo de la surface |
! rugoro rugosite orographique |
81 |
|
real, dimension(klon), intent(INOUT):: snow, qsurf |
82 |
|
real, dimension(klon), intent(IN):: tsurf, p1lay |
83 |
! tsurf temperature de surface |
! tsurf temperature de surface |
|
! tslab temperature slab ocean |
|
|
! pctsrf_slab pourcentages (0-1) des sous-surfaces dans le slab |
|
|
! tmp_pctsrf_slab = pctsrf_slab |
|
84 |
! p1lay pression 1er niveau (milieu de couche) |
! p1lay pression 1er niveau (milieu de couche) |
85 |
|
real, dimension(klon), intent(IN):: ps |
86 |
! ps pression au sol |
! ps pression au sol |
87 |
|
REAL, DIMENSION(klon), INTENT(INOUT):: radsol |
88 |
! radsol rayonnement net aus sol (LW + SW) |
! radsol rayonnement net aus sol (LW + SW) |
89 |
! ocean type d'ocean utilise ("force" ou "slab" mais pas "couple") |
real, dimension(klon), intent(INOUT):: evap |
|
! fder derivee des flux (pour le couplage) |
|
|
! taux, tauy tension de vents |
|
|
! windsp module du vent a 10m |
|
|
! rugos rugosite |
|
|
! zmasq masque terre/ocean |
|
|
! rugoro rugosite orographique |
|
|
! run_off_lic_0 runoff glacier du pas de temps precedent |
|
|
integer, intent(IN) :: itime ! numero du pas de temps |
|
|
integer, intent(IN) :: iim, jjm |
|
|
integer, intent(IN) :: klon |
|
|
real, intent(IN) :: dtime |
|
|
real, intent(IN) :: date0 |
|
|
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, lafin, ok_veget |
|
|
real, dimension(klon), intent(IN) :: rlon, rlat |
|
|
real, dimension(klon), intent(IN) :: cufi, cvfi |
|
|
real, dimension(klon), intent(INOUT) :: tq_cdrag |
|
|
real, dimension(klon), intent(IN) :: zlev |
|
|
real, dimension(klon), intent(IN) :: u1_lay, v1_lay |
|
|
real, dimension(klon), intent(IN) :: temp_air, spechum |
|
|
real, dimension(klon), intent(IN) :: epot_air, ccanopy |
|
|
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) :: sollw, sollwdown, swnet, swdown |
|
|
real, dimension(klon), intent(IN) :: ps, albedo |
|
|
real, dimension(klon), intent(IN) :: tsurf, p1lay |
|
|
!IM: "slab" ocean |
|
|
real, dimension(klon), intent(INOUT) :: tslab |
|
|
real, allocatable, dimension(:), save :: tmp_tslab |
|
|
real, dimension(klon), intent(OUT) :: flux_o, flux_g |
|
|
real, dimension(klon), intent(INOUT) :: seaice ! glace de mer (kg/m2) |
|
|
REAL, DIMENSION(klon), INTENT(INOUT) :: radsol, fder |
|
|
real, dimension(klon), intent(IN) :: zmasq |
|
|
real, dimension(klon), intent(IN) :: taux, tauy, rugos, rugoro |
|
|
real, dimension(klon), intent(IN) :: windsp |
|
|
character(len=*), intent(IN):: ocean |
|
|
integer :: npas, nexca ! nombre et pas de temps couplage |
|
|
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: |
|
90 |
! evap evaporation totale |
! evap evaporation totale |
91 |
|
real, dimension(klon), intent(OUT):: fluxsens, fluxlat |
92 |
! fluxsens flux de chaleur sensible |
! fluxsens flux de chaleur sensible |
93 |
! fluxlat flux de chaleur latente |
! fluxlat flux de chaleur latente |
94 |
! tsol_rad |
real, dimension(klon), intent(OUT):: dflux_l, dflux_s |
95 |
|
real, dimension(klon), intent(OUT):: tsurf_new, alb_new |
96 |
! tsurf_new temperature au sol |
! tsurf_new temperature au sol |
97 |
! alb_new albedo |
! alb_new albedo |
98 |
! emis_new emissivite |
real, dimension(klon), intent(OUT):: alblw |
99 |
|
real, dimension(klon), intent(OUT):: z0_new |
100 |
! z0_new surface roughness |
! z0_new surface roughness |
101 |
|
real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new |
102 |
! pctsrf_new nouvelle repartition des surfaces |
! pctsrf_new nouvelle repartition des surfaces |
|
real, dimension(klon), intent(OUT):: fluxsens, fluxlat |
|
|
real, dimension(klon), intent(OUT):: tsol_rad, tsurf_new, alb_new |
|
|
real, dimension(klon), intent(OUT):: alblw |
|
|
real, dimension(klon), intent(OUT):: emis_new, z0_new |
|
|
real, dimension(klon), intent(OUT):: dflux_l, dflux_s |
|
|
real, dimension(klon, nbsrf), intent(OUT) :: pctsrf_new |
|
103 |
real, dimension(klon), intent(INOUT):: agesno |
real, dimension(klon), intent(INOUT):: agesno |
|
real, dimension(klon), intent(INOUT):: run_off_lic_0 |
|
104 |
|
|
|
! Flux thermique utiliser pour fondre la neige |
|
|
!jld a rajouter real, dimension(klon), intent(INOUT):: ffonte |
|
|
real, dimension(klon), intent(INOUT):: ffonte |
|
105 |
! 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 |
106 |
! hauteur de neige, en kg/m2/s |
! hauteur de neige, en kg/m2/s |
107 |
!jld a rajouter real, dimension(klon), intent(INOUT):: fqcalving |
!jld a rajouter real, dimension(klon), intent(INOUT):: fqcalving |
108 |
real, dimension(klon), intent(INOUT):: fqcalving |
real, dimension(klon), intent(INOUT):: fqcalving |
109 |
!IM: "slab" ocean - Local |
|
110 |
real, parameter :: t_grnd=271.35 |
! Flux thermique utiliser pour fondre la neige |
111 |
real, dimension(klon) :: zx_sl |
!jld a rajouter real, dimension(klon), intent(INOUT):: ffonte |
112 |
|
real, dimension(klon), intent(INOUT):: ffonte |
113 |
|
|
114 |
|
real, dimension(klon), intent(INOUT):: run_off_lic_0 |
115 |
|
! run_off_lic_0 runoff glacier du pas de temps precedent |
116 |
|
|
117 |
|
!IM: "slab" ocean |
118 |
|
real, dimension(klon), intent(OUT):: flux_o, flux_g |
119 |
|
real, dimension(klon), intent(INOUT):: tslab |
120 |
|
! tslab temperature slab ocean |
121 |
|
real, dimension(klon), intent(INOUT):: seaice ! glace de mer (kg/m2) |
122 |
|
|
123 |
|
! Local: |
124 |
|
|
125 |
|
real, allocatable, dimension(:), save:: tmp_tslab |
126 |
|
REAL, dimension(klon):: soilcap |
127 |
|
REAL, dimension(klon):: soilflux |
128 |
|
|
129 |
|
!IM: "slab" ocean |
130 |
|
real, parameter:: t_grnd=271.35 |
131 |
|
real, dimension(klon):: zx_sl |
132 |
integer i |
integer i |
133 |
real, allocatable, dimension(:), save :: tmp_flux_o, tmp_flux_g |
real, allocatable, dimension(:), save:: tmp_flux_o, tmp_flux_g |
134 |
real, allocatable, dimension(:), save :: tmp_radsol |
real, allocatable, dimension(:), save:: tmp_radsol |
135 |
real, allocatable, dimension(:, :), save :: tmp_pctsrf_slab |
real, allocatable, dimension(:, :), save:: tmp_pctsrf_slab |
136 |
real, allocatable, dimension(:), save :: tmp_seaice |
! pctsrf_slab pourcentages (0-1) des sous-surfaces dans le slab |
137 |
|
! tmp_pctsrf_slab = pctsrf_slab |
138 |
! Local |
real, allocatable, dimension(:), save:: tmp_seaice |
139 |
character (len = 20), save :: modname = 'interfsurf_hq' |
|
140 |
character (len = 80) :: abort_message |
character (len = 20), save:: modname = 'interfsurf_hq' |
141 |
logical, save :: first_call = .true. |
character (len = 80):: abort_message |
142 |
integer, save :: error |
logical, save:: first_call = .true. |
143 |
integer :: ii |
integer, save:: error |
144 |
logical, save :: check = .false. |
integer:: ii |
145 |
|
logical, save:: check = .false. |
146 |
real, dimension(klon):: cal, beta, dif_grnd, capsol |
real, dimension(klon):: cal, beta, dif_grnd, capsol |
147 |
real, parameter :: calice=1.0/(5.1444e+06*0.15), tau_gl=86400.*5. |
real, parameter:: calice=1.0/(5.1444e+06*0.15), tau_gl=86400.*5. |
148 |
real, parameter :: calsno=1./(2.3867e+06*.15) |
real, parameter:: calsno=1./(2.3867e+06*.15) |
149 |
real, dimension(klon):: tsurf_temp |
real, dimension(klon):: tsurf_temp |
150 |
real, dimension(klon):: alb_neig, alb_eau |
real, dimension(klon):: alb_neig, alb_eau |
151 |
real, DIMENSION(klon):: zfra |
real, DIMENSION(klon):: zfra |
152 |
logical :: cumul = .false. |
INTEGER, dimension(1):: iloc |
|
INTEGER, dimension(1) :: iloc |
|
153 |
real, dimension(klon):: fder_prev |
real, dimension(klon):: fder_prev |
154 |
REAL, dimension(klon) :: bidule |
REAL, dimension(klon):: bidule |
155 |
|
|
156 |
!------------------------------------------------------------- |
!------------------------------------------------------------- |
157 |
|
|
161 |
! car l'ocean a besoin du ruissellement qui est y calcule |
! car l'ocean a besoin du ruissellement qui est y calcule |
162 |
|
|
163 |
if (first_call) then |
if (first_call) then |
164 |
call conf_interface(tau_calv) |
call conf_interface |
165 |
if (nisurf /= is_ter .and. klon > 1) then |
if (nisurf /= is_ter .and. klon > 1) then |
166 |
write(*, *)' *** Warning ***' |
write(*, *)' *** Warning ***' |
167 |
write(*, *)' nisurf = ', nisurf, ' /= is_ter = ', is_ter |
write(*, *)' nisurf = ', nisurf, ' /= is_ter = ', is_ter |
169 |
abort_message='voir ci-dessus' |
abort_message='voir ci-dessus' |
170 |
call abort_gcm(modname, abort_message, 1) |
call abort_gcm(modname, abort_message, 1) |
171 |
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 |
|
172 |
if ( is_oce > is_sic ) then |
if ( is_oce > is_sic ) then |
173 |
write(*, *)' *** Warning ***' |
write(*, *)' *** Warning ***' |
174 |
write(*, *)' Pour des raisons de sequencement dans le code' |
write(*, *)' Pour des raisons de sequencement dans le code' |
265 |
! Aiguillage vers les differents schemas de surface |
! Aiguillage vers les differents schemas de surface |
266 |
|
|
267 |
if (nisurf == is_ter) then |
if (nisurf == is_ter) then |
|
|
|
268 |
! Surface "terre" appel a l'interface avec les sols continentaux |
! Surface "terre" appel a l'interface avec les sols continentaux |
269 |
|
|
270 |
! allocation du run-off |
! allocation du run-off |
288 |
run_off=0.0 |
run_off=0.0 |
289 |
!cym |
!cym |
290 |
|
|
291 |
!!$PB |
ALLOCATE (tmp_rlic(iim, jjm+1)) |
|
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 |
|
292 |
tmp_rlic = 0.0 |
tmp_rlic = 0.0 |
|
|
|
|
!!$ |
|
293 |
else if (size(coastalflow) /= knon) then |
else if (size(coastalflow) /= knon) then |
294 |
write(*, *)'Bizarre, le nombre de points continentaux' |
write(*, *)'Bizarre, le nombre de points continentaux' |
295 |
write(*, *)'a change entre deux appels. J''arrete ...' |
write(*, *)'a change entre deux appels. J''arrete ...' |
301 |
|
|
302 |
! Calcul age de la neige |
! Calcul age de la neige |
303 |
|
|
304 |
if (.not. ok_veget) then |
! calcul albedo: lecture albedo fichier boundary conditions |
305 |
! calcul albedo: lecture albedo fichier boundary conditions |
! puis ajout albedo neige |
306 |
! puis ajout albedo neige |
call interfsur_lim(itime, dtime, jour, nisurf, knon, knindex, & |
307 |
call interfsur_lim(itime, dtime, jour, klon, nisurf, knon, knindex, & |
debut, alb_new, z0_new) |
308 |
debut, alb_new, z0_new) |
|
309 |
|
! calcul snow et qsurf, hydrol adapté |
310 |
! calcul snow et qsurf, hydrol adapté |
CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd) |
311 |
CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd) |
|
312 |
|
IF (soil_model) THEN |
313 |
IF (soil_model) THEN |
CALL soil(dtime, nisurf, knon, snow, tsurf, tsoil, soilcap, & |
314 |
CALL soil(dtime, nisurf, knon, snow, tsurf, tsoil, soilcap, & |
soilflux) |
315 |
soilflux) |
cal(1:knon) = RCPD / soilcap(1:knon) |
316 |
cal(1:knon) = RCPD / soilcap(1:knon) |
radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) |
317 |
radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) |
ELSE |
318 |
ELSE |
cal = RCPD * capsol |
319 |
cal = RCPD * capsol |
ENDIF |
320 |
ENDIF |
CALL calcul_fluxs( klon, knon, nisurf, dtime, & |
321 |
CALL calcul_fluxs( klon, knon, nisurf, dtime, & |
tsurf, p1lay, cal, beta, tq_cdrag, ps, & |
322 |
tsurf, p1lay, cal, beta, tq_cdrag, ps, & |
precip_rain, precip_snow, snow, qsurf, & |
323 |
precip_rain, precip_snow, snow, qsurf, & |
radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
324 |
radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
petAcoef, peqAcoef, petBcoef, peqBcoef, & |
325 |
petAcoef, peqAcoef, petBcoef, peqBcoef, & |
tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) |
326 |
tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) |
|
327 |
|
CALL fonte_neige( klon, knon, nisurf, dtime, & |
328 |
CALL fonte_neige( klon, knon, nisurf, dtime, & |
tsurf, p1lay, cal, beta, tq_cdrag, ps, & |
329 |
tsurf, p1lay, cal, beta, tq_cdrag, ps, & |
precip_rain, precip_snow, snow, qsol, & |
330 |
precip_rain, precip_snow, snow, qsol, & |
radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
331 |
radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
petAcoef, peqAcoef, petBcoef, peqBcoef, & |
332 |
petAcoef, peqAcoef, petBcoef, peqBcoef, & |
tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l, & |
333 |
tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l, & |
fqcalving, ffonte, run_off_lic_0) |
334 |
fqcalving, ffonte, run_off_lic_0) |
|
335 |
|
call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow) |
336 |
call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow) |
where (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0. |
337 |
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))) |
338 |
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) + & |
339 |
alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + & |
alb_new(1 : knon)*(1.0-zfra(1:knon)) |
340 |
alb_new(1 : knon)*(1.0-zfra(1:knon)) |
z0_new = sqrt(z0_new**2+rugoro**2) |
341 |
z0_new = sqrt(z0_new**2+rugoro**2) |
alblw(1 : knon) = alb_new(1 : knon) |
|
alblw(1 : knon) = alb_new(1 : knon) |
|
|
endif |
|
342 |
|
|
343 |
! Remplissage des pourcentages de surface |
! Remplissage des pourcentages de surface |
344 |
pctsrf_new(:, nisurf) = pctsrf(:, nisurf) |
pctsrf_new(:, nisurf) = pctsrf(:, nisurf) |
345 |
else if (nisurf == is_oce) then |
else if (nisurf == is_oce) then |
346 |
! Surface "ocean" appel a l'interface avec l'ocean |
! Surface "ocean" appel a l'interface avec l'ocean |
347 |
if (ocean == 'slab') then |
! lecture conditions limites |
348 |
tsurf_new = tsurf |
call interfoce_lim(itime, dtime, jour, klon, nisurf, knon, knindex, & |
349 |
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 |
|
350 |
|
|
351 |
tsurf_temp = tsurf_new |
tsurf_temp = tsurf_new |
352 |
cal = 0. |
cal = 0. |
382 |
tmp_radsol(knindex(i))=radsol(i) |
tmp_radsol(knindex(i))=radsol(i) |
383 |
ENDDO |
ENDDO |
384 |
|
|
|
! 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 |
|
|
|
|
385 |
! calcul albedo |
! calcul albedo |
386 |
if ( minval(rmu0) == maxval(rmu0) .and. minval(rmu0) == -999.999 ) then |
if ( minval(rmu0) == maxval(rmu0) .and. minval(rmu0) == -999.999 ) then |
387 |
CALL alboc(FLOAT(jour), rlat, alb_eau) |
CALL alboc(FLOAT(jour), rlat, alb_eau) |
399 |
|
|
400 |
! Surface "glace de mer" appel a l'interface avec l'ocean |
! Surface "glace de mer" appel a l'interface avec l'ocean |
401 |
|
|
402 |
|
! ! lecture conditions limites |
403 |
|
CALL interfoce_lim(itime, dtime, jour, & |
404 |
|
klon, nisurf, knon, knindex, & |
405 |
|
debut, & |
406 |
|
tsurf_new, pctsrf_new) |
407 |
|
|
408 |
|
!IM cf LF |
409 |
|
DO ii = 1, knon |
410 |
|
tsurf_new(ii) = tsurf(ii) |
411 |
|
!IMbad IF (pctsrf_new(ii, nisurf) < EPSFRA) then |
412 |
|
IF (pctsrf_new(knindex(ii), nisurf) < EPSFRA) then |
413 |
|
snow(ii) = 0.0 |
414 |
|
!IM cf LF/JLD tsurf(ii) = RTT - 1.8 |
415 |
|
tsurf_new(ii) = RTT - 1.8 |
416 |
|
IF (soil_model) tsoil(ii, :) = RTT -1.8 |
417 |
|
endif |
418 |
|
enddo |
419 |
|
|
420 |
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 |
|
421 |
|
|
422 |
|
IF (soil_model) THEN |
423 |
|
CALL soil(dtime, nisurf, knon, snow, tsurf_new, tsoil, soilcap, & |
424 |
|
soilflux) |
425 |
|
cal(1:knon) = RCPD / soilcap(1:knon) |
426 |
|
radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) |
427 |
|
dif_grnd = 0. |
428 |
ELSE |
ELSE |
429 |
! ! lecture conditions limites |
dif_grnd = 1.0 / tau_gl |
430 |
CALL interfoce_lim(itime, dtime, jour, & |
cal = RCPD * calice |
431 |
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 |
|
|
!IM cf LF/JLD CALL soil(dtime, nisurf, knon, snow, tsurf, tsoil, soilcap, soilflux) |
|
|
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 |
|
432 |
ENDIF |
ENDIF |
433 |
|
!IMbadtsurf_temp = tsurf |
434 |
|
tsurf_temp = tsurf_new |
435 |
|
beta = 1.0 |
436 |
|
|
437 |
CALL calcul_fluxs( klon, knon, nisurf, dtime, & |
CALL calcul_fluxs( klon, knon, nisurf, dtime, & |
438 |
tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, & |
tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, & |