/[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 100 by guez, Wed Jul 2 19:07:58 2014 UTC revision 101 by guez, Mon Jul 7 17:45:21 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, jour, rmu0, iim, jjm, nisurf, knon, &    SUBROUTINE interfsurf_hq(itime, dtime, jour, rmu0, nisurf, knon, &
8         knindex, pctsrf, rlat, debut, soil_model, nsoilmx, tsoil, qsol, &         knindex, pctsrf, rlat, debut, nsoilmx, tsoil, qsol, &
9         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, 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)
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
# Line 20  contains Line 20  contains
20    
21      USE abort_gcm_m, ONLY: abort_gcm      USE abort_gcm_m, ONLY: abort_gcm
22      USE albsno_m, ONLY: albsno      USE albsno_m, ONLY: albsno
23        use calbeta_m, only: calbeta
24      USE calcul_fluxs_m, ONLY: calcul_fluxs      USE calcul_fluxs_m, ONLY: calcul_fluxs
25        use clesphys2, only: soil_model
26      USE dimphy, ONLY: klon      USE dimphy, ONLY: klon
27      USE fonte_neige_m, ONLY: fonte_neige      USE fonte_neige_m, ONLY: fonte_neige
28      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
29      USE interface_surf, ONLY: coastalflow, riverflow, run_off, &      USE interface_surf, ONLY: run_off, run_off_lic, conf_interface
          run_off_lic, conf_interface  
30      USE interfoce_lim_m, ONLY: interfoce_lim      USE interfoce_lim_m, ONLY: interfoce_lim
     USE interfoce_slab_m, ONLY: interfoce_slab  
31      USE interfsur_lim_m, ONLY: interfsur_lim      USE interfsur_lim_m, ONLY: interfsur_lim
32        use soil_m, only: soil
33      USE suphec_m, ONLY: rcpd, rlstt, rlvtt, rtt      USE suphec_m, ONLY: rcpd, rlstt, rlvtt, rtt
34    
35      integer, intent(IN):: itime ! numero du pas de temps      integer, intent(IN):: itime ! numero du pas de temps
36      real, intent(IN):: dtime ! pas de temps de la physique (en s)      real, intent(IN):: dtime ! pas de temps de la physique (en s)
37      integer, intent(IN):: jour ! jour dans l'annee en cours      integer, intent(IN):: jour ! jour dans l'annee en cours
38      real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal      real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal
39      integer, intent(IN):: iim, jjm      integer, intent(IN):: nisurf ! index de la surface a traiter
40      ! iim, jjm nbres de pts de grille      integer, intent(IN):: knon ! nombre de points de la surface a traiter
41      integer, intent(IN):: nisurf  
     ! nisurf index de la surface a traiter (1 = sol continental)  
     integer, intent(IN):: knon  
     ! knon nombre de points de la surface a traiter  
42      integer, intent(in):: knindex(klon)      integer, intent(in):: knindex(klon)
43      ! knindex index des points de la surface a traiter      ! index des points de la surface a traiter
44    
45      real, intent(IN):: pctsrf(klon, nbsrf)      real, intent(IN):: pctsrf(klon, nbsrf)
46      ! pctsrf tableau des pourcentages de surface de chaque maille      ! tableau des pourcentages de surface de chaque maille
47      real, dimension(klon), intent(IN):: rlat  
48      ! rlat latitudes      real, intent(IN):: rlat(klon) ! latitudes
49      logical, intent(IN):: debut  
50      ! debut logical: 1er appel a la physique      logical, intent(IN):: debut ! 1er appel a la physique
51      ! (si false calcul simplifie des fluxs sur les continents)      ! (si false calcul simplifie des fluxs sur les continents)
52      !! PB ajout pour soil  
53      logical, intent(in):: soil_model      integer, intent(in):: nsoilmx
54      integer:: nsoilmx      REAL tsoil(klon, nsoilmx)
55      REAL, DIMENSION(klon, nsoilmx):: tsoil  
56      REAL, dimension(klon), intent(INOUT):: qsol      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      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
# Line 69  contains Line 70  contains
70      real, dimension(klon), intent(IN):: petBcoef, peqBcoef      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      real, intent(IN):: precip_rain(klon)
75      ! precip_snow precipitation solide      ! precipitation, liquid water mass flux (kg/m2/s), positive down
76    
77        real, intent(IN):: precip_snow(klon)
78        ! precipitation, solid water mass flux (kg/m2/s), positive down
79    
80      REAL, DIMENSION(klon), INTENT(INOUT):: fder      REAL, DIMENSION(klon), INTENT(INOUT):: fder
81      ! fder derivee des flux (pour le couplage)      ! fder derivee des flux (pour le couplage)
82      real, dimension(klon), intent(IN):: rugos, rugoro      real, dimension(klon), intent(IN):: rugos, rugoro
83      ! rugos rugosite      ! rugos rugosite
84      ! rugoro rugosite orographique      ! rugoro rugosite orographique
85      real, dimension(klon), intent(INOUT):: snow, qsurf      real, intent(INOUT):: snow(klon), qsurf(klon)
86      real, dimension(klon), intent(IN):: tsurf, p1lay      real, dimension(klon), intent(IN):: tsurf, p1lay
87      ! tsurf temperature de surface      ! tsurf temperature de surface
88      ! p1lay pression 1er niveau (milieu de couche)      ! p1lay pression 1er niveau (milieu de couche)
# Line 115  contains Line 120  contains
120    
121      !IM: "slab" ocean      !IM: "slab" ocean
122      real, dimension(klon), intent(OUT):: flux_o, flux_g      real, dimension(klon), intent(OUT):: flux_o, flux_g
     real, dimension(klon), intent(INOUT):: tslab  
     ! tslab temperature slab ocean  
     real, dimension(klon), intent(INOUT):: seaice ! glace de mer (kg/m2)  
123    
124      ! Local:      ! Local:
125    
     real, allocatable, dimension(:), save:: tmp_tslab  
126      REAL, dimension(klon):: soilcap      REAL, dimension(klon):: soilcap
127      REAL, dimension(klon):: soilflux      REAL, dimension(klon):: soilflux
128    
# Line 129  contains Line 130  contains
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
     real, allocatable, dimension(:), save:: tmp_flux_o, tmp_flux_g  
     real, allocatable, dimension(:), save:: tmp_radsol  
     real, allocatable, dimension(:, :), save:: tmp_pctsrf_slab  
     ! pctsrf_slab pourcentages (0-1) des sous-surfaces dans le slab  
     ! tmp_pctsrf_slab = pctsrf_slab  
     real, allocatable, dimension(:), save:: tmp_seaice  
133    
134      character (len = 20), save:: modname = 'interfsurf_hq'      character (len = 20), save:: modname = 'interfsurf_hq'
135      character (len = 80):: abort_message      character (len = 80):: abort_message
136      logical, save:: first_call = .true.      logical, save:: first_call = .true.
     integer, save:: error  
137      integer:: ii      integer:: ii
     logical, save:: check = .false.  
138      real, dimension(klon):: cal, beta, dif_grnd, capsol      real, dimension(klon):: cal, beta, dif_grnd, capsol
139      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.
140      real, parameter:: calsno=1./(2.3867e+06*.15)      real, parameter:: calsno=1./(2.3867e6 * 0.15)
141      real, dimension(klon):: tsurf_temp      real, dimension(klon):: tsurf_temp
142      real, dimension(klon):: alb_neig, alb_eau      real, dimension(klon):: alb_neig, alb_eau
143      real, DIMENSION(klon):: zfra      real, DIMENSION(klon):: zfra
144      INTEGER, dimension(1):: iloc      INTEGER, dimension(1):: iloc
145      real, dimension(klon):: fder_prev      real, dimension(klon):: fder_prev
     REAL, dimension(klon):: bidule  
146    
147      !-------------------------------------------------------------      !-------------------------------------------------------------
148    
     if (check) write(*, *) 'Entree ', modname  
   
149      ! On doit commencer par appeler les schemas de surfaces continentales      ! On doit commencer par appeler les schemas de surfaces continentales
150      ! car l'ocean a besoin du ruissellement qui est y calcule      ! car l'ocean a besoin du ruissellement qui est y calcule
151    
152      if (first_call) then      if (first_call) then
153         call conf_interface         call conf_interface
154         if (nisurf /= is_ter .and. klon > 1) then         if (nisurf /= is_ter .and. klon > 1) then
155            write(*, *)' *** Warning ***'            print *, ' Warning:'
156            write(*, *)' nisurf = ', nisurf, ' /= is_ter = ', is_ter            print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter
157            write(*, *)'or on doit commencer par les surfaces continentales'            print *, 'or on doit commencer par les surfaces continentales'
158            abort_message='voir ci-dessus'            abort_message='voir ci-dessus'
159            call abort_gcm(modname, abort_message, 1)            call abort_gcm(modname, abort_message, 1)
160         endif         endif
161         if ( is_oce > is_sic ) then         if (is_oce > is_sic) then
162            write(*, *)' *** Warning ***'            print *, 'Warning:'
163            write(*, *)' Pour des raisons de sequencement dans le code'            print *, ' Pour des raisons de sequencement dans le code'
164            write(*, *)' l''ocean doit etre traite avant la banquise'            print *, ' l''ocean doit etre traite avant la banquise'
165            write(*, *)' or is_oce = ', is_oce, '> is_sic = ', is_sic            print *, ' or is_oce = ', is_oce, '> is_sic = ', is_sic
166            abort_message='voir ci-dessus'            abort_message='voir ci-dessus'
167            call abort_gcm(modname, abort_message, 1)            call abort_gcm(modname, abort_message, 1)
168         endif         endif
# Line 198  contains Line 188  contains
188      flux_o = 0.      flux_o = 0.
189      flux_g = 0.      flux_g = 0.
190    
     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  
   
191      ! Aiguillage vers les differents schemas de surface      ! Aiguillage vers les differents schemas de surface
192    
193      if (nisurf == is_ter) then      if (nisurf == is_ter) then
194         ! Surface "terre" appel a l'interface avec les sols continentaux         ! Surface "terre" appel a l'interface avec les sols continentaux
195    
196         ! allocation du run-off         ! allocation du run-off
197         if (.not. allocated(coastalflow)) then         if (.not. allocated(run_off)) then
198            allocate(coastalflow(knon), stat = error)            allocate(run_off(knon))
199            if (error /= 0) then            run_off = 0.
200               abort_message='Pb allocation coastalflow'         else if (size(run_off) /= knon) then
201               call abort_gcm(modname, abort_message, 1)            print *, 'Bizarre, le nombre de points continentaux'
202            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  
   
           run_off=0.0  
        else if (size(coastalflow) /= knon) then  
           write(*, *)'Bizarre, le nombre de points continentaux'  
           write(*, *)'a change entre deux appels. J''arrete ...'  
203            abort_message='voir ci-dessus'            abort_message='voir ci-dessus'
204            call abort_gcm(modname, abort_message, 1)            call abort_gcm(modname, abort_message, 1)
205         endif         endif
        coastalflow = 0.  
        riverflow = 0.  
206    
207         ! Calcul age de la neige         ! Calcul age de la neige
208    
# Line 302  contains Line 212  contains
212              debut, alb_new, z0_new)              debut, alb_new, z0_new)
213    
214         ! calcul snow et qsurf, hydrol adapté         ! calcul snow et qsurf, hydrol adapté
215         CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd)         CALL calbeta(nisurf, snow(:knon), qsol(:knon), beta(:knon), &
216                capsol(:knon), dif_grnd(:knon))
217    
218         IF (soil_model) THEN         IF (soil_model) THEN
219            CALL soil(dtime, nisurf, knon, snow, tsurf, tsoil, soilcap, &            CALL soil(dtime, nisurf, knon, snow, tsurf, tsoil, soilcap, soilflux)
                soilflux)  
