/[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 54 by guez, Tue Dec 6 15:07:04 2011 UTC trunk/phylmd/Interface_surf/interfsurf_hq.f revision 106 by guez, Tue Sep 9 12:54:30 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, nisurf, knon, knindex, &
8         nisurf, knon, knindex, pctsrf, rlon, rlat, cufi, cvfi, debut, lafin, &         pctsrf, rlat, debut, nsoilmx, tsoil, qsol, u1_lay, v1_lay, temp_air, &
9         ok_veget, soil_model, nsoilmx, tsoil, qsol, zlev, u1_lay, v1_lay, &         spechum, tq_cdrag, petAcoef, peqAcoef, petBcoef, peqBcoef, &
10         temp_air, spechum, epot_air, ccanopy, tq_cdrag, petAcoef, peqAcoef, &         precip_rain, precip_snow, fder, rugos, rugoro, snow, qsurf, tsurf, &
11         petBcoef, peqBcoef, precip_rain, precip_snow, sollw, sollwdown, swnet, &         p1lay, ps, radsol, evap, fluxsens, fluxlat, dflux_l, dflux_s, &
12         swdown, fder, taux, tauy, windsp, rugos, rugoro, albedo, snow, qsurf, &         tsurf_new, alb_new, alblw, z0_new, pctsrf_new, agesno, fqcalving, &
13         tsurf, p1lay, ps, radsol, ocean, npas, nexca, zmasq, evap, fluxsens, &         ffonte, run_off_lic_0, flux_o, flux_g)
        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, February 2000
20      ! ("sechiba", "oasis"...).  
21        USE abort_gcm_m, ONLY: abort_gcm
22      ! L.Fairhead 02/2000      USE albsno_m, ONLY: albsno
23        use calbeta_m, only: calbeta
24      use abort_gcm_m, only: abort_gcm      USE calcul_fluxs_m, ONLY: calcul_fluxs
25      use gath_cpl, only: gath2cpl      use clesphys2, only: soil_model
26      use indicesol      USE dimphy, ONLY: klon
27      use SUPHEC_M      USE fonte_neige_m, ONLY: fonte_neige
28      use albsno_m, only: albsno      USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf
29      use interface_surf      USE interface_surf, ONLY: run_off, run_off_lic, conf_interface
30      use interfsur_lim_m, only: interfsur_lim      USE interfoce_lim_m, ONLY: interfoce_lim
31      use calcul_fluxs_m, only: calcul_fluxs      USE interfsur_lim_m, ONLY: interfsur_lim
32      use fonte_neige_m, only: fonte_neige      use soil_m, only: soil
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      ! iim, jjm nbres de pts de grille      integer, intent(IN):: nisurf ! index de la surface a traiter
40      ! dtime pas de temps de la physique (en s)      integer, intent(IN):: knon ! nombre de points de la surface a traiter
41      ! date0 jour initial  
42      ! jour jour dans l'annee en cours,      integer, intent(in):: knindex(:) ! (knon)
43      ! rmu0 cosinus de l'angle solaire zenithal      ! index des points de la surface a traiter
44      ! nexca pas de temps couplage  
45      ! nisurf index de la surface a traiter (1 = sol continental)      real, intent(IN):: pctsrf(klon, nbsrf)
46      ! knon nombre de points de la surface a traiter      ! tableau des pourcentages de surface de chaque maille
47      ! knindex index des points de la surface a traiter  
48      ! pctsrf tableau des pourcentages de surface de chaque maille      real, intent(IN):: rlat(klon) ! latitudes
49      ! rlon longitudes  
50      ! rlat latitudes      logical, intent(IN):: debut ! 1er appel a la physique
     ! cufi, cvfi resolution des mailles en x et y (m)  
     ! 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  
51      ! (si false calcul simplifie des fluxs sur les continents)      ! (si false calcul simplifie des fluxs sur les continents)
52      ! zlev hauteur de la premiere couche  
53        integer, intent(in):: nsoilmx
54        REAL tsoil(klon, nsoilmx)
55    
56        REAL, intent(INOUT):: qsol(klon)
57        ! column-density of water in soil, in kg m-2
58    
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      ! precip_rain precipitation liquide  
74      ! precip_snow precipitation solide      real, intent(IN):: precip_rain(klon)
75      ! sollw flux IR net a la surface      ! precipitation, liquid water mass flux (kg/m2/s), positive down
76      ! sollwdown flux IR descendant a la surface  
77      ! swnet flux solaire net      real, intent(IN):: precip_snow(klon)
78      ! swdown flux solaire entrant a la surface      ! precipitation, solid water mass flux (kg/m2/s), positive down
79      ! albedo albedo de la surface  
80      ! 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")  
81      ! fder derivee des flux (pour le couplage)      ! fder derivee des flux (pour le couplage)
82      ! taux, tauy tension de vents      real, dimension(klon), intent(IN):: rugos, rugoro
     ! windsp module du vent a 10m  
