--- trunk/libf/dyn3d/gcm.f90 2010/12/02 17:11:04 36 +++ trunk/libf/dyn3d/gcm.f90 2012/01/10 19:02:02 56 @@ -2,18 +2,16 @@ ! Authors: P. Le Van, L. Fairhead, F. Hourdin ! From "gcm.F", version 1.4, 2006/04/04 15:05:16 - ! General circulation model of LMD - ! Avec coordonnées verticales hybrides, avec nouveaux opérateurs de - ! dissipation "*" (gradiv2, divgrad2, nxgraro2) - ! Possibilité de choisir le schéma pour l'advection de "q", en - ! modifiant "iadv" dans "traceur.def". - ! Pour Van-Leer plus vapeur d'eau saturée : iadv(1)=4 - ! Pour Van-Leer : iadv=10 + + ! General circulation model of LMD. Avec coordonnée verticale + ! hybride, avec nouveaux opérateurs de dissipation "*" ("gradiv2", + ! "divgrad2", "nxgraro2"). Possibilité de choisir le schéma pour + ! l'advection de "q", en modifiant "iadv" dans "traceur.def". use clesphys2, only: read_clesphys2 - use com_io_dyn, only: histid, histvid, histaveid - use comconst, only: daysec, cpp, dtvr, g, rad, r, initialize + use comconst, only: daysec, cpp, dtvr, g, rad, r use comgeom, only: rlatu, aire_2d, cu_2d, cv_2d, rlonv + use comgeomphy, only: airephy, cuphy, cvphy, rlatd, rlond use conf_gcm_m, only: day_step, iperiod, anneeref, dayref, iecri, iphysiq, & nday, raz_date, periodav, conf_gcm use dimens_m, only: iim, jjm, llm, nqmx @@ -23,6 +21,7 @@ use grid_change, only: dyn_phy, init_dyn_phy use iniadvtrac_m, only: iniadvtrac use inidissip_m, only: inidissip + use inifilr_m, only: inifilr use inigeom_m, only: inigeom use initdynav_m, only: initdynav use inithist_m, only: inithist @@ -30,21 +29,21 @@ use histcom, only: histclo use leapfrog_m, only: leapfrog use logic, only: iflag_phys - use paramet_m, only: ip1jm, ip1jmp1 + use suphec_m, only: suphec use temps, only: day_ref, annee_ref, day_end, itau_dyn use tracstoke, only: istdyn, istphy + use yoethf_m, only: yoethf IMPLICIT NONE REAL zdtvr ! time step for dynamics, in s ! Variables dynamiques : - REAL vcov(ip1jm, llm), ucov(ip1jmp1, llm) ! vents covariants - REAL teta(ip1jmp1, llm) ! température potentielle - REAL q(ip1jmp1, llm, nqmx) ! champs advectés - REAL ps(ip1jmp1) ! pression au sol (Pa) - - REAL masse(ip1jmp1, llm) ! masse d'air + REAL ucov(iim + 1, jjm + 1, llm), vcov(iim + 1, jjm, llm) ! vent covariant + REAL teta(iim + 1, jjm + 1, llm) ! température potentielle + REAL q(iim + 1, jjm + 1, llm, nqmx) ! champs advectés + REAL ps(iim + 1, jjm + 1) ! pression au sol (Pa) + REAL masse(iim + 1, jjm + 1, llm) ! masse d'air REAL phis(iim + 1, jjm + 1) ! géopotentiel au sol ! Variables pour le fichier histoire : @@ -53,11 +52,6 @@ ! Calendrier : LOGICAL:: true_calendar = .false. ! default value - ! Variables pour l'initialisation de la physique : - REAL zcufi(klon), zcvfi(klon) ! "cu" and "cv" values on the scalar grid - REAL latfi(klon), lonfi(klon) - REAL airefi(klon) - logical mask_v(iim + 1, jjm) ! (mask for points in the "v" grid, first index is for longitude, ! second index is for latitude) @@ -70,9 +64,6 @@ read (unit=*, nml=main_nml) write(unit=*, nml=main_nml) - ! Initialisations: - call initialize - ! Choix du calendrier : if (true_calendar) then call ioconf_calendar('gregorian') @@ -128,28 +119,28 @@ ! Initialisation de la physique : IF (iflag_phys == 1) THEN - latfi(1)=rlatu(1) - latfi(2:klon-1) = pack(spread(rlatu(2:jjm), 1, iim), .true.) - latfi(klon)= rlatu(jjm + 1) - - lonfi(1)=0. - lonfi(2:klon-1) = pack(spread(rlonv(:iim), 2, jjm - 1), .true.) - lonfi(klon)= 0. + rlatd(1)=rlatu(1) + rlatd(2:klon-1) = pack(spread(rlatu(2:jjm), 1, iim), .true.) + rlatd(klon)= rlatu(jjm + 1) + + rlond(1)=0. + rlond(2:klon-1) = pack(spread(rlonv(:iim), 2, jjm - 1), .true.) + rlond(klon)= 0. - zcufi = pack(cu_2d, dyn_phy) + cuphy = pack(cu_2d, dyn_phy) ! Construct a mask for points in the "v" grid: mask_v = .true. mask_v(2:, 1) = .false. mask_v(iim + 1, 2:) = .false. - zcvfi(:klon - 1) = pack(cv_2d, mask_v) - zcvfi(klon) = cv_2d(1, jjm) - ! (that value of "cv_2d" is used twice in "zcvfi") - - airefi = pack(aire_2d, dyn_phy) - CALL iniphysiq(klon, llm, latfi, lonfi, airefi, zcufi, zcvfi, rad, g, r, & - cpp) + cvphy(:klon - 1) = pack(cv_2d, mask_v) + cvphy(klon) = cv_2d(1, jjm) + ! (that value of "cv_2d" is used twice in "cvphy") + + airephy = pack(aire_2d, dyn_phy) + CALL suphec + call yoethf ENDIF ! Initialisation des entrées-sorties : @@ -158,10 +149,10 @@ print *, "day_end = ", day_end CALL dynredem0("restart.nc", day_end, phis) - CALL inithist(day_ref, annee_ref, zdtvr, nqmx, histid, histvid, & - t_ops = iecri * daysec, t_wrt = iecri * daysec) - CALL initdynav(day_ref, annee_ref, zdtvr, nqmx, histaveid, & - t_ops = iperiod * zdtvr, t_wrt = periodav * daysec) + CALL inithist(day_ref, annee_ref, zdtvr, nqmx, t_ops = iecri * daysec, & + t_wrt = iecri * daysec) + CALL initdynav(day_ref, annee_ref, zdtvr, nqmx, t_ops = iperiod * zdtvr, & + t_wrt = periodav * daysec) ! Choix des fréquences de stockage pour le hors-ligne : istdyn = day_step / 4 ! stockage toutes les 6 h = 1 jour / 4