220            cal(1:knon) = RCPD / soilcap(1:knon)            cal(1:knon) = RCPD / soilcap(1:knon)
221            radsol(1:knon) = radsol(1:knon) + soilflux(1:knon)            radsol(1:knon) = radsol(1:knon) + soilflux(1:knon)
222         ELSE         ELSE
223            cal = RCPD * capsol            cal = RCPD * capsol
224         ENDIF         ENDIF
225         CALL calcul_fluxs( klon, knon, nisurf, dtime, &         CALL calcul_fluxs(klon, knon, nisurf, dtime, tsurf, p1lay, cal, beta, &
226              tsurf, p1lay, cal, beta, tq_cdrag, ps, &              tq_cdrag, ps, precip_rain, precip_snow, snow, qsurf, radsol, &
227              precip_rain, precip_snow, snow, qsurf, &              dif_grnd, temp_air, spechum, u1_lay, v1_lay, petAcoef, peqAcoef, &
228              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              petBcoef, peqBcoef, tsurf_new, evap, fluxlat, fluxsens, dflux_s, &
229              petAcoef, peqAcoef, petBcoef, peqBcoef, &              dflux_l)
230              tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)  
231           CALL fonte_neige(klon, knon, nisurf, dtime, tsurf, p1lay, beta, &
232         CALL fonte_neige( klon, knon, nisurf, dtime, &              tq_cdrag, ps, precip_rain(:knon), precip_snow, snow, qsol(:knon), &
233              tsurf, p1lay, cal, beta, tq_cdrag, ps, &              temp_air, spechum, u1_lay, v1_lay, petAcoef, peqAcoef, petBcoef, &
234              precip_rain, precip_snow, snow, qsol, &              peqBcoef, tsurf_new, evap, fqcalving, ffonte, run_off_lic_0)
             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)  