83      ! rugos rugosite      ! rugos rugosite
     ! zmasq masque terre/ocean  
84      ! rugoro rugosite orographique      ! rugoro rugosite orographique
85      ! run_off_lic_0 runoff glacier du pas de temps precedent      real, intent(INOUT):: snow(klon), qsurf(klon)
86      integer, intent(IN) :: itime ! numero du pas de temps      real, intent(IN):: tsurf(:) ! (knon) température de surface
87      integer, intent(IN) :: iim, jjm      real, dimension(klon), intent(IN):: p1lay
88      integer, intent(IN) :: klon      ! p1lay pression 1er niveau (milieu de couche)
89      real, intent(IN) :: dtime      real, dimension(klon), intent(IN):: ps
90      real, intent(IN) :: date0      ! ps pression au sol
91      integer, intent(IN) :: jour      REAL, DIMENSION(klon), INTENT(INOUT):: radsol
92      real, intent(IN) :: rmu0(klon)      ! radsol rayonnement net aus sol (LW + SW)
93      integer, intent(IN) :: nisurf      real, intent(INOUT):: evap(klon) ! evaporation totale
94      integer, intent(IN) :: knon      real, dimension(klon), intent(OUT):: fluxsens, fluxlat
     integer, dimension(klon), intent(in) :: knindex  
     real, dimension(klon, nbsrf), intent(IN) :: pctsrf  
     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:  
     ! evap evaporation totale  
95      ! fluxsens flux de chaleur sensible      ! fluxsens flux de chaleur sensible
96      ! fluxlat flux de chaleur latente      ! fluxlat flux de chaleur latente
97      ! tsol_rad      real, dimension(klon), intent(OUT):: dflux_l, dflux_s
98      ! tsurf_new temperature au sol      real, intent(OUT):: tsurf_new(knon) ! température au sol
99      ! alb_new albedo      real, intent(OUT):: alb_new(klon) ! albedo
100      ! emis_new emissivite      real, dimension(klon), intent(OUT):: alblw
101        real, dimension(klon), intent(OUT):: z0_new
102      ! z0_new surface roughness      ! z0_new surface roughness
103        real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new
104      ! 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  
105      real, dimension(klon), intent(INOUT):: agesno      real, dimension(klon), intent(INOUT):: agesno
     real, dimension(klon), intent(INOUT):: run_off_lic_0  
106    
     ! Flux thermique utiliser pour fondre la neige  
     !jld a rajouter real, dimension(klon), intent(INOUT):: ffonte  
     real, dimension(klon), intent(INOUT):: ffonte  
107      ! 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
108      ! hauteur de neige, en kg/m2/s      ! hauteur de neige, en kg/m2/s
109      !jld a rajouter real, dimension(klon), intent(INOUT):: fqcalving      !jld a rajouter real, dimension(klon), intent(INOUT):: fqcalving
110      real, dimension(klon), intent(INOUT):: fqcalving      real, dimension(klon), intent(INOUT):: fqcalving
111      !IM: "slab" ocean - Local  
112      real, parameter :: t_grnd=271.35      ! Flux thermique utiliser pour fondre la neige
113      real, dimension(klon) :: zx_sl      !jld a rajouter real, dimension(klon), intent(INOUT):: ffonte
114        real, dimension(klon), intent(INOUT):: ffonte
115    
116        real, dimension(klon), intent(INOUT):: run_off_lic_0
117        ! run_off_lic_0 runoff glacier du pas de temps precedent
118    
119        !IM: "slab" ocean
120        real, dimension(klon), intent(OUT):: flux_o, flux_g
121    
122        ! Local:
123    
124        REAL, dimension(klon):: soilcap
125        REAL, dimension(klon):: soilflux
126    
127        !IM: "slab" ocean
128        real, parameter:: t_grnd=271.35
129        real, dimension(klon):: zx_sl
130      integer i      integer i
131      real, allocatable, dimension(:), save :: tmp_flux_o, tmp_flux_g  
132      real, allocatable, dimension(:), save :: tmp_radsol      character (len = 20), save:: modname = 'interfsurf_hq'
133      real, allocatable, dimension(:, :), save :: tmp_pctsrf_slab      character (len = 80):: abort_message
134      real, allocatable, dimension(:), save :: tmp_seaice      logical, save:: first_call = .true.
135        integer:: ii
     ! Local  
     character (len = 20), save :: modname = 'interfsurf_hq'  
     character (len = 80) :: abort_message  
     logical, save :: first_call = .true.  
     integer, save :: error  
     integer :: ii  
     logical, save :: check = .false.  
