source: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inithist.F90 @ 5159

Last change on this file since 5159 was 5159, checked in by abarral, 7 weeks ago

Put dimensions.h and paramet.h into modules

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1! $Id: inithist.F90 5159 2024-08-02 19:58:25Z abarral $
2
3SUBROUTINE inithist(day0, anne0, tstep, t_ops, t_wrt)
4
5  USE IOIPSL
6  USE infotrac, ONLY: nqtot
7  USE com_io_dyn_mod, ONLY: histid, histvid, histuid, &
8          dynhist_file, dynhistv_file, dynhistu_file
9  USE comconst_mod, ONLY: pi
10  USE comvert_mod, ONLY: presnivs
11  USE temps_mod, ONLY: itau_dyn
12  USE lmdz_description, ONLY: descript
13  USE lmdz_iniprint, ONLY: lunout, prt_level
14  USE lmdz_comgeom
15
16  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
17  USE lmdz_paramet
18  IMPLICIT NONE
19
20
21  !   Routine d'initialisation des ecritures des fichiers histoires LMDZ
22  !   au format IOIPSL
23
24  !   Appels succesifs des routines: histbeg
25  !                              histhori
26  !                              histver
27  !                              histdef
28  !                              histend
29
30  !   Entree:
31
32  !  infile: nom du fichier histoire a creer
33  !  day0,anne0: date de reference
34  !  tstep: duree du pas de temps en seconde
35  !  t_ops: frequence de l'operation pour IOIPSL
36  !  t_wrt: frequence d'ecriture sur le fichier
37  !  nq: nombre de traceurs
38
39
40  !   L. Fairhead, LMD, 03/99
41
42  ! =====================================================================
43
44  !   Declarations
45
46
47
48  !   Arguments
49
50  INTEGER :: day0, anne0
51  REAL :: tstep, t_ops, t_wrt
52
53  ! This routine needs IOIPSL to work
54  !   Variables locales
55
56  INTEGER :: tau0
57  REAL :: zjulian
58  INTEGER :: iq
59  REAL :: rlong(iip1, jjp1), rlat(iip1, jjp1)
60  INTEGER :: uhoriid, vhoriid, thoriid, zvertiid
61  INTEGER :: ii, jj
62  INTEGER :: zan, dayref
63
64  !  Initialisations
65
66  pi = 4. * atan (1.)
67
68  !  Appel a histbeg: creation du fichier netcdf et initialisations diverses
69  !
70
71  zan = anne0
72  dayref = day0
73  CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)
74  tau0 = itau_dyn
75
76  ! -------------------------------------------------------------
77  ! Creation des 3 fichiers pour les grilles horizontales U,V,Scal
78  ! -------------------------------------------------------------
79  !Grille U
80  DO jj = 1, jjp1
81    DO ii = 1, iip1
82      rlong(ii, jj) = rlonu(ii) * 180. / pi
83      rlat(ii, jj) = rlatu(jj) * 180. / pi
84    enddo
85  enddo
86
87  CALL histbeg(dynhistu_file, iip1, rlong(:, 1), jjp1, rlat(1, :), &
88          1, iip1, 1, jjp1, &
89          tau0, zjulian, tstep, uhoriid, histuid)
90
91  ! Grille V
92  DO jj = 1, jjm
93    DO ii = 1, iip1
94      rlong(ii, jj) = rlonv(ii) * 180. / pi
95      rlat(ii, jj) = rlatv(jj) * 180. / pi
96    enddo
97  enddo
98
99  CALL histbeg(dynhistv_file, iip1, rlong(:, 1), jjm, rlat(1, :), &
100          1, iip1, 1, jjm, &
101          tau0, zjulian, tstep, vhoriid, histvid)
102
103  !Grille Scalaire
104  DO jj = 1, jjp1
105    DO ii = 1, iip1
106      rlong(ii, jj) = rlonv(ii) * 180. / pi
107      rlat(ii, jj) = rlatu(jj) * 180. / pi
108    enddo
109  enddo
110
111  CALL histbeg(dynhist_file, iip1, rlong(:, 1), jjp1, rlat(1, :), &
112          1, iip1, 1, jjp1, &
113          tau0, zjulian, tstep, thoriid, histid)
114  ! -------------------------------------------------------------
115  !  Appel a histvert pour la grille verticale
116  ! -------------------------------------------------------------
117  CALL histvert(histid, 'presnivs', 'Niveaux pression', 'mb', &
118          llm, presnivs / 100., zvertiid, 'down')
119  CALL histvert(histvid, 'presnivs', 'Niveaux pression', 'mb', &
120          llm, presnivs / 100., zvertiid, 'down')
121  CALL histvert(histuid, 'presnivs', 'Niveaux pression', 'mb', &
122          llm, presnivs / 100., zvertiid, 'down')
123
124  ! -------------------------------------------------------------
125  !  Appels a histdef pour la definition des variables a sauvegarder
126  ! -------------------------------------------------------------
127
128  !  Vents U
129
130  CALL histdef(histuid, 'u', 'vent u', 'm/s', &
131          iip1, jjp1, uhoriid, llm, 1, llm, zvertiid, &
132          32, 'inst(X)', t_ops, t_wrt)
133
134  !  Vents V
135
136  CALL histdef(histvid, 'v', 'vent v', 'm/s', &
137          iip1, jjm, vhoriid, llm, 1, llm, zvertiid, &
138          32, 'inst(X)', t_ops, t_wrt)
139
140
141  !  Temperature potentielle
142
143  CALL histdef(histid, 'teta', 'temperature potentielle', '-', &
144          iip1, jjp1, thoriid, llm, 1, llm, zvertiid, &
145          32, 'inst(X)', t_ops, t_wrt)
146
147  !  Geopotentiel
148
149  CALL histdef(histid, 'phi', 'geopotentiel', '-', &
150          iip1, jjp1, thoriid, llm, 1, llm, zvertiid, &
151          32, 'inst(X)', t_ops, t_wrt)
152
153  !  Traceurs
154  !
155
156  !    DO iq=1,nqtot
157  !      CALL histdef(histid, tracers(iq)%name,
158  !                           tracers(iq)%longName, '-',
159  ! .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
160  ! .             32, 'inst(X)', t_ops, t_wrt)
161  !    enddo
162  !C
163  !  Masse
164
165  CALL histdef(histid, 'masse', 'masse', 'kg', &
166          iip1, jjp1, thoriid, llm, 1, llm, zvertiid, &
167          32, 'inst(X)', t_ops, t_wrt)
168
169  !  Pression au sol
170
171  CALL histdef(histid, 'ps', 'pression naturelle au sol', 'Pa', &
172          iip1, jjp1, thoriid, 1, 1, 1, -99, &
173          32, 'inst(X)', t_ops, t_wrt)
174
175  !  Geopotentiel au sol
176  !C
177  !  CALL histdef(histid, 'phis', 'geopotentiel au sol', '-',
178  ! .             iip1, jjp1, thoriid, 1, 1, 1, -99,
179  ! .             32, 'inst(X)', t_ops, t_wrt)
180  !C
181  !  Fin
182
183  CALL histend(histid)
184  CALL histend(histuid)
185  CALL histend(histvid)
186END SUBROUTINE  inithist
Note: See TracBrowser for help on using the repository browser.