source: LMDZ6/branches/LMDZ-tracers/libf/dyn3d_common/writehist.F @ 3986

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