136      real, dimension(klon):: cal, beta, dif_grnd, capsol      real, dimension(klon):: cal, beta, dif_grnd, capsol
137      real, parameter :: calice=1.0/(5.1444e+06*0.15), tau_gl=86400.*5.      real, parameter:: calice=1.0/(5.1444e6 * 0.15), tau_gl=86400.*5.
138      real, parameter :: calsno=1./(2.3867e+06*.15)      real, parameter:: calsno=1./(2.3867e6 * 0.15)
139      real, dimension(klon):: tsurf_temp      real tsurf_temp(knon)
140      real, dimension(klon):: alb_neig, alb_eau      real, dimension(klon):: alb_neig, alb_eau
141      real, DIMENSION(klon):: zfra      real, DIMENSION(klon):: zfra
142      logical :: cumul = .false.      INTEGER, dimension(1):: iloc
     INTEGER, dimension(1) :: iloc  
143      real, dimension(klon):: fder_prev      real, dimension(klon):: fder_prev
     REAL, dimension(klon) :: bidule  
144    
145      !-------------------------------------------------------------      !-------------------------------------------------------------
146    
     if (check) write(*, *) 'Entree ', modname  
   
147      ! On doit commencer par appeler les schemas de surfaces continentales      ! On doit commencer par appeler les schemas de surfaces continentales
148      ! car l'ocean a besoin du ruissellement qui est y calcule      ! car l'ocean a besoin du ruissellement qui est y calcule
149    
150      if (first_call) then      if (first_call) then
151         call conf_interface(tau_calv)         call conf_interface
152         if (nisurf /= is_ter .and. klon > 1) then         if (nisurf /= is_ter .and. klon > 1) then
153            write(*, *)' *** Warning ***'            print *, ' Warning:'
154            write(*, *)' nisurf = ', nisurf, ' /= is_ter = ', is_ter            print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter
155            write(*, *)'or on doit commencer par les surfaces continentales'            print *, 'or on doit commencer par les surfaces continentales'
156            abort_message='voir ci-dessus'            abort_message='voir ci-dessus'
157            call abort_gcm(modname, abort_message, 1)            call abort_gcm(modname, abort_message, 1)
158         endif         endif
159         if (ocean /= 'slab' .and. ocean /= 'force') then         if (is_oce > is_sic) then
160            write(*, *)' *** Warning ***'            print *, 'Warning:'
161            write(*, *)'Option couplage pour l''ocean = ', ocean            print *, ' Pour des raisons de sequencement dans le code'
162            abort_message='option pour l''ocean non valable'            print *, ' l''ocean doit etre traite avant la banquise'
163            call abort_gcm(modname, abort_message, 1)            print *, ' or is_oce = ', is_oce, '> is_sic = ', is_sic
        endif  
        if ( is_oce > is_sic ) then  
           write(*, *)' *** Warning ***'  
           write(*, *)' Pour des raisons de sequencement dans le code'  
           write(*, *)' l''ocean doit etre traite avant la banquise'  
           write(*, *)' or is_oce = ', is_oce, '> is_sic = ', is_sic  
164            abort_message='voir ci-dessus'            abort_message='voir ci-dessus'
165            call abort_gcm(modname, abort_message, 1)            call abort_gcm(modname, abort_message, 1)
166         endif         endif
# Line 226  contains Line 171  contains
171    
172      ffonte(1:knon)=0.      ffonte(1:knon)=0.
173      fqcalving(1:knon)=0.      fqcalving(1:knon)=0.
   
