source: LMDZ.3.3/branches/rel-LF/libf/bibio/initdynav.F @ 350

Last change on this file since 350 was 350, checked in by lmdzadmin, 22 years ago

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1      subroutine initdynav(infile,day0,anne0,tstep,t_ops,t_wrt
2     .                     ,nq,fileid)
3
4       USE IOIPSL
5       USE histcom
6
7      implicit none
8
9C
10C   Routine d'initialisation des ecritures des fichiers histoires LMDZ
11C   au format IOIPSL. Initialisation du fichier histoire moyenne.
12C
13C   Appels succesifs des routines: histbeg
14C                                  histhori
15C                                  histver
16C                                  histdef
17C                                  histend
18C
19C   Entree:
20C
21C      infile: nom du fichier histoire a creer
22C      day0,anne0: date de reference
23C      tstep : frequence d'ecriture
24C      t_ops: frequence de l'operation pour IOIPSL
25C      t_wrt: frequence d'ecriture sur le fichier
26C      nq: nombre de traceurs
27C
28C   Sortie:
29C      fileid: ID du fichier netcdf cree
30C
31C   L. Fairhead, LMD, 03/99
32C
33C =====================================================================
34C
35C   Declarations
36#include "dimensions.h"
37#include "paramet.h"
38#include "comconst.h"
39#include "comvert.h"
40#include "comgeom.h"
41#include "temps.h"
42#include "ener.h"
43#include "logic.h"
44#include "description.h"
45#include "serre.h"
46
47C   Arguments
48C
49      character*(*) infile
50      integer*4 day0, anne0
51      real tstep, t_ops, t_wrt
52      integer fileid
53      integer nq
54      integer thoriid, zvertiid
55
56C   Variables locales
57C
58      integer tau0
59      real zjulian
60      character*3 str
61      character*10 ctrac
62      integer iq
63      real rlong(iip1,jjp1), rlat(iip1,jjp1)
64      integer ii,jj
65      integer zan, dayref
66C
67C  Initialisations
68C
69      pi = 4. * atan (1.)
70      str='q  '
71      ctrac = 'traceur   '
72C
73C  Appel a histbeg: creation du fichier netcdf et initialisations diverses
74C         
75
76      zan = anne0
77      dayref = day0
78      CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)
79      tau0 = itau_dyn
80     
81      do jj = 1, jjp1
82        do ii = 1, iip1
83          rlong(ii,jj) = rlonv(ii) * 180. / pi
84          rlat(ii,jj)  = rlatu(jj) * 180. / pi
85        enddo
86      enddo
87       
88      call histbeg(infile, iip1, rlong(:,1), jjp1, rlat(1,:),
89     .             1, iip1, 1, jjp1,
90     .             tau0, zjulian, tstep, thoriid, fileid)
91
92C
93C  Appel a histvert pour la grille verticale
94C
95      call histvert(fileid, 'sigss', 'Niveaux sigma','Pa',
96     .              llm, nivsigs, zvertiid)
97C
98C  Appels a histdef pour la definition des variables a sauvegarder
99C
100C  Vents U
101C
102      write(6,*)'inithistave',tstep
103      call histdef(fileid, 'u', 'vents u scalaires moyennes',
104     .             'm/s', iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
105     .             32, 'ave(X)', t_ops, t_wrt)
106
107C
108C  Vents V
109C
110      call histdef(fileid, 'v', 'vents v scalaires moyennes',
111     .             'm/s', iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
112     .             32, 'ave(X)', t_ops, t_wrt)
113
114C
115C  Temperature
116C
117      call histdef(fileid, 'temp', 'temperature moyennee', 'K',
118     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
119     .             32, 'ave(X)', t_ops, t_wrt)
120C
121C  Temperature potentielle
122C
123      call histdef(fileid, 'theta', 'temperature potentielle', 'K',
124     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
125     .             32, 'ave(X)', 7200., 7200.)
126
127
128C
129C  Geopotentiel
130C
131      call histdef(fileid, 'phi', 'geopotentiel moyenne', '-',
132     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
133     .             32, 'ave(X)', t_ops, t_wrt)
134C
135C  Traceurs
136C
137      IF(nq.GE.1) THEN
138        DO iq=1,nq
139          IF ( iq.LE.9 ) THEN
140            WRITE(str(2:2),'(i1.1)') iq
141            write(ctrac(9:9),'(i1.1)') iq
142          ELSE
143            WRITE(str(2:3),'(i2.2)') iq
144            write(ctrac(9:10),'(i2.2)') iq
145          ENDIF
146          call histdef(fileid, str, ctrac, '-',
147     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
148     .             32, 'ave(X)', t_ops, t_wrt)
149        enddo
150      endif
151C
152C  Masse
153C
154      call histdef(fileid, 'masse', 'masse', 'kg',
155     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
156     .             32, 'ave(X)', t_ops, t_wrt)
157C
158C  Pression au sol
159C
160      call histdef(fileid, 'ps', 'pression naturelle au sol', 'Pa',
161     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
162     .             32, 'ave(X)', t_ops, t_wrt)
163C
164C  Pression au sol
165C
166      call histdef(fileid, 'phis', 'geopotentiel au sol', '-',
167     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
168     .             32, 'ave(X)', t_ops, t_wrt)
169C
170C  Fin
171C
172      call histend(fileid)
173      return
174      end
Note: See TracBrowser for help on using the repository browser.