GCC Code Coverage Report


Directory: ./
File: dyn3d_common/inithist.f
Date: 2022-01-11 19:19:34
Exec Total Coverage
Lines: 0 34 0.0%
Branches: 0 24 0.0%

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