/[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/Sources/phylmd/Interface_surf/interfsurf_hq.f revision 222 by guez, Tue Apr 25 15:31:48 2017 UTC trunk/phylmd/Interface_surf/interfsurf_hq.f revision 297 by guez, Thu Jul 26 16:02:11 2018 UTC
# Line 6  contains Line 6  contains
6    
7    SUBROUTINE interfsurf_hq(dtime, julien, rmu0, nisurf, knindex, debut, &    SUBROUTINE interfsurf_hq(dtime, julien, rmu0, nisurf, knindex, debut, &
8         tsoil, qsol, u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, &         tsoil, qsol, u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, &
9         peqAcoef, petBcoef, peqBcoef, precip_rain, precip_snow, fder, rugos, &         peqAcoef, petBcoef, peqBcoef, precip_rain, precip_snow, rugos, rugoro, &
10         rugoro, snow, qsurf, ts, p1lay, ps, radsol, evap, flux_t, fluxlat, &         snow, qsurf, ts, p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, &
11         dflux_l, dflux_s, tsurf_new, albedo, z0_new, pctsrf_new_sic, agesno, &         dflux_s, tsurf_new, albedo, z0_new, pctsrf_new_sic, agesno, fqcalving, &
12         fqcalving, ffonte, run_off_lic_0)         ffonte, run_off_lic_0)
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 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
27      USE interface_surf, ONLY: conf_interface      USE conf_interface_m, ONLY: conf_interface
28      USE interfsur_lim_m, ONLY: interfsur_lim      USE interfsur_lim_m, ONLY: interfsur_lim
29      use read_sst_m, only: read_sst      use limit_read_sst_m, only: limit_read_sst
30      use soil_m, only: soil      use soil_m, only: soil
31      USE suphec_m, ONLY: rcpd, rtt      USE suphec_m, ONLY: rcpd, rtt
32    
# Line 45  contains Line 43  contains
43    
44      REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx)      REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx)
45    
46      REAL, intent(INOUT):: qsol(klon)      REAL, intent(INOUT):: qsol(:) ! (knon)
47      ! column-density of water in soil, in kg m-2      ! column-density of water in soil, in kg m-2
48    
49      real, dimension(klon), intent(IN):: u1_lay, v1_lay      real, intent(IN):: u1_lay(:), v1_lay(:) ! (knon) vitesse 1ere couche
     ! u1_lay vitesse u 1ere couche  
     ! v1_lay vitesse v 1ere couche  
     real, dimension(klon), intent(IN):: temp_air, spechum  
     ! temp_air temperature de l'air 1ere couche  
     ! spechum humidite specifique 1ere couche  
     real, dimension(klon), intent(INOUT):: tq_cdrag ! coefficient d'echange  
50    
51      real, dimension(klon), intent(IN):: petAcoef, peqAcoef      real, intent(IN):: temp_air(:) ! (knon) temperature de l'air 1ere couche
52        real, intent(IN):: spechum(:) ! (knon) humidite specifique 1ere couche
53        real, intent(IN):: tq_cdrag(:) ! (knon) coefficient d'echange
54    
55        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 68  contains Line 64  contains
64      real, intent(IN):: precip_snow(klon)      real, intent(IN):: precip_snow(klon)
65      ! precipitation, solid water mass flux (kg / m2 / s), positive down      ! precipitation, solid water mass flux (kg / m2 / s), positive down
66    
67      REAL, INTENT(INOUT):: fder(:) ! (knon) derivee des flux (pour le couplage)      real, intent(IN):: rugos(:) ! (knon) rugosite
68      real, intent(IN):: rugos(klon) ! rugosite      real, intent(IN):: rugoro(:) ! (knon) rugosite orographique
     real, intent(IN):: rugoro(klon) ! rugosite orographique  
