/[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 280 by guez, Fri Jul 20 15:47:57 2018 UTC revision 300 by guez, Thu Aug 2 15:55:01 2018 UTC
# Line 4  module interfsurf_hq_m Line 4  module interfsurf_hq_m
4    
5  contains  contains
6    
7    SUBROUTINE interfsurf_hq(dtime, julien, rmu0, nisurf, knindex, debut, &    SUBROUTINE interfsurf_hq(julien, mu0, nisurf, knindex, debut, tsoil, qsol, &
8         tsoil, qsol, u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, &         u1_lay, v1_lay, temp_air, spechum, tq_cdrag, tAcoef, qAcoef, tBcoef, &
9         peqAcoef, petBcoef, peqBcoef, precip_rain, precip_snow, rugos, rugoro, &         qBcoef, precip_rain, precip_snow, rugos, rugoro, snow, qsurf, ts, &
10         snow, qsurf, ts, p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, &         p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, dflux_s, tsurf_new, &
11         dflux_s, tsurf_new, albedo, z0_new, pctsrf_new_sic, agesno, fqcalving, &         albedo, z0_new, pctsrf_new_sic, agesno, fqcalving, ffonte, run_off_lic_0)
        ffonte, run_off_lic_0)  
12    
13      ! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface      ! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface
14      ! 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 24  contains Line 23  contains
23      USE dimphy, ONLY: klon      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
26      USE interface_surf, ONLY: conf_interface      USE conf_interface_m, ONLY: conf_interface
27      USE interfsur_lim_m, ONLY: interfsur_lim      USE interfsur_lim_m, ONLY: interfsur_lim
28      use read_sst_m, only: read_sst      use limit_read_sst_m, only: limit_read_sst
29      use soil_m, only: soil      use soil_m, only: soil
30      USE suphec_m, ONLY: rcpd, rtt      USE suphec_m, ONLY: rcpd, rtt
31    
     real, intent(IN):: dtime ! pas de temps de la physique (en s)  
32      integer, intent(IN):: julien ! jour dans l'annee en cours      integer, intent(IN):: julien ! jour dans l'annee en cours
33      real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal      real, intent(IN):: mu0(:) ! (knon) cosinus de l'angle solaire zenithal
34      integer, intent(IN):: nisurf ! index de la surface a traiter      integer, intent(IN):: nisurf ! index de la surface a traiter
35    
36      integer, intent(in):: knindex(:) ! (knon)      integer, intent(in):: knindex(:) ! (knon)
# Line 48  contains Line 46  contains
46    
47      real, intent(IN):: u1_lay(:), v1_lay(:) ! (knon) vitesse 1ere couche      real, intent(IN):: u1_lay(:), v1_lay(:) ! (knon) vitesse 1ere couche
48    
49      real, dimension(klon), intent(IN):: temp_air, spechum      real, intent(IN):: temp_air(:) ! (knon) temperature de l'air 1ere couche
50      ! temp_air temperature de l'air 1ere couche      real, intent(IN):: spechum(:) ! (knon) humidite specifique 1ere couche
     ! spechum humidite specifique 1ere couche  
51      real, intent(IN):: tq_cdrag(:) ! (knon) coefficient d'echange      real, intent(IN):: tq_cdrag(:) ! (knon) coefficient d'echange
52    
53      real, dimension(klon), intent(IN):: petAcoef, peqAcoef      real, intent(IN):: tAcoef(:), qAcoef(:) ! (knon)
54      ! 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
55    
56      real, dimension(klon), intent(IN):: petBcoef, peqBcoef      real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon)
57      ! 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
58    
59      real, intent(IN):: precip_rain(klon)      real, intent(IN):: precip_rain(:) ! (knon)
60      ! precipitation, liquid water mass flux (kg / m2 / s), positive down      ! precipitation, liquid water mass flux (kg / m2 / s), positive down
61    
62      real, intent(IN):: precip_snow(klon)      real, intent(IN):: precip_snow(:) ! (knon)
63      ! precipitation, solid water mass flux (kg / m2 / s), positive down      ! precipitation, solid water mass flux (kg / m2 / s), positive down
64    
65      real, intent(IN):: rugos(klon) ! rugosite      real, intent(IN):: rugos(:) ! (knon) rugosite
66      real, intent(IN):: rugoro(klon) ! rugosite orographique      real, intent(IN):: rugoro(:) ! (knon) rugosite orographique
67      real, intent(INOUT):: snow(:) ! (knon)      real, intent(INOUT):: snow(:) ! (knon)
68      real, intent(INOUT):: qsurf(klon)      real, intent(OUT):: qsurf(:) ! (knon)
69      real, intent(IN):: ts(:) ! (knon) temp\'erature de surface      real, intent(IN):: ts(:) ! (knon) temp\'erature de surface
70      real, intent(IN):: p1lay(klon) ! pression 1er niveau (milieu de couche)      real, intent(IN):: p1lay(:) ! (knon) pression 1er niveau (milieu de couche)
71      real, intent(IN):: ps(:) ! (knon) pression au sol      real, intent(IN):: ps(:) ! (knon) pression au sol
72      REAL, INTENT(IN):: radsol(:) ! (knon) rayonnement net au sol (LW + SW)      REAL, INTENT(IN):: radsol(:) ! (knon) rayonnement net au sol (LW + SW)
73      real, intent(OUT):: evap(:) ! (knon) evaporation totale      real, intent(OUT):: evap(:) ! (knon) evaporation totale
# Line 82  contains Line 79  contains
79      real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon)      real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon)
80      real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol      real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol
81      real, intent(OUT):: albedo(:) ! (knon) albedo      real, intent(OUT):: albedo(:) ! (knon) albedo
82      real, intent(OUT):: z0_new(klon) ! surface roughness      real, intent(OUT):: z0_new(:) ! (knon) surface roughness
83    
84      real, intent(in):: pctsrf_new_sic(:) ! (klon)      real, intent(in):: pctsrf_new_sic(:) ! (knon)
85      ! nouvelle repartition des surfaces      ! nouvelle repartition des surfaces
86    
87      real, intent(INOUT):: agesno(:) ! (knon)      real, intent(INOUT):: agesno(:) ! (knon)
88    
89        real, intent(OUT):: fqcalving(:) ! (knon)
90      ! 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
91      ! hauteur de neige, en kg / m2 / s      ! hauteur de neige, en kg / m2 / s
     real, intent(OUT):: fqcalving(:) ! (knon)  
