--- trunk/phylmd/physiq.f 2018/09/18 15:14:40 308 +++ trunk/phylmd/physiq.f 2019/06/13 13:59:19 327 @@ -29,20 +29,19 @@ 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 @@ -145,14 +144,15 @@ ! "physiq". REAL, save:: radsol(klon) - ! bilan radiatif net au sol (W/m2), positif vers le bas + ! 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 + 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 @@ -218,7 +218,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 @@ -247,7 +247,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 @@ -261,7 +264,7 @@ REAL, save:: topsw(klon), toplw(klon), solsw(klon) REAL, save:: sollw(klon) ! surface net downward longwave flux, in W m-2 - real, save:: sollwdown(klon) ! downward LW flux at surface + real, save:: sollwdown(klon) ! downwelling longwave flux at surface REAL, save:: topsw0(klon), toplw0(klon), solsw0(klon), sollw0(klon) REAL, save:: albpla(klon) @@ -276,7 +279,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) @@ -331,7 +334,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) @@ -403,8 +405,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 !---------------------------------------------------------------- @@ -432,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: @@ -542,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 @@ -563,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) @@ -653,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 @@ -669,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 @@ -809,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 @@ -849,7 +846,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 : @@ -915,8 +912,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: @@ -988,12 +985,8 @@ 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)) CALL histwrite_phy("albs", albsol) CALL histwrite_phy("tro3", wo * dobson_u * 1e3 / zmasse / rmo3 * md) @@ -1016,12 +1009,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))