/[lmdze]/trunk/Sources/phylmd/initphysto.f
ViewVC logotype

Contents of /trunk/Sources/phylmd/initphysto.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 190 - (show annotations)
Thu Apr 14 15:15:56 2016 UTC (8 years ago) by guez
File size: 5677 byte(s)
Created module cv_thermo_m around procedure cv_thermo. Moved variables
from module cvthermo to module cv_thermo_m, where they are defined.

In ini_histins and initphysto, using part of rlon and rlat from
phyetat0_m is pretending that we do not know about the dynamical grid,
while the way we extract zx_lon(:, 1) and zx_lat(1, :) depends on
ordering inside rlon and rlat. So we might as well simplify and
clarify by using directly rlonv and rlatu.

Removed intermediary variables in write_histins and phystokenc.

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

  ViewVC Help
Powered by ViewVC 1.1.21