--- trunk/libf/dyn3d/gcm.f90 2011/12/12 13:25:01 55 +++ trunk/libf/dyn3d/gcm.f90 2012/11/14 16:59:30 68 @@ -8,31 +8,32 @@ ! "divgrad2", "nxgraro2"). Possibilité de choisir le schéma pour ! l'advection de "q", en modifiant "iadv" dans "traceur.def". + USE calendar, only: ioconf_calendar use clesphys2, only: read_clesphys2 - use com_io_dyn, only: histid, histvid, histaveid 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 + nday, raz_date, periodav, conf_gcm, iflag_phys use dimens_m, only: iim, jjm, llm, nqmx use dimphy, only: klon use dynetat0_m, only: dynetat0, day_ini use dynredem0_m, only: dynredem0 use grid_change, only: dyn_phy, init_dyn_phy + use histclo_m, only: histclo 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 - USE calendar, only: ioconf_calendar - use histcom, only: histclo + use init_dynzon_m, only: init_dynzon + use jumble, only: new_unit use leapfrog_m, only: leapfrog - use logic, only: iflag_phys use suphec_m, only: suphec use temps, only: day_ref, annee_ref, day_end, itau_dyn use tracstoke, only: istdyn, istphy + use unit_nml_m, only: unit_nml use yoethf_m, only: yoethf IMPLICIT NONE @@ -61,9 +62,14 @@ !------------------------------------------------------------ + call new_unit(unit_nml) + open(unit_nml, file="used_namelists", status="replace", action="write") + + CALL conf_gcm + print *, "Enter namelist 'main_nml'." read (unit=*, nml=main_nml) - write(unit=*, nml=main_nml) + write(unit_nml, nml=main_nml) ! Choix du calendrier : if (true_calendar) then @@ -74,7 +80,6 @@ ! Lecture des fichiers "gcm.def" ou "run.def" : call read_clesphys2 - CALL conf_gcm ! Initialisation des traceurs ! Choix du schéma pour l'advection dans le fichier "traceur.def" ou via INCA @@ -150,10 +155,11 @@ 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) + call init_dynzon(dt_app = dtvr * iperiod) ! Choix des fréquences de stockage pour le hors-ligne : istdyn = day_step / 4 ! stockage toutes les 6 h = 1 jour / 4 @@ -162,6 +168,7 @@ ! Intégration temporelle du modèle : CALL leapfrog(ucov, vcov, teta, ps, masse, phis, q, time_0) + close(unit_nml) call histclo print *, 'Simulation finished' print *, 'Everything is cool'