/[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

trunk/phylmd/Interface_surf/interfsurf_hq.f revision 130 by guez, Tue Feb 24 15:43:51 2015 UTC trunk/Sources/phylmd/Interface_surf/interfsurf_hq.f revision 171 by guez, Tue Sep 29 19:48:59 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, alb_new, alblw, z0_new, pctsrf_new, agesno, fqcalving, &         tsurf_new, albedo, z0_new, pctsrf_new, agesno, fqcalving, ffonte, &
13         ffonte, 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ère et la surface      ! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface
16      ! en général (sols continentaux, océans, glaces) pour les flux de      ! en g\'en\'eral (sols continentaux, oc\'eans, glaces) pour les flux de
17      ! chaleur et d'humidité.      ! chaleur et d'humidit\'e.
18    
19      ! Laurent Fairhead, February 2000      ! Laurent Fairhead, February 2000
20    
21      USE abort_gcm_m, ONLY: abort_gcm      USE abort_gcm_m, ONLY: abort_gcm
22        use alboc_cd_m, only: alboc_cd
23      use alboc_m, only: alboc      use alboc_m, only: alboc
24      USE albsno_m, ONLY: albsno      USE albsno_m, ONLY: albsno
25      use calbeta_m, only: calbeta      use calbeta_m, only: calbeta
26      USE calcul_fluxs_m, ONLY: calcul_fluxs      USE calcul_fluxs_m, ONLY: calcul_fluxs
27      use clesphys2, only: soil_model      use clesphys2, only: soil_model, cycle_diurne
28      USE dimphy, ONLY: klon      USE dimphy, ONLY: klon
29      USE fonte_neige_m, ONLY: fonte_neige      USE fonte_neige_m, ONLY: fonte_neige
30      USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf      USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf
# Line 78  contains Line 79  contains
79      real, intent(IN):: precip_snow(klon)      real, intent(IN):: precip_snow(klon)
80      ! precipitation, solid water mass flux (kg/m2/s), positive down      ! precipitation, solid water mass flux (kg/m2/s), positive down
81    
82      REAL, DIMENSION(klon), INTENT(INOUT):: fder      REAL, INTENT(INOUT):: fder(klon) ! derivee des flux (pour le couplage)
83      ! fder derivee des flux (pour le couplage)      real, intent(IN):: rugos(klon) ! rugosite
84      real, dimension(klon), intent(IN):: rugos, rugoro      real, intent(IN):: rugoro(klon) ! rugosite orographique
     ! rugos rugosite  
     ! rugoro rugosite orographique  
85      real, intent(INOUT):: snow(klon), qsurf(klon)      real, intent(INOUT):: snow(klon), qsurf(klon)
86      real, intent(IN):: tsurf(:) ! (knon) température de surface      real, intent(IN):: tsurf(:) ! (knon) temp\'erature de surface
87      real, dimension(klon), intent(IN):: p1lay      real, dimension(klon), intent(IN):: p1lay
88      ! p1lay pression 1er niveau (milieu de couche)      ! p1lay pression 1er niveau (milieu de couche)
89      real, dimension(klon), intent(IN):: ps      real, dimension(klon), intent(IN):: ps
# Line 96  contains Line 95  contains
95      ! fluxsens flux de chaleur sensible      ! fluxsens flux de chaleur sensible
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érature au sol      real, intent(OUT):: tsurf_new(knon) ! temp\'erature au sol
99      real, intent(OUT):: alb_new(klon) ! albedo      real, intent(OUT):: albedo(:) ! (knon) albedo
100      real, dimension(klon), intent(OUT):: alblw      real, intent(OUT):: z0_new(klon) ! surface roughness
     real, dimension(klon), intent(OUT):: z0_new  
     ! z0_new 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
103      real, dimension(klon), intent(INOUT):: agesno      real, dimension(klon), intent(INOUT):: agesno
104    
105      ! Flux d'eau "perdue" par la surface et nécessaire pour que limiter la      ! Flux d'eau "perdue" par la surface et n\'ecessaire pour que limiter la
106      ! hauteur de neige, en kg/m2/s      ! hauteur de neige, en kg/m2/s
107      !jld a rajouter real, dimension(klon), intent(INOUT):: fqcalving      !jld a rajouter real, dimension(klon), intent(INOUT):: fqcalving
108      real, dimension(klon), intent(INOUT):: fqcalving      real, dimension(klon), intent(INOUT):: fqcalving
# Line 127  contains Line 124  contains
124    
125      !IM: "slab" ocean      !IM: "slab" ocean
126      real, parameter:: t_grnd=271.35      real, parameter:: t_grnd=271.35
     real, dimension(klon):: zx_sl  
127      integer i      integer i
128    
129      character (len = 20), save:: modname = 'interfsurf_hq'      character (len = 20), save:: modname = 'interfsurf_hq'
# Line 135  contains Line 131  contains
131      logical, save:: first_call = .true.      logical, save:: first_call = .true.
132      integer:: ii      integer:: ii
133      real, dimension(klon):: cal, beta, dif_grnd, capsol      real, dimension(klon):: cal, beta, dif_grnd, capsol
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, dimension(klon):: alb_neig, alb_eau      real alb_neig(klon)
138      real, DIMENSION(klon):: zfra      real zfra(klon)
     INTEGER, dimension(1):: iloc  
     real, dimension(klon):: fder_prev  
139    
140      !-------------------------------------------------------------      !-------------------------------------------------------------
141    
# Line 155  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 163  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 176  contains Line 170  contains
170      beta = 999999.      beta = 999999.
171      dif_grnd = 999999.      dif_grnd = 999999.
172      capsol = 999999.      capsol = 999999.
     alb_new = 999999.  
173      z0_new = 999999.      z0_new = 999999.
174      alb_neig = 999999.      alb_neig = 999999.
175      tsurf_new = 999999.      tsurf_new = 999999.
     alblw = 999999.  
176    
177      !IM: "slab" ocean; initialisations      !IM: "slab" ocean; initialisations
178      flux_o = 0.      flux_o = 0.
# Line 190  contains Line 182  contains
182    
183      select case (nisurf)      select case (nisurf)
184      case (is_ter)      case (is_ter)
185         ! Surface "terre" appel a l'interface avec les sols continentaux         ! Surface "terre", appel \`a l'interface avec les sols continentaux
186    
187         ! allocation du run-off         ! allocation du run-off
188         if (.not. allocated(run_off)) then         if (.not. allocated(run_off)) then
189            allocate(run_off(knon))            allocate(run_off(knon))
190            run_off = 0.            run_off = 0.
191         else if (size(run_off) /= knon) then         else if (size(run_off) /= knon) then
192            print *, 'Bizarre, le nombre de points continentaux'            call abort_gcm(modname, 'Something is wrong: the number of ' &
193            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)  
194         endif         endif
195    
196         ! Calcul age de la neige         ! Calcul age de la neige
197    
198         ! calcul albedo: lecture albedo fichier boundary conditions         ! calcul albedo: lecture albedo fichier boundary conditions
199         ! puis ajout albedo neige         ! puis ajout albedo neige
200         call interfsur_lim(itime, dtime, jour, nisurf, knindex, debut, &         call interfsur_lim(itime, dtime, jour, knindex, debut, albedo, z0_new)
             alb_new, z0_new)  
201    
202         ! calcul snow et qsurf, hydrol adapté         ! calcul snow et qsurf, hydrol adapt\'e
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 221  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 237  contains Line 227  contains
227    
228         call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)
229         where (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.         where (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.
230         zfra(1:knon) = max(0.0, min(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))         zfra(:knon) = max(0.0, min(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))
231         alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &         albedo = alb_neig(:knon) * zfra(:knon) &
232              alb_new(1 : knon)*(1.0-zfra(1:knon))              + albedo * (1. - zfra(:knon))
233         z0_new = sqrt(z0_new**2 + rugoro**2)         z0_new = sqrt(z0_new**2 + rugoro**2)
        alblw(1 : knon) = alb_new(1 : knon)  
234    
235         ! Remplissage des pourcentages de surface         ! Remplissage des pourcentages de surface
236         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)
237      case (is_oce)      case (is_oce)
238         ! Surface "ocean" appel à l'interface avec l'océan         ! Surface "ocean" appel \`a l'interface avec l'oc\'ean
239         ! lecture conditions limites         ! lecture conditions limites
240         call interfoce_lim(itime, dtime, jour, knindex, debut, tsurf_temp, &         call interfoce_lim(itime, dtime, jour, knindex, debut, tsurf_temp, &
241              pctsrf_new)              pctsrf_new)
# Line 256  contains Line 245  contains
245         dif_grnd = 0.         dif_grnd = 0.
246         alb_neig = 0.         alb_neig = 0.
247         agesno = 0.         agesno = 0.
248         call calcul_fluxs(nisurf, dtime, tsurf_temp, p1lay(:knon), &         call calcul_fluxs(dtime, tsurf_temp, p1lay(:knon), &
249              cal(:knon), beta(:knon), tq_cdrag(:knon), ps(:knon), &              cal(:knon), beta(:knon), tq_cdrag(:knon), ps(:knon), &
250              qsurf(:knon), radsol(:knon), dif_grnd(:knon), temp_air(:knon), &              qsurf(:knon), radsol(:knon), dif_grnd(:knon), temp_air(:knon), &
251              spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), &              spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), &
252              peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), &              peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), &
253              tsurf_new, evap(:knon), fluxlat(:knon), fluxsens(:knon), &              tsurf_new, evap(:knon), fluxlat(:knon), fluxsens(:knon), &
254              dflux_s(:knon), dflux_l(:knon))              dflux_s(:knon), dflux_l(:knon))
255         fder_prev = fder         fder = fder + dflux_s + dflux_l
        fder = fder_prev + dflux_s + dflux_l  
        iloc = maxloc(fder(1:klon))  
256    
257         !IM: flux ocean-atmosphere utile pour le "slab" ocean         !IM: flux ocean-atmosphere utile pour le "slab" ocean
258         DO i=1, knon         flux_o(:knon) = fluxsens(:knon) - evap(:knon) &
259            zx_sl(i) = RLVTT              * merge(RLSTT, RLVTT, tsurf_new < RTT)
           if (tsurf_new(i) < RTT) zx_sl(i) = RLSTT  
           flux_o(i) = fluxsens(i)-evap(i)*zx_sl(i)  
        ENDDO  
260    
261         ! calcul albedo         ! calcul albedo
262         if (minval(rmu0) == maxval(rmu0) .and. minval(rmu0) == -999.999) then         if (cycle_diurne) then
263            CALL alboc(jour, rlat, alb_eau)            CALL alboc_cd(rmu0(knindex), albedo)
264         else ! cycle diurne         else
265            CALL alboc_cd(rmu0, alb_eau)            CALL alboc(jour, rlat(knindex), albedo)
266         endif         endif
        DO ii =1, knon  
           alb_new(ii) = alb_eau(knindex(ii))  
        enddo  
267    
268         z0_new = sqrt(rugos**2 + rugoro**2)         z0_new = sqrt(rugos**2 + rugoro**2)
        alblw(1:knon) = alb_new(1:knon)  
269      case (is_sic)      case (is_sic)
270         ! Surface "glace de mer" appel a l'interface avec l'ocean         ! Surface "glace de mer" appel a l'interface avec l'ocean
271    
# Line 298  contains Line 278  contains
278            IF (pctsrf_new(knindex(ii), nisurf) < EPSFRA) then            IF (pctsrf_new(knindex(ii), nisurf) < EPSFRA) then
279               snow(ii) = 0.0               snow(ii) = 0.0
280               tsurf_new(ii) = RTT - 1.8               tsurf_new(ii) = RTT - 1.8
281               IF (soil_model) tsoil(ii, :) = RTT -1.8               IF (soil_model) tsoil(ii, :) = RTT - 1.8
282            endif            endif
283         enddo         enddo
284    
# Line 319  contains Line 299  contains
299         tsurf_temp = tsurf_new         tsurf_temp = tsurf_new
300         beta = 1.0         beta = 1.0
301    
302         CALL calcul_fluxs(nisurf, dtime, tsurf_temp, p1lay(:knon), cal(:knon), &         CALL calcul_fluxs(dtime, tsurf_temp, p1lay(:knon), cal(:knon), &
303              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &
304              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &
305              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &
# Line 344  contains Line 324  contains
324    
325         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)
326         WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.         WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.
327         zfra(1:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))         zfra(:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))
328         alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &         albedo = alb_neig(:knon) * zfra(:knon) + 0.6 * (1.0 - zfra(:knon))
             0.6 * (1.0-zfra(1:knon))  
   
        fder_prev = fder  
        fder = fder_prev + dflux_s + dflux_l  
329    
330         iloc = maxloc(fder(1:klon))         fder = fder + dflux_s + dflux_l
331    
332         ! 2eme appel a interfoce pour le cumul et le passage des flux a l'ocean         ! 2eme appel a interfoce pour le cumul et le passage des flux a l'ocean
333    
334         z0_new = 0.002         z0_new = 0.002
335         z0_new = SQRT(z0_new**2 + rugoro**2)         z0_new = SQRT(z0_new**2 + rugoro**2)
        alblw(1:knon) = alb_new(1:knon)  
   
336      case (is_lic)      case (is_lic)
337         if (.not. allocated(run_off_lic)) then         if (.not. allocated(run_off_lic)) then
338            allocate(run_off_lic(knon))            allocate(run_off_lic(knon))
# Line 378  contains Line 352  contains
352         beta = 1.0         beta = 1.0
353         dif_grnd = 0.0         dif_grnd = 0.0
354    
355         call calcul_fluxs(nisurf, dtime, tsurf, p1lay(:knon), cal(:knon), &         call calcul_fluxs(dtime, tsurf, p1lay(:knon), cal(:knon), &
356              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &              beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), &
357              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &              radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), &
358              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &              u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), &
# Line 395  contains Line 369  contains
369         ! calcul albedo         ! calcul albedo
370         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)         CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow)
371         WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.         WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0.
372         zfra(1:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))         zfra(:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0)))
373         alb_new(1 : knon) = alb_neig(1 : knon)*zfra(1:knon) + &         albedo = 0.77
             0.6 * (1.0-zfra(1:knon))  
   
        !IM: plusieurs choix/tests sur l'albedo des "glaciers continentaux"  
        !IM: KstaTER0.77 & LMD_ARMIP6  
        alb_new(1 : knon) = 0.77  
374    
375         ! Rugosite         ! Rugosite
376         z0_new = rugoro         z0_new = rugoro
# Line 409  contains Line 378  contains
378         ! Remplissage des pourcentages de surface         ! Remplissage des pourcentages de surface
379         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)         pctsrf_new(:, nisurf) = pctsrf(:, nisurf)
380    
        alblw(1:knon) = alb_new(1:knon)  
381      case default      case default
382         print *, 'Index surface = ', nisurf         print *, 'Index surface = ', nisurf
383         abort_message = 'Index surface non valable'         abort_message = 'Index surface non valable'
384         call abort_gcm(modname, abort_message, 1)         call abort_gcm(modname, abort_message)
385      end select      end select
386    
387    END SUBROUTINE interfsurf_hq    END SUBROUTINE interfsurf_hq

Legend:
Removed from v.130  
changed lines
  Added in v.171

  ViewVC Help
Powered by ViewVC 1.1.21