source: LMDZ6/trunk/libf/dyn3d_common/inithist.f90 @ 5272

Last change on this file since 5272 was 5272, checked in by abarral, 23 hours ago

Turn paramet.h into a module

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