174      cal = 999999.      cal = 999999.
175      beta = 999999.      beta = 999999.
176      dif_grnd = 999999.      dif_grnd = 999999.
# Line 241  contains Line 185  contains
185      flux_o = 0.      flux_o = 0.
186      flux_g = 0.      flux_g = 0.
187    
     if (.not. allocated(tmp_flux_o)) then  
        allocate(tmp_flux_o(klon), stat = error)  
        DO i=1, knon  
           tmp_flux_o(knindex(i))=flux_o(i)  
        ENDDO  
        if (error /= 0) then  
           abort_message='Pb allocation tmp_flux_o'  
           call abort_gcm(modname, abort_message, 1)  
        endif  
     endif  
     if (.not. allocated(tmp_flux_g)) then  
        allocate(tmp_flux_g(klon), stat = error)  
        DO i=1, knon  
           tmp_flux_g(knindex(i))=flux_g(i)  
        ENDDO  
        if (error /= 0) then  
           abort_message='Pb allocation tmp_flux_g'  
           call abort_gcm(modname, abort_message, 1)  
        endif  
     endif  
     if (.not. allocated(tmp_radsol)) then  
        allocate(tmp_radsol(klon), stat = error)  
        if (error /= 0) then  
           abort_message='Pb allocation tmp_radsol'  
           call abort_gcm(modname, abort_message, 1)  
        endif  
     endif  
     DO i=1, knon  
        tmp_radsol(knindex(i))=radsol(i)  
     ENDDO  
     if (.not. allocated(tmp_pctsrf_slab)) then  
        allocate(tmp_pctsrf_slab(klon, nbsrf), stat = error)  
        if (error /= 0) then  
           abort_message='Pb allocation tmp_pctsrf_slab'  
           call abort_gcm(modname, abort_message, 1)  
        endif  
        DO i=1, klon  
           tmp_pctsrf_slab(i, 1:nbsrf)=pctsrf(i, 1:nbsrf)  
        ENDDO  
     endif  
   
     if (.not. allocated(tmp_seaice)) then  
        allocate(tmp_seaice(klon), stat = error)  
        if (error /= 0) then  
           abort_message='Pb allocation tmp_seaice'  
           call abort_gcm(modname, abort_message, 1)  
        endif  
        DO i=1, klon  
           tmp_seaice(i)=seaice(i)  
        ENDDO  
     endif  
   
     if (.not. allocated(tmp_tslab)) then  
        allocate(tmp_tslab(klon), stat = error)  
        if (error /= 0) then  
           abort_message='Pb allocation tmp_tslab'  
           call abort_gcm(modname, abort_message, 1)  
        endif  
     endif  
     DO i=1, klon  
        tmp_tslab(i)=tslab(i)  
     ENDDO  
   
188      ! Aiguillage vers les differents schemas de surface      ! Aiguillage vers les differents schemas de surface
189    
190      if (nisurf == is_ter) then      select case (nisurf)
191        case (is_ter)
192         ! Surface "terre" appel a l'interface avec les sols continentaux         ! Surface "terre" appel a l'interface avec les sols continentaux
193    
194         ! allocation du run-off         ! allocation du run-off
195         if (.not. allocated(coastalflow)) then         if (.not. allocated(run_off)) then
196            allocate(coastalflow(knon), stat = error)            allocate(run_off(knon))
197            if (error /= 0) then            run_off = 0.
198               abort_message='Pb allocation coastalflow'         else if (size(run_off) /= knon) then
199               call abort_gcm(modname, abort_message, 1)            print *, 'Bizarre, le nombre de points continentaux'
200            endif            print *, 'a change entre deux appels. J''arrete '
           allocate(riverflow(knon), stat = error)  
           if (error /= 0) then  
              abort_message='Pb allocation riverflow'  
              call abort_gcm(modname, abort_message, 1)  
           endif  
           allocate(run_off(knon), stat = error)  
           if (error /= 0) then  
              abort_message='Pb allocation run_off'  
              call abort_gcm(modname, abort_message, 1)  
           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  
   
 !!$  
        else if (size(coastalflow) /= knon) then  
           write(*, *)'Bizarre, le nombre de points continentaux'  
           write(*, *)'a change entre deux appels. J''arrete ...'  
201            abort_message='voir ci-dessus'            abort_message='voir ci-dessus'
202            call abort_gcm(modname, abort_message, 1)            call abort_gcm(modname, abort_message, 1)
203         endif         endif
        coastalflow = 0.  
        riverflow = 0.  
