source: LMDZ5/trunk/libf/dyn3dpar/initdynav_p.F @ 3981

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

Some code tidying: turn ener.h into ener_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.0 KB
RevLine 
[763]1!
[1279]2! $Id: initdynav_p.F 2622 2016-09-04 06:12:02Z fairhead $
[763]3!
[1146]4      subroutine initdynav_p(infile,day0,anne0,tstep,t_ops,t_wrt,fileid)
[763]5
[1279]6#ifdef CPP_IOIPSL
7! This routine needs IOIPSL
[763]8       USE IOIPSL
[1279]9#endif
[1823]10       USE parallel_lmdz
[763]11       use Write_field
12       use misc_mod
[1146]13       USE infotrac
[2597]14       USE comconst_mod, ONLY: pi
[2600]15       USE comvert_mod, ONLY: nivsigs
[2601]16       USE temps_mod, ONLY: itau_dyn
[1146]17
[763]18      implicit none
19
20C
21C   Routine d'initialisation des ecritures des fichiers histoires LMDZ
22C   au format IOIPSL. Initialisation du fichier histoire moyenne.
23C
24C   Appels succesifs des routines: histbeg
25C                                  histhori
26C                                  histver
27C                                  histdef
28C                                  histend
29C
30C   Entree:
31C
32C      infile: nom du fichier histoire a creer
33C      day0,anne0: date de reference
34C      tstep : frequence d'ecriture
35C      t_ops: frequence de l'operation pour IOIPSL
36C      t_wrt: frequence d'ecriture sur le fichier
37C
38C   Sortie:
39C      fileid: ID du fichier netcdf cree
40C
41C   L. Fairhead, LMD, 03/99
42C
43C =====================================================================
44C
45C   Declarations
46#include "dimensions.h"
47#include "paramet.h"
48#include "comgeom.h"
49#include "description.h"
[1279]50#include "iniprint.h"
[763]51
52C   Arguments
53C
54      character*(*) infile
55      integer*4 day0, anne0
56      real tstep, t_ops, t_wrt
57      integer fileid
58
[1279]59#ifdef CPP_IOIPSL
60! This routine needs IOIPSL
[763]61C   Variables locales
62C
[1279]63      integer thoriid, zvertiid
[763]64      integer tau0
65      real zjulian
66      integer iq
67      real rlong(iip1,jjp1), rlat(iip1,jjp1)
68      integer ii,jj
69      integer zan, dayref
70      integer :: jjb,jje,jjn
[1000]71
72! definition du domaine d'ecriture pour le rebuild
73
74      INTEGER,DIMENSION(2) :: ddid
75      INTEGER,DIMENSION(2) :: dsg
76      INTEGER,DIMENSION(2) :: dsl
77      INTEGER,DIMENSION(2) :: dpf
78      INTEGER,DIMENSION(2) :: dpl
79      INTEGER,DIMENSION(2) :: dhs
80      INTEGER,DIMENSION(2) :: dhe
[763]81     
[1000]82      INTEGER :: dynave_domain_id
83     
[763]84      if (adjust) return
85C
86C  Initialisations
87C
88      pi = 4. * atan (1.)
89C
90C  Appel a histbeg: creation du fichier netcdf et initialisations diverses
91C         
92
93      zan = anne0
94      dayref = day0
95      CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)
96      tau0 = itau_dyn
97     
98      do jj = 1, jjp1
99        do ii = 1, iip1
100          rlong(ii,jj) = rlonv(ii) * 180. / pi
101          rlat(ii,jj)  = rlatu(jj) * 180. / pi
102        enddo
103      enddo
104
105      jjb=jj_begin
106      jje=jj_end
107      jjn=jj_nb
[1000]108
109      ddid=(/ 1,2 /)
110      dsg=(/ iip1,jjp1 /)
111      dsl=(/ iip1,jjn /)
112      dpf=(/ 1,jjb /)
113      dpl=(/ iip1,jje /)
114      dhs=(/ 0,0 /)
115      dhe=(/ 0,0 /)
116
117      call flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe,
118     .                 'box',dynave_domain_id)
[763]119             
[1000]120      call histbeg(trim(infile),iip1, rlong(:,1), jjn, rlat(1,jjb:jje),
121     .             1, iip1, 1, jjn,tau0, zjulian, tstep, thoriid,
122     .             fileid,dynave_domain_id)
[763]123
124C
125C  Appel a histvert pour la grille verticale
126C
127      call histvert(fileid, 'sigss', 'Niveaux sigma','Pa',
128     .              llm, nivsigs, zvertiid)
129C
130C  Appels a histdef pour la definition des variables a sauvegarder
131C
132C  Vents U
133C
134      write(6,*)'inithistave',tstep
135      call histdef(fileid, 'u', 'vents u scalaires moyennes',
136     .             'm/s', iip1, jjn, thoriid, llm, 1, llm, zvertiid,
137     .             32, 'ave(X)', t_ops, t_wrt)
138
139C
140C  Vents V
141C
142      call histdef(fileid, 'v', 'vents v scalaires moyennes',
143     .             'm/s', iip1, jjn, thoriid, llm, 1, llm, zvertiid,
144     .             32, 'ave(X)', t_ops, t_wrt)
145
146C
147C  Temperature
148C
149      call histdef(fileid, 'temp', 'temperature moyennee', 'K',
150     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
151     .             32, 'ave(X)', t_ops, t_wrt)
152C
153C  Temperature potentielle
154C
155      call histdef(fileid, 'theta', 'temperature potentielle', 'K',
156     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
157     .             32, 'ave(X)', t_ops, t_wrt)
158
159
160C
161C  Geopotentiel
162C
163      call histdef(fileid, 'phi', 'geopotentiel moyenne', '-',
164     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
165     .             32, 'ave(X)', t_ops, t_wrt)
166C
167C  Traceurs
168C
[1146]169        DO iq=1,nqtot
[763]170          call histdef(fileid, ttext(iq), ttext(iq), '-',
171     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
172     .             32, 'ave(X)', t_ops, t_wrt)
173        enddo
174C
175C  Masse
176C
177      call histdef(fileid, 'masse', 'masse', 'kg',
178     .             iip1, jjn, thoriid, 1, 1, 1, -99,
179     .             32, 'ave(X)', t_ops, t_wrt)
180C
181C  Pression au sol
182C
183      call histdef(fileid, 'ps', 'pression naturelle au sol', 'Pa',
184     .             iip1, jjn, thoriid, 1, 1, 1, -99,
185     .             32, 'ave(X)', t_ops, t_wrt)
186C
187C  Pression au sol
188C
189      call histdef(fileid, 'phis', 'geopotentiel au sol', '-',
190     .             iip1, jjn, thoriid, 1, 1, 1, -99,
191     .             32, 'ave(X)', t_ops, t_wrt)
192C
193C  Fin
194C
195      call histend(fileid)
[1279]196#else
197      write(lunout,*)'initdynav_p: Needs IOIPSL to function'
198#endif
199! #endif of #ifdef CPP_IOIPSL
[763]200      return
201      end
Note: See TracBrowser for help on using the repository browser.