69      real, intent(INOUT):: snow(:) ! (knon)      real, intent(INOUT):: snow(:) ! (knon)
70      real, intent(INOUT):: qsurf(klon)      real, intent(OUT):: qsurf(:) ! (knon)
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
83      real, intent(OUT):: albedo(:) ! (knon) albedo      real, intent(OUT):: albedo(:) ! (knon) albedo
84      real, intent(OUT):: z0_new(klon) ! surface roughness      real, intent(OUT):: z0_new(:) ! (knon) surface roughness
85    
86      real, intent(in):: pctsrf_new_sic(:) ! (klon)      real, intent(in):: pctsrf_new_sic(:) ! (klon)
87      ! nouvelle repartition des surfaces      ! nouvelle repartition des surfaces
88    
89      real, intent(INOUT):: agesno(:) ! (knon)      real, intent(INOUT):: agesno(:) ! (knon)
90    
91        real, intent(OUT):: fqcalving(:) ! (knon)
92      ! 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
93      ! hauteur de neige, en kg / m2 / s      ! hauteur de neige, en kg / m2 / s
     real, dimension(klon), intent(INOUT):: fqcalving  
94    
     ! Flux thermique utiliser pour fondre la neige  
95      real, dimension(klon), intent(INOUT):: ffonte      real, dimension(klon), intent(INOUT):: ffonte
96        ! Flux thermique utiliser pour fondre la neige
97    
98      real, dimension(klon), intent(INOUT):: run_off_lic_0      real, dimension(klon), intent(INOUT):: run_off_lic_0
99      ! run_off_lic_0 runoff glacier du pas de temps precedent      ! run_off_lic_0 runoff glacier du pas de temps precedent
# Line 111  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 148  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.  
     z0_new = 999999.  
147    
148      ! Aiguillage vers les differents schemas de surface      ! Aiguillage vers les differents schemas de surface
149    
# Line 166  contains Line 158  contains
158    
159         call interfsur_lim(dtime, julien, knindex, debut, albedo, z0_new)         call interfsur_lim(dtime, julien, knindex, debut, albedo, z0_new)
160    
161         ! Calcul de snow et qsurf, hydrologie adapt\'ee         beta = min(2. * qsol / max_eau_sol, 1.)
162         CALL calbeta(is_ter, snow, qsol(:knon), beta, capsol(:knon), &         dif_grnd(:knon) = 0.
163              dif_grnd(:knon))         CALL soil(dtime, is_ter, snow, ts, tsoil, soilcap, soilflux)
164           cal = RCPD / soilcap
165         IF (soil_model) THEN  
166            CALL soil(dtime, is_ter, snow, ts, tsoil, soilcap, soilflux)         CALL calcul_fluxs(dtime, ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, &
167            cal = RCPD / soilcap              radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, &
168            radsol = radsol + soilflux              v1_lay, petAcoef, peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, &
169         ELSE              fluxlat, flux_t, dflux_s, dflux_l)
170            cal = RCPD * capsol(:knon)         CALL fonte_neige(is_ter, dtime, precip_rain(:knon), precip_snow(:knon), &
171         ENDIF              snow, qsol, tsurf_new, evap, fqcalving, ffonte(:knon), &
172                run_off_lic_0(:knon))
        CALL calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag(:knon), &  
             ps(:knon), qsurf(:knon), radsol, dif_grnd(:knon), &  
             temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), &  
             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(:knon), tsurf_new, evap, &  
             fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))  
173    
174         call albsno(dtime, agesno, alb_neig, precip_snow(:knon))         call albsno(dtime, agesno, alb_neig, precip_snow(:knon))
175         where (snow < 0.0001) agesno = 0.         where (snow < 0.0001) agesno = 0.
# Line 195  contains Line 179  contains
179      case (is_oce)      case (is_oce)
180         ! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean         ! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean
181    
182         call read_sst(julien, knindex, tsurf)         call limit_read_sst(julien, knindex, tsurf)
183         cal = 0.         cal = 0.
184         beta = 1.         beta = 1.
185         dif_grnd = 0.         dif_grnd = 0.
186         call calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, &         call calcul_fluxs(dtime, tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, &
187              tq_cdrag(:knon), ps(:knon), qsurf(:knon), radsol, &              radsol, dif_grnd(:knon), temp_air, spechum, u1_lay, v1_lay, &
188              dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay(:knon), &              petAcoef, peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, fluxlat, &
189              v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), &              flux_t, dflux_s, dflux_l)
             peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)  
190         agesno = 0.         agesno = 0.
        fder = fder + dflux_s + dflux_l  