92    
93      ! Flux thermique utiliser pour fondre la neige      real, intent(OUT):: ffonte(:) ! (knon)
94      real, dimension(klon), intent(INOUT):: ffonte      ! flux thermique utilis\'e pour fondre la neige
95    
96      real, dimension(klon), intent(INOUT):: run_off_lic_0      real, intent(INOUT):: run_off_lic_0(:) ! (knon)
97      ! run_off_lic_0 runoff glacier du pas de temps precedent      ! run_off_lic_0 runoff glacier du pas de temps precedent
98    
99      ! Local:      ! Local:
# Line 107  contains Line 104  contains
104      integer ii      integer ii
105      real cal(size(knindex)) ! (knon)      real cal(size(knindex)) ! (knon)
106      real beta(size(knindex)) ! (knon) evap reelle      real beta(size(knindex)) ! (knon) evap reelle
     real dif_grnd(klon)  
107      real tsurf(size(knindex)) ! (knon)      real tsurf(size(knindex)) ! (knon)
108      real alb_neig(size(knindex)) ! (knon)      real alb_neig(size(knindex)) ! (knon)
109      real zfra(size(knindex)) ! (knon)      real zfra(size(knindex)) ! (knon)
# Line 119  contains Line 115  contains
115    
116      knon = size(knindex)      knon = size(knindex)
117    
118      ! On doit commencer par appeler les schemas de surfaces continentales      ! On doit commencer par appeler les sch\'emas de surfaces
119      ! car l'ocean a besoin du ruissellement qui est y calcule      ! continentales car l'oc\'ean a besoin du ruissellement.
120    
121      if (first_call) then      if (first_call) then
122         call conf_interface         call conf_interface
123    
124         if (nisurf /= is_ter .and. klon > 1) then         if (nisurf /= is_ter .and. klon > 1) then
125            print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter            print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter
           print *, 'or on doit commencer par les surfaces continentales'  
