--- trunk/Sources/phylmd/physiq.f 2017/11/14 14:56:42 244 +++ trunk/phylmd/physiq.f 2018/07/24 16:27:12 288 @@ -18,10 +18,9 @@ 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 pbl_surface_m, ONLY: pbl_surface use clouds_gno_m, only: clouds_gno use comconst, only: dtphys USE comgeomphy, ONLY: airephy @@ -31,7 +30,7 @@ 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 @@ -170,14 +169,13 @@ 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) : @@ -189,11 +187,11 @@ 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 @@ -238,7 +236,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 @@ -291,14 +289,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 : @@ -377,7 +371,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) @@ -424,7 +417,6 @@ t2m = 0. q2m = 0. ffonte = 0. - fqcalving = 0. rain_con = 0. snow_con = 0. d_u_con = 0. @@ -440,9 +432,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 @@ -480,14 +469,8 @@ 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 phyredem0 ENDIF test_firstcal @@ -566,14 +549,13 @@ 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, coefh, t2m, q2m, u10m_srf, v10m_srf, & - pblh, capCL, oliqCL, cteiCL, pblT, therm, trmb1, trmb2, trmb3, plcl, & - fqcalving, ffonte, run_off_lic_0) + CALL pbl_surface(dtphys, 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, & + q2m, u10m_srf, v10m_srf, pblh, capCL, oliqCL, cteiCL, pblT, therm, & + plcl, fqcalving, ffonte, run_off_lic_0) ! Incr\'ementation des flux @@ -601,7 +583,6 @@ 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) @@ -609,9 +590,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 @@ -623,7 +601,6 @@ 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) @@ -631,9 +608,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 @@ -645,9 +619,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,10 +642,9 @@ 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) + 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 @@ -721,9 +693,9 @@ ! 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 @@ -757,10 +729,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(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) WHERE (rain_lsc < 0) rain_lsc = 0. WHERE (snow_lsc < 0) snow_lsc = 0. @@ -897,18 +868,16 @@ 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(dtphys, 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 @@ -922,16 +891,14 @@ 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(dtphys, paprs, play, zmea, zstd, zpic, itest, t_seri, & + CALL lift_noro(dtphys, 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) @@ -1040,6 +1007,7 @@ 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.) @@ -1065,9 +1033,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)