1 |
|
|
! $Id: initdynav.F90 4046 2021-12-15 22:18:49Z dcugnet $ |
2 |
|
|
|
3 |
|
|
subroutine initdynav(day0,anne0,tstep,t_ops,t_wrt) |
4 |
|
|
|
5 |
|
|
#ifdef CPP_IOIPSL |
6 |
|
|
USE IOIPSL |
7 |
|
|
#endif |
8 |
|
|
USE infotrac, ONLY : nqtot |
9 |
|
|
use com_io_dyn_mod, only : histaveid,histvaveid,histuaveid, & |
10 |
|
|
dynhistave_file,dynhistvave_file,dynhistuave_file |
11 |
|
|
USE comconst_mod, ONLY: pi |
12 |
|
|
USE comvert_mod, ONLY: presnivs |
13 |
|
|
USE temps_mod, ONLY: itau_dyn |
14 |
|
|
|
15 |
|
|
implicit none |
16 |
|
|
|
17 |
|
|
|
18 |
|
|
! Routine d'initialisation des ecritures des fichiers histoires LMDZ |
19 |
|
|
! au format IOIPSL. Initialisation du fichier histoire moyenne. |
20 |
|
|
|
21 |
|
|
! Appels succesifs des routines: histbeg |
22 |
|
|
! histhori |
23 |
|
|
! histver |
24 |
|
|
! histdef |
25 |
|
|
! histend |
26 |
|
|
|
27 |
|
|
! Entree: |
28 |
|
|
|
29 |
|
|
! infile: nom du fichier histoire a creer |
30 |
|
|
! day0,anne0: date de reference |
31 |
|
|
! tstep : frequence d'ecriture |
32 |
|
|
! t_ops: frequence de l'operation pour IOIPSL |
33 |
|
|
! t_wrt: frequence d'ecriture sur le fichier |
34 |
|
|
|
35 |
|
|
|
36 |
|
|
! L. Fairhead, LMD, 03/99 |
37 |
|
|
|
38 |
|
|
include "dimensions.h" |
39 |
|
|
include "paramet.h" |
40 |
|
|
include "comgeom.h" |
41 |
|
|
include "description.h" |
42 |
|
|
include "iniprint.h" |
43 |
|
|
|
44 |
|
|
! Arguments |
45 |
|
|
|
46 |
|
|
integer day0, anne0 |
47 |
|
|
real tstep, t_ops, t_wrt |
48 |
|
|
|
49 |
|
|
#ifdef CPP_IOIPSL |
50 |
|
|
! This routine needs IOIPSL to work |
51 |
|
|
! Variables locales |
52 |
|
|
|
53 |
|
|
integer tau0 |
54 |
|
|
real zjulian |
55 |
|
|
integer iq |
56 |
|
|
real rlong(iip1,jjp1), rlat(iip1,jjp1) |
57 |
|
|
integer uhoriid, vhoriid, thoriid, zvertiid |
58 |
|
|
integer ii,jj |
59 |
|
|
integer zan, dayref |
60 |
|
|
|
61 |
|
|
!-------------------------------------------------------------------- |
62 |
|
|
|
63 |
|
|
! Initialisations |
64 |
|
|
|
65 |
|
|
pi = 4. * atan (1.) |
66 |
|
|
|
67 |
|
|
! Appel a histbeg: creation du fichier netcdf et initialisations diverses |
68 |
|
|
|
69 |
|
|
|
70 |
|
|
zan = anne0 |
71 |
|
|
dayref = day0 |
72 |
|
|
CALL ymds2ju(zan, 1, dayref, 0.0, zjulian) |
73 |
|
|
tau0 = itau_dyn |
74 |
|
|
|
75 |
|
|
do jj = 1, jjp1 |
76 |
|
|
do ii = 1, iip1 |
77 |
|
|
rlong(ii,jj) = rlonv(ii) * 180. / pi |
78 |
|
|
rlat(ii,jj) = rlatu(jj) * 180. / pi |
79 |
|
|
enddo |
80 |
|
|
enddo |
81 |
|
|
|
82 |
|
|
! Creation de 3 fichiers pour les differentes grilles horizontales |
83 |
|
|
! Restriction de IOIPSL: seulement 2 coordonnees dans le meme fichier |
84 |
|
|
! Grille Scalaire |
85 |
|
|
call histbeg(dynhistave_file, iip1, rlong(:,1), jjp1, rlat(1,:), & |
86 |
|
|
1, iip1, 1, jjp1, & |
87 |
|
|
tau0, zjulian, tstep, thoriid,histaveid) |
88 |
|
|
|
89 |
|
|
! Creation du fichier histoire pour les grilles en V et U (oblige |
90 |
|
|
! pour l'instant, IOIPSL ne permet pas de grilles avec des nombres |
91 |
|
|
! de point differents dans un meme fichier) |
92 |
|
|
! Grille V |
93 |
|
|
do jj = 1, jjm |
94 |
|
|
do ii = 1, iip1 |
95 |
|
|
rlong(ii,jj) = rlonv(ii) * 180. / pi |
96 |
|
|
rlat(ii,jj) = rlatv(jj) * 180. / pi |
97 |
|
|
enddo |
98 |
|
|
enddo |
99 |
|
|
|
100 |
|
|
call histbeg(dynhistvave_file, iip1, rlong(:,1), jjm, rlat(1,:), & |
101 |
|
|
1, iip1, 1, jjm, & |
102 |
|
|
tau0, zjulian, tstep, vhoriid,histvaveid) |
103 |
|
|
! Grille U |
104 |
|
|
do jj = 1, jjp1 |
105 |
|
|
do ii = 1, iip1 |
106 |
|
|
rlong(ii,jj) = rlonu(ii) * 180. / pi |
107 |
|
|
rlat(ii,jj) = rlatu(jj) * 180. / pi |
108 |
|
|
enddo |
109 |
|
|
enddo |
110 |
|
|
|
111 |
|
|
call histbeg(dynhistuave_file, iip1, rlong(:,1),jjp1, rlat(1,:), & |
112 |
|
|
1, iip1, 1, jjp1, & |
113 |
|
|
tau0, zjulian, tstep, uhoriid,histuaveid) |
114 |
|
|
|
115 |
|
|
! Appel a histvert pour la grille verticale |
116 |
|
|
|
117 |
|
|
call histvert(histaveid,'presnivs','Niveaux Pression approximatifs','mb', & |
118 |
|
|
llm, presnivs/100., zvertiid,'down') |
119 |
|
|
call histvert(histuaveid,'presnivs','Niveaux Pression approximatifs','mb', & |
120 |
|
|
llm, presnivs/100., zvertiid,'down') |
121 |
|
|
call histvert(histvaveid,'presnivs','Niveaux Pression approximatifs','mb', & |
122 |
|
|
llm, presnivs/100., zvertiid,'down') |
123 |
|
|
|
124 |
|
|
! Appels a histdef pour la definition des variables a sauvegarder |
125 |
|
|
|
126 |
|
|
! Vents U |
127 |
|
|
|
128 |
|
|
call histdef(histuaveid, 'u', 'vent u moyen ', & |
129 |
|
|
'm/s', iip1, jjp1, uhoriid, llm, 1, llm, zvertiid, & |
130 |
|
|
32, 'ave(X)', t_ops, t_wrt) |
131 |
|
|
|
132 |
|
|
! Vents V |
133 |
|
|
|
134 |
|
|
call histdef(histvaveid, 'v', 'vent v moyen', & |
135 |
|
|
'm/s', iip1, jjm, vhoriid, llm, 1, llm, zvertiid, & |
136 |
|
|
32, 'ave(X)', t_ops, t_wrt) |
137 |
|
|
|
138 |
|
|
|
139 |
|
|
! Temperature |
140 |
|
|
|
141 |
|
|
call histdef(histaveid, 'temp', 'temperature moyenne', 'K', & |
142 |
|
|
iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & |
143 |
|
|
32, 'ave(X)', t_ops, t_wrt) |
144 |
|
|
|
145 |
|
|
! Temperature potentielle |
146 |
|
|
|
147 |
|
|
call histdef(histaveid, 'theta', 'temperature potentielle', 'K', & |
148 |
|
|
iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & |
149 |
|
|
32, 'ave(X)', t_ops, t_wrt) |
150 |
|
|
|
151 |
|
|
! Geopotentiel |
152 |
|
|
|
153 |
|
|
call histdef(histaveid, 'phi', 'geopotentiel moyen', '-', & |
154 |
|
|
iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & |
155 |
|
|
32, 'ave(X)', t_ops, t_wrt) |
156 |
|
|
|
157 |
|
|
! Traceurs |
158 |
|
|
|
159 |
|
|
! DO iq=1,nqtot |
160 |
|
|
! call histdef(histaveid, tracers(iq)%name, & |
161 |
|
|
! tracers(iq)%longName, '-', & |
162 |
|
|
! iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & |
163 |
|
|
! 32, 'ave(X)', t_ops, t_wrt) |
164 |
|
|
! enddo |
165 |
|
|
|
166 |
|
|
! Masse |
167 |
|
|
|
168 |
|
|
call histdef(histaveid, 'masse', 'masse', 'kg', & |
169 |
|
|
iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & |
170 |
|
|
32, 'ave(X)', t_ops, t_wrt) |
171 |
|
|
|
172 |
|
|
! Pression au sol |
173 |
|
|
|
174 |
|
|
call histdef(histaveid, 'ps', 'pression naturelle au sol', 'Pa', & |
175 |
|
|
iip1, jjp1, thoriid, 1, 1, 1, -99, & |
176 |
|
|
32, 'ave(X)', t_ops, t_wrt) |
177 |
|
|
|
178 |
|
|
! Geopotentiel au sol |
179 |
|
|
|
180 |
|
|
! call histdef(histaveid, 'phis', 'geopotentiel au sol', '-', & |
181 |
|
|
! iip1, jjp1, thoriid, 1, 1, 1, -99, & |
182 |
|
|
! 32, 'ave(X)', t_ops, t_wrt) |
183 |
|
|
|
184 |
|
|
call histend(histaveid) |
185 |
|
|
call histend(histuaveid) |
186 |
|
|
call histend(histvaveid) |
187 |
|
|
#else |
188 |
|
|
write(lunout,*)"initdynav: Warning this routine should not be", & |
189 |
|
|
" used without ioipsl" |
190 |
|
|
#endif |
191 |
|
|
! of #ifdef CPP_IOIPSL |
192 |
|
|
|
193 |
|
|
end subroutine initdynav |