126            call abort_gcm("interfsurf_hq", &            call abort_gcm("interfsurf_hq", &
127                 'On doit commencer par les surfaces continentales')                 'On doit commencer par les surfaces continentales.')
128         endif         endif
129    
130         if (is_oce > is_sic) then         if (is_oce > is_sic) then
131            print *, 'is_oce = ', is_oce, '> is_sic = ', is_sic            print *, 'is_oce = ', is_oce, '> is_sic = ', is_sic
132            call abort_gcm("interfsurf_hq", &            call abort_gcm("interfsurf_hq", &
133                 "L'ocean doit etre traite avant la banquise")                 "L'oc\'ean doit \^etre trait\'e avant la banquise.")
134         endif         endif
135    
136         first_call = .false.         first_call = .false.
137      endif      endif
138    
     ! Initialisations diverses  
   
     ffonte(1:knon) = 0.  
     dif_grnd = 999999.  
     z0_new = 999999.  
   
139      ! Aiguillage vers les differents schemas de surface      ! Aiguillage vers les differents schemas de surface
140    
141      select case (nisurf)      select case (nisurf)
# Line 158  contains Line 147  contains
147         ! Read albedo from the file containing boundary conditions then         ! Read albedo from the file containing boundary conditions then
148         ! add the albedo of snow:         ! add the albedo of snow:
149    
150         call interfsur_lim(dtime, julien, knindex, debut, albedo, z0_new)         call interfsur_lim(julien, knindex, debut, albedo, z0_new)
151    
152         beta = min(2. * qsol / max_eau_sol, 1.)         beta = min(2. * qsol / max_eau_sol, 1.)
153         dif_grnd(:knon) = 0.         CALL soil(is_ter, snow, ts, tsoil, soilcap, soilflux)
        CALL soil(dtime, is_ter, snow, ts, tsoil, soilcap, soilflux)  
154         cal = RCPD / soilcap         cal = RCPD / soilcap
155    
156         CALL calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag, ps, &         CALL calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, &
157              qsurf(:knon), radsol + soilflux, dif_grnd(:knon), temp_air(:knon), &              radsol + soilflux, temp_air, spechum, u1_lay, v1_lay, tAcoef, &
158              spechum(:knon), u1_lay, v1_lay, petAcoef(:knon), peqAcoef(:knon), &              qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &
159              petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap, fluxlat, &              dflux_l, dif_grnd = 0.)
160              flux_t, dflux_s, dflux_l)         CALL fonte_neige(is_ter, precip_rain, precip_snow, snow, qsol, &
161         CALL fonte_neige(is_ter, dtime, precip_rain(:knon), precip_snow(:knon), &              tsurf_new, evap, fqcalving, ffonte, run_off_lic_0)
             snow, qsol, tsurf_new, evap, fqcalving, ffonte(:knon), &  
             run_off_lic_0(:knon))  
162    
163         call albsno(dtime, agesno, alb_neig, precip_snow(:knon))         call albsno(agesno, alb_neig, precip_snow)
164         where (snow < 0.0001) agesno = 0.         where (snow < 0.0001) agesno = 0.
165         zfra = max(0., min(1., snow / (snow + 10.)))         zfra = max(0., min(1., snow / (snow + 10.)))
166         albedo = alb_neig * zfra + albedo * (1. - zfra)         albedo = alb_neig * zfra + albedo * (1. - zfra)
# Line 182  contains Line 168  contains
168      case (is_oce)      case (is_oce)
169         ! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean         ! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean
170    
171         call read_sst(julien, knindex, tsurf)         ffonte = 0.
172           call limit_read_sst(julien, knindex, tsurf)
173         cal = 0.         cal = 0.
174         beta = 1.         beta = 1.
175         dif_grnd = 0.         call calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, radsol, &
176         call calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, tq_cdrag, ps, &              temp_air, spechum, u1_lay, v1_lay, tAcoef, qAcoef, tBcoef, qBcoef, &
177              qsurf(:knon), radsol, dif_grnd(:knon), temp_air(:knon), &              tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l, dif_grnd = 0.)
             spechum(:knon), u1_lay, v1_lay, petAcoef(:knon), peqAcoef(:knon), &  
             petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap, fluxlat, &  
             flux_t, dflux_s, dflux_l)  
