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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 98 by guez, Tue May 13 17:23:16 2014 UTC revision 99 by guez, Wed Jul 2 18:39:15 2014 UTC
# Line 5  module interfsurf_hq_m Line 5  module interfsurf_hq_m
5  contains  contains
6    
7    SUBROUTINE interfsurf_hq(itime, dtime, jour, rmu0, iim, jjm, nisurf, knon, &    SUBROUTINE interfsurf_hq(itime, dtime, jour, rmu0, iim, jjm, nisurf, knon, &
8         knindex, pctsrf, rlat, debut, ok_veget, soil_model, nsoilmx, tsoil, &         knindex, pctsrf, rlat, debut, soil_model, nsoilmx, tsoil, qsol, &
9         qsol, u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, peqAcoef, &         u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, peqAcoef, &
10         petBcoef, peqBcoef, precip_rain, precip_snow, fder, rugos, rugoro, &         petBcoef, peqBcoef, precip_rain, precip_snow, fder, rugos, rugoro, &
11         snow, qsurf, tsurf, p1lay, ps, radsol, ocean, evap, fluxsens, fluxlat, &         snow, qsurf, tsurf, p1lay, ps, radsol, evap, fluxsens, fluxlat, &
12         dflux_l, dflux_s, tsurf_new, alb_new, alblw, z0_new, pctsrf_new, &         dflux_l, dflux_s, tsurf_new, alb_new, alblw, z0_new, pctsrf_new, &
13         agesno, fqcalving, ffonte, run_off_lic_0, flux_o, flux_g, tslab, seaice)         agesno, fqcalving, ffonte, run_off_lic_0, flux_o, flux_g, tslab, seaice)
14    
# Line 23  contains Line 23  contains
23      USE calcul_fluxs_m, ONLY: calcul_fluxs      USE calcul_fluxs_m, ONLY: calcul_fluxs
24      USE dimphy, ONLY: klon      USE dimphy, ONLY: klon
25      USE fonte_neige_m, ONLY: fonte_neige      USE fonte_neige_m, ONLY: fonte_neige
26      USE gath_cpl, ONLY: gath2cpl      USE gath2cpl_m, ONLY: gath2cpl
27      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
28      USE interface_surf, ONLY: coastalflow, riverflow, run_off, &      USE interface_surf, ONLY: coastalflow, riverflow, run_off, &
29           run_off_lic, conf_interface, tmp_rcoa, tmp_rlic, tmp_rriv           run_off_lic, conf_interface, tmp_rlic
30      USE interfoce_lim_m, ONLY: interfoce_lim      USE interfoce_lim_m, ONLY: interfoce_lim
31      USE interfoce_slab_m, ONLY: interfoce_slab      USE interfoce_slab_m, ONLY: interfoce_slab
32      USE interfsur_lim_m, ONLY: interfsur_lim      USE interfsur_lim_m, ONLY: interfsur_lim
33      USE suphec_m, ONLY: rcpd, rlstt, rlvtt, rtt      USE suphec_m, ONLY: rcpd, rlstt, rlvtt, rtt
34    
35      ! Parametres d'entree      integer, intent(IN):: itime ! numero du pas de temps
36      ! input:      real, intent(IN):: dtime ! pas de temps de la physique (en s)
37        integer, intent(IN):: jour ! jour dans l'annee en cours
38        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
     ! jour jour dans l'annee en cours,  
     ! rmu0 cosinus de l'angle solaire zenithal  
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        real, dimension(klon), intent(IN):: rlat
50      ! rlat latitudes      ! rlat latitudes
51        logical, intent(IN):: debut
52      ! 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  
53      ! (si false calcul simplifie des fluxs sur les continents)      ! (si false calcul simplifie des fluxs sur les continents)
54        !! 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        real, dimension(klon), intent(INOUT):: tq_cdrag
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      ! 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")  
77      ! fder derivee des flux (pour le couplage)      ! fder derivee des flux (pour le couplage)
78        real, dimension(klon), intent(IN):: rugos, rugoro
79      ! rugos rugosite      ! rugos rugosite
80      ! rugoro rugosite orographique      ! rugoro rugosite orographique
81      ! 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  
     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  
82      real, dimension(klon), intent(IN):: tsurf, p1lay      real, dimension(klon), intent(IN):: tsurf, p1lay
83      !IM: "slab" ocean      ! tsurf temperature de surface
84      real, dimension(klon), intent(INOUT):: tslab      ! p1lay pression 1er niveau (milieu de couche)
85      real, allocatable, dimension(:), save:: tmp_tslab      real, dimension(klon), intent(IN):: ps
86      real, dimension(klon), intent(OUT):: flux_o, flux_g      ! ps pression au sol
87      real, dimension(klon), intent(INOUT):: seaice ! glace de mer (kg/m2)      REAL, DIMENSION(klon), INTENT(INOUT):: radsol
88      REAL, DIMENSION(klon), INTENT(INOUT):: radsol, fder      ! radsol rayonnement net aus sol (LW + SW)
89      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:  
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        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
     ! 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  
98      real, dimension(klon), intent(OUT):: alblw      real, dimension(klon), intent(OUT):: alblw
99      real, dimension(klon), intent(OUT):: z0_new      real, dimension(klon), intent(OUT):: z0_new
100      real, dimension(klon), intent(OUT):: dflux_l, dflux_s      ! z0_new surface roughness
101      real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new      real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new
102        ! pctsrf_new nouvelle repartition des surfaces
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        ! Flux thermique utiliser pour fondre la neige
111        !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      real, parameter:: t_grnd=271.35
131      real, dimension(klon):: zx_sl      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        ! pctsrf_slab pourcentages (0-1) des sous-surfaces dans le slab
137        ! tmp_pctsrf_slab = pctsrf_slab
138      real, allocatable, dimension(:), save:: tmp_seaice      real, allocatable, dimension(:), save:: tmp_seaice
139    
     ! Local  
140      character (len = 20), save:: modname = 'interfsurf_hq'      character (len = 20), save:: modname = 'interfsurf_hq'
141      character (len = 80):: abort_message      character (len = 80):: abort_message
142      logical, save:: first_call = .true.      logical, save:: first_call = .true.
# Line 152  contains Line 149  contains
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
     logical:: cumul = .false.  
152      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
# Line 173  contains Line 169  contains
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'
# Line 298  contains Line 288  contains
288            run_off=0.0            run_off=0.0
289            !cym            !cym
290    
291            ALLOCATE (tmp_rriv(iim, jjm+1), stat=error)            ALLOCATE (tmp_rlic(iim, jjm+1))
           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'
# Line 327  contains Line 301  contains
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, 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.
# Line 415  contains Line 382  contains
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)
# Line 448  contains Line 399  contains
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  
              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, &

Legend:
Removed from v.98  
changed lines
  Added in v.99

  ViewVC Help
Powered by ViewVC 1.1.21