--- trunk/Sources/phylmd/physiq.f 2015/06/18 13:49:26 150 +++ trunk/Sources/phylmd/physiq.f 2015/07/08 17:03:45 155 @@ -4,13 +4,13 @@ contains - SUBROUTINE physiq(lafin, dayvrai, time, dtphys, paprs, play, pphi, pphis, & - u, v, t, qx, omega, d_u, d_v, d_t, d_qx) + SUBROUTINE physiq(lafin, dayvrai, time, paprs, play, pphi, pphis, u, v, t, & + qx, omega, d_u, d_v, d_t, d_qx) ! From phylmd/physiq.F, version 1.22 2006/02/20 09:38:28 ! (subversion revision 678) - ! Author: Z.X. Li (LMD/CNRS) 1993 + ! Author: Z. X. Li (LMD/CNRS) 1993 ! This is the main procedure for the "physics" part of the program. @@ -25,9 +25,10 @@ ok_orodr, ok_orolf USE clmain_m, ONLY: clmain 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, raz_date + USE conf_gcm_m, ONLY: offline, raz_date, day_step, iphysiq USE conf_phys_m, ONLY: conf_phys use conflx_m, only: conflx USE ctherm, ONLY: iflag_thermals, nsplit_thermals @@ -70,7 +71,6 @@ ! current day number, based at value 1 on January 1st of annee_ref REAL, intent(in):: time ! heure de la journ\'ee en fraction de jour - REAL, intent(in):: dtphys ! pas d'integration pour la physique (seconde) REAL, intent(in):: paprs(:, :) ! (klon, llm + 1) ! pression pour chaque inter-couche, en Pa @@ -248,8 +248,7 @@ ! column-density of water in soil, in kg m-2 REAL, save:: fsnow(klon, nbsrf) ! epaisseur neigeuse - REAL, save:: falbe(klon, nbsrf) ! albedo par type de surface - REAL, save:: falblw(klon, nbsrf) ! albedo par type de surface + REAL, save:: falbe(klon, nbsrf) ! albedo visible par type de surface ! Param\`etres de l'orographie \`a l'\'echelle sous-maille (OESM) : REAL, save:: zmea(klon) ! orographie moyenne @@ -319,8 +318,7 @@ REAL dlw(klon) ! derivee infra rouge SAVE dlw REAL bils(klon) ! bilan de chaleur au sol - REAL fder(klon) ! Derive de flux (sensible et latente) - save fder + REAL, save:: fder(klon) ! Derive 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 @@ -335,8 +333,7 @@ INTEGER, SAVE:: lmt_pas ! number of time steps of "physics" per day REAL, save:: pctsrf(klon, nbsrf) ! percentage of surface REAL pctsrf_new(klon, nbsrf) ! pourcentage surfaces issus d'ORCHIDEE - REAL, save:: albsol(klon) ! albedo du sol total - REAL, save:: albsollw(klon) ! albedo du sol total + REAL, save:: albsol(klon) ! albedo du sol total visible REAL, SAVE:: wo(klon, llm) ! column density of ozone in a cell, in kDU ! Declaration des procedures appelees @@ -370,21 +367,16 @@ ! Le rayonnement n'est pas calcul\'e tous les pas, il faut donc que ! les variables soient r\'emanentes. REAL, save:: heat(klon, llm) ! chauffage solaire - REAL heat0(klon, llm) ! chauffage solaire ciel clair + REAL, save:: heat0(klon, llm) ! chauffage solaire ciel clair REAL, save:: cool(klon, llm) ! refroidissement infrarouge - REAL cool0(klon, llm) ! refroidissement infrarouge ciel clair + 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:: topsw0(klon), toplw0(klon), solsw0(klon), sollw0(klon) - REAL albpla(klon) + REAL, save:: albpla(klon) REAL fsollw(klon, nbsrf) ! bilan flux IR pour chaque sous surface REAL fsolsw(klon, nbsrf) ! flux solaire absorb. pour chaque sous surface - SAVE albpla - SAVE heat0, cool0 - - INTEGER itaprad - SAVE itaprad REAL conv_q(klon, llm) ! convergence de l'humidite (kg/kg/s) REAL conv_t(klon, llm) ! convergence of temperature (K/s) @@ -503,7 +495,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 zsto real date0 ! Variables li\'ees au bilan d'\'energie et d'enthalpie : @@ -633,9 +624,8 @@ frugs = 0. itap = 0 - itaprad = 0 CALL phyetat0(pctsrf, ftsol, ftsoil, tslab, seaice, fqsurf, qsol, & - fsnow, falbe, falblw, fevap, rain_fall, snow_fall, solsw, sollw, & + 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) @@ -643,19 +633,16 @@ ! ATTENTION : il faudra a terme relire q2 dans l'etat initial q2 = 1e-8 - radpas = NINT(86400. / dtphys / nbapp_rad) + lmt_pas = day_step / iphysiq + print *, 'Number of time steps of "physics" per day: ', lmt_pas + + radpas = lmt_pas / nbapp_rad - ! on remet le calendrier a zero + ! On remet le calendrier a zero IF (raz_date) itau_phy = 0 CALL printflag(radpas, ok_journe, ok_instan, ok_region) - IF (dtphys * radpas > 21600. .AND. cycle_diurne) THEN - print *, "Au minimum 4 appels par jour si cycle diurne" - call abort_gcm('physiq', & - "Nombre d'appels au rayonnement insuffisant", 1) - ENDIF - ! Initialisation pour le sch\'ema de convection d'Emanuel : IF (iflag_con >= 3) THEN ibas_con = 1 @@ -669,9 +656,6 @@ rugoro = 0. ENDIF - lmt_pas = NINT(86400. / dtphys) ! tous les jours - print *, 'Number of time steps of "physics" per day: ', lmt_pas - ecrit_ins = NINT(ecrit_ins/dtphys) ecrit_hf = NINT(ecrit_hf/dtphys) ecrit_mth = NINT(ecrit_mth/dtphys) @@ -783,7 +767,6 @@ ! Calcul de l'abedo moyen par maille albsol = sum(falbe * pctsrf, dim = 2) - albsollw = sum(falblw * pctsrf, dim = 2) ! R\'epartition sous maille des flux longwave et shortwave ! R\'epartition du longwave par sous-surface lin\'earis\'ee @@ -799,14 +782,14 @@ ! Couche limite: CALL clmain(dtphys, itap, pctsrf, pctsrf_new, t_seri, q_seri, u_seri, & - v_seri, julien, mu0, co2_ppm, ftsol, cdmmax, cdhmax, & - ksta, ksta_ter, ok_kzmin, ftsoil, qsol, paprs, play, fsnow, fqsurf, & - fevap, falbe, falblw, fluxlat, rain_fall, snow_fall, fsolsw, fsollw, & - fder, rlat, frugs, firstcal, agesno, rugoro, d_t_vdf, d_q_vdf, & - d_u_vdf, d_v_vdf, d_ts, fluxt, fluxq, fluxu, fluxv, 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, fluxo, fluxg, tslab) + v_seri, julien, mu0, co2_ppm, ftsol, cdmmax, cdhmax, ksta, ksta_ter, & + ok_kzmin, ftsoil, qsol, paprs, play, fsnow, fqsurf, fevap, falbe, & + fluxlat, rain_fall, snow_fall, fsolsw, fsollw, fder, rlat, frugs, & + firstcal, agesno, rugoro, d_t_vdf, d_q_vdf, d_u_vdf, d_v_vdf, d_ts, & + fluxt, fluxq, fluxu, fluxv, 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, fluxo, fluxg, tslab) ! Incr\'ementation des flux @@ -1252,30 +1235,20 @@ bl95_b1, cldtaupi, re, fl) endif - IF (MOD(itaprad, radpas) == 0) THEN + IF (MOD(itap - 1, radpas) == 0) THEN ! Appeler le rayonnement mais calculer tout d'abord l'albedo du sol. - DO i = 1, klon - albsol(i) = falbe(i, is_oce) * pctsrf(i, is_oce) & - + falbe(i, is_lic) * pctsrf(i, is_lic) & - + falbe(i, is_ter) * pctsrf(i, is_ter) & - + falbe(i, is_sic) * pctsrf(i, is_sic) - albsollw(i) = falblw(i, is_oce) * pctsrf(i, is_oce) & - + falblw(i, is_lic) * pctsrf(i, is_lic) & - + falblw(i, is_ter) * pctsrf(i, is_ter) & - + falblw(i, is_sic) * pctsrf(i, is_sic) - ENDDO + ! Calcul de l'abedo moyen par maille + albsol = sum(falbe * pctsrf, dim = 2) + ! Rayonnement (compatible Arpege-IFS) : - CALL radlwsw(dist, mu0, fract, paprs, play, zxtsol, albsol, & - albsollw, t_seri, q_seri, wo, cldfra, cldemi, cldtau, heat, & - heat0, cool, cool0, radsol, albpla, topsw, toplw, solsw, sollw, & - sollwdown, topsw0, toplw0, solsw0, sollw0, lwdn0, lwdn, lwup0, & - lwup, swdn0, swdn, swup0, swup, ok_ade, ok_aie, tau_ae, piz_ae, & - cg_ae, topswad, solswad, cldtaupi, topswai, solswai) - itaprad = 0 + CALL radlwsw(dist, mu0, fract, paprs, play, zxtsol, albsol, t_seri, & + q_seri, wo, cldfra, cldemi, cldtau, heat, heat0, cool, cool0, & + radsol, albpla, topsw, toplw, solsw, sollw, sollwdown, topsw0, & + toplw0, solsw0, sollw0, lwdn0, lwdn, lwup0, lwup, swdn0, swdn, & + swup0, swup, ok_ade, ok_aie, tau_ae, piz_ae, cg_ae, topswad, & + solswad, cldtaupi, topswai, solswai) ENDIF - itaprad = itaprad + 1 - ! Ajouter la tendance des rayonnements (tous les pas) DO k = 1, llm @@ -1476,7 +1449,7 @@ IF (lafin) THEN itau_phy = itau_phy + itap CALL phyredem("restartphy.nc", pctsrf, ftsol, ftsoil, tslab, seaice, & - fqsurf, qsol, fsnow, falbe, falblw, fevap, rain_fall, snow_fall, & + 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) @@ -1494,8 +1467,7 @@ USE histsync_m, ONLY: histsync USE histwrite_m, ONLY: histwrite - real zout - integer itau_w ! pas de temps ecriture + integer i, itau_w ! pas de temps ecriture REAL zx_tmp_2d(iim, jjm + 1), zx_tmp_3d(iim, jjm + 1, llm) !-------------------------------------------------- @@ -1503,15 +1475,11 @@ IF (ok_instan) THEN ! Champs 2D: - zsto = dtphys * ecrit_ins - zout = dtphys * ecrit_ins itau_w = itau_phy + itap - i = NINT(zout/zsto) CALL gr_fi_ecrit(1, klon, iim, jjm + 1, pphis, zx_tmp_2d) CALL histwrite(nid_ins, "phis", itau_w, zx_tmp_2d) - i = NINT(zout/zsto) CALL gr_fi_ecrit(1, klon, iim, jjm + 1, airephy, zx_tmp_2d) CALL histwrite(nid_ins, "aire", itau_w, zx_tmp_2d) @@ -1643,7 +1611,7 @@ CALL histwrite(nid_ins, "rugs_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) - zx_tmp_fi2d(1 : klon) = falbe(1 : klon, nsrf) + zx_tmp_fi2d(1 : klon) = falbe(:, nsrf) CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "albe_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) @@ -1651,8 +1619,6 @@ END DO CALL gr_fi_ecrit(1, klon, iim, jjm + 1, albsol, zx_tmp_2d) CALL histwrite(nid_ins, "albs", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, jjm + 1, albsollw, zx_tmp_2d) - CALL histwrite(nid_ins, "albslw", itau_w, zx_tmp_2d) CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zxrugs, zx_tmp_2d) CALL histwrite(nid_ins, "rugs", itau_w, zx_tmp_2d)