19 |
use dimens_m, only: iim, jjm, llm, nqmx |
use dimens_m, only: iim, jjm, llm, nqmx |
20 |
use dimphy, only: klon |
use dimphy, only: klon |
21 |
use paramet_m, only: ip1jm, ip1jmp1 |
use paramet_m, only: ip1jm, ip1jmp1 |
22 |
use comconst, only: daysec, cpp, dtvr, dtphys, g, rad, r, initialize |
use comconst, only: daysec, cpp, dtvr, g, rad, r, initialize |
|
|
|
23 |
use comdissnew, only: lstardis, nitergdiv, nitergrot, niterh, tetagdiv, & |
use comdissnew, only: lstardis, nitergdiv, nitergrot, niterh, tetagdiv, & |
24 |
tetagrot, tetatemp |
tetagrot, tetatemp |
|
|
|
25 |
use conf_gcm_m, only: day_step, iperiod, anneeref, dayref, iecri, iphysiq, & |
use conf_gcm_m, only: day_step, iperiod, anneeref, dayref, iecri, iphysiq, & |
26 |
nday, raz_date, periodav, conf_gcm |
nday, raz_date, periodav, conf_gcm |
|
|
|
27 |
use logic, only: iflag_phys |
use logic, only: iflag_phys |
28 |
use comgeom, only: rlatu, aire_2d, cu_2d, cv_2d, rlonv |
use comgeom, only: rlatu, aire_2d, cu_2d, cv_2d, rlonv |
29 |
use temps, only: day_ref, annee_ref, day_ini, day_end, itau_phy, itau_dyn |
use temps, only: day_ref, annee_ref, day_end, itau_dyn |
30 |
use com_io_dyn, only: histid, histvid, histaveid |
use com_io_dyn, only: histid, histvid, histaveid |
31 |
use tracstoke, only: istdyn, istphy |
use tracstoke, only: istdyn, istphy |
32 |
use abort_gcm_m, only: abort_gcm |
use abort_gcm_m, only: abort_gcm |
33 |
use inithist_m, only: inithist |
use inithist_m, only: inithist |
34 |
use initdynav_m, only: initdynav |
use initdynav_m, only: initdynav |
35 |
use dynetat0_m, only: dynetat0 |
use dynetat0_m, only: dynetat0, day_ini |
36 |
use grid_change, only: dyn_phy, init_dyn_phy |
use grid_change, only: dyn_phy, init_dyn_phy |
37 |
use advtrac_m, only: iniadvtrac |
use iniadvtrac_m, only: iniadvtrac |
38 |
use leapfrog_m, only: leapfrog |
use leapfrog_m, only: leapfrog |
39 |
use dynredem0_m, only: dynredem0 |
use dynredem0_m, only: dynredem0 |
40 |
|
use clesphys2, only: read_clesphys2 |
41 |
|
use inigeom_m, only: inigeom |
42 |
|
|
43 |
IMPLICIT NONE |
IMPLICIT NONE |
44 |
|
|
|
REAL clesphy0(20) |
|
45 |
REAL zdtvr ! time step for dynamics, in s |
REAL zdtvr ! time step for dynamics, in s |
46 |
|
|
47 |
! Variables dynamiques : |
! Variables dynamiques : |
54 |
REAL phis(iim + 1, jjm + 1) ! géopotentiel au sol |
REAL phis(iim + 1, jjm + 1) ! géopotentiel au sol |
55 |
|
|
56 |
! Variables pour le fichier histoire : |
! Variables pour le fichier histoire : |
57 |
REAL time_0 |
REAL time_0 ! time in day, as a fraction of day, in [0, 1[ |
|
|
|
|
!!INTEGER i |
|
58 |
|
|
59 |
! Calendrier : |
! Calendrier : |
60 |
LOGICAL:: true_calendar = .false. ! default value |
LOGICAL:: true_calendar = .false. ! default value |
61 |
|
|
62 |
! Variables pour l'initialisation de la physique : |
! Variables pour l'initialisation de la physique : |
|
integer nq |
|
63 |
REAL zcufi(klon), zcvfi(klon) ! "cu" and "cv" values on the scalar grid |
REAL zcufi(klon), zcvfi(klon) ! "cu" and "cv" values on the scalar grid |
64 |
REAL latfi(klon), lonfi(klon) |
REAL latfi(klon), lonfi(klon) |
65 |
REAL airefi(klon) |
REAL airefi(klon) |
87 |
endif |
endif |
88 |
|
|
89 |
! Lecture des fichiers "gcm.def" ou "run.def" : |
! Lecture des fichiers "gcm.def" ou "run.def" : |
90 |
CALL conf_gcm(clesphy0) |
call read_clesphys2 |
91 |
|
CALL conf_gcm |
92 |
|
|
93 |
! Initialisation des traceurs |
! Initialisation des traceurs |
94 |
! 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 |
95 |
call iniadvtrac(nq) |
call iniadvtrac |
96 |
|
|
97 |
! Lecture du fichier "start.nc" : |
! Lecture du fichier "start.nc" : |
98 |
CALL dynetat0(vcov, ucov, teta, q, masse, ps, phis, time_0) |
CALL dynetat0(vcov, ucov, teta, q, masse, ps, phis, time_0) |
115 |
if (annee_ref /= anneeref .or. day_ref /= dayref) then |
if (annee_ref /= anneeref .or. day_ref /= dayref) then |
116 |
print *, 'Attention : les dates initiales lues dans le fichier ' // & |
print *, 'Attention : les dates initiales lues dans le fichier ' // & |
117 |
'"start" ne correspondent pas à celles lues dans "gcm.def".' |
'"start" ne correspondent pas à celles lues dans "gcm.def".' |
118 |
if (raz_date /= 1) then |
if (raz_date) then |
|
print *, 'On garde les dates du fichier "start".' |
|
|
else |
|
119 |
print *, 'On réinitialise à la date lue dans "gcm.def".' |
print *, 'On réinitialise à la date lue dans "gcm.def".' |
120 |
annee_ref = anneeref |
annee_ref = anneeref |
121 |
day_ref = dayref |
day_ref = dayref |
122 |
day_ini = dayref |
day_ini = dayref |
123 |
itau_dyn = 0 |
itau_dyn = 0 |
|
itau_phy = 0 |
|
124 |
time_0 = 0. |
time_0 = 0. |
125 |
|
else |
126 |
|
print *, 'On garde les dates du fichier "start".' |
127 |
endif |
endif |
128 |
ELSE |
ELSE |
129 |
raz_date = 0 |
raz_date = .false. |
130 |
endif |
endif |
131 |
|
|
132 |
! Initialisation des constantes dynamiques : |
! Initialisation des constantes dynamiques : |
176 |
|
|
177 |
airefi = pack(aire_2d, dyn_phy) |
airefi = pack(aire_2d, dyn_phy) |
178 |
print *, 'Attention : vitesse verticale nulle dans la physique.' |
print *, 'Attention : vitesse verticale nulle dans la physique.' |
179 |
CALL iniphysiq(klon, llm, daysec, day_ini, dtphys, latfi, lonfi, airefi, & |
CALL iniphysiq(klon, llm, latfi, lonfi, airefi, & |
180 |
zcufi, zcvfi, rad, g, r, cpp) |
zcufi, zcvfi, rad, g, r, cpp) |
181 |
ENDIF |
ENDIF |
182 |
|
|
|
! Numéro de stockage pour les fichiers de redémarrage : |
|
183 |
! Initialisation des entrées-sorties : |
! Initialisation des entrées-sorties : |
184 |
day_end = day_ini + nday |
day_end = day_ini + nday |
185 |
print *, "day_ini = ", day_ini |
print *, "day_ini = ", day_ini |
197 |
istphy = istdyn / iphysiq |
istphy = istdyn / iphysiq |
198 |
|
|
199 |
! Intégration temporelle du modèle : |
! Intégration temporelle du modèle : |
200 |
CALL leapfrog(ucov, vcov, teta, ps, masse, phis, nq, q, clesphy0, time_0) |
CALL leapfrog(ucov, vcov, teta, ps, masse, phis, q, time_0) |
201 |
|
|
202 |
call histclo |
call histclo |
203 |
print *, 'Simulation finished' |
print *, 'Simulation finished' |