178         agesno = 0.         agesno = 0.
179         albedo = alboc_cd(rmu0(knindex)) * fmagic         albedo = alboc_cd(mu0) * fmagic
180         z0_new = sqrt(rugos**2 + rugoro**2)         z0_new = sqrt(rugos**2 + rugoro**2)
181         fqcalving = 0.         fqcalving = 0.
182      case (is_sic)      case (is_sic)
183         ! Surface "glace de mer" appel a l'interface avec l'ocean         ! Surface "glace de mer" appel a l'interface avec l'ocean
184    
185         DO ii = 1, knon         DO ii = 1, knon
186            IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then            IF (pctsrf_new_sic(ii) < EPSFRA) then
187               snow(ii) = 0.               snow(ii) = 0.
188               tsurf_new(ii) = RTT - 1.8               tsurf_new(ii) = RTT - 1.8
189               tsoil(ii, :) = RTT - 1.8               tsoil(ii, :) = RTT - 1.8
# Line 208  contains Line 192  contains
192            endif            endif
193         enddo         enddo
194    
195         CALL soil(dtime, is_sic, snow, tsurf_new, tsoil, soilcap, soilflux)         CALL soil(is_sic, snow, tsurf_new, tsoil, soilcap, soilflux)
196         cal = RCPD / soilcap         cal = RCPD / soilcap
        dif_grnd = 1. / tau_gl  
197         tsurf = tsurf_new         tsurf = tsurf_new
198         beta = 1.         beta = 1.
199           CALL calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, &
200         CALL calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, tq_cdrag, ps, &              radsol + soilflux, temp_air, spechum, u1_lay, v1_lay, tAcoef, &
201              qsurf(:knon), radsol + soilflux, dif_grnd(:knon), temp_air(:knon), &              qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &
202              spechum(:knon), u1_lay, v1_lay, petAcoef(:knon), peqAcoef(:knon), &              dflux_l, dif_grnd = 1. / tau_gl)
203              petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap, fluxlat, &         CALL fonte_neige(is_sic, precip_rain, precip_snow, snow, qsol, &
204              flux_t, dflux_s, dflux_l)              tsurf_new, evap, fqcalving, ffonte, run_off_lic_0)
        CALL fonte_neige(is_sic, dtime, precip_rain(:knon), &  
             precip_snow(:knon), snow, qsol, tsurf_new, evap, &  
             fqcalving, ffonte(:knon), run_off_lic_0(:knon))  
205    
206         ! Compute the albedo:         ! Compute the albedo:
207    
208         CALL albsno(dtime, agesno, alb_neig, precip_snow(:knon))         CALL albsno(agesno, alb_neig, precip_snow)
209         WHERE (snow < 0.0001) agesno = 0.         WHERE (snow < 0.0001) agesno = 0.
210         zfra = MAX(0., MIN(1., snow / (snow + 10.)))         zfra = MAX(0., MIN(1., snow / (snow + 10.)))
211         albedo = alb_neig * zfra + 0.6 * (1. - zfra)         albedo = alb_neig * zfra + 0.6 * (1. - zfra)
# Line 234  contains Line 214  contains
214      case (is_lic)      case (is_lic)
215         ! Surface "glacier continentaux" appel a l'interface avec le sol         ! Surface "glacier continentaux" appel a l'interface avec le sol
216    
217         CALL soil(dtime, is_lic, snow, ts, tsoil, soilcap, soilflux)         CALL soil(is_lic, snow, ts, tsoil, soilcap, soilflux)
218         cal = RCPD / soilcap         cal = RCPD / soilcap
219         beta = 1.         beta = 1.
220         dif_grnd = 0.         call calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, &
221                radsol + soilflux, temp_air, spechum, u1_lay, v1_lay, tAcoef, &
222         call calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag, ps, &              qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, &
223              qsurf(:knon), radsol + soilflux, dif_grnd(:knon), temp_air(:knon), &              dflux_l, dif_grnd = 0.)
224              spechum(:knon), u1_lay, v1_lay, petAcoef(:knon), peqAcoef(:knon), &         call fonte_neige(is_lic, precip_rain, precip_snow, snow, qsol, &
225              petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap, fluxlat, &              tsurf_new, evap, fqcalving, ffonte, run_off_lic_0)
             flux_t, dflux_s, dflux_l)  
        call fonte_neige(is_lic, dtime, precip_rain(:knon), &  
             precip_snow(:knon), snow, qsol, tsurf_new, evap, &  
             fqcalving, ffonte(:knon), run_off_lic_0(:knon))  
226    
227         ! calcul albedo         ! calcul albedo
228         CALL albsno(dtime, agesno, alb_neig, precip_snow(:knon))         CALL albsno(agesno, alb_neig, precip_snow)
229         WHERE (snow < 0.0001) agesno = 0.         WHERE (snow < 0.0001) agesno = 0.
230         albedo = 0.77         albedo = 0.77
231    

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

  ViewVC Help
Powered by ViewVC 1.1.21