/[lmdze]/trunk/Sources/phylmd/Interface_surf/interfsurf_hq.f
ViewVC logotype

Diff of /trunk/Sources/phylmd/Interface_surf/interfsurf_hq.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 154 by guez, Tue Jul 7 17:49:23 2015 UTC revision 174 by guez, Wed Nov 25 20:14:19 2015 UTC
# Line 9  contains Line 9  contains
9         spechum, tq_cdrag, petAcoef, peqAcoef, petBcoef, peqBcoef, &         spechum, tq_cdrag, petAcoef, peqAcoef, petBcoef, peqBcoef, &
10         precip_rain, precip_snow, fder, rugos, rugoro, snow, qsurf, tsurf, &         precip_rain, precip_snow, fder, rugos, rugoro, snow, qsurf, tsurf, &
11         p1lay, ps, radsol, evap, fluxsens, fluxlat, dflux_l, dflux_s, &         p1lay, ps, radsol, evap, fluxsens, fluxlat, dflux_l, dflux_s, &
12         tsurf_new, alblw, z0_new, pctsrf_new, agesno, fqcalving, ffonte, &         tsurf_new, albedo, z0_new, pctsrf_new, agesno, fqcalving, ffonte, &
13         run_off_lic_0, flux_o, flux_g)         run_off_lic_0, flux_o, flux_g)
14    
15      ! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface      ! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface
# Line 96  contains Line 96  contains
96      ! fluxlat flux de chaleur latente      ! fluxlat flux de chaleur latente
97      real, dimension(klon), intent(OUT):: dflux_l, dflux_s      real, dimension(klon), intent(OUT):: dflux_l, dflux_s
98      real, intent(OUT):: tsurf_new(knon) ! temp\'erature au sol      real, intent(OUT):: tsurf_new(knon) ! temp\'erature au sol
99      real, intent(OUT):: alblw(:) ! (knon) albedo      real, intent(OUT):: albedo(:) ! (knon) albedo
100      real, intent(OUT):: z0_new(klon) ! surface roughness      real, intent(OUT):: z0_new(klon) ! surface roughness
101      real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new      real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new
102      ! pctsrf_new nouvelle repartition des surfaces      ! pctsrf_new nouvelle repartition des surfaces
# Line 134  contains Line 134  contains
134      real, parameter:: calice=1.0/(5.1444e6 * 0.15), tau_gl=86400. * 5.      real, parameter:: calice=1.0/(5.1444e6 * 0.15), tau_gl=86400. * 5.
135      real, parameter:: calsno=1./(2.3867e6 * 0.15)      real, parameter:: calsno=1./(2.3867e6 * 0.15)
136      real tsurf_temp(knon)      real tsurf_temp(knon)
137      real alb_neig(klon)      real alb_neig(knon)
138      real zfra(klon)      real zfra(knon)
139    
140      !-------------------------------------------------------------      !-------------------------------------------------------------
141    
# Line 149  contains Line 149  contains
149            print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter            print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter
150            print *, 'or on doit commencer par les surfaces continentales'            print *, 'or on doit commencer par les surfaces continentales'
151            abort_message='voir ci-dessus'            abort_message='voir ci-dessus'
152            call abort_gcm(modname, abort_message, 1)            call abort_gcm(modname, abort_message)
153         endif         endif
154         if (is_oce > is_sic) then         if (is_oce > is_sic) then
155            print *, 'Warning:'            print *, 'Warning:'
# Line 157  contains Line 157  contains
157            print *, ' l''ocean doit etre traite avant la banquise'            print *, ' l''ocean doit etre traite avant la banquise'
158            print *, ' or is_oce = ', is_oce, '> is_sic = ', is_sic            print *, ' or is_oce = ', is_oce, '> is_sic = ', is_sic
159            abort_message='voir ci-dessus'            abort_message='voir ci-dessus'
160            call abort_gcm(modname, abort_message, 1)            call abort_gcm(modname, abort_message)
161         endif         endif
162      endif      endif
163      first_call = .false.      first_call = .false.
# Line 171  contains Line 171  contains
171      dif_grnd = 999999.      dif_grnd = 999999.
172      capsol = 999999.      capsol = 999999.
173      z0_new = 999999.      z0_new = 999999.
     alb_neig = 999999.  