204    
205         ! Calcul age de la neige         ! Calcul age de la neige
206    
207         if (.not. ok_veget) then         ! calcul albedo: lecture albedo fichier boundary conditions
208            ! calcul albedo: lecture albedo fichier boundary conditions         ! puis ajout albedo neige
209            ! puis ajout albedo neige         call interfsur_lim(itime, dtime, jour, nisurf, knindex, debut, &
210            call interfsur_lim(itime, dtime, jour, klon, nisurf, knon, knindex, &              alb_new, z0_new)
211                 debut, alb_new, z0_new)  
212           ! calcul snow et qsurf, hydrol adapté
213            ! calcul snow et qsurf, hydrol adapté         CALL calbeta(nisurf, snow(:knon), qsol(:knon), beta(:knon), &
214            CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd)              capsol(:knon), dif_grnd(:knon))
215    
216            IF (soil_model) THEN         IF (soil_model) THEN
217               CALL soil(dtime, nisurf, knon, snow, tsurf, tsoil, soilcap, &            CALL soil(dtime, nisurf, knon, snow, tsurf, tsoil, soilcap, soilflux)
218                    soilflux)            cal(1:knon) = RCPD / soilcap(1:knon)
219               cal(1:knon) = RCPD / soilcap(1:knon)            radsol(1:knon) = radsol(1:knon) + soilflux(:knon)
220               radsol(1:knon) = radsol(1:knon) + soilflux(1:knon)         ELSE
221            ELSE            cal = RCPD * capsol
222               cal = RCPD * capsol         ENDIF
223            ENDIF         CALL calcul_fluxs(nisurf, dtime, tsurf, p1lay(:knon), cal(:knon), beta(:knon), &
224            CALL calcul_fluxs( klon, knon, nisurf, dtime, &              tq_cdrag(:knon), ps(:knon), qsurf(:knon), radsol(:knon), &
225                 tsurf, p1lay, cal, beta, tq_cdrag, ps, &              dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &
226                 precip_rain, precip_snow, snow, qsurf, &              petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap(:knon), fluxlat(:knon), fluxsens(:knon), dflux_s(:knon), &
227                 radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              dflux_l(:knon))
228                 petAcoef, peqAcoef, petBcoef, peqBcoef, &  
229                 tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)         CALL fonte_neige(nisurf, dtime, tsurf, p1lay(:knon), beta(:knon), &
230                tq_cdrag(:knon), ps(:knon), precip_rain(:knon), precip_snow(:knon), snow(:knon), qsol(:knon), &
231            CALL fonte_neige( klon, knon, nisurf, dtime, &              temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &
232                 tsurf, p1lay, cal, beta, tq_cdrag, ps, &              peqBcoef(:knon), tsurf_new, evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))
233                 precip_rain, precip_snow, snow, qsol, &  
234                 radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &         call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)
235                 petAcoef, peqAcoef, petBcoef, peqBcoef, &         where (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.
236                 tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l, &         zfra(1:knon) = max(0.0, min(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))
237                 fqcalving, ffonte, run_off_lic_0)         alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &
238                alb_new(1 : knon)*(1.0-zfra(1:knon))
239            call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         z0_new = sqrt(z0_new**2 + rugoro**2)
240            where (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.         alblw(1 : knon) = alb_new(1 : knon)
           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) + &  
                alb_new(1 : knon)*(1.0-zfra(1:knon))  
           z0_new = sqrt(z0_new**2+rugoro**2)  
           alblw(1 : knon) = alb_new(1 : knon)  
        endif  
241    
242         ! Remplissage des pourcentages de surface         ! Remplissage des pourcentages de surface
243         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)
244      else if (nisurf == is_oce) then      case (is_oce)
245         ! Surface "ocean" appel a l'interface avec l'ocean         ! Surface "ocean" appel à l'interface avec l'océan
246         if (ocean == 'slab') then         ! lecture conditions limites
247            tsurf_new = tsurf         call interfoce_lim(itime, dtime, jour, knindex, debut, tsurf_temp, &
248            pctsrf_new = tmp_pctsrf_slab              pctsrf_new)
        else  
           ! lecture conditions limites  
           call interfoce_lim(itime, dtime, jour, klon, nisurf, knon, knindex, &  
                debut, tsurf_new, pctsrf_new)  
        endif  
249    
        tsurf_temp = tsurf_new  
