/[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 254 by guez, Mon Feb 5 10:39:38 2018 UTC revision 281 by guez, Fri Jul 20 16:28:36 2018 UTC
# Line 20  contains Line 20  contains
20      USE abort_gcm_m, ONLY: abort_gcm      USE abort_gcm_m, ONLY: abort_gcm
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
     use calbeta_m, only: calbeta  
23      USE calcul_fluxs_m, ONLY: calcul_fluxs      USE calcul_fluxs_m, ONLY: calcul_fluxs
     use clesphys2, only: soil_model  
24      USE dimphy, ONLY: klon      USE dimphy, ONLY: klon
25      USE fonte_neige_m, ONLY: fonte_neige      USE fonte_neige_m, ONLY: fonte_neige
26      USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter      USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter
# Line 50  contains Line 48  contains
48    
49      real, intent(IN):: u1_lay(:), v1_lay(:) ! (knon) vitesse 1ere couche      real, intent(IN):: u1_lay(:), v1_lay(:) ! (knon) vitesse 1ere couche
50    
51      real, dimension(klon), intent(IN):: temp_air, spechum      real, intent(IN):: temp_air(:) ! (knon) temperature de l'air 1ere couche
52      ! temp_air temperature de l'air 1ere couche      real, intent(IN):: spechum(:) ! (knon) humidite specifique 1ere couche
     ! spechum humidite specifique 1ere couche  
53      real, intent(IN):: tq_cdrag(:) ! (knon) coefficient d'echange      real, intent(IN):: tq_cdrag(:) ! (knon) coefficient d'echange
54    
55      real, dimension(klon), intent(IN):: petAcoef, peqAcoef      real, intent(IN):: petAcoef(:), peqAcoef(:) ! (knon)
56      ! coefficients A de la r\'esolution de la couche limite pour t et q      ! coefficients A de la r\'esolution de la couche limite pour t et q
57    
58      real, dimension(klon), intent(IN):: petBcoef, peqBcoef      real, intent(IN):: petBcoef(:), peqBcoef(:) ! (knon)
59      ! coefficients B de la r\'esolution de la couche limite pour t et q      ! coefficients B de la r\'esolution de la couche limite pour t et q
60    
61      real, intent(IN):: precip_rain(klon)      real, intent(IN):: precip_rain(klon)
# Line 72  contains Line 69  contains
69      real, intent(INOUT):: snow(:) ! (knon)      real, intent(INOUT):: snow(:) ! (knon)
70      real, intent(INOUT):: qsurf(klon)      real, intent(INOUT):: qsurf(klon)
71      real, intent(IN):: ts(:) ! (knon) temp\'erature de surface      real, intent(IN):: ts(:) ! (knon) temp\'erature de surface
72      real, intent(IN):: p1lay(klon) ! pression 1er niveau (milieu de couche)      real, intent(IN):: p1lay(:) ! (knon) pression 1er niveau (milieu de couche)
73      real, dimension(klon), intent(IN):: ps ! pression au sol      real, intent(IN):: ps(:) ! (knon) pression au sol
74      REAL, INTENT(INOUT):: radsol(:) ! (knon) rayonnement net au sol (LW + SW)      REAL, INTENT(IN):: radsol(:) ! (knon) rayonnement net au sol (LW + SW)
75      real, intent(OUT):: evap(:) ! (knon) evaporation totale      real, intent(OUT):: evap(:) ! (knon) evaporation totale
76    
77      real, intent(OUT):: flux_t(:) ! (knon) flux de chaleur sensible      real, intent(OUT):: flux_t(:) ! (knon) flux de chaleur sensible
78      ! (Cp T) à la surface, positif vers le bas, W / m2      ! (Cp T) à la surface, positif vers le bas, W / m2
79        
80      real, intent(OUT):: fluxlat(:) ! (knon) flux de chaleur latente      real, intent(OUT):: fluxlat(:) ! (knon) flux de chaleur latente
81      real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon)      real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon)
82      real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol      real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol
# Line 93  contains Line 90  contains
90    
91      ! Flux d'eau "perdue" par la surface et n\'ecessaire pour limiter la      ! Flux d'eau "perdue" par la surface et n\'ecessaire pour limiter la
92      ! hauteur de neige, en kg / m2 / s      ! hauteur de neige, en kg / m2 / s
93      real, dimension(klon), intent(INOUT):: fqcalving      real, intent(OUT):: fqcalving(:) ! (knon)
94    
95      ! Flux thermique utiliser pour fondre la neige      ! Flux thermique utiliser pour fondre la neige
96      real, dimension(klon), intent(INOUT):: ffonte      real, dimension(klon), intent(INOUT):: ffonte
# Line 109  contains Line 106  contains
106      integer ii      integer ii
107      real cal(size(knindex)) ! (knon)      real cal(size(knindex)) ! (knon)
108      real beta(size(knindex)) ! (knon) evap reelle      real beta(size(knindex)) ! (knon) evap reelle
109      real dif_grnd(klon), capsol(klon)      real dif_grnd(klon)
     real, parameter:: calice = 1. / (5.1444e6 * 0.15), tau_gl = 86400. * 5.  
     real, parameter:: calsno = 1. / (2.3867e6 * 0.15)  
