source: LMDZ6/branches/LMDZ-tracers/libf/dyn3d_common/writedynav.F90 @ 3852

Last change on this file since 3852 was 3852, checked in by dcugnet, 4 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: 3.1 KB
Line 
1! $Id: writedynav.F90 3852 2021-02-22 16:28:31Z dcugnet $
2
3subroutine writedynav(time, vcov, ucov, teta, ppk, phi, q, masse, ps, phis)
4
5#ifdef CPP_IOIPSL
6  USE ioipsl
7#endif
8  USE infotrac, ONLY : nqtot
9  use com_io_dyn_mod, only : histaveid, histvaveid, histuaveid
10  USE comconst_mod, ONLY: cpp
11  USE temps_mod, ONLY: itau_dyn
12
13  implicit none
14
15  !   Ecriture du fichier histoire au format IOIPSL
16
17  !   Appels succesifs des routines: histwrite
18
19  !   Entree:
20  !      time: temps de l'ecriture
21  !      vcov: vents v covariants
22  !      ucov: vents u covariants
23  !      teta: temperature potentielle
24  !      phi : geopotentiel instantane
25  !      q   : traceurs
26  !      masse: masse
27  !      ps   :pression au sol
28  !      phis : geopotentiel au sol
29
30  !   L. Fairhead, LMD, 03/99
31
32  !   Declarations
33  include "dimensions.h"
34  include "paramet.h"
35  include "comgeom.h"
36  include "description.h"
37  include "iniprint.h"
38
39  !   Arguments
40
41  REAL vcov(ip1jm, llm), ucov(ip1jmp1, llm)
42  REAL teta(ip1jmp1*llm), phi(ip1jmp1, llm), ppk(ip1jmp1*llm)     
43  REAL ps(ip1jmp1), masse(ip1jmp1, llm)                   
44  REAL phis(ip1jmp1)                 
45  REAL q(ip1jmp1, llm, nqtot)
46  integer time
47
48#ifdef CPP_IOIPSL
49  ! This routine needs IOIPSL to work
50  !   Variables locales
51
52  integer ndex2d(ip1jmp1), ndexu(ip1jmp1*llm), ndexv(ip1jm*llm)
53  INTEGER iq, ii, ll
54  real tm(ip1jmp1*llm)
55  REAL vnat(ip1jm, llm), unat(ip1jmp1, llm)
56  logical ok_sync
57  integer itau_w
58
59  !-----------------------------------------------------------------
60
61  !  Initialisations
62
63  ndexu = 0
64  ndexv = 0
65  ndex2d = 0
66  ok_sync = .TRUE.
67  tm = 999.999
68  vnat = 999.999
69  unat = 999.999
70  itau_w = itau_dyn + time
71
72  ! Passage aux composantes naturelles du vent
73  call covnat(llm, ucov, vcov, unat, vnat)
74
75  !  Appels a histwrite pour l'ecriture des variables a sauvegarder
76
77  !  Vents U
78
79  call histwrite(histuaveid, 'u', itau_w, unat,  &
80       iip1*jjp1*llm, ndexu)
81
82  !  Vents V
83
84  call histwrite(histvaveid, 'v', itau_w, vnat,  &
85       iip1*jjm*llm, ndexv)
86
87  !  Temperature potentielle moyennee
88
89  call histwrite(histaveid, 'theta', itau_w, teta,  &
90       iip1*jjp1*llm, ndexu)
91
92  !  Temperature moyennee
93
94  do ii = 1, ijp1llm
95     tm(ii) = teta(ii) * ppk(ii)/cpp
96  enddo
97  call histwrite(histaveid, 'temp', itau_w, tm,  &
98       iip1*jjp1*llm, ndexu)
99
100  !  Geopotentiel
101
102  call histwrite(histaveid, 'phi', itau_w, phi,  &
103       iip1*jjp1*llm, ndexu)
104
105  !  Traceurs
106
107  !  DO iq=1, nqtot
108  !       call histwrite(histaveid, tracers(iq)%lnam, itau_w, &
109  !                      q(:, :, iq), iip1*jjp1*llm, ndexu)
110  ! enddo
111
112  !  Masse
113
114  call histwrite(histaveid, 'masse', itau_w, masse,  &
115       iip1*jjp1*llm, ndexu)
116
117  !  Pression au sol
118
119  call histwrite(histaveid, 'ps', itau_w, ps, iip1*jjp1, ndex2d)
120
121  ! Geopotentiel au sol
122
123  ! call histwrite(histaveid, 'phis', itau_w, phis, iip1*jjp1, ndex2d)
124
125  if (ok_sync) then
126     call histsync(histaveid)
127     call histsync(histvaveid)
128     call histsync(histuaveid)
129  ENDIF
130
131#else
132  write(lunout, *) "writedynav: Warning this routine should not be", &
133       " used without ioipsl"
134#endif
135  ! of #ifdef CPP_IOIPSL
136
137end subroutine writedynav
Note: See TracBrowser for help on using the repository browser.