/[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 300 by guez, Thu Aug 2 15:55:01 2018 UTC revision 301 by guez, Thu Aug 2 17:23:07 2018 UTC
# Line 4  module interfsurf_hq_m Line 4  module interfsurf_hq_m
4    
5  contains  contains
6    
7    SUBROUTINE interfsurf_hq(julien, mu0, nisurf, knindex, debut, tsoil, qsol, &    SUBROUTINE interfsurf_hq(julien, mu0, nisurf, knindex, tsoil, qsol, u1_lay, &
8         u1_lay, v1_lay, temp_air, spechum, tq_cdrag, tAcoef, qAcoef, tBcoef, &         v1_lay, temp_air, spechum, tq_cdrag, tAcoef, qAcoef, tBcoef, qBcoef, &
9         qBcoef, precip_rain, precip_snow, rugos, rugoro, snow, qsurf, ts, &         precip_rain, precip_snow, rugos, rugoro, snow, qsurf, ts, p1lay, ps, &
10         p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, dflux_s, tsurf_new, &         radsol, evap, flux_t, fluxlat, dflux_l, dflux_s, tsurf_new, albedo, &
11         albedo, z0_new, pctsrf_new_sic, agesno, fqcalving, ffonte, run_off_lic_0)         z0_new, pctsrf_new_sic, agesno, fqcalving, ffonte, run_off_lic_0, &
12           run_off_lic)
13    
14      ! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface      ! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface
15      ! en g\'en\'eral (sols continentaux, oc\'eans, glaces) pour les flux de      ! en g\'en\'eral (sols continentaux, oc\'eans, glaces) pour les flux de
# Line 20  contains Line 21  contains
21      use alboc_cd_m, only: alboc_cd      use alboc_cd_m, only: alboc_cd
22      USE albsno_m, ONLY: albsno      USE albsno_m, ONLY: albsno
23      USE calcul_fluxs_m, ONLY: calcul_fluxs      USE calcul_fluxs_m, ONLY: calcul_fluxs
     USE dimphy, ONLY: klon  
24      USE fonte_neige_m, ONLY: fonte_neige      USE fonte_neige_m, ONLY: fonte_neige
25      USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter      USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter
     USE conf_interface_m, ONLY: conf_interface  
26      USE interfsur_lim_m, ONLY: interfsur_lim      USE interfsur_lim_m, ONLY: interfsur_lim
27      use limit_read_sst_m, only: limit_read_sst      use limit_read_sst_m, only: limit_read_sst
28      use soil_m, only: soil      use soil_m, only: soil
# Line 36  contains Line 35  contains
35      integer, intent(in):: knindex(:) ! (knon)      integer, intent(in):: knindex(:) ! (knon)
36      ! index des points de la surface a traiter      ! index des points de la surface a traiter
37    
     logical, intent(IN):: debut ! 1er appel a la physique  
     ! (si false calcul simplifie des fluxs sur les continents)  
   
38      REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx)      REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx)
39    
40      REAL, intent(INOUT):: qsol(:) ! (knon)      REAL, intent(INOUT):: qsol(:) ! (knon)
# Line 96  contains Line 92  contains
92      real, intent(INOUT):: run_off_lic_0(:) ! (knon)      real, intent(INOUT):: run_off_lic_0(:) ! (knon)
93      ! run_off_lic_0 runoff glacier du pas de temps precedent      ! run_off_lic_0 runoff glacier du pas de temps precedent
94    
95        REAL, intent(OUT):: run_off_lic(:) ! (knon) ruissellement total
96    
97      ! Local:      ! Local:
     integer knon ! nombre de points de la surface a traiter  
98      REAL soilcap(size(knindex)) ! (knon)      REAL soilcap(size(knindex)) ! (knon)
99      REAL soilflux(size(knindex)) ! (knon)      REAL soilflux(size(knindex)) ! (knon)
     logical:: first_call = .true.  
