1 |
guez |
155 |
module initphysto_m |
2 |
guez |
3 |
|
3 |
guez |
155 |
IMPLICIT NONE |
4 |
guez |
3 |
|
5 |
guez |
155 |
contains |
6 |
guez |
3 |
|
7 |
guez |
190 |
SUBROUTINE initphysto(infile, tstep, t_ops, t_wrt, fileid) |
8 |
guez |
3 |
|
9 |
guez |
190 |
! From phylmd/initphysto.F, v 1.2 2004/06/22 11:45:32 |
10 |
guez |
3 |
|
11 |
guez |
190 |
! Routine d'initialisation des ecritures des fichiers histoires LMDZ |
12 |
|
|
! au format IOIPSL |
13 |
guez |
3 |
|
14 |
guez |
190 |
! L. Fairhead, 03/99 |
15 |
guez |
3 |
|
16 |
guez |
190 |
use dynetat0_m, only: day_ref, annee_ref, rlatu, rlonv |
17 |
guez |
155 |
USE histbeg_totreg_m, ONLY : histbeg_totreg |
18 |
|
|
USE histdef_m, ONLY : histdef |
19 |
|
|
USE histend_m, ONLY : histend |
20 |
|
|
use histsync_m, only: histsync |
21 |
|
|
USE histvert_m, ONLY : histvert |
22 |
guez |
190 |
USE dimens_m, only: iim, jjm, llm |
23 |
|
|
use nr_util, only: pi |
24 |
|
|
USE ymds2ju_m, only: ymds2ju |
25 |
guez |
3 |
|
26 |
guez |
190 |
! Entree: |
27 |
|
|
|
28 |
|
|
! infile: nom du fichier histoire a creer |
29 |
|
|
! day0, anne0: date de reference |
30 |
|
|
! tstep: duree du pas de temps en seconde |
31 |
|
|
! t_ops: frequence de l'operation pour IOIPSL |
32 |
|
|
! t_wrt: frequence d'ecriture sur le fichier |
33 |
|
|
|
34 |
|
|
! Sortie: |
35 |
|
|
! fileid: ID du fichier netcdf cree |
36 |
|
|
! filevid:ID du fichier netcdf pour la grille v |
37 |
|
|
|
38 |
|
|
! Arguments |
39 |
guez |
155 |
CHARACTER(len=*) infile |
40 |
guez |
190 |
INTEGER nhoriid |
41 |
guez |
155 |
REAL, INTENT (IN) :: tstep |
42 |
|
|
REAL t_ops, t_wrt |
43 |
|
|
INTEGER fileid |
44 |
|
|
INTEGER l |
45 |
|
|
REAL nivsigs(llm) |
46 |
guez |
3 |
|
47 |
guez |
190 |
! Variables locales |
48 |
guez |
3 |
|
49 |
guez |
155 |
INTEGER tau0 |
50 |
|
|
REAL zjulian |
51 |
|
|
INTEGER zvertiid |
52 |
|
|
LOGICAL ok_sync |
53 |
guez |
3 |
|
54 |
guez |
155 |
!----------------------------------------------------- |
55 |
guez |
3 |
|
56 |
guez |
190 |
! Initialisations |
57 |
guez |
155 |
ok_sync = .TRUE. |
58 |
guez |
3 |
|
59 |
guez |
190 |
! Appel a histbeg: creation du fichier netcdf et initialisations |
60 |
|
|
! diverses |
61 |
guez |
3 |
|
62 |
guez |
190 |
CALL ymds2ju(annee_ref, 1, day_ref, 0.0, zjulian) |
63 |
guez |
155 |
tau0 = 0 |
64 |
guez |
3 |
|
65 |
guez |
190 |
CALL histbeg_totreg(infile, rlonv(:iim) / pi * 180., rlatu / pi * 180., & |
66 |
|
|
1, iim, 1, jjm+1, tau0, zjulian, tstep, nhoriid, fileid) |
67 |
guez |
3 |
|
68 |
guez |
190 |
! Appel a histvert pour la grille verticale |
69 |
guez |
3 |
|
70 |
guez |
155 |
DO l = 1, llm |
71 |
guez |
208 |
nivsigs(l) = real(l) |
72 |
guez |
155 |
END DO |
73 |
guez |
3 |
|
74 |
guez |
190 |
CALL histvert(fileid, 'sig_s', 'Niveaux sigma', 'sigma_level', nivsigs, & |
75 |
guez |
155 |
zvertiid) |
76 |
guez |
3 |
|
77 |
guez |
190 |
! Appels a histdef pour la definition des variables a sauvegarder |
78 |
guez |
3 |
|
79 |
guez |
190 |
CALL histdef(fileid, 'phis', 'Surface geop. height', '-', iim, jjm+1, nhoriid, & |
80 |
|
|
1, 1, 1, -99, 'once', t_ops, t_wrt) |
81 |
guez |
3 |
|
82 |
guez |
190 |
CALL histdef(fileid, 'aire', 'Grid area', '-', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
83 |
|
|
'once', t_ops, t_wrt) |
84 |
guez |
3 |
|
85 |
guez |
190 |
CALL histdef(fileid, 'dtime', 'tps phys ', 's', 1, 1, nhoriid, 1, 1, 1, -99, & |
86 |
|
|
'once', t_ops, t_wrt) |
87 |
guez |
3 |
|
88 |
guez |
190 |
CALL histdef(fileid, 'istphy', 'tps stock', 's', 1, 1, nhoriid, 1, 1, 1, -99, & |
89 |
|
|
'once', t_ops, t_wrt) |
90 |
guez |
3 |
|
91 |
guez |
155 |
! T |
92 |
guez |
3 |
|
93 |
guez |
190 |
CALL histdef(fileid, 't', 'Temperature', 'K', iim, jjm+1, nhoriid, llm, 1, llm, & |
94 |
|
|
zvertiid, 'inst(X)', t_ops, t_wrt) |
95 |
guez |
31 |
|
96 |
guez |
190 |
CALL histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s', iim, jjm+1, nhoriid, & |
97 |
|
|
llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
98 |
guez |
31 |
|
99 |
guez |
190 |
CALL histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s', iim, jjm+1, nhoriid, & |
100 |
|
|
llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
101 |
guez |
31 |
|
102 |
guez |
155 |
! en_u |
103 |
guez |
31 |
|
104 |
guez |
190 |
CALL histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', iim, jjm+1, nhoriid, & |
105 |
|
|
llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
106 |
guez |
31 |
|
107 |
guez |
190 |
CALL histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s', iim, jjm+1, nhoriid, & |
108 |
|
|
llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
109 |
guez |
31 |
|
110 |
guez |
155 |
! en_d |
111 |
guez |
31 |
|
112 |
guez |
190 |
CALL histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', iim, jjm+1, nhoriid, & |
113 |
|
|
llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
114 |
guez |
31 |
|
115 |
guez |
155 |
! de_d |
116 |
guez |
31 |
|
117 |
guez |
190 |
CALL histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', iim, jjm+1, nhoriid, & |
118 |
|
|
llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
119 |
guez |
31 |
|
120 |
guez |
190 |
! coefh frac_impa, frac_nucl |
121 |
guez |
31 |
|
122 |
guez |
190 |
CALL histdef(fileid, 'coefh', ' ', ' ', iim, jjm+1, nhoriid, llm, 1, llm, & |
123 |
|
|
zvertiid, 'inst(X)', t_ops, t_wrt) |
124 |
guez |
31 |
|
125 |
guez |
155 |
! abderrahmane le 16 09 02 |
126 |
guez |
190 |
CALL histdef(fileid, 'fm_th', ' ', ' ', iim, jjm+1, nhoriid, llm, 1, llm, & |
127 |
|
|
zvertiid, 'inst(X)', t_ops, t_wrt) |
128 |
guez |
31 |
|
129 |
guez |
190 |
CALL histdef(fileid, 'en_th', ' ', ' ', iim, jjm+1, nhoriid, llm, 1, llm, & |
130 |
|
|
zvertiid, 'inst(X)', t_ops, t_wrt) |
131 |
guez |
155 |
! fin aj |
132 |
guez |
31 |
|
133 |
guez |
190 |
CALL histdef(fileid, 'frac_impa', ' ', ' ', iim, jjm+1, nhoriid, llm, 1, llm, & |
134 |
|
|
zvertiid, 'inst(X)', t_ops, t_wrt) |
135 |
guez |
31 |
|
136 |
guez |
190 |
CALL histdef(fileid, 'frac_nucl', ' ', ' ', iim, jjm+1, nhoriid, llm, 1, llm, & |
137 |
|
|
zvertiid, 'inst(X)', t_ops, t_wrt) |
138 |
guez |
31 |
|
139 |
guez |
155 |
! pyu1 |
140 |
guez |
31 |
|
141 |
guez |
190 |
CALL histdef(fileid, 'pyu1', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
142 |
|
|
'inst(X)', t_ops, t_wrt) |
143 |
guez |
31 |
|
144 |
guez |
155 |
! pyv1 |
145 |
guez |
31 |
|
146 |
guez |
190 |
CALL histdef(fileid, 'pyv1', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
147 |
|
|
'inst(X)', t_ops, t_wrt) |
148 |
guez |
31 |
|
149 |
guez |
190 |
CALL histdef(fileid, 'ftsol1', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
150 |
|
|
'inst(X)', t_ops, t_wrt) |
151 |
guez |
31 |
|
152 |
guez |
155 |
! ftsol2 |
153 |
guez |
31 |
|
154 |
guez |
190 |
CALL histdef(fileid, 'ftsol2', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
155 |
|
|
'inst(X)', t_ops, t_wrt) |
156 |
guez |
31 |
|
157 |
guez |
155 |
! ftsol3 |
158 |
guez |
31 |
|
159 |
guez |
190 |
CALL histdef(fileid, 'ftsol3', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
160 |
|
|
'inst(X)', t_ops, t_wrt) |
161 |
guez |
31 |
|
162 |
guez |
155 |
! ftsol4 |
163 |
guez |
31 |
|
164 |
guez |
190 |
CALL histdef(fileid, 'ftsol4', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
165 |
|
|
'inst(X)', t_ops, t_wrt) |
166 |
guez |
31 |
|
167 |
guez |
155 |
! rain |
168 |
guez |
31 |
|
169 |
guez |
190 |
CALL histdef(fileid, 'rain', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
170 |
|
|
'inst(X)', t_ops, t_wrt) |
171 |
guez |
31 |
|
172 |
guez |
155 |
! psrf1 |
173 |
guez |
31 |
|
174 |
guez |
190 |
CALL histdef(fileid, 'psrf1', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
175 |
|
|
'inst(X)', t_ops, t_wrt) |
176 |
guez |
31 |
|
177 |
guez |
155 |
! psrf2 |
178 |
guez |
31 |
|
179 |
guez |
190 |
CALL histdef(fileid, 'psrf2', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
180 |
|
|
'inst(X)', t_ops, t_wrt) |
181 |
guez |
31 |
|
182 |
guez |
155 |
! psrf3 |
183 |
guez |
31 |
|
184 |
guez |
190 |
CALL histdef(fileid, 'psrf3', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
185 |
|
|
'inst(X)', t_ops, t_wrt) |
186 |
guez |
31 |
|
187 |
guez |
155 |
! psrf4 |
188 |
guez |
31 |
|
189 |
guez |
190 |
CALL histdef(fileid, 'psrf4', ' ', ' ', iim, jjm+1, nhoriid, 1, 1, 1, -99, & |
190 |
|
|
'inst(X)', t_ops, t_wrt) |
191 |
guez |
155 |
|
192 |
|
|
CALL histend(fileid) |
193 |
|
|
IF (ok_sync) CALL histsync |
194 |
|
|
|
195 |
|
|
END SUBROUTINE initphysto |
196 |
|
|
|
197 |
|
|
end module initphysto_m |