--- trunk/Sources/phylmd/physiq.f 2017/04/28 13:22:36 223 +++ trunk/phylmd/physiq.f 2018/09/27 16:29:06 310 @@ -18,20 +18,20 @@ USE abort_gcm_m, ONLY: abort_gcm use ajsec_m, only: ajsec use calltherm_m, only: calltherm - USE clesphys, ONLY: cdhmax, cdmmax, ecrit_ins, ksta, ksta_ter, ok_kzmin, & - ok_instan + USE clesphys, ONLY: cdhmax, cdmmax, ecrit_ins, ok_instan USE clesphys2, ONLY: conv_emanuel, nbapp_rad, new_oliq, ok_orodr, ok_orolf - USE clmain_m, ONLY: clmain + USE conf_interface_m, ONLY: conf_interface + USE pbl_surface_m, ONLY: pbl_surface use clouds_gno_m, only: clouds_gno use comconst, only: dtphys USE comgeomphy, ONLY: airephy USE concvl_m, ONLY: concvl - USE conf_gcm_m, ONLY: offline, lmt_pas + 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 diagcld2_m, only: diagcld2 - USE dimens_m, ONLY: llm, nqmx + USE dimensions, ONLY: llm, nqmx USE dimphy, ONLY: klon USE dimsoil, ONLY: nsoilmx use drag_noro_m, only: drag_noro @@ -44,16 +44,16 @@ USE indicesol, ONLY: clnsurf, epsfra, is_lic, is_oce, is_sic, is_ter, & 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, rlat, rlon + USE phyetat0_m, ONLY: phyetat0 USE phyredem_m, ONLY: phyredem USE phyredem0_m, ONLY: phyredem0 - USE phystokenc_m, ONLY: phystokenc USE phytrac_m, ONLY: phytrac use radlwsw_m, only: radlwsw use yoegwd, only: sugwd @@ -144,13 +144,14 @@ ! 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 + + REAL, save:: ftsol(klon, nbsrf) ! skin temperature of surface fraction, in K 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) @@ -170,33 +171,29 @@ REAL, save:: zval(klon) ! Minimum de l'OESM REAL, save:: rugoro(klon) ! longueur de rugosite de l'OESM REAL zulow(klon), zvlow(klon) - INTEGER igwd, itest(klon) + INTEGER ktest(klon) REAL, save:: agesno(klon, nbsrf) ! age de la neige REAL, save:: run_off_lic_0(klon) ! Variables li\'ees \`a la convection d'Emanuel : REAL, save:: Ma(klon, llm) ! undilute upward mass flux - REAL, save:: qcondc(klon, llm) ! in-cld water content from convect REAL, save:: sig1(klon, llm), w01(klon, llm) ! Variables pour la couche limite (Alain Lahellec) : REAL cdragh(klon) ! drag coefficient pour T and Q REAL cdragm(klon) ! drag coefficient pour vent - ! Pour phytrac : - REAL ycoefh(klon, llm) ! coef d'echange pour phytrac - REAL yu1(klon) ! vents dans la premiere couche U - REAL yv1(klon) ! vents dans la premiere couche V + REAL coefh(klon, 2:llm) ! coef d'echange pour phytrac REAL, save:: ffonte(klon, nbsrf) ! flux thermique utilise pour fondre la neige - REAL, save:: fqcalving(klon, nbsrf) - ! flux d'eau "perdue" par la surface et necessaire pour limiter la - ! hauteur de neige, en kg / m2 / s + REAL fqcalving(klon, nbsrf) + ! flux d'eau "perdue" par la surface et n\'ecessaire pour limiter + ! la hauteur de neige, en kg / m2 / s - REAL zxffonte(klon), zxfqcalving(klon) + REAL zxffonte(klon) REAL, save:: pfrac_impa(klon, llm)! Produits des coefs lessivage impaction REAL, save:: pfrac_nucl(klon, llm)! Produits des coefs lessivage nucleation @@ -216,9 +213,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) @@ -241,7 +238,7 @@ real, save:: clwcon(klon, llm), rnebcon(klon, llm) real, save:: clwcon0(klon, llm), rnebcon0(klon, llm) - REAL rhcl(klon, llm) ! humiditi relative ciel clair + REAL rhcl(klon, llm) ! humidit\'e relative ciel clair REAL dialiq(klon, llm) ! eau liquide nuageuse REAL diafra(klon, llm) ! fraction nuageuse REAL cldliq(klon, llm) ! eau liquide nuageuse @@ -250,9 +247,13 @@ 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_u(klon, nbsrf) ! flux turbulent de vitesse u à la surface - REAL flux_v(klon, nbsrf) ! flux turbulent de vitesse v à 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 ! Le rayonnement n'est pas calcul\'e tous les pas, il faut donc que ! les variables soient r\'emanentes. @@ -261,12 +262,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:: sollw(klon) ! surface net downward longwave flux, in W m-2 real, save:: sollwdown(klon) ! downward LW 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) @@ -293,14 +293,10 @@ REAL, SAVE:: cteiCL(klon, nbsrf) ! cloud top instab. crit. couche limite REAL, SAVE:: pblt(klon, nbsrf) ! T \`a la hauteur de couche limite REAL, SAVE:: therm(klon, nbsrf) - REAL, SAVE:: trmb1(klon, nbsrf) ! deep_cape - REAL, SAVE:: trmb2(klon, nbsrf) ! inhibition - REAL, SAVE:: trmb3(klon, nbsrf) ! Point Omega ! Grandeurs de sorties REAL s_pblh(klon), s_lcl(klon), s_capCL(klon) REAL s_oliqCL(klon), s_cteiCL(klon), s_pblt(klon) - REAL s_therm(klon), s_trmb1(klon), s_trmb2(klon) - REAL s_trmb3(klon) + REAL s_therm(klon) ! Variables pour la convection de K. Emanuel : @@ -334,9 +330,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 @@ -372,7 +368,6 @@ REAL zustrdr(klon), zvstrdr(klon) REAL zustrli(klon), zvstrli(klon) - REAL zustrph(klon), zvstrph(klon) REAL aam, torsfc REAL ve_lay(klon, llm) ! transport meri. de l'energie a chaque niveau vert. @@ -380,7 +375,6 @@ REAL ue_lay(klon, llm) ! transport zonal de l'energie a chaque niveau vert. REAL uq_lay(klon, llm) ! transport zonal de l'eau a chaque niveau vert. - real date0 REAL tsol(klon) REAL d_t_ec(klon, llm) @@ -390,9 +384,11 @@ REAL, save:: t2m(klon, nbsrf), q2m(klon, nbsrf) ! temperature and humidity at 2 m - REAL, save:: u10m(klon, nbsrf), v10m(klon, nbsrf) ! vents a 10 m + REAL, save:: u10m_srf(klon, nbsrf), v10m_srf(klon, nbsrf) + ! composantes du vent \`a 10 m + REAL zt2m(klon), zq2m(klon) ! température, humidité 2 m moyenne sur 1 maille - REAL zu10m(klon), zv10m(klon) ! vents a 10 m moyennes sur 1 maille + REAL u10m(klon), v10m(klon) ! vent \`a 10 m moyenn\' sur les sous-surfaces ! Aerosol effects: @@ -420,14 +416,11 @@ test_firstcal: IF (firstcal) THEN ! initialiser - u10m = 0. - v10m = 0. + u10m_srf = 0. + v10m_srf = 0. t2m = 0. q2m = 0. ffonte = 0. - fqcalving = 0. - rain_con = 0. - snow_con = 0. d_u_con = 0. d_v_con = 0. rnebcon0 = 0. @@ -441,9 +434,6 @@ cteiCL =0. ! cloud top instab. crit. couche limite pblt =0. therm =0. - trmb1 =0. ! deep_cape - trmb2 =0. ! inhibition - trmb3 =0. ! Point Omega iflag_thermals = 0 nsplit_thermals = 1 @@ -457,10 +447,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 @@ -481,15 +471,10 @@ rugoro = 0. ENDIF - ecrit_ins = NINT(ecrit_ins / dtphys) - ! Initialisation des sorties - - call ini_histins(dtphys, ok_newmicro) - CALL ymds2ju(annee_ref, 1, day_ref, 0., date0) - ! Positionner date0 pour initialisation de ORCHIDEE - print *, 'physiq date0: ', date0 + call ini_histins(ok_newmicro) CALL phyredem0 + call conf_interface ENDIF test_firstcal ! We will modify variables *_seri and we will not touch variables @@ -556,31 +541,20 @@ 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 clmain(dtphys, pctsrf, t_seri, q_seri, u_seri, v_seri, julien, mu0, & - ftsol, cdmmax, cdhmax, ksta, ksta_ter, ok_kzmin, 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, ycoefh, yu1, yv1, t2m, q2m, u10m, v10m, & - pblh, capCL, oliqCL, cteiCL, pblT, therm, trmb1, trmb2, trmb3, plcl, & - fqcalving, ffonte, run_off_lic_0) + 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) ! 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 + dsens + devap + fder = dlw + dflux_t + dflux_q DO k = 1, llm DO i = 1, klon @@ -591,18 +565,15 @@ 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) zq2m = sum(q2m * pctsrf, dim = 2) - zu10m = sum(u10m * pctsrf, dim = 2) - zv10m = sum(v10m * pctsrf, dim = 2) + u10m = sum(u10m_srf * pctsrf, dim = 2) + v10m = sum(v10m_srf * pctsrf, dim = 2) zxffonte = sum(ffonte * pctsrf, dim = 2) - zxfqcalving = sum(fqcalving * pctsrf, dim = 2) s_pblh = sum(pblh * pctsrf, dim = 2) s_lcl = sum(plcl * pctsrf, dim = 2) s_capCL = sum(capCL * pctsrf, dim = 2) @@ -610,9 +581,6 @@ s_cteiCL = sum(cteiCL * pctsrf, dim = 2) s_pblT = sum(pblT * pctsrf, dim = 2) s_therm = sum(therm * pctsrf, dim = 2) - s_trmb1 = sum(trmb1 * pctsrf, dim = 2) - s_trmb2 = sum(trmb2 * pctsrf, dim = 2) - s_trmb3 = sum(trmb3 * pctsrf, dim = 2) ! Si une sous-fraction n'existe pas, elle prend la valeur moyenne : DO nsrf = 1, nbsrf @@ -621,10 +589,9 @@ ftsol(i, nsrf) = tsol(i) t2m(i, nsrf) = zt2m(i) q2m(i, nsrf) = zq2m(i) - u10m(i, nsrf) = zu10m(i) - v10m(i, nsrf) = zv10m(i) + u10m_srf(i, nsrf) = u10m(i) + v10m_srf(i, nsrf) = v10m(i) ffonte(i, nsrf) = zxffonte(i) - fqcalving(i, nsrf) = zxfqcalving(i) pblh(i, nsrf) = s_pblh(i) plcl(i, nsrf) = s_lcl(i) capCL(i, nsrf) = s_capCL(i) @@ -632,9 +599,6 @@ cteiCL(i, nsrf) = s_cteiCL(i) pblT(i, nsrf) = s_pblT(i) therm(i, nsrf) = s_therm(i) - trmb1(i, nsrf) = s_trmb1(i) - trmb2(i, nsrf) = s_trmb2(i) - trmb3(i, nsrf) = s_trmb3(i) end IF ENDDO ENDDO @@ -646,9 +610,8 @@ if (conv_emanuel) then CALL concvl(paprs, play, t_seri, q_seri, u_seri, v_seri, sig1, w01, & d_t_con, d_q_con, d_u_con, d_v_con, rain_con, ibas_con, itop_con, & - upwd, dnwd, Ma, cape, iflagctrl, qcondc, pmflxr, da, phi, mp) + upwd, dnwd, Ma, cape, iflagctrl, clwcon0, pmflxr, da, phi, mp) snow_con = 0. - clwcon0 = qcondc mfu = upwd + dnwd zqsat = MIN(0.5, r2es * FOEEW(t_seri, rtt >= t_seri) / play) @@ -669,11 +632,10 @@ conv_q = d_q_dyn + d_q_vdf / dtphys conv_t = d_t_dyn + d_t_vdf / dtphys z_avant = sum((q_seri + ql_seri) * zmasse, dim=2) - CALL conflx(dtphys, paprs, play, t_seri(:, llm:1:- 1), & - q_seri(:, llm:1:- 1), conv_t, conv_q, - evap, omega, & - d_t_con, d_q_con, rain_con, snow_con, mfu(:, llm:1:- 1), & - mfd(:, llm:1:- 1), pen_u, pde_u, pen_d, pde_d, kcbot, kctop, & - kdtop, pmflxr, pmflxs) + CALL conflx(paprs, play, t_seri(:, llm:1:- 1), q_seri(:, llm:1:- 1), & + conv_t, conv_q, - evap, omega, d_t_con, d_q_con, rain_con, & + snow_con, mfu(:, llm:1:- 1), mfd(:, llm:1:- 1), pen_u, pde_u, & + pen_d, pde_d, kcbot, kctop, kdtop, pmflxr, pmflxs) WHERE (rain_con < 0.) rain_con = 0. WHERE (snow_con < 0.) snow_con = 0. ibas_con = llm + 1 - kcbot @@ -716,15 +678,15 @@ t_seri = t_seri + d_t_ajs q_seri = q_seri + d_q_ajs else - call calltherm(dtphys, 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) + 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 - ! ratqs convectifs \`a l'ancienne en fonction de (q(z = 0) - q) / q - ! on \'ecrase le tableau ratqsc calcul\'e par clouds_gno if (iflag_cldcon == 1) then + ! ratqs convectifs \`a l'ancienne en fonction de (q(z = 0) - q) / q + ! on \'ecrase le tableau ratqsc calcul\'e par clouds_gno do k = 1, llm do i = 1, klon if(ptconv(i, k)) then @@ -758,10 +720,9 @@ ratqs = ratqss endif - CALL fisrtilp(dtphys, paprs, play, t_seri, q_seri, ptconv, ratqs, & - d_t_lsc, d_q_lsc, d_ql_lsc, rneb, cldliq, rain_lsc, snow_lsc, & - pfrac_impa, pfrac_nucl, pfrac_1nucl, frac_impa, frac_nucl, prfl, & - psfl, rhcl) + CALL fisrtilp(paprs, play, t_seri, q_seri, ptconv, ratqs, d_t_lsc, & + d_q_lsc, d_ql_lsc, rneb, cldliq, rain_lsc, snow_lsc, pfrac_impa, & + pfrac_nucl, pfrac_1nucl, frac_impa, frac_nucl, prfl, psfl, rhcl) WHERE (rain_lsc < 0) rain_lsc = 0. WHERE (snow_lsc < 0) snow_lsc = 0. @@ -891,25 +852,23 @@ ! 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 : IF (ok_orodr) THEN ! S\'election des points pour lesquels le sch\'ema est actif : - igwd = 0 DO i = 1, klon - itest(i) = 0 + ktest(i) = 0 IF (zpic(i) - zmea(i) > 100. .AND. zstd(i) > 10.) THEN - itest(i) = 1 - igwd = igwd + 1 + ktest(i) = 1 ENDIF ENDDO - CALL drag_noro(klon, llm, dtphys, paprs, play, zmea, zstd, zsig, zgam, & - zthe, zpic, zval, itest, t_seri, u_seri, v_seri, zulow, zvlow, & - zustrdr, zvstrdr, d_t_oro, d_u_oro, d_v_oro) + CALL drag_noro(paprs, play, zmea, zstd, zsig, zgam, zthe, zpic, zval, & + ktest, t_seri, u_seri, v_seri, zulow, zvlow, zustrdr, zvstrdr, & + d_t_oro, d_u_oro, d_v_oro) ! ajout des tendances DO k = 1, llm @@ -923,18 +882,15 @@ IF (ok_orolf) THEN ! S\'election des points pour lesquels le sch\'ema est actif : - igwd = 0 DO i = 1, klon - itest(i) = 0 + ktest(i) = 0 IF (zpic(i) - zmea(i) > 100.) THEN - itest(i) = 1 - igwd = igwd + 1 + ktest(i) = 1 ENDIF ENDDO - CALL lift_noro(klon, llm, dtphys, paprs, play, rlat, zmea, zstd, zpic, & - itest, t_seri, u_seri, v_seri, zulow, zvlow, zustrli, zvstrli, & - d_t_lif, d_u_lif, d_v_lif) + CALL lift_noro(paprs, play, zmea, zstd, zpic, ktest, t_seri, u_seri, & + v_seri, zulow, zvlow, zustrli, zvstrli, d_t_lif, d_u_lif, d_v_lif) ! Ajout des tendances : DO k = 1, llm @@ -946,33 +902,16 @@ ENDDO ENDIF - ! Stress n\'ecessaires : toute la physique - - DO i = 1, klon - zustrph(i) = 0. - zvstrph(i) = 0. - ENDDO - DO k = 1, llm - DO i = 1, klon - zustrph(i) = zustrph(i) + (u_seri(i, k) - u(i, k)) / dtphys & - * zmasse(i, k) - zvstrph(i) = zvstrph(i) + (v_seri(i, k) - v(i, k)) / dtphys & - * zmasse(i, k) - ENDDO - ENDDO - - CALL aaam_bud(rg, romega, rlat, rlon, pphis, zustrdr, zustrli, zustrph, & - zvstrdr, zvstrli, zvstrph, paprs, u, v, aam, torsfc) + CALL aaam_bud(rg, romega, pphis, zustrdr, zustrli, & + sum((u_seri - u) / dtphys * zmasse, dim = 2), zvstrdr, & + zvstrli, sum((v_seri - v) / dtphys * zmasse, dim = 2), paprs, u, v, & + aam, torsfc) ! Calcul des tendances traceurs - call phytrac(julien, time, firstcal, lafin, dtphys, t, paprs, play, mfu, & - mfd, pde_u, pen_d, ycoefh, fm_therm, entr_therm, yu1, yv1, ftsol, & - pctsrf, frac_impa, frac_nucl, da, phi, mp, upwd, dnwd, tr_seri, & - zmasse, ncid_startphy) - - IF (offline) call phystokenc(dtphys, t, mfu, mfd, pen_u, pde_u, pen_d, & - pde_d, fm_therm, entr_therm, ycoefh, yu1, yv1, ftsol, pctsrf, & - frac_impa, frac_nucl, pphis, airephy) + call phytrac(julien, time, firstcal, lafin, t, paprs, play, mfu, mfd, & + pde_u, pen_d, coefh, cdragh, fm_therm, entr_therm, u(:, 1), v(:, 1), & + ftsol, pctsrf, frac_impa, frac_nucl, da, phi, mp, upwd, dnwd, & + tr_seri, zmasse, ncid_startphy) ! Calculer le transport de l'eau et de l'energie (diagnostique) CALL transp(paprs, t_seri, q_seri, u_seri, v_seri, zphi, ve, vq, ue, uq) @@ -1041,36 +980,24 @@ CALL histwrite_phy("tsol", tsol) CALL histwrite_phy("t2m", zt2m) CALL histwrite_phy("q2m", zq2m) - CALL histwrite_phy("u10m", zu10m) - CALL histwrite_phy("v10m", zv10m) + CALL histwrite_phy("u10m", u10m) + CALL histwrite_phy("v10m", v10m) CALL histwrite_phy("snow", snow_fall) CALL histwrite_phy("cdrm", cdragm) CALL histwrite_phy("cdrh", cdragh) 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)) - - 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)) - END DO - + 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) CALL histwrite_phy("rugs", zxrugs) @@ -1081,15 +1008,6 @@ CALL histwrite_phy("s_oliqCL", s_oliqCL) CALL histwrite_phy("s_cteiCL", s_cteiCL) CALL histwrite_phy("s_therm", s_therm) - CALL histwrite_phy("s_trmb1", s_trmb1) - CALL histwrite_phy("s_trmb2", s_trmb2) - CALL histwrite_phy("s_trmb3", s_trmb3) - - 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) @@ -1103,16 +1021,34 @@ 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("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.