235    
236         call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)
237         where (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.         where (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.
238         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)))
239         alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &         alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &
240              alb_new(1 : knon)*(1.0-zfra(1:knon))              alb_new(1 : knon)*(1.0-zfra(1:knon))
241         z0_new = sqrt(z0_new**2+rugoro**2)         z0_new = sqrt(z0_new**2 + rugoro**2)
242         alblw(1 : knon) = alb_new(1 : knon)         alblw(1 : knon) = alb_new(1 : knon)
243    
244         ! Remplissage des pourcentages de surface         ! Remplissage des pourcentages de surface
# Line 350  contains Line 256  contains
256         alb_neig = 0.         alb_neig = 0.
257         agesno = 0.         agesno = 0.
258    
259         call calcul_fluxs( klon, knon, nisurf, dtime, &         call calcul_fluxs(klon, knon, nisurf, dtime, tsurf_temp, p1lay, cal, &
260              tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, &              beta, tq_cdrag, ps, precip_rain, precip_snow, snow, qsurf, &
261              precip_rain, precip_snow, snow, qsurf, &              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, petAcoef, &
262              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, fluxlat, fluxsens, &
263              petAcoef, peqAcoef, petBcoef, peqBcoef, &              dflux_s, dflux_l)
             tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)  
264    
265         fder_prev = fder         fder_prev = fder
266         fder = fder_prev + dflux_s + dflux_l         fder = fder_prev + dflux_s + dflux_l
267    
268         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  
269    
270         !IM: flux ocean-atmosphere utile pour le "slab" ocean         !IM: flux ocean-atmosphere utile pour le "slab" ocean
271         DO i=1, knon         DO i=1, knon
272            zx_sl(i) = RLVTT            zx_sl(i) = RLVTT
273            if (tsurf_new(i) .LT. RTT) zx_sl(i) = RLSTT            if (tsurf_new(i) .LT. RTT) zx_sl(i) = RLSTT
274            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)  
275         ENDDO         ENDDO
276    
277         ! calcul albedo         ! calcul albedo
278         if ( minval(rmu0) == maxval(rmu0) .and. minval(rmu0) == -999.999 ) then         if (minval(rmu0) == maxval(rmu0) .and. minval(rmu0) == -999.999) then
279            CALL alboc(FLOAT(jour), rlat, alb_eau)            CALL alboc(FLOAT(jour), rlat, alb_eau)
280         else ! cycle diurne         else ! cycle diurne
281            CALL alboc_cd(rmu0, alb_eau)            CALL alboc_cd(rmu0, alb_eau)
# Line 390  contains Line 287  contains
287         z0_new = sqrt(rugos**2 + rugoro**2)         z0_new = sqrt(rugos**2 + rugoro**2)
288         alblw(1:knon) = alb_new(1:knon)         alblw(1:knon) = alb_new(1:knon)
289      else if (nisurf == is_sic) then      else if (nisurf == is_sic) then
        if (check) write(*, *)'sea ice, nisurf = ', nisurf  
   
