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

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

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