250         cal = 0.         cal = 0.
251         beta = 1.         beta = 1.
252         dif_grnd = 0.         dif_grnd = 0.
253         alb_neig = 0.         alb_neig = 0.
254         agesno = 0.         agesno = 0.
255           call calcul_fluxs(nisurf, dtime, tsurf_temp, p1lay(:knon), &
256         call calcul_fluxs( klon, knon, nisurf, dtime, &              cal(:knon), beta(:knon), tq_cdrag(:knon), ps(:knon), &
257              tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, &              qsurf(:knon), radsol(:knon), dif_grnd(:knon), temp_air(:knon), &
258              precip_rain, precip_snow, snow, qsurf, &              spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), &
259              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), &
260              petAcoef, peqAcoef, petBcoef, peqBcoef, &              tsurf_new, evap(:knon), fluxlat(:knon), fluxsens(:knon), &
261              tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)              dflux_s(:knon), dflux_l(:knon))
   
262         fder_prev = fder         fder_prev = fder
263         fder = fder_prev + dflux_s + dflux_l         fder = fder_prev + dflux_s + dflux_l
   
264         iloc = maxloc(fder(1:klon))         iloc = maxloc(fder(1:klon))
        if (check.and.fder(iloc(1))> 0.) then  
           WRITE(*, *)'**** Debug fder****'  
           WRITE(*, *)'max fder(', iloc(1), ') = ', fder(iloc(1))  
           WRITE(*, *)'fder_prev, dflux_s, dflux_l', fder_prev(iloc(1)), &  
                dflux_s(iloc(1)), dflux_l(iloc(1))  
        endif  
265    
266         !IM: flux ocean-atmosphere utile pour le "slab" ocean         !IM: flux ocean-atmosphere utile pour le "slab" ocean
267         DO i=1, knon         DO i=1, knon
268            zx_sl(i) = RLVTT            zx_sl(i) = RLVTT
269            if (tsurf_new(i) .LT. RTT) zx_sl(i) = RLSTT            if (tsurf_new(i) < RTT) zx_sl(i) = RLSTT
270            flux_o(i) = fluxsens(i)-evap(i)*zx_sl(i)            flux_o(i) = fluxsens(i)-evap(i)*zx_sl(i)
           tmp_flux_o(knindex(i)) = flux_o(i)  
           tmp_radsol(knindex(i))=radsol(i)  
271         ENDDO         ENDDO
272    
        ! 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  
   
273         ! calcul albedo         ! calcul albedo
274         if ( minval(rmu0) == maxval(rmu0) .and. minval(rmu0) == -999.999 ) then         if (minval(rmu0) == maxval(rmu0) .and. minval(rmu0) == -999.999) then
275            CALL alboc(FLOAT(jour), rlat, alb_eau)            CALL alboc(FLOAT(jour), rlat, alb_eau)
276         else ! cycle diurne         else ! cycle diurne
277            CALL alboc_cd(rmu0, alb_eau)            CALL alboc_cd(rmu0, alb_eau)
# Line 479  contains Line 282  contains
282    
283         z0_new = sqrt(rugos**2 + rugoro**2)         z0_new = sqrt(rugos**2 + rugoro**2)
284         alblw(1:knon) = alb_new(1:knon)         alblw(1:knon) = alb_new(1:knon)
285      else if (nisurf == is_sic) then      case (is_sic)
        if (check) write(*, *)'sea ice, nisurf = ', nisurf  
   
286         ! Surface "glace de mer" appel a l'interface avec l'ocean         ! Surface "glace de mer" appel a l'interface avec l'ocean
287    
288           ! ! lecture conditions limites
289           CALL interfoce_lim(itime, dtime, jour, knindex, debut, tsurf_new, &
290                pctsrf_new)
291    
292           DO ii = 1, knon
293              tsurf_new(ii) = tsurf(ii)
294              IF (pctsrf_new(knindex(ii), nisurf) < EPSFRA) then
295                 snow(ii) = 0.0
296                 tsurf_new(ii) = RTT - 1.8
297                 IF (soil_model) tsoil(ii, :) = RTT -1.8
298              endif
299           enddo
300    
301         if (ocean == 'slab ') then         CALL calbeta(nisurf, snow(:knon), qsol(:knon), beta(:knon), &
302            pctsrf_new=tmp_pctsrf_slab              capsol(:knon), dif_grnd(:knon))
   
           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  
