--- trunk/phylmd/physiq.f 2018/09/11 12:52:28 307 +++ trunk/phylmd/physiq.f90 2019/09/16 17:25:30 338 @@ -29,26 +29,24 @@ 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 USE histsync_m, ONLY: histsync USE histwrite_phy_m, ONLY: histwrite_phy - USE indicesol, ONLY: clnsurf, epsfra, is_lic, is_oce, is_sic, is_ter, & - nbsrf + USE indicesol, ONLY: clnsurf, epsfra, nbsrf USE ini_histins_m, ONLY: ini_histins, nid_ins use lift_noro_m, only: lift_noro use netcdf95, only: NF95_CLOSE use newmicro_m, only: newmicro use nr_util, only: assert - use nuage_m, only: nuage USE orbite_m, ONLY: orbite USE ozonecm_m, ONLY: ozonecm USE phyetat0_m, ONLY: phyetat0 @@ -144,19 +142,25 @@ ! 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 REAL, save:: qsol(klon) ! column-density of water in soil, in kg m-2 - REAL, save:: fsnow(klon, nbsrf) ! \'epaisseur neigeuse + + REAL, save:: fsnow(klon, nbsrf) + ! column-density of mass of snow at the surface, in kg m-2 + REAL, save:: falbe(klon, nbsrf) ! albedo visible par type de surface ! Param\`etres de l'orographie \`a l'\'echelle sous-maille (OESM) : @@ -215,8 +219,7 @@ REAL sens(klon) ! flux de chaleur sensible au sol 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 @@ -241,11 +244,14 @@ REAL diafra(klon, llm) ! fraction nuageuse REAL cldliq(klon, llm) ! eau liquide nuageuse REAL cldfra(klon, llm) ! fraction nuageuse - REAL cldtau(klon, llm) ! epaisseur optique - REAL cldemi(klon, llm) ! emissivite infrarouge + REAL cldtau(klon, llm) ! \'epaisseur optique + REAL cldemi(klon, llm) ! \'emissivit\'e 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,8 +263,9 @@ 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) @@ -273,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) @@ -328,7 +335,6 @@ real rain_lsc(klon) REAL snow_con(klon) ! neige (mm / s) real snow_lsc(klon) - REAL d_ts(klon, nbsrf) ! variation of ftsol REAL d_u_vdf(klon, llm), d_v_vdf(klon, llm) REAL d_t_vdf(klon, llm), d_q_vdf(klon, llm) @@ -342,10 +348,9 @@ real ratqss(klon, llm), ratqsc(klon, llm) real:: ratqsbas = 0.01, ratqshaut = 0.3 - ! Parametres lies au nouveau schema de nuages (SB, PDF) + ! Param\`etres li\'es au nouveau sch\'ema de nuages : real:: fact_cldcon = 0.375 real:: facttemps = 1.e-4 - logical:: ok_newmicro = .true. real facteur integer:: iflag_cldcon = 1 @@ -399,9 +404,8 @@ 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 + namelist /physiq_nml/ fact_cldcon, facttemps, iflag_cldcon, ratqsbas, & + ratqshaut, ok_ade, bl95_b0, bl95_b1 !---------------------------------------------------------------- @@ -429,12 +433,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: @@ -466,7 +469,7 @@ ENDIF ! Initialisation des sorties - call ini_histins(ok_newmicro) + call ini_histins CALL phyredem0 call conf_interface ENDIF test_firstcal @@ -539,14 +542,14 @@ 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, 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) + d_q_vdf, d_u_vdf, d_v_vdf, 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 @@ -560,7 +563,6 @@ ENDDO call assert(abs(sum(pctsrf, dim = 2) - 1.) <= EPSFRA, 'physiq: pctsrf') - ftsol = ftsol + d_ts ! update surface temperature tsol = sum(ftsol * pctsrf, dim = 2) zxfluxlat = sum(fluxlat * pctsrf, dim = 2) zt2m = sum(t2m * pctsrf, dim = 2) @@ -650,7 +652,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 @@ -666,14 +668,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 @@ -806,8 +807,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 @@ -818,13 +818,8 @@ ! Param\`etres optiques des nuages et quelques param\`etres pour ! diagnostics : - if (ok_newmicro) then - CALL newmicro(paprs, play, t_seri, cldliq, cldfra, cldtau, cldemi, & - cldh, cldl, cldm, cldt, cldq, flwp, fiwp, flwc, fiwc) - else - CALL nuage(paprs, play, t_seri, cldliq, cldfra, cldtau, cldemi, cldh, & - cldl, cldm, cldt, cldq) - endif + CALL newmicro(paprs, play, t_seri, cldliq, cldfra, cldtau, cldemi, cldh, & + cldl, cldm, cldt, cldq, flwp, fiwp, flwc, fiwc) IF (MOD(itap - 1, radpas) == 0) THEN wo = ozonecm(REAL(julien), paprs) @@ -844,11 +839,6 @@ ENDDO ENDDO - ! 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) - ENDDO - ! Param\'etrisation de l'orographie \`a l'\'echelle sous-maille : IF (ok_orodr) THEN @@ -912,8 +902,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: @@ -982,15 +972,11 @@ 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("bils", radsol + sens + zxfluxlat) + 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)) CALL histwrite_phy("albs", albsol) CALL histwrite_phy("tro3", wo * dobson_u * 1e3 / zmasse / rmo3 * md) @@ -1013,12 +999,12 @@ 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("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))