290         ! Surface "glace de mer" appel a l'interface avec l'ocean         ! Surface "glace de mer" appel a l'interface avec l'ocean
291    
292         ! ! lecture conditions limites         ! ! lecture conditions limites
293         CALL interfoce_lim(itime, dtime, jour, &         CALL interfoce_lim(itime, dtime, jour, klon, nisurf, knon, knindex, &
294              klon, nisurf, knon, knindex, &              debut, tsurf_new, pctsrf_new)
             debut, &  
             tsurf_new, pctsrf_new)  
295    
296         !IM cf LF         !IM cf LF
297         DO ii = 1, knon         DO ii = 1, knon
# Line 412  contains Line 305  contains
305            endif            endif
306         enddo         enddo
307    
308         CALL calbeta(dtime, nisurf, knon, snow, qsol, beta, capsol, dif_grnd)         CALL calbeta(nisurf, snow(:knon), qsol(:knon), beta(:knon), &
309                capsol(:knon), dif_grnd(:knon))
310    
311         IF (soil_model) THEN         IF (soil_model) THEN
312            CALL soil(dtime, nisurf, knon, snow, tsurf_new, tsoil, soilcap, &            CALL soil(dtime, nisurf, knon, snow, tsurf_new, tsoil, soilcap, &
# Line 429  contains Line 323  contains
323         tsurf_temp = tsurf_new         tsurf_temp = tsurf_new
324         beta = 1.0         beta = 1.0
325    
326         CALL calcul_fluxs( klon, knon, nisurf, dtime, &         CALL calcul_fluxs(klon, knon, nisurf, dtime, tsurf_temp, p1lay, cal, &
327              tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, &              beta, tq_cdrag, ps, precip_rain, precip_snow, snow, qsurf, &
328              precip_rain, precip_snow, snow, qsurf, &              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, petAcoef, &
329              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, fluxlat, fluxsens, &
330              petAcoef, peqAcoef, petBcoef, peqBcoef, &              dflux_s, dflux_l)
             tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)  
331    
332         !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
333         DO i = 1, knon         DO i = 1, knon
334            flux_g(i) = 0.0            flux_g(i) = 0.0
335              IF (cal(i) > 1e-15) flux_g(i) = (tsurf_new(i) - t_grnd) &
336            !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)  
337         ENDDO         ENDDO
338    
339         CALL fonte_neige( klon, knon, nisurf, dtime, &         CALL fonte_neige(klon, knon, nisurf, dtime, tsurf_temp, p1lay, beta, &
340              tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, &              tq_cdrag, ps, precip_rain(:knon), precip_snow, snow, qsol(:knon), &
341              precip_rain, precip_snow, snow, qsol, &              temp_air, spechum, u1_lay, v1_lay, petAcoef, peqAcoef, petBcoef, &
342              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              peqBcoef, tsurf_new, evap, fqcalving, ffonte, run_off_lic_0)
             petAcoef, peqAcoef, petBcoef, peqBcoef, &  
             tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l, &  
             fqcalving, ffonte, run_off_lic_0)  
343    
344         ! calcul albedo         ! calcul albedo
345    
346         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)
347         WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.         WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.
348         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)))
349         alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &         alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &
350              0.6 * (1.0-zfra(1:knon))              0.6 * (1.0-zfra(1:knon))
351    
# Line 479  contains Line 353  contains
353         fder = fder_prev + dflux_s + dflux_l         fder = fder_prev + dflux_s + dflux_l
354    
355         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  
   
