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

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

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