174      tsurf_new = 999999.      tsurf_new = 999999.
175    
176      !IM: "slab" ocean; initialisations      !IM: "slab" ocean; initialisations
# Line 182  contains Line 181  contains
181    
182      select case (nisurf)      select case (nisurf)
183      case (is_ter)      case (is_ter)
184         ! Surface "terre" appel a l'interface avec les sols continentaux         ! Surface "terre", appel \`a l'interface avec les sols continentaux
185    
186         ! allocation du run-off         ! allocation du run-off
187         if (.not. allocated(run_off)) then         if (.not. allocated(run_off)) then
188            allocate(run_off(knon))            allocate(run_off(knon))
189            run_off = 0.            run_off = 0.
190         else if (size(run_off) /= knon) then         else if (size(run_off) /= knon) then
191            print *, 'Bizarre, le nombre de points continentaux'            call abort_gcm(modname, 'Something is wrong: the number of ' &
192            print *, 'a change entre deux appels. J''arrete '                 // 'continental points has changed since last call.')
           abort_message='voir ci-dessus'  
           call abort_gcm(modname, abort_message, 1)  
193         endif         endif
194    
195         ! Calcul age de la neige         ! Calcul age de la neige
196    
197         ! calcul albedo: lecture albedo fichier boundary conditions         ! Read albedo from the file containing boundary conditions then
198         ! puis ajout albedo neige         ! add the albedo of snow:
199         call interfsur_lim(itime, dtime, jour, knindex, debut, alblw, z0_new)  
200           call interfsur_lim(itime, dtime, jour, knindex, debut, albedo, z0_new)
201    
202         ! calcul snow et qsurf, hydrol adapt\'e         ! Calcul snow et qsurf, hydrologie adapt\'ee
203         CALL calbeta(nisurf, snow(:knon), qsol(:knon), beta(:knon), &         CALL calbeta(nisurf, snow(:knon), qsol(:knon), beta(:knon), &
204              capsol(:knon), dif_grnd(:knon))              capsol(:knon), dif_grnd(:knon))
205    
# Line 212  contains Line 210  contains
210         ELSE         ELSE
211            cal = RCPD * capsol            cal = RCPD * capsol
212         ENDIF         ENDIF
213         CALL calcul_fluxs(nisurf, dtime, tsurf, p1lay(:knon), cal(:knon), &  
214           CALL calcul_fluxs(dtime, tsurf, p1lay(:knon), cal(:knon), &
215              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &
216              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &
217              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &
# Line 226  contains Line 225  contains
225              peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), tsurf_new, &              peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), tsurf_new, &
226              evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))              evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))
227    
228         call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         call albsno(dtime, agesno(:knon), alb_neig, precip_snow(:knon))
229         where (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.         where (snow(:knon) < 0.0001) agesno(:knon) = 0.
230         zfra(:knon) = max(0.0, min(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))         zfra = max(0.0, min(1.0, snow(:knon)/(snow(:knon) + 10.0)))
231         alblw = alb_neig(:knon) * zfra(:knon) &         albedo = alb_neig * zfra + albedo * (1. - zfra)
             + alblw * (1. - zfra(:knon))  
232         z0_new = sqrt(z0_new**2 + rugoro**2)         z0_new = sqrt(z0_new**2 + rugoro**2)
233    
234         ! Remplissage des pourcentages de surface         ! Remplissage des pourcentages de surface
# Line 244  contains Line 242  contains
242         cal = 0.         cal = 0.
243         beta = 1.         beta = 1.
244         dif_grnd = 0.         dif_grnd = 0.
        alb_neig = 0.  
245         agesno = 0.         agesno = 0.
246         call calcul_fluxs(nisurf, dtime, tsurf_temp, p1lay(:knon), &         call calcul_fluxs(dtime, tsurf_temp, p1lay(:knon), &
247              cal(:knon), beta(:knon), tq_cdrag(:knon), ps(:knon), &              cal(:knon), beta(:knon), tq_cdrag(:knon), ps(:knon), &
248              qsurf(:knon), radsol(:knon), dif_grnd(:knon), temp_air(:knon), &              qsurf(:knon), radsol(:knon), dif_grnd(:knon), temp_air(:knon), &
249              spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), &              spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), &
# Line 259  contains Line 256  contains
256         flux_o(:knon) = fluxsens(:knon) - evap(:knon) &         flux_o(:knon) = fluxsens(:knon) - evap(:knon) &
257              * merge(RLSTT, RLVTT, tsurf_new < RTT)              * merge(RLSTT, RLVTT, tsurf_new < RTT)
258    
259         ! calcul albedo         ! Compute the albedo:
260         if (cycle_diurne) then         if (cycle_diurne) then
261            CALL alboc_cd(rmu0(knindex), alblw)            CALL alboc_cd(rmu0(knindex), albedo)
262         else         else
263            CALL alboc(jour, rlat(knindex), alblw)            CALL alboc(jour, rlat(knindex), albedo)
264         endif         endif
265    
266         z0_new = sqrt(rugos**2 + rugoro**2)         z0_new = sqrt(rugos**2 + rugoro**2)
# Line 300  contains Line 297  contains
297         tsurf_temp = tsurf_new         tsurf_temp = tsurf_new
298         beta = 1.0         beta = 1.0
299    
300         CALL calcul_fluxs(nisurf, dtime, tsurf_temp, p1lay(:knon), cal(:knon), &         CALL calcul_fluxs(dtime, tsurf_temp, p1lay(:knon), cal(:knon), &
301              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &
302              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &
303              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &
# Line 321  contains Line 318  contains
318              peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), tsurf_new, &              peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), tsurf_new, &
319              evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))              evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))
320    
321         ! calcul albedo         ! Compute the albedo:
322    
323         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         CALL albsno(dtime, agesno(:knon), alb_neig, precip_snow(:knon))
324         WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.         WHERE (snow(:knon) < 0.0001) agesno(:knon) = 0.
325         zfra(:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))         zfra = MAX(0.0, MIN(1.0, snow(:knon)/(snow(:knon) + 10.0)))
326         alblw = alb_neig(:knon) * zfra(:knon) + 0.6 * (1.0 - zfra(:knon))         albedo = alb_neig * zfra + 0.6 * (1.0 - zfra)
327    
328         fder = fder + dflux_s + dflux_l         fder = fder + dflux_s + dflux_l
329    
# Line 353  contains Line 350  contains
350         beta = 1.0         beta = 1.0
351         dif_grnd = 0.0         dif_grnd = 0.0
352    
353         call calcul_fluxs(nisurf, dtime, tsurf, p1lay(:knon), cal(:knon), &         call calcul_fluxs(dtime, tsurf, p1lay(:knon), cal(:knon), &
354              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &
355              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &
356              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &
# Line 368  contains Line 365  contains
365              evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))              evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon))
366    
367         ! calcul albedo         ! calcul albedo
368         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         CALL albsno(dtime, agesno(:knon), alb_neig, precip_snow(:knon))
369         WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.         WHERE (snow(:knon) < 0.0001) agesno(:knon) = 0.
370         zfra(:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))         albedo = 0.77
        alblw = 0.77  
371    
372         ! Rugosite         ! Rugosite
373         z0_new = rugoro         z0_new = rugoro
# Line 382  contains Line 378  contains
378      case default      case default
379         print *, 'Index surface = ', nisurf         print *, 'Index surface = ', nisurf
380         abort_message = 'Index surface non valable'         abort_message = 'Index surface non valable'
381         call abort_gcm(modname, abort_message, 1)         call abort_gcm(modname, abort_message)
382      end select      end select
383    
384    END SUBROUTINE interfsurf_hq    END SUBROUTINE interfsurf_hq

Legend:
Removed from v.154  
changed lines
  Added in v.174

  ViewVC Help
Powered by ViewVC 1.1.21