100      integer ii      integer ii
101      real cal(size(knindex)) ! (knon)      real cal(size(knindex)) ! (knon)
102      real beta(size(knindex)) ! (knon) evap reelle      real beta(size(knindex)) ! (knon) evap reelle
# Line 113  contains Line 109  contains
109    
110      !-------------------------------------------------------------      !-------------------------------------------------------------
111    
     knon = size(knindex)  
   
     ! On doit commencer par appeler les sch\'emas de surfaces  
     ! continentales car l'oc\'ean a besoin du ruissellement.  
   
     if (first_call) then  
        call conf_interface  
   
        if (nisurf /= is_ter .and. klon > 1) then  
           print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter  
           call abort_gcm("interfsurf_hq", &  
                'On doit commencer par les surfaces continentales.')  
        endif  
   
        if (is_oce > is_sic) then  
           print *, 'is_oce = ', is_oce, '> is_sic = ', is_sic  
           call abort_gcm("interfsurf_hq", &  
                "L'oc\'ean doit \^etre trait\'e avant la banquise.")  
        endif  
   
        first_call = .false.  
     endif  
   
     ! Aiguillage vers les differents schemas de surface  
   
112      select case (nisurf)      select case (nisurf)
113      case (is_ter)      case (is_ter)
114         ! Surface "terre", appel \`a l'interface avec les sols continentaux         ! Surface "terre", appel \`a l'interface avec les sols continentaux
# Line 147  contains Line 118  contains
118         ! Read albedo from the file containing boundary conditions then         ! Read albedo from the file containing boundary conditions then
119         ! add the albedo of snow:         ! add the albedo of snow:
120    
121         call interfsur_lim(julien, knindex, debut, albedo, z0_new)         call interfsur_lim(julien, knindex, albedo, z0_new)
122    
123         beta = min(2. * qsol / max_eau_sol, 1.)         beta = min(2. * qsol / max_eau_sol, 1.)
124         CALL soil(is_ter, snow, ts, tsoil, soilcap, soilflux)         CALL soil(is_ter, snow, ts, tsoil, soilcap, soilflux)
# Line 158  contains Line 129  contains
129              qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &              qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &
130              dflux_l, dif_grnd = 0.)              dflux_l, dif_grnd = 0.)
131         CALL fonte_neige(is_ter, precip_rain, precip_snow, snow, qsol, &         CALL fonte_neige(is_ter, precip_rain, precip_snow, snow, qsol, &
132              tsurf_new, evap, fqcalving, ffonte, run_off_lic_0)              tsurf_new, evap, fqcalving, ffonte, run_off_lic_0, run_off_lic)
133    
134         call albsno(agesno, alb_neig, precip_snow)         call albsno(agesno, alb_neig, precip_snow)
135         where (snow < 0.0001) agesno = 0.         where (snow < 0.0001) agesno = 0.
# Line 182  contains Line 153  contains
153      case (is_sic)      case (is_sic)
154         ! Surface "glace de mer" appel a l'interface avec l'ocean         ! Surface "glace de mer" appel a l'interface avec l'ocean
155    
156         DO ii = 1, knon         DO ii = 1, size(knindex)
157            IF (pctsrf_new_sic(ii) < EPSFRA) then            IF (pctsrf_new_sic(ii) < EPSFRA) then
158               snow(ii) = 0.               snow(ii) = 0.
159               tsurf_new(ii) = RTT - 1.8               tsurf_new(ii) = RTT - 1.8
# Line 201  contains Line 172  contains
172              qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &              qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &
173              dflux_l, dif_grnd = 1. / tau_gl)              dflux_l, dif_grnd = 1. / tau_gl)
174         CALL fonte_neige(is_sic, precip_rain, precip_snow, snow, qsol, &         CALL fonte_neige(is_sic, precip_rain, precip_snow, snow, qsol, &
175              tsurf_new, evap, fqcalving, ffonte, run_off_lic_0)              tsurf_new, evap, fqcalving, ffonte, run_off_lic_0, run_off_lic)
176    
177         ! Compute the albedo:         ! Compute the albedo:
178    
# Line 222  contains Line 193  contains
193              qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &              qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &
194              dflux_l, dif_grnd = 0.)              dflux_l, dif_grnd = 0.)
195         call fonte_neige(is_lic, precip_rain, precip_snow, snow, qsol, &         call fonte_neige(is_lic, precip_rain, precip_snow, snow, qsol, &
196              tsurf_new, evap, fqcalving, ffonte, run_off_lic_0)              tsurf_new, evap, fqcalving, ffonte, run_off_lic_0, run_off_lic)
197    
198         ! calcul albedo         ! calcul albedo
199         CALL albsno(agesno, alb_neig, precip_snow)         CALL albsno(agesno, alb_neig, precip_snow)

Legend:
Removed from v.300  
changed lines
  Added in v.301

  ViewVC Help
Powered by ViewVC 1.1.21