191         albedo = alboc_cd(rmu0(knindex)) * fmagic         albedo = alboc_cd(rmu0(knindex)) * fmagic
192         z0_new = sqrt(rugos**2 + rugoro**2)         z0_new = sqrt(rugos**2 + rugoro**2)
193           fqcalving = 0.
194      case (is_sic)      case (is_sic)
195         ! Surface "glace de mer" appel a l'interface avec l'ocean         ! Surface "glace de mer" appel a l'interface avec l'ocean
196    
# Line 215  contains Line 198  contains
198            IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then            IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then
199               snow(ii) = 0.               snow(ii) = 0.
200               tsurf_new(ii) = RTT - 1.8               tsurf_new(ii) = RTT - 1.8
201               IF (soil_model) tsoil(ii, :) = RTT - 1.8               tsoil(ii, :) = RTT - 1.8
202            else            else
203               tsurf_new(ii) = ts(ii)               tsurf_new(ii) = ts(ii)
204            endif            endif
205         enddo         enddo
206    
207         CALL calbeta(is_sic, snow, qsol(:knon), beta, capsol(:knon), &         CALL soil(dtime, is_sic, snow, tsurf_new, tsoil, soilcap, soilflux)
208              dif_grnd(:knon))         cal = RCPD / soilcap
209           dif_grnd = 1. / tau_gl
        IF (soil_model) THEN  
           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  
210         tsurf = tsurf_new         tsurf = tsurf_new
211         beta = 1.         beta = 1.
212    
213         CALL calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, &         CALL calcul_fluxs(dtime, tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, &
214              tq_cdrag(:knon), ps(:knon), qsurf(:knon), radsol, &              radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, &
215              dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay(:knon), &              v1_lay, petAcoef, peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, &
216              v1_lay(:knon), 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)  
217         CALL fonte_neige(is_sic, dtime, precip_rain(:knon), &         CALL fonte_neige(is_sic, dtime, precip_rain(:knon), &
218              precip_snow(:knon), snow, qsol(:knon), tsurf_new, evap, &              precip_snow(:knon), snow, qsol, tsurf_new, evap, &
219              fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))              fqcalving, ffonte(:knon), run_off_lic_0(:knon))
220    
221         ! Compute the albedo:         ! Compute the albedo:
222    
# Line 254  contains Line 225  contains
225         zfra = MAX(0., MIN(1., snow / (snow + 10.)))         zfra = MAX(0., MIN(1., snow / (snow + 10.)))
226         albedo = alb_neig * zfra + 0.6 * (1. - zfra)         albedo = alb_neig * zfra + 0.6 * (1. - zfra)
227    
        fder = fder + dflux_s + dflux_l  
228         z0_new = SQRT(0.002**2 + rugoro**2)         z0_new = SQRT(0.002**2 + rugoro**2)
229      case (is_lic)      case (is_lic)
230         ! Surface "glacier continentaux" appel a l'interface avec le sol         ! Surface "glacier continentaux" appel a l'interface avec le sol
231    
232         IF (soil_model) THEN         CALL soil(dtime, is_lic, snow, ts, tsoil, soilcap, soilflux)
233            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  
234         beta = 1.         beta = 1.
235         dif_grnd = 0.         dif_grnd = 0.
236    
237         call calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag(:knon), &         call calcul_fluxs(dtime, ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, &
238              ps(:knon), qsurf(:knon), radsol, dif_grnd(:knon), &              radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, &
239              temp_air(:knon), spechum(:knon), u1_lay(:knon), v1_lay(:knon), &              v1_lay, petAcoef, peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, &
240              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)  
241         call fonte_neige(is_lic, dtime, precip_rain(:knon), &         call fonte_neige(is_lic, dtime, precip_rain(:knon), &
242              precip_snow(:knon), snow, qsol(:knon), tsurf_new, evap, &              precip_snow(:knon), snow, qsol, tsurf_new, evap, &
243              fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))              fqcalving, ffonte(:knon), run_off_lic_0(:knon))
244    
245         ! calcul albedo         ! calcul albedo
246         CALL albsno(dtime, agesno, alb_neig, precip_snow(:knon))         CALL albsno(dtime, agesno, alb_neig, precip_snow(:knon))

Legend:
Removed from v.222  
changed lines
  Added in v.297

  ViewVC Help
Powered by ViewVC 1.1.21