/[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 230 by guez, Mon Nov 6 17:47:03 2017 UTC trunk/phylmd/Interface_surf/interfsurf_hq.f revision 297 by guez, Thu Jul 26 16:02:11 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
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 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 67  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(IN):: rugos(klon) ! rugosite      real, intent(IN):: rugos(:) ! (knon) rugosite
68      real, intent(IN):: rugoro(klon) ! rugosite orographique      real, intent(IN):: rugoro(:) ! (knon) 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 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.  
     z0_new = 999999.  
147    
148      ! Aiguillage vers les differents schemas de surface      ! Aiguillage vers les differents schemas de surface
149    
# Line 164  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, beta, capsol(:knon), dif_grnd(:knon))         dif_grnd(:knon) = 0.
163           CALL soil(dtime, is_ter, snow, ts, tsoil, soilcap, soilflux)
164         IF (soil_model) THEN         cal = RCPD / soilcap
165            CALL soil(dtime, is_ter, snow, ts, tsoil, soilcap, soilflux)  
166            cal = RCPD / soilcap         CALL calcul_fluxs(dtime, ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, &
167            radsol = radsol + soilflux              radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, &
168         ELSE              v1_lay, petAcoef, peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, &
169            cal = RCPD * capsol(:knon)              fluxlat, flux_t, dflux_s, dflux_l)
170         ENDIF         CALL fonte_neige(is_ter, dtime, precip_rain(:knon), precip_snow(:knon), &
171                snow, qsol, tsurf_new, evap, fqcalving, ffonte(:knon), &
172         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))  
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 192  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, 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, &              petAcoef, peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, fluxlat, &
189              v1_lay, 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.
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 211  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, beta, capsol(:knon), dif_grnd(:knon))         CALL soil(dtime, is_sic, snow, tsurf_new, tsoil, soilcap, soilflux)
208           cal = RCPD / soilcap
209         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  
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, 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, &              v1_lay, petAcoef, peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, &
216              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)  
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, 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 253  contains Line 229  contains
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, &         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, v1_lay, &              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, 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.230  
changed lines
  Added in v.297

  ViewVC Help
Powered by ViewVC 1.1.21