source: LMDZ5/trunk/libf/dyn3d_common/inithist.F @ 2600

Last change on this file since 2600 was 2600, checked in by Ehouarn Millour, 8 years ago

Cleanup in the dynamics: turn comvert.h into module comvert_mod.F90
EM

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