--- trunk/Sources/phylmd/Interface_surf/interfsurf_hq.f 2015/07/07 17:49:23 154 +++ trunk/Sources/phylmd/Interface_surf/interfsurf_hq.f 2015/11/25 20:14:19 174 @@ -9,7 +9,7 @@ spechum, tq_cdrag, petAcoef, peqAcoef, petBcoef, peqBcoef, & precip_rain, precip_snow, fder, rugos, rugoro, snow, qsurf, tsurf, & p1lay, ps, radsol, evap, fluxsens, fluxlat, dflux_l, dflux_s, & - tsurf_new, alblw, z0_new, pctsrf_new, agesno, fqcalving, ffonte, & + tsurf_new, albedo, z0_new, pctsrf_new, agesno, fqcalving, ffonte, & run_off_lic_0, flux_o, flux_g) ! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface @@ -96,7 +96,7 @@ ! fluxlat flux de chaleur latente real, dimension(klon), intent(OUT):: dflux_l, dflux_s real, intent(OUT):: tsurf_new(knon) ! temp\'erature au sol - real, intent(OUT):: alblw(:) ! (knon) albedo + real, intent(OUT):: albedo(:) ! (knon) albedo real, intent(OUT):: z0_new(klon) ! surface roughness real, dimension(klon, nbsrf), intent(OUT):: pctsrf_new ! pctsrf_new nouvelle repartition des surfaces @@ -134,8 +134,8 @@ real, parameter:: calice=1.0/(5.1444e6 * 0.15), tau_gl=86400. * 5. real, parameter:: calsno=1./(2.3867e6 * 0.15) real tsurf_temp(knon) - real alb_neig(klon) - real zfra(klon) + real alb_neig(knon) + real zfra(knon) !------------------------------------------------------------- @@ -149,7 +149,7 @@ print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter print *, 'or on doit commencer par les surfaces continentales' abort_message='voir ci-dessus' - call abort_gcm(modname, abort_message, 1) + call abort_gcm(modname, abort_message) endif if (is_oce > is_sic) then print *, 'Warning:' @@ -157,7 +157,7 @@ print *, ' l''ocean doit etre traite avant la banquise' print *, ' or is_oce = ', is_oce, '> is_sic = ', is_sic abort_message='voir ci-dessus' - call abort_gcm(modname, abort_message, 1) + call abort_gcm(modname, abort_message) endif endif first_call = .false. @@ -171,7 +171,6 @@ dif_grnd = 999999. capsol = 999999. z0_new = 999999. - alb_neig = 999999. tsurf_new = 999999. !IM: "slab" ocean; initialisations @@ -182,26 +181,25 @@ select case (nisurf) case (is_ter) - ! Surface "terre" appel a l'interface avec les sols continentaux + ! Surface "terre", appel \`a l'interface avec les sols continentaux ! allocation du run-off if (.not. allocated(run_off)) then allocate(run_off(knon)) run_off = 0. else if (size(run_off) /= knon) then - print *, 'Bizarre, le nombre de points continentaux' - print *, 'a change entre deux appels. J''arrete ' - abort_message='voir ci-dessus' - call abort_gcm(modname, abort_message, 1) + call abort_gcm(modname, 'Something is wrong: the number of ' & + // 'continental points has changed since last call.') endif ! Calcul age de la neige - ! calcul albedo: lecture albedo fichier boundary conditions - ! puis ajout albedo neige - call interfsur_lim(itime, dtime, jour, knindex, debut, alblw, z0_new) + ! Read albedo from the file containing boundary conditions then + ! add the albedo of snow: + + call interfsur_lim(itime, dtime, jour, knindex, debut, albedo, z0_new) - ! calcul snow et qsurf, hydrol adapt\'e + ! Calcul snow et qsurf, hydrologie adapt\'ee CALL calbeta(nisurf, snow(:knon), qsol(:knon), beta(:knon), & capsol(:knon), dif_grnd(:knon)) @@ -212,7 +210,8 @@ ELSE cal = RCPD * capsol ENDIF - CALL calcul_fluxs(nisurf, dtime, tsurf, p1lay(:knon), cal(:knon), & + + CALL calcul_fluxs(dtime, tsurf, p1lay(:knon), cal(:knon), & beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), & radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), & u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), & @@ -226,11 +225,10 @@ peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), tsurf_new, & evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon)) - call albsno(klon, knon, dtime, agesno, alb_neig, precip_snow) - where (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0. - zfra(:knon) = max(0.0, min(1.0, snow(1:knon)/(snow(1:knon) + 10.0))) - alblw = alb_neig(:knon) * zfra(:knon) & - + alblw * (1. - zfra(:knon)) + call albsno(dtime, agesno(:knon), alb_neig, precip_snow(:knon)) + where (snow(:knon) < 0.0001) agesno(:knon) = 0. + zfra = max(0.0, min(1.0, snow(:knon)/(snow(:knon) + 10.0))) + albedo = alb_neig * zfra + albedo * (1. - zfra) z0_new = sqrt(z0_new**2 + rugoro**2) ! Remplissage des pourcentages de surface @@ -244,9 +242,8 @@ cal = 0. beta = 1. dif_grnd = 0. - alb_neig = 0. agesno = 0. - call calcul_fluxs(nisurf, dtime, tsurf_temp, p1lay(:knon), & + call calcul_fluxs(dtime, tsurf_temp, p1lay(:knon), & cal(:knon), beta(:knon), tq_cdrag(:knon), ps(:knon), & qsurf(:knon), radsol(:knon), dif_grnd(:knon), temp_air(:knon), & spechum(:knon), u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), & @@ -259,11 +256,11 @@ flux_o(:knon) = fluxsens(:knon) - evap(:knon) & * merge(RLSTT, RLVTT, tsurf_new < RTT) - ! calcul albedo + ! Compute the albedo: if (cycle_diurne) then - CALL alboc_cd(rmu0(knindex), alblw) + CALL alboc_cd(rmu0(knindex), albedo) else - CALL alboc(jour, rlat(knindex), alblw) + CALL alboc(jour, rlat(knindex), albedo) endif z0_new = sqrt(rugos**2 + rugoro**2) @@ -300,7 +297,7 @@ tsurf_temp = tsurf_new beta = 1.0 - CALL calcul_fluxs(nisurf, dtime, tsurf_temp, p1lay(:knon), cal(:knon), & + CALL calcul_fluxs(dtime, tsurf_temp, p1lay(:knon), cal(:knon), & beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), & radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), & u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), & @@ -321,12 +318,12 @@ peqAcoef(:knon), petBcoef(:knon), peqBcoef(:knon), tsurf_new, & evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon)) - ! calcul albedo + ! Compute the albedo: - CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow) - WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0. - zfra(:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0))) - alblw = alb_neig(:knon) * zfra(:knon) + 0.6 * (1.0 - zfra(:knon)) + CALL albsno(dtime, agesno(:knon), alb_neig, precip_snow(:knon)) + WHERE (snow(:knon) < 0.0001) agesno(:knon) = 0. + zfra = MAX(0.0, MIN(1.0, snow(:knon)/(snow(:knon) + 10.0))) + albedo = alb_neig * zfra + 0.6 * (1.0 - zfra) fder = fder + dflux_s + dflux_l @@ -353,7 +350,7 @@ beta = 1.0 dif_grnd = 0.0 - call calcul_fluxs(nisurf, dtime, tsurf, p1lay(:knon), cal(:knon), & + call calcul_fluxs(dtime, tsurf, p1lay(:knon), cal(:knon), & beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), & radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), & u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), & @@ -368,10 +365,9 @@ evap(:knon), fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon)) ! calcul albedo - CALL albsno(klon, knon, dtime, agesno, alb_neig, precip_snow) - WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0. - zfra(:knon) = MAX(0.0, MIN(1.0, snow(1:knon)/(snow(1:knon) + 10.0))) - alblw = 0.77 + CALL albsno(dtime, agesno(:knon), alb_neig, precip_snow(:knon)) + WHERE (snow(:knon) < 0.0001) agesno(:knon) = 0. + albedo = 0.77 ! Rugosite z0_new = rugoro @@ -382,7 +378,7 @@ case default print *, 'Index surface = ', nisurf abort_message = 'Index surface non valable' - call abort_gcm(modname, abort_message, 1) + call abort_gcm(modname, abort_message) end select END SUBROUTINE interfsurf_hq