110      real tsurf(size(knindex)) ! (knon)      real tsurf(size(knindex)) ! (knon)
111      real alb_neig(size(knindex)) ! (knon)      real alb_neig(size(knindex)) ! (knon)
112      real zfra(size(knindex)) ! (knon)      real zfra(size(knindex)) ! (knon)
113      REAL, PARAMETER:: fmagic = 1. ! facteur magique pour r\'egler l'alb\'edo      REAL, PARAMETER:: fmagic = 1. ! facteur magique pour r\'egler l'alb\'edo
114        REAL, PARAMETER:: max_eau_sol = 150. ! in kg m-2
115        REAL, PARAMETER:: tau_gl = 86400. * 5.
116    
117      !-------------------------------------------------------------      !-------------------------------------------------------------
118    
119      knon = size(knindex)      knon = size(knindex)
120        
121      ! On doit commencer par appeler les schemas de surfaces continentales      ! On doit commencer par appeler les schemas de surfaces continentales
122      ! car l'ocean a besoin du ruissellement qui est y calcule      ! car l'ocean a besoin du ruissellement qui est y calcule
123    
# Line 146  contains Line 143  contains
143      ! Initialisations diverses      ! Initialisations diverses
144    
145      ffonte(1:knon) = 0.      ffonte(1:knon) = 0.
     fqcalving(1:knon) = 0.  
146      dif_grnd = 999999.      dif_grnd = 999999.
     capsol = 999999.  
147      z0_new = 999999.      z0_new = 999999.
148    
149      ! Aiguillage vers les differents schemas de surface      ! Aiguillage vers les differents schemas de surface
# Line 164  contains Line 159  contains
159    
160         call interfsur_lim(dtime, julien, knindex, debut, albedo, z0_new)         call interfsur_lim(dtime, julien, knindex, debut, albedo, z0_new)
161    
162         ! Calcul de snow et qsurf, hydrologie adapt\'ee         beta = min(2. * qsol / max_eau_sol, 1.)
163         CALL calbeta(is_ter, snow, qsol, beta, capsol(:knon), dif_grnd(:knon))         dif_grnd(:knon) = 0.
164           CALL soil(dtime, is_ter, snow, ts, tsoil, soilcap, soilflux)
165         IF (soil_model) THEN         cal = RCPD / soilcap
166            CALL soil(dtime, is_ter, snow, ts, tsoil, soilcap, soilflux)  
167            cal = RCPD / soilcap         CALL calcul_fluxs(dtime, ts, p1lay, cal, beta, tq_cdrag, ps, &
168            radsol = radsol + soilflux              qsurf(:knon), radsol + soilflux, dif_grnd(:knon), temp_air, &
169         ELSE              spechum, u1_lay, v1_lay, petAcoef, peqAcoef, petBcoef, &
170            cal = RCPD * capsol(:knon)              peqBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)
171         ENDIF         CALL fonte_neige(is_ter, dtime, precip_rain(:knon), precip_snow(:knon), &
172                snow, qsol, tsurf_new, evap, fqcalving, ffonte(:knon), &
173         CALL calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag, &              run_off_lic_0(:knon))
             ps(:knon), qsurf(:knon), radsol, dif_grnd(:knon), &  
             temp_air(:knon), spechum(:knon), u1_lay, v1_lay, &  
             petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &  
             peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)  
        CALL fonte_neige(is_ter, dtime, precip_rain(:knon), &  
             precip_snow(:knon), snow, qsol, tsurf_new, evap, &  
             fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))  
174    
175         call albsno(dtime, agesno, alb_neig, precip_snow(:knon))         call albsno(dtime, agesno, alb_neig, precip_snow(:knon))
176         where (snow < 0.0001) agesno = 0.         where (snow < 0.0001) agesno = 0.
# Line 196  contains Line 184  contains
184         cal = 0.         cal = 0.
185         beta = 1.         beta = 1.
186         dif_grnd = 0.         dif_grnd = 0.
187         call calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, &         call calcul_fluxs(dtime, tsurf, p1lay, cal, beta, tq_cdrag, ps, &
188              tq_cdrag, ps(:knon), qsurf(:knon), radsol, &              qsurf(:knon), radsol, dif_grnd(:knon), temp_air, spechum, u1_lay, &
189              dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay, &              v1_lay, petAcoef, peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, &
190              v1_lay, petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &              fluxlat, flux_t, dflux_s, dflux_l)
             peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)  
