--- trunk/phylmd/physiq.f 2014/12/18 17:30:24 118 +++ trunk/Sources/phylmd/physiq.f 2015/06/23 15:14:20 151 @@ -4,7 +4,7 @@ contains - SUBROUTINE physiq(lafin, rdayvrai, time, dtphys, paprs, play, pphi, pphis, & + SUBROUTINE physiq(lafin, dayvrai, time, dtphys, 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 @@ -25,7 +25,7 @@ ok_orodr, ok_orolf USE clmain_m, ONLY: clmain use clouds_gno_m, only: clouds_gno - USE comgeomphy, ONLY: airephy, cuphy, cvphy + USE comgeomphy, ONLY: airephy USE concvl_m, ONLY: concvl USE conf_gcm_m, ONLY: offline, raz_date USE conf_phys_m, ONLY: conf_phys @@ -38,6 +38,7 @@ USE dimphy, ONLY: klon USE dimsoil, ONLY: nsoilmx use drag_noro_m, only: drag_noro + use dynetat0_m, only: day_ref, annee_ref USE fcttre, ONLY: foeew, qsatl, qsats, thermcep use fisrtilp_m, only: fisrtilp USE hgardfou_m, ONLY: hgardfou @@ -57,7 +58,7 @@ use readsulfate_preind_m, only: readsulfate_preind 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 temps, ONLY: itau_phy use unit_nml_m, only: unit_nml USE ymds2ju_m, ONLY: ymds2ju USE yoethf_m, ONLY: r2es, rvtmp2 @@ -65,8 +66,8 @@ logical, intent(in):: lafin ! dernier passage - REAL, intent(in):: rdayvrai - ! (elapsed time since January 1st 0h of the starting year, in days) + integer, intent(in):: dayvrai + ! 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) @@ -223,8 +224,8 @@ ! Variables propres a la physique INTEGER, save:: radpas - ! (Radiative transfer computations are made every "radpas" call to - ! "physiq".) + ! Radiative transfer computations are made every "radpas" call to + ! "physiq". REAL radsol(klon) SAVE radsol ! bilan radiatif au sol calcule par code radiatif @@ -502,7 +503,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 : @@ -649,7 +649,7 @@ CALL printflag(radpas, ok_journe, ok_instan, ok_region) - IF (dtphys * REAL(radpas) > 21600. .AND. cycle_diurne) THEN + 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) @@ -680,7 +680,7 @@ ! Initialisation des sorties call ini_histins(dtphys, ok_instan, nid_ins) - CALL ymds2ju(annee_ref, 1, int(day_ref), 0., date0) + CALL ymds2ju(annee_ref, 1, day_ref, 0., date0) ! Positionner date0 pour initialisation de ORCHIDEE print *, 'physiq date0: ', date0 ENDIF test_firstcal @@ -740,7 +740,7 @@ ! Incrémenter le compteur de la physique itap = itap + 1 - julien = MOD(NINT(rdayvrai), 360) + julien = MOD(dayvrai, 360) if (julien == 0) julien = 360 forall (k = 1: llm) zmasse(:, k) = (paprs(:, k) - paprs(:, k + 1)) / rg @@ -775,7 +775,7 @@ CALL orbite(REAL(julien), longi, dist) IF (cycle_diurne) THEN - CALL zenang(longi, time, dtphys * REAL(radpas), mu0, fract) + CALL zenang(longi, time, dtphys * radpas, mu0, fract) ELSE mu0 = -999.999 ENDIF @@ -1228,8 +1228,8 @@ ! 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) + CALL readsulfate(dayvrai, time, firstcal, sulfate) + CALL readsulfate_preind(dayvrai, time, firstcal, sulfate_pi) CALL aeropt(play, paprs, t_seri, sulfate, rhcl, tau_ae, piz_ae, cg_ae, & aerindex) @@ -1324,8 +1324,8 @@ ENDDO CALL drag_noro(klon, llm, dtphys, paprs, play, zmea, zstd, zsig, zgam, & - zthe, zpic, zval, igwd, idx, itest, t_seri, u_seri, v_seri, & - zulow, zvlow, zustrdr, zvstrdr, d_t_oro, d_u_oro, d_v_oro) + zthe, zpic, zval, itest, 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 @@ -1474,11 +1474,11 @@ ! Si c'est la fin, il faut conserver l'etat de redemarrage IF (lafin) THEN itau_phy = itau_phy + itap - CALL phyredem("restartphy.nc", rlat, rlon, pctsrf, ftsol, ftsoil, & - tslab, seaice, fqsurf, qsol, fsnow, falbe, falblw, 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("restartphy.nc", pctsrf, ftsol, ftsoil, tslab, seaice, & + fqsurf, qsol, fsnow, falbe, falblw, 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) ENDIF firstcal = .FALSE. @@ -1493,8 +1493,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) !-------------------------------------------------- @@ -1502,15 +1501,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)