303    
304           IF (soil_model) THEN
305              CALL soil(dtime, nisurf, knon, snow, tsurf_new, tsoil, soilcap, &
306                   soilflux)
307              cal(1:knon) = RCPD / soilcap(1:knon)
308              radsol(1:knon) = radsol(1:knon) + soilflux(1:knon)
309              dif_grnd = 0.
310         ELSE         ELSE
311            ! ! lecture conditions limites            dif_grnd = 1.0 / tau_gl
312            CALL interfoce_lim(itime, dtime, jour, &            cal = RCPD * calice
313                 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  
314         ENDIF         ENDIF
315           tsurf_temp = tsurf_new
316           beta = 1.0
317    
318         CALL calcul_fluxs( klon, knon, nisurf, dtime, &         CALL calcul_fluxs(nisurf, dtime, tsurf_temp, p1lay(:knon), cal(:knon), &
319              tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, &              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &
320              precip_rain, precip_snow, snow, qsurf, &              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), &
321              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap(:knon), fluxlat(:knon), fluxsens(:knon), &
322              petAcoef, peqAcoef, petBcoef, peqBcoef, &              dflux_s(:knon), dflux_l(:knon))
             tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)  
323    
324         !IM: flux entre l'ocean et la glace de mer pour le "slab" ocean         !IM: flux entre l'ocean et la glace de mer pour le "slab" ocean
325         DO i = 1, knon         DO i = 1, knon
326            flux_g(i) = 0.0            flux_g(i) = 0.0
327              IF (cal(i) > 1e-15) flux_g(i) = (tsurf_new(i) - t_grnd) &
328            !IM: faire dependre le coefficient de conduction de la glace de mer                 * dif_grnd(i) * RCPD / cal(i)
           ! de l'epaisseur de la glace de mer, dans l'hypothese ou le coeff.  
           ! actuel correspond a 3m de glace de mer, cf. L.Li  
   
           ! IF(1.EQ.0) THEN  
           ! IF(siceh(i).GT.0.) THEN  
           ! new_dif_grnd(i) = dif_grnd(i)*3./siceh(i)  
           ! ELSE  
           ! new_dif_grnd(i) = 0.  
           ! ENDIF  
           ! ENDIF !(1.EQ.0) THEN  
   
           IF (cal(i).GT.1.0e-15) flux_g(i)=(tsurf_new(i)-t_grnd) &  
                * dif_grnd(i) *RCPD/cal(i)  
           ! & * new_dif_grnd(i) *RCPD/cal(i)  
           tmp_flux_g(knindex(i))=flux_g(i)  
           tmp_radsol(knindex(i))=radsol(i)  
329         ENDDO         ENDDO
330    
331         CALL fonte_neige( klon, knon, nisurf, dtime, &         CALL fonte_neige(nisurf, dtime, tsurf_temp, p1lay(:knon), beta(:knon), &
332              tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, &              tq_cdrag(:knon), ps(:knon), precip_rain(:knon), precip_snow(:knon), snow(:knon), qsol(:knon), &
333              precip_rain, precip_snow, snow, qsol, &              temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &
334              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              peqBcoef(:knon), tsurf_new, evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))
             petAcoef, peqAcoef, petBcoef, peqBcoef, &  
             tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l, &  
             fqcalving, ffonte, run_off_lic_0)  
335    
336         ! calcul albedo         ! calcul albedo
337    
338         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)
339         WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.         WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.
340         zfra(1:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon)+10.0)))         zfra(1:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))
341         alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &         alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &
342              0.6 * (1.0-zfra(1:knon))              0.6 * (1.0-zfra(1:knon))
343    
# Line 598  contains Line 345  contains
345         fder = fder_prev + dflux_s + dflux_l         fder = fder_prev + dflux_s + dflux_l
346    
347         iloc = maxloc(fder(1:klon))         iloc = maxloc(fder(1:klon))
        if (check.and.fder(iloc(1))> 0.) then  
           WRITE(*, *)'**** Debug fder ****'  
           WRITE(*, *)'max fder(', iloc(1), ') = ', fder(iloc(1))  
           WRITE(*, *)'fder_prev, dflux_s, dflux_l', fder_prev(iloc(1)), &  
                dflux_s(iloc(1)), dflux_l(iloc(1))  
        endif  
   
348    
349         ! 2eme appel a interfoce pour le cumul et le passage des flux a l'ocean         ! 2eme appel a interfoce pour le cumul et le passage des flux a l'ocean
350    
351         z0_new = 0.002         z0_new = 0.002
352         z0_new = SQRT(z0_new**2+rugoro**2)         z0_new = SQRT(z0_new**2 + rugoro**2)
353         alblw(1:knon) = alb_new(1:knon)         alblw(1:knon) = alb_new(1:knon)
354    
355      else if (nisurf == is_lic) then      case (is_lic)
   
        if (check) write(*, *)'glacier, nisurf = ', nisurf  
   
