--- trunk/phylmd/physiq.f 2018/09/06 15:51:09 304 +++ trunk/phylmd/physiq.f 2019/06/10 00:29:10 326 @@ -29,13 +29,13 @@ USE conf_gcm_m, ONLY: lmt_pas USE conf_phys_m, ONLY: conf_phys use conflx_m, only: conflx - USE ctherm, ONLY: iflag_thermals, nsplit_thermals + USE ctherm_m, ONLY: iflag_thermals, ctherm use diagcld2_m, only: diagcld2 USE dimensions, ONLY: llm, nqmx USE dimphy, ONLY: klon USE dimsoil, ONLY: nsoilmx use drag_noro_m, only: drag_noro - use dynetat0_m, only: day_ref, annee_ref + use dynetat0_chosen_m, only: day_ref, annee_ref USE fcttre, ONLY: foeew use fisrtilp_m, only: fisrtilp USE hgardfou_m, ONLY: hgardfou @@ -144,13 +144,16 @@ ! Radiative transfer computations are made every "radpas" call to ! "physiq". - REAL, save:: radsol(klon) ! bilan radiatif au sol calcule par code radiatif - REAL, save:: ftsol(klon, nbsrf) ! skin temperature of surface fraction + REAL, save:: radsol(klon) + ! Bilan radiatif net au sol (W/m2), positif vers le bas. Must be + ! saved because radlwsw is not called at every time step. + + REAL, save:: ftsol(klon, nbsrf) ! skin temperature of surface fraction, in K REAL, save:: ftsoil(klon, nsoilmx, nbsrf) ! soil temperature of surface fraction - REAL fluxlat(klon, nbsrf) + REAL fluxlat(klon, nbsrf) ! flux de chaleur latente, en W m-2 REAL, save:: fqsurf(klon, nbsrf) ! humidite de l'air au contact de la surface @@ -216,7 +219,7 @@ real dflux_t(klon) ! derivee du flux de chaleur sensible au sol REAL, save:: dlw(klon) ! derivative of infra-red flux REAL bils(klon) ! bilan de chaleur au sol - REAL fder(klon) ! Derive de flux (sensible et latente) + REAL fder(klon) ! d\'erive de flux (sensible et latente) REAL ve(klon) ! integr. verticale du transport meri. de l'energie REAL vq(klon) ! integr. verticale du transport meri. de l'eau REAL ue(klon) ! integr. verticale du transport zonal de l'energie @@ -245,7 +248,10 @@ REAL cldemi(klon, llm) ! emissivite infrarouge REAL flux_q(klon, nbsrf) ! flux turbulent d'humidite à la surface - REAL flux_t(klon, nbsrf) ! flux turbulent de chaleur à la surface + + REAL flux_t(klon, nbsrf) + ! flux de chaleur sensible (c_p T) (W / m2) (orientation positive + ! vers le bas) à la surface REAL flux_u(klon, nbsrf), flux_v(klon, nbsrf) ! tension du vent (flux turbulent de vent) à la surface, en Pa @@ -257,12 +263,11 @@ REAL, save:: cool(klon, llm) ! refroidissement infrarouge REAL, save:: cool0(klon, llm) ! refroidissement infrarouge ciel clair REAL, save:: topsw(klon), toplw(klon), solsw(klon) - REAL, save:: sollw(klon) ! rayonnement infrarouge montant \`a la surface - real, save:: sollwdown(klon) ! downward LW flux at surface + + REAL, save:: sollw(klon) ! surface net downward longwave flux, in W m-2 + real, save:: sollwdown(klon) ! downwelling longwave flux at surface REAL, save:: topsw0(klon), toplw0(klon), solsw0(klon), sollw0(klon) REAL, save:: albpla(klon) - REAL fsollw(klon, nbsrf) ! bilan flux IR pour chaque sous-surface - REAL fsolsw(klon, nbsrf) ! flux solaire absorb\'e pour chaque sous-surface REAL conv_q(klon, llm) ! convergence de l'humidite (kg / kg / s) REAL conv_t(klon, llm) ! convergence of temperature (K / s) @@ -275,7 +280,7 @@ real longi REAL z_avant(klon), z_apres(klon), z_factor(klon) REAL zb - REAL zx_t, zx_qs, zcor + REAL zx_qs, zcor real zqsat(klon, llm) INTEGER i, k, iq, nsrf REAL zphi(klon, llm) @@ -326,9 +331,9 @@ INTEGER, save:: ibas_con(klon), itop_con(klon) real ema_pct(klon) ! Emanuel pressure at cloud top, in Pa - REAL, save:: rain_con(klon) + REAL rain_con(klon) real rain_lsc(klon) - REAL, save:: snow_con(klon) ! neige (mm / s) + REAL snow_con(klon) ! neige (mm / s) real snow_lsc(klon) REAL d_ts(klon, nbsrf) ! variation of ftsol @@ -402,8 +407,7 @@ integer, save:: ncid_startphy namelist /physiq_nml/ fact_cldcon, facttemps, ok_newmicro, iflag_cldcon, & - ratqsbas, ratqshaut, ok_ade, bl95_b0, bl95_b1, iflag_thermals, & - nsplit_thermals + ratqsbas, ratqshaut, ok_ade, bl95_b0, bl95_b1 !---------------------------------------------------------------- @@ -417,8 +421,6 @@ t2m = 0. q2m = 0. ffonte = 0. - rain_con = 0. - snow_con = 0. d_u_con = 0. d_v_con = 0. rnebcon0 = 0. @@ -433,12 +435,11 @@ pblt =0. therm =0. - iflag_thermals = 0 - nsplit_thermals = 1 print *, "Enter namelist 'physiq_nml'." read(unit=*, nml=physiq_nml) write(unit_nml, nml=physiq_nml) + call ctherm call conf_phys ! Initialiser les compteurs: @@ -539,28 +540,18 @@ CALL orbite(REAL(julien), longi, dist) CALL zenang(longi, time, dtphys * radpas, mu0, fract) - albsol = sum(falbe * pctsrf, dim = 2) - - ! R\'epartition sous maille des flux longwave et shortwave - ! R\'epartition du longwave par sous-surface lin\'earis\'ee - - forall (nsrf = 1: nbsrf) - fsollw(:, nsrf) = sollw + 4. * RSIGMA * tsol**3 & - * (tsol - ftsol(:, nsrf)) - fsolsw(:, nsrf) = solsw * (1. - falbe(:, nsrf)) / (1. - albsol) - END forall CALL pbl_surface(pctsrf, t_seri, q_seri, u_seri, v_seri, julien, mu0, & ftsol, cdmmax, cdhmax, ftsoil, qsol, paprs, play, fsnow, fqsurf, & - falbe, fluxlat, rain_fall, snow_fall, fsolsw, fsollw, frugs, agesno, & - rugoro, d_t_vdf, d_q_vdf, d_u_vdf, d_v_vdf, d_ts, flux_t, flux_q, & - flux_u, flux_v, cdragh, cdragm, q2, dflux_t, dflux_q, coefh, t2m, & - q2m, u10m_srf, v10m_srf, pblh, capCL, oliqCL, cteiCL, pblT, therm, & - plcl, fqcalving, ffonte, run_off_lic_0) + falbe, fluxlat, rain_fall, snow_fall, frugs, agesno, rugoro, d_t_vdf, & + d_q_vdf, d_u_vdf, d_v_vdf, d_ts, flux_t, flux_q, flux_u, flux_v, & + cdragh, cdragm, q2, dflux_t, dflux_q, coefh, t2m, q2m, u10m_srf, & + v10m_srf, pblh, capCL, oliqCL, cteiCL, pblT, therm, plcl, fqcalving, & + ffonte, run_off_lic_0, albsol, sollw, solsw, tsol) ! Incr\'ementation des flux - sens = - sum(flux_t * pctsrf, dim = 2) + sens = sum(flux_t * pctsrf, dim = 2) evap = - sum(flux_q * pctsrf, dim = 2) fder = dlw + dflux_t + dflux_q @@ -664,7 +655,7 @@ z_factor = (z_avant - (rain_con + snow_con) * dtphys) / z_apres DO k = 1, llm DO i = 1, klon - IF (z_factor(i) > 1. + 1E-8 .OR. z_factor(i) < 1. - 1E-8) THEN + IF (z_factor(i) /= 1.) THEN q_seri(i, k) = q_seri(i, k) * z_factor(i) ENDIF ENDDO @@ -680,14 +671,13 @@ fm_therm = 0. entr_therm = 0. - if (iflag_thermals == 0) then - ! Ajustement sec + if (iflag_thermals) then + call calltherm(play, paprs, pphi, u_seri, v_seri, t_seri, q_seri, & + d_u_ajs, d_v_ajs, d_t_ajs, d_q_ajs, fm_therm, entr_therm) + else CALL ajsec(paprs, play, t_seri, q_seri, d_t_ajs, d_q_ajs) t_seri = t_seri + d_t_ajs q_seri = q_seri + d_q_ajs - else - call calltherm(play, paprs, pphi, u_seri, v_seri, t_seri, q_seri, & - d_u_ajs, d_v_ajs, d_t_ajs, d_q_ajs, fm_therm, entr_therm) endif ! Caclul des ratqs @@ -820,8 +810,7 @@ ! Humidit\'e relative pour diagnostic : DO k = 1, llm DO i = 1, klon - zx_t = t_seri(i, k) - zx_qs = r2es * FOEEW(zx_t, rtt >= zx_t) / play(i, k) + zx_qs = r2es * FOEEW(t_seri(i, k), rtt >= t_seri(i, k)) / play(i, k) zx_qs = MIN(0.5, zx_qs) zcor = 1. / (1. - retv * zx_qs) zx_qs = zx_qs * zcor @@ -860,7 +849,7 @@ ! Calculer le bilan du sol et la d\'erive de temp\'erature (couplage) DO i = 1, klon - bils(i) = radsol(i) - sens(i) + zxfluxlat(i) + bils(i) = radsol(i) + sens(i) + zxfluxlat(i) ENDDO ! Param\'etrisation de l'orographie \`a l'\'echelle sous-maille : @@ -926,8 +915,8 @@ ! diag. bilKP - CALL transp_lay(paprs, t_seri, q_seri, u_seri, v_seri, zphi, & - ve_lay, vq_lay, ue_lay, uq_lay) + CALL transp_lay(paprs, t_seri, q_seri, u_seri, v_seri, zphi, ve_lay, & + vq_lay, ue_lay, uq_lay) ! Accumuler les variables a stocker dans les fichiers histoire: @@ -996,31 +985,16 @@ CALL histwrite_phy("topl", toplw) CALL histwrite_phy("evap", evap) CALL histwrite_phy("sols", solsw) - CALL histwrite_phy("soll", sollw) + CALL histwrite_phy("rls", sollw) CALL histwrite_phy("solldown", sollwdown) CALL histwrite_phy("bils", bils) - CALL histwrite_phy("sens", - sens) + CALL histwrite_phy("sens", sens) CALL histwrite_phy("fder", fder) CALL histwrite_phy("dtsvdfo", d_ts(:, is_oce)) CALL histwrite_phy("dtsvdft", d_ts(:, is_ter)) CALL histwrite_phy("dtsvdfg", d_ts(:, is_lic)) CALL histwrite_phy("dtsvdfi", d_ts(:, is_sic)) CALL histwrite_phy("zxfqcalving", sum(fqcalving * pctsrf, dim = 2)) - - DO nsrf = 1, nbsrf - CALL histwrite_phy("pourc_"//clnsurf(nsrf), pctsrf(:, nsrf) * 100.) - CALL histwrite_phy("fract_"//clnsurf(nsrf), pctsrf(:, nsrf)) - CALL histwrite_phy("sens_"//clnsurf(nsrf), flux_t(:, nsrf)) - CALL histwrite_phy("lat_"//clnsurf(nsrf), fluxlat(:, nsrf)) - CALL histwrite_phy("tsol_"//clnsurf(nsrf), ftsol(:, nsrf)) - CALL histwrite_phy("taux_"//clnsurf(nsrf), flux_u(:, nsrf)) - CALL histwrite_phy("tauy_"//clnsurf(nsrf), flux_v(:, nsrf)) - CALL histwrite_phy("rugs_"//clnsurf(nsrf), frugs(:, nsrf)) - CALL histwrite_phy("albe_"//clnsurf(nsrf), falbe(:, nsrf)) - CALL histwrite_phy("u10m_"//clnsurf(nsrf), u10m_srf(:, nsrf)) - CALL histwrite_phy("v10m_"//clnsurf(nsrf), v10m_srf(:, nsrf)) - END DO - CALL histwrite_phy("albs", albsol) CALL histwrite_phy("tro3", wo * dobson_u * 1e3 / zmasse / rmo3 * md) CALL histwrite_phy("rugs", zxrugs) @@ -1031,12 +1005,6 @@ CALL histwrite_phy("s_oliqCL", s_oliqCL) CALL histwrite_phy("s_cteiCL", s_cteiCL) CALL histwrite_phy("s_therm", s_therm) - - if (conv_emanuel) then - CALL histwrite_phy("ptop", ema_pct) - CALL histwrite_phy("dnwd0", - mp) - end if - CALL histwrite_phy("temp", t_seri) CALL histwrite_phy("vitu", u_seri) CALL histwrite_phy("vitv", v_seri) @@ -1048,8 +1016,28 @@ CALL histwrite_phy("d_t_ec", d_t_ec) CALL histwrite_phy("dtsw0", heat0 / 86400.) CALL histwrite_phy("dtlw0", - cool0 / 86400.) + call histwrite_phy("pmflxr", pmflxr(:, :llm)) CALL histwrite_phy("msnow", sum(fsnow * pctsrf, dim = 2)) call histwrite_phy("qsurf", sum(fqsurf * pctsrf, dim = 2)) + call histwrite_phy("flat", zxfluxlat) + + DO nsrf = 1, nbsrf + CALL histwrite_phy("fract_"//clnsurf(nsrf), pctsrf(:, nsrf)) + CALL histwrite_phy("sens_"//clnsurf(nsrf), flux_t(:, nsrf)) + CALL histwrite_phy("lat_"//clnsurf(nsrf), fluxlat(:, nsrf)) + CALL histwrite_phy("tsol_"//clnsurf(nsrf), ftsol(:, nsrf)) + CALL histwrite_phy("taux_"//clnsurf(nsrf), flux_u(:, nsrf)) + CALL histwrite_phy("tauy_"//clnsurf(nsrf), flux_v(:, nsrf)) + CALL histwrite_phy("rugs_"//clnsurf(nsrf), frugs(:, nsrf)) + CALL histwrite_phy("albe_"//clnsurf(nsrf), falbe(:, nsrf)) + CALL histwrite_phy("u10m_"//clnsurf(nsrf), u10m_srf(:, nsrf)) + CALL histwrite_phy("v10m_"//clnsurf(nsrf), v10m_srf(:, nsrf)) + END DO + + if (conv_emanuel) then + CALL histwrite_phy("ptop", ema_pct) + CALL histwrite_phy("dnwd0", - mp) + end if if (ok_instan) call histsync(nid_ins)