--- trunk/libf/phylmd/physiq.f90 2011/09/20 09:14:34 51 +++ trunk/libf/phylmd/physiq.f90 2013/06/24 15:39:52 70 @@ -12,8 +12,12 @@ ! This is the main procedure for the "physics" part of the program. + use aaam_bud_m, only: aaam_bud USE abort_gcm_m, ONLY: abort_gcm + use aeropt_m, only: aeropt + use ajsec_m, only: ajsec USE calendar, ONLY: ymds2ju + use calltherm_m, only: calltherm USE clesphys, ONLY: cdhmax, cdmmax, co2_ppm, ecrit_hf, ecrit_ins, & ecrit_mth, ecrit_reg, ecrit_tra, ksta, ksta_ter, ok_kzmin USE clesphys2, ONLY: cycle_diurne, iflag_con, nbapp_rad, new_oliq, & @@ -23,20 +27,26 @@ USE concvl_m, ONLY: concvl USE conf_gcm_m, ONLY: offline, raz_date 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 diagetpq_m, only: diagetpq + use diagphy_m, only: diagphy USE dimens_m, ONLY: iim, jjm, llm, nqmx USE dimphy, ONLY: klon, nbtr USE dimsoil, ONLY: nsoilmx + use drag_noro_m, only: drag_noro USE fcttre, ONLY: foeew, qsatl, qsats, thermcep + use fisrtilp_m, only: fisrtilp USE hgardfou_m, ONLY: hgardfou - USE histcom, ONLY: histsync + USE histsync_m, ONLY: histsync USE histwrite_m, ONLY: histwrite USE indicesol, ONLY: clnsurf, epsfra, is_lic, is_oce, is_sic, is_ter, & nbsrf USE ini_histhf_m, ONLY: ini_histhf USE ini_histday_m, ONLY: ini_histday USE ini_histins_m, ONLY: ini_histins + use newmicro_m, only: newmicro USE oasis_m, ONLY: ok_oasis USE orbite_m, ONLY: orbite, zenang USE ozonecm_m, ONLY: ozonecm @@ -45,8 +55,12 @@ USE phystokenc_m, ONLY: phystokenc USE phytrac_m, ONLY: phytrac USE qcheck_m, ONLY: qcheck + use radlwsw_m, only: radlwsw + use readsulfate_m, only: readsulfate + use sugwd_m, only: sugwd USE suphec_m, ONLY: ra, rcpd, retv, rg, rlvtt, romega, rsigma, rtt USE temps, ONLY: annee_ref, day_ref, itau_phy + use unit_nml_m, only: unit_nml USE yoethf_m, ONLY: r2es, rvtmp2 ! Arguments: @@ -93,8 +107,6 @@ REAL PVteta(klon, nbteta) ! (output vorticite potentielle a des thetas constantes) - LOGICAL ok_cvl ! pour activer le nouveau driver pour convection KE - PARAMETER (ok_cvl = .TRUE.) LOGICAL ok_gust ! pour activer l'effet des gust sur flux surface PARAMETER (ok_gust = .FALSE.) @@ -109,12 +121,9 @@ logical rnpb parameter(rnpb = .true.) - character(len = 6), save:: ocean + character(len = 6):: ocean = 'force ' ! (type de modèle océan à utiliser: "force" ou "slab" mais pas "couple") - logical ok_ocean - SAVE ok_ocean - ! "slab" ocean REAL, save:: tslab(klon) ! temperature of ocean slab REAL, save:: seaice(klon) ! glace de mer (kg/m2) @@ -122,13 +131,11 @@ REAL fluxg(klon) ! flux turbulents ocean-atmosphere ! Modele thermique du sol, a activer pour le cycle diurne: - logical, save:: ok_veget - LOGICAL, save:: ok_journe ! sortir le fichier journalier - - LOGICAL ok_mensuel ! sortir le fichier mensuel + logical:: ok_veget = .false. ! type de modele de vegetation utilise - LOGICAL ok_instan ! sortir le fichier instantane - save ok_instan + logical:: ok_journe = .false., ok_mensuel = .true., ok_instan = .false. + ! sorties journalieres, mensuelles et instantanees dans les + ! fichiers histday, histmth et histins LOGICAL ok_region ! sortir le fichier regional PARAMETER (ok_region = .FALSE.) @@ -160,15 +167,12 @@ !MI Amip2 PV a theta constante - INTEGER klevp1 - PARAMETER(klevp1 = llm + 1) - - REAL swdn0(klon, klevp1), swdn(klon, klevp1) - REAL swup0(klon, klevp1), swup(klon, klevp1) + REAL swdn0(klon, llm + 1), swdn(klon, llm + 1) + REAL swup0(klon, llm + 1), swup(klon, llm + 1) SAVE swdn0, swdn, swup0, swup - REAL lwdn0(klon, klevp1), lwdn(klon, klevp1) - REAL lwup0(klon, klevp1), lwup(klon, klevp1) + REAL lwdn0(klon, llm + 1), lwdn(klon, llm + 1) + REAL lwup0(klon, llm + 1), lwup(klon, llm + 1) SAVE lwdn0, lwdn, lwup0, lwup !IM Amip2 @@ -311,9 +315,7 @@ SAVE qcondc REAL ema_work1(klon, llm), ema_work2(klon, llm) SAVE ema_work1, ema_work2 - - REAL wd(klon) ! sb - SAVE wd ! sb + REAL, save:: wd(klon) ! Variables locales pour la couche limite (al1): @@ -322,7 +324,7 @@ REAL cdragh(klon) ! drag coefficient pour T and Q REAL cdragm(klon) ! drag coefficient pour vent - !AA Pour phytrac + ! 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 @@ -341,11 +343,9 @@ REAL frac_impa(klon, llm) ! fractions d'aerosols lessivees (impaction) REAL frac_nucl(klon, llm) ! idem (nucleation) - !AA - REAL rain_fall(klon) ! pluie - REAL snow_fall(klon) ! neige - save snow_fall, rain_fall - !IM cf FH pour Tiedtke 080604 + REAL, save:: rain_fall(klon) ! pluie + REAL, save:: snow_fall(klon) ! neige + REAL rain_tiedtke(klon), snow_tiedtke(klon) REAL evap(klon), devap(klon) ! evaporation et sa derivee @@ -369,11 +369,9 @@ INTEGER julien INTEGER, SAVE:: lmt_pas ! number of time steps of "physics" per day - REAL pctsrf(klon, nbsrf) - !IM - REAL pctsrf_new(klon, nbsrf) !pourcentage surfaces issus d'ORCHIDEE + REAL, save:: pctsrf(klon, nbsrf) ! percentage of surface + REAL pctsrf_new(klon, nbsrf) ! pourcentage surfaces issus d'ORCHIDEE - SAVE pctsrf ! sous-fraction du sol REAL albsol(klon) SAVE albsol ! albedo du sol total REAL albsollw(klon) @@ -384,12 +382,9 @@ ! Declaration des procedures appelees EXTERNAL alboc ! calculer l'albedo sur ocean - EXTERNAL ajsec ! ajustement sec !KE43 EXTERNAL conema3 ! convect4.3 - EXTERNAL fisrtilp ! schema de condensation a grande echelle (pluie) EXTERNAL nuage ! calculer les proprietes radiatives - EXTERNAL radlwsw ! rayonnements solaire et infrarouge EXTERNAL transp ! transport total de l'eau et de l'energie ! Variables locales @@ -417,20 +412,20 @@ REAL zxfluxu(klon, llm) REAL zxfluxv(klon, llm) - REAL heat(klon, llm) ! chauffage solaire + ! Le rayonnement n'est pas calculé tous les pas, il faut donc que + ! les variables soient rémanentes. + REAL, save:: heat(klon, llm) ! chauffage solaire REAL heat0(klon, llm) ! chauffage solaire ciel clair - REAL cool(klon, llm) ! refroidissement infrarouge + REAL, save:: cool(klon, llm) ! refroidissement infrarouge REAL cool0(klon, llm) ! refroidissement infrarouge ciel clair - REAL topsw(klon), toplw(klon), solsw(klon), sollw(klon) + REAL, save:: topsw(klon), toplw(klon), solsw(klon), sollw(klon) real sollwdown(klon) ! downward LW flux at surface - REAL topsw0(klon), toplw0(klon), solsw0(klon), sollw0(klon) + REAL, save:: topsw0(klon), toplw0(klon), solsw0(klon), sollw0(klon) REAL albpla(klon) REAL fsollw(klon, nbsrf) ! bilan flux IR pour chaque sous surface REAL fsolsw(klon, nbsrf) ! flux solaire absorb. pour chaque sous surface - ! Le rayonnement n'est pas calcule tous les pas, il faut donc - ! sauvegarder les sorties du rayonnement - SAVE heat, cool, albpla, topsw, toplw, solsw, sollw, sollwdown - SAVE topsw0, toplw0, solsw0, sollw0, heat0, cool0 + SAVE albpla, sollwdown + SAVE heat0, cool0 INTEGER itaprad SAVE itaprad @@ -446,17 +441,12 @@ REAL dist, rmu0(klon), fract(klon) REAL zdtime ! pas de temps du rayonnement (s) real zlongi - REAL z_avant(klon), z_apres(klon), z_factor(klon) - LOGICAL zx_ajustq - REAL za, zb REAL zx_t, zx_qs, zdelta, zcor real zqsat(klon, llm) INTEGER i, k, iq, nsrf - REAL t_coup - PARAMETER (t_coup = 234.0) - + REAL, PARAMETER:: t_coup = 234. REAL zphi(klon, llm) !IM cf. AM Variables locales pour la CLA (hbtm2) @@ -477,7 +467,7 @@ REAL s_therm(klon), s_trmb1(klon), s_trmb2(klon) REAL s_trmb3(klon) - ! Variables locales pour la convection de K. Emanuel (sb): + ! Variables locales pour la convection de K. Emanuel : REAL upwd(klon, llm) ! saturated updraft mass flux REAL dnwd(klon, llm) ! saturated downdraft mass flux @@ -493,7 +483,6 @@ REAL rflag(klon) ! flag fonctionnement de convect INTEGER iflagctrl(klon) ! flag fonctionnement de convect ! -- convect43: - INTEGER ntra ! nb traceurs pour convect4.3 REAL dtvpdt1(klon, llm), dtvpdq1(klon, llm) REAL dplcldt(klon), dplcldr(klon) @@ -518,7 +507,7 @@ REAL pmflxr(klon, llm + 1), pmflxs(klon, llm + 1) REAL prfl(klon, llm + 1), psfl(klon, llm + 1) - INTEGER,save:: ibas_con(klon), itop_con(klon) + INTEGER, save:: ibas_con(klon), itop_con(klon) REAL rain_con(klon), rain_lsc(klon) REAL snow_con(klon), snow_lsc(klon) @@ -532,20 +521,17 @@ REAL d_u_lif(klon, llm), d_v_lif(klon, llm) REAL d_t_lif(klon, llm) - REAL ratqs(klon, llm), ratqss(klon, llm), ratqsc(klon, llm) - real ratqsbas, ratqshaut - save ratqsbas, ratqshaut, ratqs + REAL, save:: ratqs(klon, llm) + real ratqss(klon, llm), ratqsc(klon, llm) + real:: ratqsbas = 0.01, ratqshaut = 0.3 ! Parametres lies au nouveau schema de nuages (SB, PDF) - real, save:: fact_cldcon - real, save:: facttemps - logical ok_newmicro - save ok_newmicro + real:: fact_cldcon = 0.375 + real:: facttemps = 1.e-4 + logical:: ok_newmicro = .true. real facteur - integer iflag_cldcon - save iflag_cldcon - + integer:: iflag_cldcon = 1 logical ptconv(klon, llm) ! Variables locales pour effectuer les appels en série : @@ -578,8 +564,6 @@ REAL zsto - character(len = 20) modname - character(len = 80) abort_message logical ok_sync real date0 @@ -589,57 +573,54 @@ REAL, SAVE:: d_h_vcol_phy REAL fs_bound, fq_bound REAL zero_v(klon) - CHARACTER(LEN = 15) ztit + CHARACTER(LEN = 15) tit INTEGER:: ip_ebil = 0 ! print level for energy conservation diagnostics - INTEGER, SAVE:: if_ebil ! level for energy conservation diagnostics + INTEGER:: if_ebil = 0 ! verbosity for diagnostics of energy conservation REAL d_t_ec(klon, llm) ! tendance due à la conversion Ec -> E thermique REAL ZRCPD REAL t2m(klon, nbsrf), q2m(klon, nbsrf) ! temperature and humidity at 2 m - REAL u10m(klon, nbsrf), v10m(klon, nbsrf) !vents a 10m - REAL zt2m(klon), zq2m(klon) !temp., hum. 2m moyenne s/ 1 maille - REAL zu10m(klon), zv10m(klon) !vents a 10m moyennes s/1 maille - !jq Aerosol effects (Johannes Quaas, 27/11/2003) - REAL sulfate(klon, llm) ! SO4 aerosol concentration [ug/m3] + REAL u10m(klon, nbsrf), v10m(klon, nbsrf) ! vents a 10 m + REAL zt2m(klon), zq2m(klon) ! temp., hum. 2 m moyenne s/ 1 maille + REAL zu10m(klon), zv10m(klon) ! vents a 10 m moyennes s/1 maille + + ! Aerosol effects: + + REAL sulfate(klon, llm) ! SO4 aerosol concentration (micro g/m3) REAL, save:: sulfate_pi(klon, llm) - ! (SO4 aerosol concentration, in ug/m3, pre-industrial value) + ! SO4 aerosol concentration, in micro g/m3, pre-industrial value REAL cldtaupi(klon, llm) - ! (Cloud optical thickness for pre-industrial (pi) aerosols) + ! cloud optical thickness for pre-industrial (pi) aerosols REAL re(klon, llm) ! Cloud droplet effective radius REAL fl(klon, llm) ! denominator of re ! Aerosol optical properties - REAL tau_ae(klon, llm, 2), piz_ae(klon, llm, 2) - REAL cg_ae(klon, llm, 2) - - REAL topswad(klon), solswad(klon) ! Aerosol direct effect. - ! ok_ade = True -ADE = topswad-topsw + REAL, save:: tau_ae(klon, llm, 2), piz_ae(klon, llm, 2) + REAL, save:: cg_ae(klon, llm, 2) - REAL topswai(klon), solswai(klon) ! Aerosol indirect effect. - ! ok_aie = True -> - ! ok_ade = True -AIE = topswai-topswad - ! ok_ade = F -AIE = topswai-topsw + REAL topswad(klon), solswad(klon) ! aerosol direct effect + REAL topswai(klon), solswai(klon) ! aerosol indirect effect REAL aerindex(klon) ! POLDER aerosol index - ! Parameters - LOGICAL ok_ade, ok_aie ! Apply aerosol (in)direct effects or not - REAL bl95_b0, bl95_b1 ! Parameter in Boucher and Lohmann (1995) + LOGICAL:: ok_ade = .false. ! apply aerosol direct effect + LOGICAL:: ok_aie = .false. ! apply aerosol indirect effect + + REAL:: bl95_b0 = 2., bl95_b1 = 0.2 + ! Parameters in equation (D) of Boucher and Lohmann (1995, Tellus + ! B). They link cloud droplet number concentration to aerosol mass + ! concentration. - SAVE ok_ade, ok_aie, bl95_b0, bl95_b1 SAVE u10m SAVE v10m SAVE t2m SAVE q2m SAVE ffonte SAVE fqcalving - SAVE piz_ae - SAVE tau_ae - SAVE cg_ae SAVE rain_con SAVE snow_con SAVE topswai @@ -656,19 +637,17 @@ real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2 + namelist /physiq_nml/ ocean, ok_veget, ok_journe, ok_mensuel, ok_instan, & + fact_cldcon, facttemps, ok_newmicro, iflag_cldcon, ratqsbas, & + ratqshaut, if_ebil, ok_ade, ok_aie, bl95_b0, bl95_b1, iflag_thermals, & + nsplit_thermals + !---------------------------------------------------------------- - modname = 'physiq' - IF (if_ebil >= 1) THEN - DO i = 1, klon - zero_v(i) = 0. - END DO - END IF + IF (if_ebil >= 1) zero_v = 0. ok_sync = .TRUE. - IF (nqmx < 2) THEN - abort_message = 'eaux vapeur et liquide sont indispensables' - CALL abort_gcm(modname, abort_message, 1) - ENDIF + IF (nqmx < 2) CALL abort_gcm('physiq', & + 'eaux vapeur et liquide sont indispensables', 1) test_firstcal: IF (firstcal) THEN ! initialiser @@ -683,8 +662,6 @@ cg_ae = 0. rain_con(:) = 0. snow_con(:) = 0. - bl95_b0 = 0. - bl95_b1 = 0. topswai(:) = 0. topswad(:) = 0. solswai(:) = 0. @@ -710,14 +687,13 @@ IF (if_ebil >= 1) d_h_vcol_phy = 0. - ! appel a la lecture du run.def physique + iflag_thermals = 0 + nsplit_thermals = 1 + print *, "Enter namelist 'physiq_nml'." + read(unit=*, nml=physiq_nml) + write(unit_nml, nml=physiq_nml) - call conf_phys(ocean, ok_veget, ok_journe, ok_mensuel, & - ok_instan, fact_cldcon, facttemps, ok_newmicro, & - iflag_cldcon, ratqsbas, ratqshaut, if_ebil, & - ok_ade, ok_aie, & - bl95_b0, bl95_b1, & - iflag_thermals, nsplit_thermals) + call conf_phys ! Initialiser les compteurs: @@ -731,7 +707,7 @@ ancien_ok, rnebcon, ratqs, clwcon, run_off_lic_0) ! ATTENTION : il faudra a terme relire q2 dans l'etat initial - q2 = 1.e-8 + q2 = 1e-8 radpas = NINT(86400. / dtphys / nbapp_rad) @@ -739,41 +715,24 @@ IF (raz_date) itau_phy = 0 PRINT *, 'cycle_diurne = ', cycle_diurne + CALL printflag(radpas, ocean /= 'force', ok_oasis, ok_journe, & + ok_instan, ok_region) - IF(ocean.NE.'force ') THEN - ok_ocean = .TRUE. + IF (dtphys * REAL(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 - CALL printflag(radpas, ok_ocean, ok_oasis, ok_journe, ok_instan, & - ok_region) - - IF (dtphys*REAL(radpas) > 21600..AND.cycle_diurne) THEN - print *,'Nbre d appels au rayonnement insuffisant' - print *,"Au minimum 4 appels par jour si cycle diurne" - abort_message = 'Nbre d appels au rayonnement insuffisant' - call abort_gcm(modname, abort_message, 1) - ENDIF - print *,"Clef pour la convection, iflag_con = ", iflag_con - print *,"Clef pour le driver de la convection, ok_cvl = ", & - ok_cvl - - ! Initialisation pour la convection de K.E. (sb): + ! Initialisation pour le schéma de convection d'Emanuel : IF (iflag_con >= 3) THEN - - print *,"*** Convection de Kerry Emanuel 4.3 " - - !IM15/11/02 rajout initialisation ibas_con, itop_con cf. SB =>BEG - DO i = 1, klon - ibas_con(i) = 1 - itop_con(i) = 1 - ENDDO - !IM15/11/02 rajout initialisation ibas_con, itop_con cf. SB =>END - + ibas_con = 1 + itop_con = 1 ENDIF IF (ok_orodr) THEN rugoro = MAX(1e-5, zstd * zsig / 2) - CALL SUGWD(klon, llm, paprs, play) + CALL SUGWD(paprs, play) else rugoro = 0. ENDIF @@ -792,27 +751,25 @@ npas = 0 nexca = 0 - print *,'AVANT HIST IFLAG_CON = ', iflag_con - ! Initialisation des sorties call ini_histhf(dtphys, nid_hf, nid_hf3d) call ini_histday(dtphys, ok_journe, nid_day, nqmx) call ini_histins(dtphys, ok_instan, nid_ins) CALL ymds2ju(annee_ref, 1, int(day_ref), 0., date0) - !XXXPB Positionner date0 pour initialisation de ORCHIDEE - WRITE(*, *) 'physiq date0: ', date0 + ! Positionner date0 pour initialisation de ORCHIDEE + print *, 'physiq date0: ', date0 ENDIF test_firstcal ! Mettre a zero des variables de sortie (pour securite) DO i = 1, klon - d_ps(i) = 0.0 + d_ps(i) = 0. ENDDO DO iq = 1, nqmx DO k = 1, llm DO i = 1, klon - d_qx(i, k, iq) = 0.0 + d_qx(i, k, iq) = 0. ENDDO ENDDO ENDDO @@ -848,8 +805,8 @@ ENDDO IF (if_ebil >= 1) THEN - ztit = 'after dynamics' - CALL diagetpq(airephy, ztit, ip_ebil, 1, 1, dtphys, t_seri, q_seri, & + tit = 'after dynamics' + CALL diagetpq(airephy, tit, ip_ebil, 1, 1, dtphys, t_seri, q_seri, & ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & d_ql, d_qs, d_ec) ! Comme les tendances de la physique sont ajoutés dans la @@ -857,7 +814,7 @@ ! être égale à la variation de la physique au pas de temps ! précédent. Donc la somme de ces 2 variations devrait être ! nulle. - call diagphy(airephy, ztit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & + call diagphy(airephy, tit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & zero_v, zero_v, zero_v, zero_v, ztsol, d_h_vcol + d_h_vcol_phy, & d_qt, 0., fs_bound, fq_bound) END IF @@ -897,14 +854,10 @@ forall (k = 1: llm) zmasse(:, k) = (paprs(:, k)-paprs(:, k + 1)) / rg - ! Mettre en action les conditions aux limites (albedo, sst, etc.). + ! Mettre en action les conditions aux limites (albedo, sst etc.). ! Prescrire l'ozone et calculer l'albedo sur l'ocean. - if (nqmx >= 5) then - wo = qx(:, :, 5) * zmasse / dobson_u / 1e3 - else IF (MOD(itap - 1, lmt_pas) == 0) THEN - wo = ozonecm(REAL(julien), paprs) - ENDIF + wo = ozonecm(REAL(julien), paprs) ! Évaporation de l'eau liquide nuageuse : DO k = 1, llm @@ -918,11 +871,11 @@ ql_seri = 0. IF (if_ebil >= 2) THEN - ztit = 'after reevap' - CALL diagetpq(airephy, ztit, ip_ebil, 2, 1, dtphys, t_seri, q_seri, & + tit = 'after reevap' + CALL diagetpq(airephy, tit, ip_ebil, 2, 1, dtphys, t_seri, q_seri, & ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & d_ql, d_qs, d_ec) - call diagphy(airephy, ztit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & + call diagphy(airephy, tit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & zero_v, zero_v, zero_v, zero_v, ztsol, d_h_vcol, d_qt, d_ec, & fs_bound, fq_bound) @@ -970,8 +923,8 @@ DO nsrf = 1, nbsrf DO i = 1, klon fsollw(i, nsrf) = sollw(i) & - + 4.0*RSIGMA*ztsol(i)**3 * (ztsol(i)-ftsol(i, nsrf)) - fsolsw(i, nsrf) = solsw(i)*(1.-falbe(i, nsrf))/(1.-albsol(i)) + + 4. * RSIGMA * ztsol(i)**3 * (ztsol(i) - ftsol(i, nsrf)) + fsolsw(i, nsrf) = solsw(i) * (1. - falbe(i, nsrf)) / (1. - albsol(i)) ENDDO ENDDO @@ -999,20 +952,16 @@ DO nsrf = 1, nbsrf DO k = 1, llm DO i = 1, klon - zxfluxt(i, k) = zxfluxt(i, k) + & - fluxt(i, k, nsrf) * pctsrf(i, nsrf) - zxfluxq(i, k) = zxfluxq(i, k) + & - fluxq(i, k, nsrf) * pctsrf(i, nsrf) - zxfluxu(i, k) = zxfluxu(i, k) + & - fluxu(i, k, nsrf) * pctsrf(i, nsrf) - zxfluxv(i, k) = zxfluxv(i, k) + & - fluxv(i, k, nsrf) * pctsrf(i, nsrf) + zxfluxt(i, k) = zxfluxt(i, k) + fluxt(i, k, nsrf) * pctsrf(i, nsrf) + zxfluxq(i, k) = zxfluxq(i, k) + fluxq(i, k, nsrf) * pctsrf(i, nsrf) + zxfluxu(i, k) = zxfluxu(i, k) + fluxu(i, k, nsrf) * pctsrf(i, nsrf) + zxfluxv(i, k) = zxfluxv(i, k) + fluxv(i, k, nsrf) * pctsrf(i, nsrf) END DO END DO END DO DO i = 1, klon sens(i) = - zxfluxt(i, 1) ! flux de chaleur sensible au sol - evap(i) = - zxfluxq(i, 1) ! flux d'evaporation au sol + evap(i) = - zxfluxq(i, 1) ! flux d'évaporation au sol fder(i) = dlw(i) + dsens(i) + devap(i) ENDDO @@ -1026,11 +975,11 @@ ENDDO IF (if_ebil >= 2) THEN - ztit = 'after clmain' - CALL diagetpq(airephy, ztit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & + tit = 'after clmain' + CALL diagetpq(airephy, tit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & d_ql, d_qs, d_ec) - call diagphy(airephy, ztit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & + call diagphy(airephy, tit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & sens, evap, zero_v, zero_v, ztsol, d_h_vcol, d_qt, d_ec, & fs_bound, fq_bound) END IF @@ -1059,12 +1008,9 @@ s_trmb2(i) = 0.0 s_trmb3(i) = 0.0 - IF (abs(pctsrf(i, is_ter) + pctsrf(i, is_lic) + & - pctsrf(i, is_oce) + pctsrf(i, is_sic) - 1.) > EPSFRA) & - THEN - WRITE(*, *) 'physiq : pb sous surface au point ', i, & - pctsrf(i, 1 : nbsrf) - ENDIF + IF (abs(pctsrf(i, is_ter) + pctsrf(i, is_lic) + pctsrf(i, is_oce) & + + pctsrf(i, is_sic) - 1.) > EPSFRA) print *, & + 'physiq : problème sous surface au point ', i, pctsrf(i, 1 : nbsrf) ENDDO DO nsrf = 1, nbsrf DO i = 1, klon @@ -1121,85 +1067,51 @@ ! Calculer la derive du flux infrarouge DO i = 1, klon - dlw(i) = - 4.0*RSIGMA*zxtsol(i)**3 + dlw(i) = - 4. * RSIGMA * zxtsol(i)**3 ENDDO ! Appeler la convection (au choix) DO k = 1, llm DO i = 1, klon - conv_q(i, k) = d_q_dyn(i, k) & - + d_q_vdf(i, k)/dtphys - conv_t(i, k) = d_t_dyn(i, k) & - + d_t_vdf(i, k)/dtphys + conv_q(i, k) = d_q_dyn(i, k) + d_q_vdf(i, k)/dtphys + conv_t(i, k) = d_t_dyn(i, k) + d_t_vdf(i, k)/dtphys ENDDO ENDDO + IF (check) THEN za = qcheck(klon, llm, paprs, q_seri, ql_seri, airephy) print *, "avantcon = ", za ENDIF - zx_ajustq = .FALSE. - IF (iflag_con == 2) zx_ajustq = .TRUE. - IF (zx_ajustq) THEN - DO i = 1, klon - z_avant(i) = 0.0 - ENDDO - DO k = 1, llm - DO i = 1, klon - z_avant(i) = z_avant(i) + (q_seri(i, k) + ql_seri(i, k)) & - *zmasse(i, k) - ENDDO - ENDDO - ENDIF - select case (iflag_con) - case (1) - print *, 'Réactiver l''appel à "conlmd" dans "physiq.F".' - stop 1 - case (2) - CALL conflx(dtphys, paprs, play, t_seri, q_seri, conv_t, conv_q, & - zxfluxq(1, 1), omega, d_t_con, d_q_con, rain_con, snow_con, pmfu, & - pmfd, pen_u, pde_u, pen_d, pde_d, kcbot, kctop, kdtop, pmflxr, & - pmflxs) + if (iflag_con == 2) then + z_avant = sum((q_seri + ql_seri) * zmasse, dim=2) + CALL conflx(dtphys, paprs, play, t_seri(:, llm:1:-1), q_seri, & + conv_t, conv_q, zxfluxq(:, 1), omega, d_t_con, d_q_con, & + rain_con, snow_con, pmfu, pmfd, 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. DO i = 1, klon ibas_con(i) = llm + 1 - kcbot(i) itop_con(i) = llm + 1 - kctop(i) ENDDO - case (3:) - ! number of tracers for the Kerry-Emanuel convection: + else + ! iflag_con >= 3 + CALL concvl(dtphys, paprs, play, t_seri, q_seri, u_seri, & + v_seri, tr_seri, ema_work1, ema_work2, d_t_con, d_q_con, & + d_u_con, d_v_con, d_tr, rain_con, snow_con, ibas_con, & + itop_con, upwd, dnwd, dnwd0, Ma, cape, tvp, iflagctrl, & + pbase, bbase, dtvpdt1, dtvpdq1, dplcldt, dplcldr, qcondc, & + wd, pmflxr, pmflxs, da, phi, mp, ntra=1) + ! (number of tracers for the convection scheme of Kerry Emanuel: ! la partie traceurs est faite dans phytrac ! on met ntra = 1 pour limiter les appels mais on peut - ! supprimer les calculs / ftra. - ntra = 1 - ! Schéma de convection modularisé et vectorisé : - ! (driver commun aux versions 3 et 4) - - IF (ok_cvl) THEN - ! new driver for convectL - CALL concvl(iflag_con, dtphys, paprs, play, t_seri, q_seri, & - u_seri, v_seri, tr_seri, ntra, ema_work1, ema_work2, d_t_con, & - d_q_con, d_u_con, d_v_con, d_tr, rain_con, snow_con, ibas_con, & - itop_con, upwd, dnwd, dnwd0, Ma, cape, tvp, iflagctrl, pbase, & - bbase, dtvpdt1, dtvpdq1, dplcldt, dplcldr, qcondc, wd, pmflxr, & - pmflxs, da, phi, mp) - clwcon0 = qcondc - pmfu = upwd + dnwd - ELSE - ! conema3 ne contient pas les traceurs - CALL conema3 (dtphys, paprs, play, t_seri, q_seri, u_seri, v_seri, & - tr_seri, ntra, ema_work1, ema_work2, d_t_con, d_q_con, & - d_u_con, d_v_con, d_tr, rain_con, snow_con, ibas_con, & - itop_con, upwd, dnwd, dnwd0, bas, top, Ma, cape, tvp, rflag, & - pbase, bbase, dtvpdt1, dtvpdq1, dplcldt, dplcldr, clwcon0) - ENDIF + ! supprimer les calculs / ftra.) - IF (.NOT. ok_gust) THEN - do i = 1, klon - wd(i) = 0.0 - enddo - ENDIF + clwcon0 = qcondc + pmfu = upwd + dnwd + IF (.NOT. ok_gust) wd = 0. ! Calcul des propriétés des nuages convectifs @@ -1225,12 +1137,9 @@ ! calcul des proprietes des nuages convectifs clwcon0 = fact_cldcon*clwcon0 - call clouds_gno & - (klon, llm, q_seri, zqsat, clwcon0, ptconv, ratqsc, rnebcon0) - case default - print *, "iflag_con non-prevu", iflag_con - stop 1 - END select + call clouds_gno(klon, llm, q_seri, zqsat, clwcon0, ptconv, ratqsc, & + rnebcon0) + END if DO k = 1, llm DO i = 1, klon @@ -1242,18 +1151,18 @@ ENDDO IF (if_ebil >= 2) THEN - ztit = 'after convect' - CALL diagetpq(airephy, ztit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & + tit = 'after convect' + CALL diagetpq(airephy, tit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & d_ql, d_qs, d_ec) - call diagphy(airephy, ztit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & + call diagphy(airephy, tit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & zero_v, zero_v, rain_con, snow_con, ztsol, d_h_vcol, d_qt, d_ec, & fs_bound, fq_bound) END IF IF (check) THEN za = qcheck(klon, llm, paprs, q_seri, ql_seri, airephy) - print *,"aprescon = ", za + print *, "aprescon = ", za zx_t = 0.0 za = 0.0 DO i = 1, klon @@ -1262,32 +1171,20 @@ snow_con(i))*airephy(i)/REAL(klon) ENDDO zx_t = zx_t/za*dtphys - print *,"Precip = ", zx_t + print *, "Precip = ", zx_t ENDIF - IF (zx_ajustq) THEN - DO i = 1, klon - z_apres(i) = 0.0 - ENDDO - DO k = 1, llm - DO i = 1, klon - z_apres(i) = z_apres(i) + (q_seri(i, k) + ql_seri(i, k)) & - *zmasse(i, k) - ENDDO - ENDDO - DO i = 1, klon - z_factor(i) = (z_avant(i)-(rain_con(i) + snow_con(i))*dtphys) & - /z_apres(i) - ENDDO + + IF (iflag_con == 2) THEN + z_apres = sum((q_seri + ql_seri) * zmasse, dim=2) + z_factor = (z_avant - (rain_con + snow_con) * dtphys) / z_apres DO k = 1, llm DO i = 1, klon - IF (z_factor(i) > (1.0 + 1.0E-08) .OR. & - z_factor(i) < (1.0-1.0E-08)) THEN + IF (z_factor(i) > 1. + 1E-8 .OR. z_factor(i) < 1. - 1E-8) THEN q_seri(i, k) = q_seri(i, k) * z_factor(i) ENDIF ENDDO ENDDO ENDIF - zx_ajustq = .FALSE. ! Convection sèche (thermiques ou ajustement) @@ -1310,22 +1207,22 @@ endif IF (if_ebil >= 2) THEN - ztit = 'after dry_adjust' - CALL diagetpq(airephy, ztit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & + tit = 'after dry_adjust' + CALL diagetpq(airephy, tit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & d_ql, d_qs, d_ec) END IF ! Caclul des ratqs - ! ratqs convectifs a l'ancienne en fonction de q(z = 0)-q / q - ! on ecrase le tableau ratqsc calcule par clouds_gno + ! ratqs convectifs à l'ancienne en fonction de (q(z = 0) - q) / q + ! on écrase le tableau ratqsc calculé par clouds_gno if (iflag_cldcon == 1) then do k = 1, llm do i = 1, klon if(ptconv(i, k)) then - ratqsc(i, k) = ratqsbas & - +fact_cldcon*(q_seri(i, 1)-q_seri(i, k))/q_seri(i, k) + ratqsc(i, k) = ratqsbas + fact_cldcon & + * (q_seri(i, 1) - q_seri(i, k)) / q_seri(i, k) else ratqsc(i, k) = 0. endif @@ -1336,19 +1233,18 @@ ! ratqs stables do k = 1, llm do i = 1, klon - ratqss(i, k) = ratqsbas + (ratqshaut-ratqsbas)* & - min((paprs(i, 1)-play(i, k))/(paprs(i, 1)-30000.), 1.) + ratqss(i, k) = ratqsbas + (ratqshaut - ratqsbas) & + * min((paprs(i, 1) - play(i, k)) / (paprs(i, 1) - 3e4), 1.) enddo enddo ! ratqs final - if (iflag_cldcon == 1 .or.iflag_cldcon == 2) then + if (iflag_cldcon == 1 .or. iflag_cldcon == 2) then ! les ratqs sont une conbinaison de ratqss et ratqsc ! ratqs final ! 1e4 (en gros 3 heures), en dur pour le moment, est le temps de ! relaxation des ratqs - facteur = exp(-dtphys*facttemps) - ratqs = max(ratqs*facteur, ratqss) + ratqs = max(ratqs * exp(- dtphys * facttemps), ratqss) ratqs = max(ratqs, ratqsc) else ! on ne prend que le ratqs stable pour fisrtilp @@ -1375,7 +1271,7 @@ ENDDO IF (check) THEN za = qcheck(klon, llm, paprs, q_seri, ql_seri, airephy) - print *,"apresilp = ", za + print *, "apresilp = ", za zx_t = 0.0 za = 0.0 DO i = 1, klon @@ -1384,15 +1280,15 @@ + snow_lsc(i))*airephy(i)/REAL(klon) ENDDO zx_t = zx_t/za*dtphys - print *,"Precip = ", zx_t + print *, "Precip = ", zx_t ENDIF IF (if_ebil >= 2) THEN - ztit = 'after fisrt' - CALL diagetpq(airephy, ztit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & + tit = 'after fisrt' + CALL diagetpq(airephy, tit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & d_ql, d_qs, d_ec) - call diagphy(airephy, ztit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & + call diagphy(airephy, tit, ip_ebil, zero_v, zero_v, zero_v, zero_v, & zero_v, zero_v, rain_lsc, snow_lsc, ztsol, d_h_vcol, d_qt, d_ec, & fs_bound, fq_bound) END IF @@ -1401,7 +1297,8 @@ ! 1. NUAGES CONVECTIFS - IF (iflag_cldcon.le.-1) THEN ! seulement pour Tiedtke + IF (iflag_cldcon <= -1) THEN + ! seulement pour Tiedtke snow_tiedtke = 0. if (iflag_cldcon == -1) then rain_tiedtke = rain_con @@ -1418,9 +1315,8 @@ endif ! Nuages diagnostiques pour Tiedtke - CALL diagcld1(paprs, play, & - rain_tiedtke, snow_tiedtke, ibas_con, itop_con, & - diafra, dialiq) + CALL diagcld1(paprs, play, rain_tiedtke, snow_tiedtke, ibas_con, & + itop_con, diafra, dialiq) DO k = 1, llm DO i = 1, klon IF (diafra(i, k) > cldfra(i, k)) THEN @@ -1436,7 +1332,7 @@ facteur = dtphys *facttemps do k = 1, llm do i = 1, klon - rnebcon(i, k) = rnebcon(i, k)*facteur + rnebcon(i, k) = rnebcon(i, k) * facteur if (rnebcon0(i, k)*clwcon0(i, k) > rnebcon(i, k)*clwcon(i, k)) & then rnebcon(i, k) = rnebcon0(i, k) @@ -1465,21 +1361,16 @@ ENDIF ! Precipitation totale - DO i = 1, klon rain_fall(i) = rain_con(i) + rain_lsc(i) snow_fall(i) = snow_con(i) + snow_lsc(i) ENDDO - IF (if_ebil >= 2) THEN - ztit = "after diagcld" - CALL diagetpq(airephy, ztit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & - ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & - d_ql, d_qs, d_ec) - END IF - - ! Calculer l'humidite relative pour diagnostique + IF (if_ebil >= 2) CALL diagetpq(airephy, "after diagcld", ip_ebil, 2, 2, & + dtphys, t_seri, q_seri, ql_seri, qs_seri, u_seri, v_seri, paprs, & + d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) + ! Humidité relative pour diagnostic : DO k = 1, llm DO i = 1, klon zx_t = t_seri(i, k) @@ -1500,47 +1391,33 @@ zqsat(i, k) = zx_qs ENDDO ENDDO - !jq - introduce the aerosol direct and first indirect radiative forcings - !jq - Johannes Quaas, 27/11/2003 (quaas@lmd.jussieu.fr) - IF (ok_ade.OR.ok_aie) THEN - ! Get sulfate aerosol distribution + + ! Introduce the aerosol direct and first indirect radiative forcings: + IF (ok_ade .OR. ok_aie) THEN + ! Get sulfate aerosol distribution : CALL readsulfate(rdayvrai, firstcal, sulfate) CALL readsulfate_preind(rdayvrai, firstcal, sulfate_pi) - ! Calculate aerosol optical properties (Olivier Boucher) - CALL aeropt(play, paprs, t_seri, sulfate, rhcl, & - tau_ae, piz_ae, cg_ae, aerindex) + CALL aeropt(play, paprs, t_seri, sulfate, rhcl, tau_ae, piz_ae, cg_ae, & + aerindex) ELSE - tau_ae = 0.0 - piz_ae = 0.0 - cg_ae = 0.0 + tau_ae = 0. + piz_ae = 0. + cg_ae = 0. ENDIF - ! Calculer les parametres optiques des nuages et quelques - ! parametres pour diagnostiques: - + ! Paramètres optiques des nuages et quelques paramètres pour diagnostics : if (ok_newmicro) then - CALL newmicro (paprs, play, ok_newmicro, & - t_seri, cldliq, cldfra, cldtau, cldemi, & - cldh, cldl, cldm, cldt, cldq, & - flwp, fiwp, flwc, fiwc, & - ok_aie, & - sulfate, sulfate_pi, & - bl95_b0, bl95_b1, & - cldtaupi, re, fl) + CALL newmicro(paprs, play, t_seri, cldliq, cldfra, cldtau, cldemi, & + cldh, cldl, cldm, cldt, cldq, flwp, fiwp, flwc, fiwc, ok_aie, & + sulfate, sulfate_pi, bl95_b0, bl95_b1, cldtaupi, re, fl) else - CALL nuage (paprs, play, & - t_seri, cldliq, cldfra, cldtau, cldemi, & - cldh, cldl, cldm, cldt, cldq, & - ok_aie, & - sulfate, sulfate_pi, & - bl95_b0, bl95_b1, & - cldtaupi, re, fl) - + CALL nuage(paprs, play, t_seri, cldliq, cldfra, cldtau, cldemi, cldh, & + cldl, cldm, cldt, cldq, ok_aie, sulfate, sulfate_pi, bl95_b0, & + bl95_b1, cldtaupi, re, fl) endif ! Appeler le rayonnement mais calculer tout d'abord l'albedo du sol. - IF (MOD(itaprad, radpas) == 0) THEN DO i = 1, klon albsol(i) = falbe(i, is_oce) * pctsrf(i, is_oce) & @@ -1552,7 +1429,7 @@ + falblw(i, is_ter) * pctsrf(i, is_ter) & + falblw(i, is_sic) * pctsrf(i, is_sic) ENDDO - ! nouveau rayonnement (compatible Arpege-IFS): + ! Rayonnement (compatible Arpege-IFS) : CALL radlwsw(dist, rmu0, fract, paprs, play, zxtsol, albsol, & albsollw, t_seri, q_seri, wo, cldfra, cldemi, cldtau, heat, & heat0, cool, cool0, radsol, albpla, topsw, toplw, solsw, sollw, & @@ -1567,17 +1444,16 @@ DO k = 1, llm DO i = 1, klon - t_seri(i, k) = t_seri(i, k) & - + (heat(i, k)-cool(i, k)) * dtphys/86400. + t_seri(i, k) = t_seri(i, k) + (heat(i, k)-cool(i, k)) * dtphys/86400. ENDDO ENDDO IF (if_ebil >= 2) THEN - ztit = 'after rad' - CALL diagetpq(airephy, ztit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & + tit = 'after rad' + CALL diagetpq(airephy, tit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & d_ql, d_qs, d_ec) - call diagphy(airephy, ztit, ip_ebil, topsw, toplw, solsw, sollw, & + call diagphy(airephy, tit, ip_ebil, topsw, toplw, solsw, sollw, & zero_v, zero_v, zero_v, zero_v, ztsol, d_h_vcol, d_qt, d_ec, & fs_bound, fq_bound) END IF @@ -1654,7 +1530,7 @@ ENDDO ENDIF - ! STRESS NECESSAIRES: TOUTE LA PHYSIQUE + ! Stress nécessaires : toute la physique DO i = 1, klon zustrph(i) = 0. @@ -1662,31 +1538,26 @@ 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) + 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 - !IM calcul composantes axiales du moment angulaire et couple des montagnes - - CALL aaam_bud(27, klon, llm, time, ra, rg, romega, rlat, rlon, pphis, & - zustrdr, zustrli, zustrph, zvstrdr, zvstrli, zvstrph, paprs, u, v, & - aam, torsfc) + CALL aaam_bud(ra, rg, romega, rlat, rlon, pphis, zustrdr, zustrli, & + zustrph, zvstrdr, zvstrli, zvstrph, paprs, u, v, aam, torsfc) - IF (if_ebil >= 2) THEN - ztit = 'after orography' - CALL diagetpq(airephy, ztit, ip_ebil, 2, 2, dtphys, t_seri, q_seri, & - ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & - d_ql, d_qs, d_ec) - END IF + IF (if_ebil >= 2) CALL diagetpq(airephy, 'after orography', ip_ebil, 2, & + 2, dtphys, t_seri, q_seri, ql_seri, qs_seri, u_seri, v_seri, paprs, & + d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) ! Calcul des tendances traceurs - call phytrac(rnpb, itap, lmt_pas, julien, time, firstcal, lafin, & - nqmx-2, dtphys, u, t, paprs, play, pmfu, pmfd, pen_u, pde_u, & - pen_d, pde_d, ycoefh, fm_therm, entr_therm, yu1, yv1, ftsol, pctsrf, & - frac_impa, frac_nucl, pphis, albsol, rhcl, cldfra, rneb, & - diafra, cldliq, pmflxr, pmflxs, prfl, psfl, da, phi, mp, upwd, dnwd, & - tr_seri, zmasse) + call phytrac(rnpb, itap, lmt_pas, julien, time, firstcal, lafin, nqmx-2, & + dtphys, u, t, paprs, play, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, & + ycoefh, fm_therm, entr_therm, yu1, yv1, ftsol, pctsrf, frac_impa, & + frac_nucl, pphis, albsol, rhcl, cldfra, rneb, diafra, cldliq, & + pmflxr, pmflxs, prfl, psfl, da, phi, mp, upwd, dnwd, tr_seri, zmasse) IF (offline) THEN call phystokenc(dtphys, rlon, rlat, t, pmfu, pmfd, pen_u, pde_u, & @@ -1700,7 +1571,7 @@ ! diag. bilKP - CALL transp_lay (paprs, zxtsol, t_seri, q_seri, u_seri, v_seri, zphi, & + CALL transp_lay(paprs, zxtsol, 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: @@ -1717,15 +1588,15 @@ END DO IF (if_ebil >= 1) THEN - ztit = 'after physic' - CALL diagetpq(airephy, ztit, ip_ebil, 1, 1, dtphys, t_seri, q_seri, & + tit = 'after physic' + CALL diagetpq(airephy, tit, ip_ebil, 1, 1, dtphys, t_seri, q_seri, & ql_seri, qs_seri, u_seri, v_seri, paprs, d_h_vcol, d_qt, d_qw, & d_ql, d_qs, d_ec) ! Comme les tendances de la physique sont ajoute dans la dynamique, ! on devrait avoir que la variation d'entalpie par la dynamique ! est egale a la variation de la physique au pas de temps precedent. ! Donc la somme de ces 2 variations devrait etre nulle. - call diagphy(airephy, ztit, ip_ebil, topsw, toplw, solsw, sollw, sens, & + call diagphy(airephy, tit, ip_ebil, topsw, toplw, solsw, sollw, sens, & evap, rain_fall, snow_fall, ztsol, d_h_vcol, d_qt, d_ec, & fs_bound, fq_bound) @@ -1735,7 +1606,7 @@ ! SORTIES - !cc prw = eau precipitable + ! prw = eau precipitable DO i = 1, klon prw(i) = 0. DO k = 1, llm @@ -1848,208 +1719,208 @@ itau_w = itau_phy + itap i = NINT(zout/zsto) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), pphis, zx_tmp_2d) + 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 gr_fi_ecrit(1, klon, iim, jjm + 1, airephy, zx_tmp_2d) CALL histwrite(nid_ins, "aire", itau_w, zx_tmp_2d) DO i = 1, klon zx_tmp_fi2d(i) = paprs(i, 1) ENDDO - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "psol", itau_w, zx_tmp_2d) DO i = 1, klon zx_tmp_fi2d(i) = rain_fall(i) + snow_fall(i) ENDDO - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "precip", itau_w, zx_tmp_2d) DO i = 1, klon zx_tmp_fi2d(i) = rain_lsc(i) + snow_lsc(i) ENDDO - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "plul", itau_w, zx_tmp_2d) DO i = 1, klon zx_tmp_fi2d(i) = rain_con(i) + snow_con(i) ENDDO - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "pluc", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zxtsol, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zxtsol, zx_tmp_2d) CALL histwrite(nid_ins, "tsol", itau_w, zx_tmp_2d) !ccIM - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zt2m, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zt2m, zx_tmp_2d) CALL histwrite(nid_ins, "t2m", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zq2m, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zq2m, zx_tmp_2d) CALL histwrite(nid_ins, "q2m", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zu10m, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zu10m, zx_tmp_2d) CALL histwrite(nid_ins, "u10m", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zv10m, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zv10m, zx_tmp_2d) CALL histwrite(nid_ins, "v10m", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), snow_fall, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, snow_fall, zx_tmp_2d) CALL histwrite(nid_ins, "snow", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), cdragm, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, cdragm, zx_tmp_2d) CALL histwrite(nid_ins, "cdrm", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), cdragh, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, cdragh, zx_tmp_2d) CALL histwrite(nid_ins, "cdrh", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), toplw, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, toplw, zx_tmp_2d) CALL histwrite(nid_ins, "topl", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), evap, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, evap, zx_tmp_2d) CALL histwrite(nid_ins, "evap", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), solsw, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, solsw, zx_tmp_2d) CALL histwrite(nid_ins, "sols", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), sollw, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, sollw, zx_tmp_2d) CALL histwrite(nid_ins, "soll", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), sollwdown, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, sollwdown, zx_tmp_2d) CALL histwrite(nid_ins, "solldown", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), bils, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, bils, zx_tmp_2d) CALL histwrite(nid_ins, "bils", itau_w, zx_tmp_2d) zx_tmp_fi2d(1:klon) = -1*sens(1:klon) - ! CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), sens, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + ! CALL gr_fi_ecrit(1, klon, iim, jjm + 1, sens, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "sens", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), fder, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, fder, zx_tmp_2d) CALL histwrite(nid_ins, "fder", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), d_ts(1, is_oce), zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, d_ts(1, is_oce), zx_tmp_2d) CALL histwrite(nid_ins, "dtsvdfo", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), d_ts(1, is_ter), zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, d_ts(1, is_ter), zx_tmp_2d) CALL histwrite(nid_ins, "dtsvdft", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), d_ts(1, is_lic), zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, d_ts(1, is_lic), zx_tmp_2d) CALL histwrite(nid_ins, "dtsvdfg", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), d_ts(1, is_sic), zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, d_ts(1, is_sic), zx_tmp_2d) CALL histwrite(nid_ins, "dtsvdfi", itau_w, zx_tmp_2d) DO nsrf = 1, nbsrf !XXX zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, nsrf)*100. - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "pourc_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, nsrf) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "fract_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) zx_tmp_fi2d(1 : klon) = fluxt(1 : klon, 1, nsrf) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "sens_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) zx_tmp_fi2d(1 : klon) = fluxlat(1 : klon, nsrf) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "lat_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) zx_tmp_fi2d(1 : klon) = ftsol(1 : klon, nsrf) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "tsol_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) zx_tmp_fi2d(1 : klon) = fluxu(1 : klon, 1, nsrf) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "taux_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) zx_tmp_fi2d(1 : klon) = fluxv(1 : klon, 1, nsrf) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "tauy_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) zx_tmp_fi2d(1 : klon) = frugs(1 : klon, nsrf) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, zx_tmp_fi2d, zx_tmp_2d) CALL histwrite(nid_ins, "rugs_"//clnsurf(nsrf), itau_w, & zx_tmp_2d) zx_tmp_fi2d(1 : klon) = falbe(1 : klon, nsrf) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), zx_tmp_fi2d, zx_tmp_2d) + 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) END DO - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), albsol, zx_tmp_2d) + 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 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 gr_fi_ecrit(1, klon, iim, jjm + 1, zxrugs, zx_tmp_2d) CALL histwrite(nid_ins, "rugs", itau_w, zx_tmp_2d) !HBTM2 - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_pblh, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_pblh, zx_tmp_2d) CALL histwrite(nid_ins, "s_pblh", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_pblt, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_pblt, zx_tmp_2d) CALL histwrite(nid_ins, "s_pblt", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_lcl, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_lcl, zx_tmp_2d) CALL histwrite(nid_ins, "s_lcl", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_capCL, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_capCL, zx_tmp_2d) CALL histwrite(nid_ins, "s_capCL", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_oliqCL, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_oliqCL, zx_tmp_2d) CALL histwrite(nid_ins, "s_oliqCL", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_cteiCL, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_cteiCL, zx_tmp_2d) CALL histwrite(nid_ins, "s_cteiCL", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_therm, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_therm, zx_tmp_2d) CALL histwrite(nid_ins, "s_therm", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_trmb1, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_trmb1, zx_tmp_2d) CALL histwrite(nid_ins, "s_trmb1", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_trmb2, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_trmb2, zx_tmp_2d) CALL histwrite(nid_ins, "s_trmb2", itau_w, zx_tmp_2d) - CALL gr_fi_ecrit(1, klon, iim, (jjm + 1), s_trmb3, zx_tmp_2d) + CALL gr_fi_ecrit(1, klon, iim, jjm + 1, s_trmb3, zx_tmp_2d) CALL histwrite(nid_ins, "s_trmb3", itau_w, zx_tmp_2d) ! Champs 3D: - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), t_seri, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, t_seri, zx_tmp_3d) CALL histwrite(nid_ins, "temp", itau_w, zx_tmp_3d) - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), u_seri, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, u_seri, zx_tmp_3d) CALL histwrite(nid_ins, "vitu", itau_w, zx_tmp_3d) - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), v_seri, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, v_seri, zx_tmp_3d) CALL histwrite(nid_ins, "vitv", itau_w, zx_tmp_3d) - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), zphi, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, zphi, zx_tmp_3d) CALL histwrite(nid_ins, "geop", itau_w, zx_tmp_3d) - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), play, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, play, zx_tmp_3d) CALL histwrite(nid_ins, "pres", itau_w, zx_tmp_3d) - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), d_t_vdf, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, d_t_vdf, zx_tmp_3d) CALL histwrite(nid_ins, "dtvdf", itau_w, zx_tmp_3d) - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), d_q_vdf, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, d_q_vdf, zx_tmp_3d) CALL histwrite(nid_ins, "dqvdf", itau_w, zx_tmp_3d) if (ok_sync) then @@ -2073,20 +1944,20 @@ ! Champs 3D: - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), t_seri, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, t_seri, zx_tmp_3d) CALL histwrite(nid_hf3d, "temp", itau_w, zx_tmp_3d) - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), qx(1, 1, ivap), zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, qx(1, 1, ivap), zx_tmp_3d) CALL histwrite(nid_hf3d, "ovap", itau_w, zx_tmp_3d) - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), u_seri, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, u_seri, zx_tmp_3d) CALL histwrite(nid_hf3d, "vitu", itau_w, zx_tmp_3d) - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), v_seri, zx_tmp_3d) + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, v_seri, zx_tmp_3d) CALL histwrite(nid_hf3d, "vitv", itau_w, zx_tmp_3d) if (nbtr >= 3) then - CALL gr_fi_ecrit(llm, klon, iim, (jjm + 1), tr_seri(1, 1, 3), & + CALL gr_fi_ecrit(llm, klon, iim, jjm + 1, tr_seri(1, 1, 3), & zx_tmp_3d) CALL histwrite(nid_hf3d, "O3", itau_w, zx_tmp_3d) end if