356    
357         ! 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
358    
359         z0_new = 0.002         z0_new = 0.002
360         z0_new = SQRT(z0_new**2+rugoro**2)         z0_new = SQRT(z0_new**2 + rugoro**2)
361         alblw(1:knon) = alb_new(1:knon)         alblw(1:knon) = alb_new(1:knon)
362    
363      else if (nisurf == is_lic) then      else if (nisurf == is_lic) then
   
        if (check) write(*, *)'glacier, nisurf = ', nisurf  
   
364         if (.not. allocated(run_off_lic)) then         if (.not. allocated(run_off_lic)) then
365            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  
366            run_off_lic = 0.            run_off_lic = 0.
367         endif         endif
368    
# Line 519  contains Line 379  contains
379         beta = 1.0         beta = 1.0
380         dif_grnd = 0.0         dif_grnd = 0.0
381    
382         call calcul_fluxs( klon, knon, nisurf, dtime, &         call calcul_fluxs(klon, knon, nisurf, dtime, tsurf, p1lay, cal, beta, &
383              tsurf, p1lay, cal, beta, tq_cdrag, ps, &              tq_cdrag, ps, precip_rain, precip_snow, snow, qsurf, radsol, &
384              precip_rain, precip_snow, snow, qsurf, &              dif_grnd, temp_air, spechum, u1_lay, v1_lay, petAcoef, peqAcoef, &
385              radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &              petBcoef, peqBcoef, tsurf_new, evap, fluxlat, fluxsens, dflux_s, &
386              petAcoef, peqAcoef, petBcoef, peqBcoef, &              dflux_l)
387              tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)  
388           call fonte_neige(klon, knon, nisurf, dtime, tsurf, p1lay, beta, &
389         call fonte_neige( klon, knon, nisurf, dtime, &              tq_cdrag, ps, precip_rain(:knon), precip_snow, snow, qsol(:knon), &
390              tsurf, p1lay, cal, beta, tq_cdrag, ps, &              temp_air, spechum, u1_lay, v1_lay, petAcoef, peqAcoef, petBcoef, &
391              precip_rain, precip_snow, snow, qsol, &              peqBcoef, tsurf_new, evap, fqcalving, ffonte, run_off_lic_0)
             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)  