356         if (.not. allocated(run_off_lic)) then         if (.not. allocated(run_off_lic)) then
357            allocate(run_off_lic(knon), stat = error)            allocate(run_off_lic(knon))
           if (error /= 0) then  
              abort_message='Pb allocation run_off_lic'  
              call abort_gcm(modname, abort_message, 1)  
           endif  
358            run_off_lic = 0.            run_off_lic = 0.
359         endif         endif
360    
# Line 638  contains Line 371  contains
371         beta = 1.0         beta = 1.0
372         dif_grnd = 0.0         dif_grnd = 0.0
373    
374         call calcul_fluxs( klon, knon, nisurf, dtime, &         call calcul_fluxs(nisurf, dtime, tsurf, p1lay(:knon), cal(:knon), beta(:knon), &
375              tsurf, p1lay, cal, beta, tq_cdrag, ps, &              tq_cdrag(:knon), ps(:knon), qsurf(:knon), radsol(:knon), &
376              precip_rain, precip_snow, snow, qsurf, &              dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &
377              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap(:knon), fluxlat(:knon), fluxsens(:knon), dflux_s(:knon), &
378              petAcoef, peqAcoef, petBcoef, peqBcoef, &              dflux_l(:knon))
379              tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)  
380           call fonte_neige(nisurf, dtime, tsurf, p1lay(:knon), beta(:knon), &
381         call fonte_neige( klon, knon, nisurf, dtime, &              tq_cdrag(:knon), ps(:knon), precip_rain(:knon), precip_snow(:knon), snow(:knon), qsol(:knon), &
382              tsurf, p1lay, cal, beta, tq_cdrag, ps, &              temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &
383              precip_rain, precip_snow, snow, qsol, &              peqBcoef(:knon), tsurf_new, evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))
             radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &  
             petAcoef, peqAcoef, petBcoef, peqBcoef, &  
             tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l, &  
             fqcalving, ffonte, run_off_lic_0)  
   
        ! passage du run-off des glaciers calcule dans fonte_neige au coupleur  
        bidule=0.  
        bidule(1:knon)= run_off_lic(1:knon)  
        call gath2cpl(bidule, tmp_rlic, klon, knon, iim, jjm, knindex)  
384    
385         ! calcul albedo         ! calcul albedo
   
386         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)
387         WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.         WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.
388         zfra(1:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon)+10.0)))         zfra(1:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))
389         alb_new(1 : knon) = alb_neig(1 : knon)*zfra(1:knon) + &         alb_new(1 : knon) = alb_neig(1 : knon)*zfra(1:knon) + &
390              0.6 * (1.0-zfra(1:knon))              0.6 * (1.0-zfra(1:knon))
391    
392         !IM: plusieurs choix/tests sur l'albedo des "glaciers continentaux"         !IM: plusieurs choix/tests sur l'albedo des "glaciers continentaux"
        ! alb_new(1 : knon) = 0.6 !IM cf FH/GK  
        ! alb_new(1 : knon) = 0.82  
        ! alb_new(1 : knon) = 0.77 !211003 Ksta0.77  
        ! alb_new(1 : knon) = 0.8 !KstaTER0.8 & LMD_ARMIP5  
393         !IM: KstaTER0.77 & LMD_ARMIP6         !IM: KstaTER0.77 & LMD_ARMIP6
394         alb_new(1 : knon) = 0.77         alb_new(1 : knon) = 0.77
395    
   
396         ! Rugosite         ! Rugosite
   
397         z0_new = rugoro         z0_new = rugoro
398    
399         ! Remplissage des pourcentages de surface         ! Remplissage des pourcentages de surface
   
400         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)
401    
402         alblw(1:knon) = alb_new(1:knon)         alblw(1:knon) = alb_new(1:knon)
403      else      case default
404         write(*, *)'Index surface = ', nisurf         print *, 'Index surface = ', nisurf
405         abort_message = 'Index surface non valable'         abort_message = 'Index surface non valable'
406         call abort_gcm(modname, abort_message, 1)         call abort_gcm(modname, abort_message, 1)
407      endif      end select
408    
409    END SUBROUTINE interfsurf_hq    END SUBROUTINE interfsurf_hq
410    

Legend:
Removed from v.54  
changed lines
  Added in v.106

  ViewVC Help
Powered by ViewVC 1.1.21