191         agesno = 0.         agesno = 0.
192         albedo = alboc_cd(rmu0(knindex)) * fmagic         albedo = alboc_cd(rmu0(knindex)) * fmagic
193         z0_new = sqrt(rugos**2 + rugoro**2)         z0_new = sqrt(rugos**2 + rugoro**2)
194           fqcalving = 0.
195      case (is_sic)      case (is_sic)
196         ! Surface "glace de mer" appel a l'interface avec l'ocean         ! Surface "glace de mer" appel a l'interface avec l'ocean
197    
# Line 211  contains Line 199  contains
199            IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then            IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then
200               snow(ii) = 0.               snow(ii) = 0.
201               tsurf_new(ii) = RTT - 1.8               tsurf_new(ii) = RTT - 1.8
202               IF (soil_model) tsoil(ii, :) = RTT - 1.8               tsoil(ii, :) = RTT - 1.8
203            else            else
204               tsurf_new(ii) = ts(ii)               tsurf_new(ii) = ts(ii)
205            endif            endif
206         enddo         enddo
207    
208         CALL calbeta(is_sic, snow, qsol, beta, capsol(:knon), dif_grnd(:knon))         CALL soil(dtime, is_sic, snow, tsurf_new, tsoil, soilcap, soilflux)
209           cal = RCPD / soilcap
210         IF (soil_model) THEN         dif_grnd = 1. / tau_gl
           CALL soil(dtime, is_sic, snow, tsurf_new, tsoil, soilcap, &  
                soilflux)  
           cal = RCPD / soilcap  
           radsol = radsol + soilflux  
           dif_grnd = 0.  
        ELSE  
           dif_grnd = 1. / tau_gl  
           cal = RCPD * calice  
           WHERE (snow > 0.) cal = RCPD * calsno  
        ENDIF  
211         tsurf = tsurf_new         tsurf = tsurf_new
212         beta = 1.         beta = 1.
213    
214         CALL calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, &         CALL calcul_fluxs(dtime, tsurf, p1lay, cal, beta, tq_cdrag, ps, &
215              tq_cdrag, ps(:knon), qsurf(:knon), radsol, &              qsurf(:knon), radsol + soilflux, dif_grnd(:knon), temp_air, &
216              dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay, &              spechum, u1_lay, v1_lay, petAcoef, peqAcoef, petBcoef, &
217              v1_lay, petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &              peqBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)
             peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)  
218         CALL fonte_neige(is_sic, dtime, precip_rain(:knon), &         CALL fonte_neige(is_sic, dtime, precip_rain(:knon), &
219              precip_snow(:knon), snow, qsol, tsurf_new, evap, &              precip_snow(:knon), snow, qsol, tsurf_new, evap, &
220              fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))              fqcalving, ffonte(:knon), run_off_lic_0(:knon))
221    
222         ! Compute the albedo:         ! Compute the albedo:
223    
# Line 253  contains Line 230  contains
230      case (is_lic)      case (is_lic)
231         ! Surface "glacier continentaux" appel a l'interface avec le sol         ! Surface "glacier continentaux" appel a l'interface avec le sol
232    
233         IF (soil_model) THEN         CALL soil(dtime, is_lic, snow, ts, tsoil, soilcap, soilflux)
234            CALL soil(dtime, is_lic, snow, ts, tsoil, soilcap, soilflux)         cal = RCPD / soilcap
           cal = RCPD / soilcap  
           radsol = radsol + soilflux  
        ELSE  
           cal = RCPD * calice  
           WHERE (snow > 0.) cal = RCPD * calsno  
        ENDIF  
235         beta = 1.         beta = 1.
236         dif_grnd = 0.         dif_grnd = 0.
237    
238         call calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag, &         call calcul_fluxs(dtime, ts, p1lay, cal, beta, tq_cdrag, ps, &
239              ps(:knon), qsurf(:knon), radsol, dif_grnd(:knon), &              qsurf(:knon), radsol + soilflux, dif_grnd(:knon), temp_air, &
240              temp_air(:knon), spechum(:knon), u1_lay, v1_lay, &              spechum, u1_lay, v1_lay, petAcoef, peqAcoef, petBcoef, &
241              petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &              peqBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)
             peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)  
242         call fonte_neige(is_lic, dtime, precip_rain(:knon), &         call fonte_neige(is_lic, dtime, precip_rain(:knon), &
243              precip_snow(:knon), snow, qsol, tsurf_new, evap, &              precip_snow(:knon), snow, qsol, tsurf_new, evap, &
244              fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))              fqcalving, ffonte(:knon), run_off_lic_0(:knon))
245    
246         ! calcul albedo         ! calcul albedo
247         CALL albsno(dtime, agesno, alb_neig, precip_snow(:knon))         CALL albsno(dtime, agesno, alb_neig, precip_snow(:knon))

Legend:
Removed from v.254  
changed lines
  Added in v.281

  ViewVC Help
Powered by ViewVC 1.1.21