8 |
! "divgrad2", "nxgraro2"). Possibilité de choisir le schéma pour |
! "divgrad2", "nxgraro2"). Possibilité de choisir le schéma pour |
9 |
! l'advection de "q", en modifiant "iadv" dans "traceur.def". |
! l'advection de "q", en modifiant "iadv" dans "traceur.def". |
10 |
|
|
11 |
USE calendar, only: ioconf_calendar |
use comconst, only: daysec, dtvr, iniconst |
|
use comconst, only: daysec, cpp, dtvr, g, rad, r |
|
12 |
use comgeom, only: rlatu, aire_2d, cu_2d, cv_2d, rlonv, inigeom |
use comgeom, only: rlatu, aire_2d, cu_2d, cv_2d, rlonv, inigeom |
13 |
use comgeomphy, only: airephy, cuphy, cvphy, rlatd, rlond |
use comgeomphy, only: airephy, cuphy, cvphy, rlatd, rlond |
14 |
use conf_gcm_m, only: day_step, iperiod, anneeref, dayref, iecri, iphysiq, & |
use conf_gcm_m, only: day_step, iperiod, anneeref, dayref, iecri, iphysiq, & |
15 |
nday, raz_date, periodav, conf_gcm, iflag_phys |
nday, raz_date, periodav, conf_gcm, iflag_phys |
16 |
use dimens_m, only: iim, jjm, llm, nqmx |
use dimens_m, only: iim, jjm, llm, nqmx |
17 |
use dimphy, only: klon |
use dimphy, only: klon |
18 |
|
USE disvert_m, ONLY : disvert |
19 |
use dynetat0_m, only: dynetat0, day_ini |
use dynetat0_m, only: dynetat0, day_ini |
20 |
use dynredem0_m, only: dynredem0 |
use dynredem0_m, only: dynredem0 |
21 |
use grid_change, only: dyn_phy, init_dyn_phy |
use grid_change, only: dyn_phy, init_dyn_phy |
26 |
use initdynav_m, only: initdynav |
use initdynav_m, only: initdynav |
27 |
use inithist_m, only: inithist |
use inithist_m, only: inithist |
28 |
use init_dynzon_m, only: init_dynzon |
use init_dynzon_m, only: init_dynzon |
29 |
|
USE ioconf_calendar_m, only: ioconf_calendar |
30 |
use jumble, only: new_unit |
use jumble, only: new_unit |
31 |
use leapfrog_m, only: leapfrog |
use leapfrog_m, only: leapfrog |
32 |
use suphec_m, only: suphec |
use suphec_m, only: suphec |
37 |
|
|
38 |
IMPLICIT NONE |
IMPLICIT NONE |
39 |
|
|
|
REAL zdtvr ! time step for dynamics, in s |
|
|
|
|
40 |
! Variables dynamiques : |
! Variables dynamiques : |
41 |
REAL ucov(iim + 1, jjm + 1, llm), vcov(iim + 1, jjm, llm) ! vent covariant |
REAL ucov(iim + 1, jjm + 1, llm), vcov(iim + 1, jjm, llm) ! vent covariant |
42 |
REAL teta(iim + 1, jjm + 1, llm) ! température potentielle |
REAL teta(iim + 1, jjm + 1, llm) ! température potentielle |
60 |
!------------------------------------------------------------ |
!------------------------------------------------------------ |
61 |
|
|
62 |
call new_unit(unit_nml) |
call new_unit(unit_nml) |
63 |
open(unit_nml, file="used_namelists", status="replace", action="write") |
open(unit_nml, file="used_namelists.txt", status="replace", action="write") |
64 |
|
|
65 |
CALL conf_gcm |
CALL conf_gcm |
66 |
|
|
79 |
! Choix du schéma pour l'advection dans le fichier "traceur.def" ou via INCA |
! Choix du schéma pour l'advection dans le fichier "traceur.def" ou via INCA |
80 |
call iniadvtrac |
call iniadvtrac |
81 |
|
|
82 |
|
CALL iniconst |
83 |
|
|
84 |
! Lecture du fichier "start.nc" : |
! Lecture du fichier "start.nc" : |
85 |
CALL dynetat0(vcov, ucov, teta, q, masse, ps, phis, time_0) |
CALL dynetat0(vcov, ucov, teta, q, masse, ps, phis, time_0) |
86 |
|
|
87 |
! On remet le calendrier à zero si demandé : |
! On remet le calendrier à zéro si demandé : |
88 |
if (annee_ref /= anneeref .or. day_ref /= dayref) then |
if (raz_date) then |
89 |
print *, 'Attention : les dates initiales lues dans le fichier ' // & |
print *, 'On réinitialise à la date lue dans la namelist.' |
90 |
'"start" ne correspondent pas à celles lues dans "gcm.def".' |
annee_ref = anneeref |
91 |
if (raz_date) then |
day_ref = dayref |
92 |
print *, 'On réinitialise à la date lue dans "gcm.def".' |
day_ini = dayref |
93 |
annee_ref = anneeref |
itau_dyn = 0 |
94 |
day_ref = dayref |
time_0 = 0. |
95 |
day_ini = dayref |
else |
96 |
itau_dyn = 0 |
print *, 'On garde les dates du fichier "start".' |
|
time_0 = 0. |
|
|
else |
|
|
print *, 'On garde les dates du fichier "start".' |
|
|
endif |
|
|
ELSE |
|
|
raz_date = .false. |
|
97 |
endif |
endif |
98 |
|
|
99 |
! On recalcule éventuellement le pas de temps : |
CALL disvert |
|
zdtvr = daysec / REAL(day_step) |
|
|
IF (dtvr /= zdtvr) THEN |
|
|
print *, 'Warning: the time steps in the ".def" file and in ' // & |
|
|
'"start.nc" are different' |
|
|
print *, 'dtvr (from "start.nc") = ', dtvr |
|
|
print *, 'zdtvr (from ".def") = ', zdtvr |
|
|
print *, 'Using the value from the ".def" file.' |
|
|
dtvr = zdtvr |
|
|
ENDIF |
|
|
|
|
|
CALL iniconst |
|
100 |
CALL inigeom ! initialisation de la géometrie |
CALL inigeom ! initialisation de la géometrie |
101 |
CALL inifilr ! initialisation du filtre |
CALL inifilr ! initialisation du filtre |
102 |
CALL inidissip |
CALL inidissip |
134 |
print *, "day_end = ", day_end |
print *, "day_end = ", day_end |
135 |
|
|
136 |
CALL dynredem0("restart.nc", day_end, phis) |
CALL dynredem0("restart.nc", day_end, phis) |
137 |
CALL inithist(day_ref, annee_ref, zdtvr, nqmx, t_ops = iecri * daysec, & |
CALL inithist(day_ref, annee_ref, dtvr, nqmx, t_ops = iecri * daysec, & |
138 |
t_wrt = iecri * daysec) |
t_wrt = iecri * daysec) |
139 |
CALL initdynav(day_ref, annee_ref, zdtvr, nqmx, t_ops = iperiod * zdtvr, & |
CALL initdynav(day_ref, annee_ref, dtvr, nqmx, t_ops = iperiod * dtvr, & |
140 |
t_wrt = periodav * daysec) |
t_wrt = periodav * daysec) |
141 |
call init_dynzon(dt_app = dtvr * iperiod) |
call init_dynzon(dt_app = dtvr * iperiod) |
142 |
|
|