/[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

trunk/libf/phylmd/Interface_surf/interfsurf_hq.f90 revision 62 by guez, Thu Jul 26 14:37:37 2012 UTC trunk/phylmd/Interface_surf/interfsurf_hq.f revision 100 by guez, Wed Jul 2 19:07:58 2014 UTC
# Line 4  module interfsurf_hq_m Line 4  module interfsurf_hq_m
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 indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf
27      use SUPHEC_M      USE interface_surf, ONLY: coastalflow, riverflow, run_off, &
28      use albsno_m, only: albsno           run_off_lic, conf_interface
29      use interface_surf      USE interfoce_lim_m, ONLY: interfoce_lim
30      use interfsur_lim_m, only: interfsur_lim      USE interfoce_slab_m, ONLY: interfoce_slab
31      use calcul_fluxs_m, only: calcul_fluxs      USE interfsur_lim_m, ONLY: interfsur_lim
32      use fonte_neige_m, only: fonte_neige      USE suphec_m, ONLY: rcpd, rlstt, rlvtt, rtt
33      use interfoce_lim_m, only: interfoce_lim  
34      use interfoce_slab_m, only: interfoce_slab      integer, intent(IN):: itime ! numero du pas de temps
35        real, intent(IN):: dtime ! pas de temps de la physique (en s)
36      ! Parametres d'entree      integer, intent(IN):: jour ! jour dans l'annee en cours
37      ! input:      real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal
38      ! klon nombre total de points de grille      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
     ! date0 jour initial  
     ! jour jour dans l'annee en cours,  
     ! rmu0 cosinus de l'angle solaire zenithal  
     ! nexca pas de temps couplage  
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      ! rlon longitudes      real, dimension(klon), intent(IN):: rlat
49      ! rlat latitudes      ! rlat latitudes
50      ! cufi, cvfi resolution des mailles en x et y (m)      logical, intent(IN):: debut
51      ! 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  
52      ! (si false calcul simplifie des fluxs sur les continents)      ! (si false calcul simplifie des fluxs sur les continents)
53      ! zlev hauteur de la premiere couche      !! 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      ! epot_air temp potentielle de l'air      real, dimension(klon), intent(INOUT):: tq_cdrag
     ! ccanopy concentration CO2 canopee  
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      ! sollw flux IR net a la surface      REAL, DIMENSION(klon), INTENT(INOUT):: fder
76      ! sollwdown flux IR descendant a la surface      ! fder derivee des flux (pour le couplage)
77      ! swnet flux solaire net      real, dimension(klon), intent(IN):: rugos, rugoro
78      ! swdown flux solaire entrant a la surface      ! rugos rugosite
79      ! albedo albedo de la surface      ! rugoro rugosite orographique
80        real, dimension(klon), intent(INOUT):: snow, qsurf
81        real, dimension(klon), intent(IN):: tsurf, p1lay
82      ! 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  
83      ! p1lay pression 1er niveau (milieu de couche)      ! p1lay pression 1er niveau (milieu de couche)
84        real, dimension(klon), intent(IN):: ps
85      ! ps pression au sol      ! ps pression au sol
86        REAL, DIMENSION(klon), INTENT(INOUT):: radsol
87      ! radsol rayonnement net aus sol (LW + SW)      ! radsol rayonnement net aus sol (LW + SW)
88      ! 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:  
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      ! tsol_rad      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
97      ! emis_new emissivite      real, dimension(klon), intent(OUT):: alblw
98        real, dimension(klon), intent(OUT):: z0_new
99      ! z0_new surface roughness      ! z0_new surface roughness
100        real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new
101      ! 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  
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      real, parameter :: t_grnd=271.35      ! Flux thermique utiliser pour fondre la neige
110      real, dimension(klon) :: zx_sl      !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
130        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      real, allocatable, dimension(:), save :: tmp_seaice      ! pctsrf_slab pourcentages (0-1) des sous-surfaces dans le slab
136        ! tmp_pctsrf_slab = pctsrf_slab
137      ! Local      real, allocatable, dimension(:), save:: tmp_seaice
138      character (len = 20), save :: modname = 'interfsurf_hq'  
139      character (len = 80) :: abort_message      character (len = 20), save:: modname = 'interfsurf_hq'
140      logical, save :: first_call = .true.      character (len = 80):: abort_message
141      integer, save :: error      logical, save:: first_call = .true.
142      integer :: ii      integer, save:: error
143      logical, save :: check = .false.      integer:: ii
144        logical, save:: check = .false.
145      real, dimension(klon):: cal, beta, dif_grnd, capsol      real, dimension(klon):: cal, beta, dif_grnd, capsol
146      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.
147      real, parameter :: calsno=1./(2.3867e+06*.15)      real, parameter:: calsno=1./(2.3867e+06*.15)
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
151      logical :: cumul = .false.      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
154    
155      !-------------------------------------------------------------      !-------------------------------------------------------------
156    
# Line 197  contains Line 160  contains
160      ! car l'ocean a besoin du ruissellement qui est y calcule      ! car l'ocean a besoin du ruissellement qui est y calcule
161    
162      if (first_call) then      if (first_call) then
163         call conf_interface(tau_calv)         call conf_interface
164         if (nisurf /= is_ter .and. klon > 1) then         if (nisurf /= is_ter .and. klon > 1) then
165            write(*, *)' *** Warning ***'            write(*, *)' *** Warning ***'
166            write(*, *)' nisurf = ', nisurf, ' /= is_ter = ', is_ter            write(*, *)' nisurf = ', nisurf, ' /= is_ter = ', is_ter
# Line 205  contains Line 168  contains
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'
# Line 307  contains Line 264  contains
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
# Line 327  contains Line 283  contains
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  
286    
287  !!$PB            run_off=0.0
           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  
   
 !!$  
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 ...'
# Line 363  contains Line 296  contains
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.
# Line 451  contains Line 377  contains
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)
# Line 484  contains Line 394  contains
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  
              !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  
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, &
# Line 656  contains Line 537  contains
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    

Legend:
Removed from v.62  
changed lines
  Added in v.100

  ViewVC Help
Powered by ViewVC 1.1.21