392    
393         ! calcul albedo         ! calcul albedo
   
394         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)
395         WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.         WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.
396         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)))
397         alb_new(1 : knon) = alb_neig(1 : knon)*zfra(1:knon) + &         alb_new(1 : knon) = alb_neig(1 : knon)*zfra(1:knon) + &
398              0.6 * (1.0-zfra(1:knon))              0.6 * (1.0-zfra(1:knon))
399    
400         !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  
401         !IM: KstaTER0.77 & LMD_ARMIP6         !IM: KstaTER0.77 & LMD_ARMIP6
402         alb_new(1 : knon) = 0.77         alb_new(1 : knon) = 0.77
403    
   
404         ! Rugosite         ! Rugosite
   
405         z0_new = rugoro         z0_new = rugoro
406    
407         ! Remplissage des pourcentages de surface         ! Remplissage des pourcentages de surface
   
408         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)
409    
410         alblw(1:knon) = alb_new(1:knon)         alblw(1:knon) = alb_new(1:knon)
411      else      else
412         write(*, *)'Index surface = ', nisurf         print *, 'Index surface = ', nisurf
413         abort_message = 'Index surface non valable'         abort_message = 'Index surface non valable'
414         call abort_gcm(modname, abort_message, 1)         call abort_gcm(modname, abort_message, 1)
415      endif      endif

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

  ViewVC Help
Powered by ViewVC 1.1.21