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

Last change on this file since 2602 was 2601, checked in by Ehouarn Millour, 9 years ago

Cleanup in the dynamics: turn temps.h into module temps_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
RevLine 
[524]1!
[1279]2! $Id: inithist.F 2601 2016-07-24 09:51:55Z emillour $
[524]3!
[1403]4      subroutine inithist(day0,anne0,tstep,t_ops,t_wrt)
[524]5
[1279]6#ifdef CPP_IOIPSL
[524]7       USE IOIPSL
[1279]8#endif
[1146]9       USE infotrac, ONLY : nqtot, ttext
[1403]10       use com_io_dyn_mod, only : histid,histvid,histuid,               &
11     &                        dynhist_file,dynhistv_file,dynhistu_file
[2597]12       USE comconst_mod, ONLY: pi
[2600]13       USE comvert_mod, ONLY: presnivs
[2601]14       USE temps_mod, ONLY: itau_dyn
15       
[524]16      implicit none
17
18C
19C   Routine d'initialisation des ecritures des fichiers histoires LMDZ
20C   au format IOIPSL
21C
22C   Appels succesifs des routines: histbeg
23C                                  histhori
24C                                  histver
25C                                  histdef
26C                                  histend
27C
28C   Entree:
29C
30C      infile: nom du fichier histoire a creer
31C      day0,anne0: date de reference
32C      tstep: duree du pas de temps en seconde
33C      t_ops: frequence de l'operation pour IOIPSL
34C      t_wrt: frequence d'ecriture sur le fichier
35C      nq: nombre de traceurs
36C
37C
38C   L. Fairhead, LMD, 03/99
39C
40C =====================================================================
41C
42C   Declarations
[2597]43      include "dimensions.h"
44      include "paramet.h"
45      include "comgeom.h"
46      include "ener.h"
47      include "logic.h"
48      include "description.h"
49      include "iniprint.h"
[524]50
51C   Arguments
52C
[1279]53      integer day0, anne0
[524]54      real tstep, t_ops, t_wrt
55
[1279]56#ifdef CPP_IOIPSL
57! This routine needs IOIPSL to work
[524]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     
[1403]80! -------------------------------------------------------------
81! Creation des 3 fichiers pour les grilles horizontales U,V,Scal
82! -------------------------------------------------------------
83!Grille U     
[524]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       
[1403]91      call histbeg(dynhistu_file, iip1, rlong(:,1), jjp1, rlat(1,:),
[524]92     .             1, iip1, 1, jjp1,
[1403]93     .             tau0, zjulian, tstep, uhoriid, histuid)
[524]94
[1403]95! Grille V
[524]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
[1403]103      call histbeg(dynhistv_file, iip1, rlong(:,1), jjm, rlat(1,:),
[524]104     .             1, iip1, 1, jjm,
[1403]105     .             tau0, zjulian, tstep, vhoriid, histvid)
106
107!Grille Scalaire
[524]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
[1403]115      call histbeg(dynhist_file, iip1, rlong(:,1), jjp1, rlat(1,:),
116     .             1, iip1, 1, jjp1,
117     .             tau0, zjulian, tstep, thoriid, histid)
118! -------------------------------------------------------------
[524]119C  Appel a histvert pour la grille verticale
[1403]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')
[524]127C
[1403]128! -------------------------------------------------------------
[524]129C  Appels a histdef pour la definition des variables a sauvegarder
[1403]130! -------------------------------------------------------------
[524]131C
132C  Vents U
133C
[1403]134      call histdef(histuid, 'u', 'vent u', 'm/s',
[524]135     .             iip1, jjp1, uhoriid, llm, 1, llm, zvertiid,
136     .             32, 'inst(X)', t_ops, t_wrt)
137C
138C  Vents V
139C
[1403]140      call histdef(histvid, 'v', 'vent v', 'm/s',
[524]141     .             iip1, jjm, vhoriid, llm, 1, llm, zvertiid,
142     .             32, 'inst(X)', t_ops, t_wrt)
143
144C
145C  Temperature potentielle
146C
[1403]147      call histdef(histid, 'teta', 'temperature potentielle', '-',
[524]148     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
149     .             32, 'inst(X)', t_ops, t_wrt)
150C
151C  Geopotentiel
152C
[1403]153      call histdef(histid, 'phi', 'geopotentiel', '-',
[524]154     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
155     .             32, 'inst(X)', t_ops, t_wrt)
156C
157C  Traceurs
158C
[1403]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
[524]166C  Masse
167C
[1403]168      call histdef(histid, 'masse', 'masse', 'kg',
169     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
[524]170     .             32, 'inst(X)', t_ops, t_wrt)
171C
172C  Pression au sol
173C
[1403]174      call histdef(histid, 'ps', 'pression naturelle au sol', 'Pa',
[524]175     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
176     .             32, 'inst(X)', t_ops, t_wrt)
177C
[1403]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
[524]184C  Fin
185C
[1403]186      call histend(histid)
187      call histend(histuid)
188      call histend(histvid)
[1279]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
[524]195      return
196      end
Note: See TracBrowser for help on using the repository browser.