source: LMDZ6/branches/LMDZ-tracers/libf/dyn3d_common/inithist.F @ 3895

Last change on this file since 3895 was 3852, checked in by dcugnet, 3 years ago

Extension of the tracers management.

The tracers files can be:

1) "traceur.def": old format, with:

  • the number of tracers on the first line
  • one line for each tracer: <tracer name> <hadv> <vadv> [<parent name>]

2) "tracer.def": new format with one section each model component.
3) "tracer_<name>.def": new format with a single section.

The formats 2 and 3 reading is driven by the "type_trac" key, which can be a

coma-separated list of components.

  • Format 2: read the sections from the "tracer.def" file.
  • format 3: read one section each "tracer_<section name>.def" file.
  • the first line of a section is "&<section name>
  • the other lines start with a tracer name followed by <key>=<val> pairs.
  • the "default" tracer name is reserved ; the other tracers of the section inherit its <key>=<val>, except for the keys that are redefined locally.

This format helps keeping the tracers files compact, thanks to the "default"
special tracer and the three levels of factorization:

  • on the tracers names: a tracer name can be a coma-separated list of tracers => all the tracers of the list have the same <key>=<val> properties
  • on the parents names: the value of the "parent" property can be a coma-separated list of tracers => only possible for geographic tagging tracers
  • on the phases: the property "phases" is [g](l][s] (gas/liquid/solid)

Read information is stored in the vector "tracers(:)", of derived type "tra".

"isotopes_params.def" is a similar file, with one section each isotopes family.
It contains a database of isotopes properties ; if there are second generation
tracers (isotopes), the corresponding sections are read.

Read information is stored in the vector "isotopes(:)", of derived type "iso".

The "getKey" function helps to get the values of the parameters stored in
"tracers" or "isotopes".

  • 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 3852 2021-02-22 16:28:31Z 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
10       use com_io_dyn_mod, only : histid,histvid,histuid,               &
11     &                        dynhist_file,dynhistv_file,dynhistu_file
12       USE comconst_mod, ONLY: pi
13       USE comvert_mod, ONLY: presnivs
14       USE temps_mod, ONLY: itau_dyn
15       
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
43      include "dimensions.h"
44      include "paramet.h"
45      include "comgeom.h"
46      include "description.h"
47      include "iniprint.h"
48
49C   Arguments
50C
51      integer day0, anne0
52      real tstep, t_ops, t_wrt
53
54#ifdef CPP_IOIPSL
55! This routine needs IOIPSL to work
56C   Variables locales
57C
58      integer tau0
59      real zjulian
60      integer iq
61      real rlong(iip1,jjp1), rlat(iip1,jjp1)
62      integer uhoriid, vhoriid, thoriid, zvertiid
63      integer ii,jj
64      integer zan, dayref
65C
66C  Initialisations
67C
68      pi = 4. * atan (1.)
69C
70C  Appel a histbeg: creation du fichier netcdf et initialisations diverses
71C         
72
73      zan = anne0
74      dayref = day0
75      CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)
76      tau0 = itau_dyn
77     
78! -------------------------------------------------------------
79! Creation des 3 fichiers pour les grilles horizontales U,V,Scal
80! -------------------------------------------------------------
81!Grille U     
82      do jj = 1, jjp1
83        do ii = 1, iip1
84          rlong(ii,jj) = rlonu(ii) * 180. / pi
85          rlat(ii,jj) = rlatu(jj) * 180. / pi
86        enddo
87      enddo
88       
89      call histbeg(dynhistu_file, iip1, rlong(:,1), jjp1, rlat(1,:),
90     .             1, iip1, 1, jjp1,
91     .             tau0, zjulian, tstep, uhoriid, histuid)
92
93! Grille V
94      do jj = 1, jjm
95        do ii = 1, iip1
96          rlong(ii,jj) = rlonv(ii) * 180. / pi
97          rlat(ii,jj) = rlatv(jj) * 180. / pi
98        enddo
99      enddo
100
101      call histbeg(dynhistv_file, iip1, rlong(:,1), jjm, rlat(1,:),
102     .             1, iip1, 1, jjm,
103     .             tau0, zjulian, tstep, vhoriid, histvid)
104
105!Grille Scalaire
106      do jj = 1, jjp1
107        do ii = 1, iip1
108          rlong(ii,jj) = rlonv(ii) * 180. / pi
109          rlat(ii,jj) = rlatu(jj) * 180. / pi
110        enddo
111      enddo
112
113      call histbeg(dynhist_file, iip1, rlong(:,1), jjp1, rlat(1,:),
114     .             1, iip1, 1, jjp1,
115     .             tau0, zjulian, tstep, thoriid, histid)
116! -------------------------------------------------------------
117C  Appel a histvert pour la grille verticale
118! -------------------------------------------------------------
119      call histvert(histid, 'presnivs', 'Niveaux pression','mb',
120     .              llm, presnivs/100., zvertiid,'down')
121      call histvert(histvid, 'presnivs', 'Niveaux pression','mb',
122     .              llm, presnivs/100., zvertiid,'down')
123      call histvert(histuid, 'presnivs', 'Niveaux pression','mb',
124     .              llm, presnivs/100., zvertiid,'down')
125C
126! -------------------------------------------------------------
127C  Appels a histdef pour la definition des variables a sauvegarder
128! -------------------------------------------------------------
129C
130C  Vents U
131C
132      call histdef(histuid, 'u', 'vent u', 'm/s',
133     .             iip1, jjp1, uhoriid, llm, 1, llm, zvertiid,
134     .             32, 'inst(X)', t_ops, t_wrt)
135C
136C  Vents V
137C
138      call histdef(histvid, 'v', 'vent v', 'm/s',
139     .             iip1, jjm, vhoriid, llm, 1, llm, zvertiid,
140     .             32, 'inst(X)', t_ops, t_wrt)
141
142C
143C  Temperature potentielle
144C
145      call histdef(histid, 'teta', 'temperature potentielle', '-',
146     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
147     .             32, 'inst(X)', t_ops, t_wrt)
148C
149C  Geopotentiel
150C
151      call histdef(histid, 'phi', 'geopotentiel', '-',
152     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
153     .             32, 'inst(X)', t_ops, t_wrt)
154C
155C  Traceurs
156C
157!
158!        DO iq=1,nqtot
159!          call histdef(histid, tracers(iq)lnam, tracers(iq)%lnam,
160!     .             '-', iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
161!     .             32, 'inst(X)', t_ops, t_wrt)
162!        enddo
163!C
164C  Masse
165C
166      call histdef(histid, 'masse', 'masse', 'kg',
167     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
168     .             32, 'inst(X)', t_ops, t_wrt)
169C
170C  Pression au sol
171C
172      call histdef(histid, 'ps', 'pression naturelle au sol', 'Pa',
173     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
174     .             32, 'inst(X)', t_ops, t_wrt)
175C
176C  Geopotentiel au sol
177!C
178!      call histdef(histid, 'phis', 'geopotentiel au sol', '-',
179!     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
180!     .             32, 'inst(X)', t_ops, t_wrt)
181!C
182C  Fin
183C
184      call histend(histid)
185      call histend(histuid)
186      call histend(histvid)
187#else
188! tell the user this routine should be run with ioipsl
189      write(lunout,*)"inithist: Warning this routine should not be",
190     &               " used without ioipsl"
191#endif
192! of #ifdef CPP_IOIPSL
193      return
194      end
Note: See TracBrowser for help on using the repository browser.