--- trunk/phylmd/physiq.f 2018/08/02 17:23:07 301 +++ trunk/phylmd/physiq.f 2018/09/11 12:23:47 306 @@ -150,7 +150,6 @@ REAL, save:: ftsoil(klon, nsoilmx, nbsrf) ! soil temperature of surface fraction - REAL, save:: fevap(klon, nbsrf) ! evaporation REAL fluxlat(klon, nbsrf) REAL, save:: fqsurf(klon, nbsrf) @@ -212,9 +211,9 @@ REAL rain_tiedtke(klon), snow_tiedtke(klon) REAL evap(klon) ! flux d'\'evaporation au sol - real devap(klon) ! derivative of the evaporation flux at the surface + real dflux_q(klon) ! derivative of the evaporation flux at the surface REAL sens(klon) ! flux de chaleur sensible au sol - real dsens(klon) ! derivee du 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) @@ -327,9 +326,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 @@ -418,8 +417,6 @@ t2m = 0. q2m = 0. ffonte = 0. - rain_con = 0. - snow_con = 0. d_u_con = 0. d_v_con = 0. rnebcon0 = 0. @@ -446,10 +443,10 @@ frugs = 0. CALL phyetat0(pctsrf, ftsol, ftsoil, fqsurf, qsol, fsnow, falbe, & - fevap, rain_fall, snow_fall, solsw, sollw, dlw, radsol, frugs, & - agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, t_ancien, & - q_ancien, ancien_ok, rnebcon, ratqs, clwcon, run_off_lic_0, sig1, & - w01, ncid_startphy) + rain_fall, snow_fall, solsw, sollw, dlw, radsol, frugs, agesno, & + zmea, zstd, zsig, zgam, zthe, zpic, zval, t_ancien, q_ancien, & + ancien_ok, rnebcon, ratqs, clwcon, run_off_lic_0, sig1, w01, & + ncid_startphy) ! ATTENTION : il faudra a terme relire q2 dans l'etat initial q2 = 1e-8 @@ -553,9 +550,9 @@ CALL pbl_surface(pctsrf, t_seri, q_seri, u_seri, v_seri, julien, mu0, & ftsol, cdmmax, cdhmax, ftsoil, qsol, paprs, play, fsnow, fqsurf, & - fevap, 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, dsens, devap, coefh, t2m, & + 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) @@ -563,7 +560,7 @@ sens = - sum(flux_t * pctsrf, dim = 2) evap = - sum(flux_q * pctsrf, dim = 2) - fder = dlw + dsens + devap + fder = dlw + dflux_t + dflux_q DO k = 1, llm DO i = 1, klon @@ -574,10 +571,8 @@ ENDDO ENDDO - ! Update surface temperature: - call assert(abs(sum(pctsrf, dim = 2) - 1.) <= EPSFRA, 'physiq: pctsrf') - ftsol = ftsol + d_ts + 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) @@ -1009,21 +1004,6 @@ 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) @@ -1034,12 +1014,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) @@ -1053,16 +1027,35 @@ CALL histwrite_phy("dtlw0", - cool0 / 86400.) 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)) + 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) IF (lafin) then call NF95_CLOSE(ncid_startphy) - CALL phyredem(pctsrf, ftsol, ftsoil, fqsurf, qsol, & - fsnow, falbe, fevap, rain_fall, snow_fall, solsw, sollw, dlw, & - radsol, frugs, agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, & - t_ancien, q_ancien, rnebcon, ratqs, clwcon, run_off_lic_0, sig1, & - w01) + CALL phyredem(pctsrf, ftsol, ftsoil, fqsurf, qsol, fsnow, falbe, & + rain_fall, snow_fall, solsw, sollw, dlw, radsol, frugs, agesno, & + zmea, zstd, zsig, zgam, zthe, zpic, zval, t_ancien, q_ancien, & + rnebcon, ratqs, clwcon, run_off_lic_0, sig1, w01) end IF firstcal = .FALSE.