source: trac_types_mod.F90 @ 17

Last change on this file since 17 was 13, checked in by dcugnet, 3 years ago
  • Rename "iTraPha" and "iZonIso": now named "iqTraPha" and "itZonIso".
  • Add the possibility of a cloud H2O tracer (nqo=4) for ok_ice_sursat=y and 4 H2O tracers in traceur.def (commit from O. Boucher on the LMDZ trunk branch, r4075).
  • Simplify the naming (old and new conventions) operations using old2newName and new2oldName routines.
  • Remove the useless "old2newPhase".
  • Add a function form "fGetKey" for string keys, using either a string tracer name or its index.
  • Function addPhase accepts now a phase index instead of the string phase itself.
  • The fType==1 case (old traceur.def files) now really complies with the old conventions, especially for isotopes with name structure <parent[phase]>_<isotope>.
  • Add the calling routine name "modname" to some routines to improve displayed messages accuracy.
  • Propagates the new generations counting convention (from 0 and not from 1).
  • Few fixes about the %isInPhysics and %component frames.
  • Few fixes about the code imposing the water to be at the beginning of the tracers table.
File size: 4.7 KB
Line 
1MODULE trac_types_mod
2
3  USE strings_mod, ONLY: maxlen
4  PRIVATE
5
6!=== TRACERS DESCRIPTOR DERIVED TYPE AND ASSOCIATED ROUTINES INTERFACES =======================================================
7  PUBLIC :: trac_type, isot_type, keys_type
8!------------------------------------------------------------------------------------------------------------------------------
9  TYPE :: keys_type                                        !=== TYPE FOR A SET OF KEYS ASSOCIATED TO AN ELEMENT
10    CHARACTER(LEN=maxlen)              :: name             !--- Tracer name
11    CHARACTER(LEN=maxlen), ALLOCATABLE :: key(:)           !--- Keys string list
12    CHARACTER(LEN=maxlen), ALLOCATABLE :: val(:)           !--- Corresponding values string list
13  END TYPE keys_type
14!------------------------------------------------------------------------------------------------------------------------------
15  TYPE :: trac_type                                        !=== TYPE FOR A SINGLE TRACER NAMED "name"
16    CHARACTER(LEN=maxlen) :: name        = ''              !--- Name of the tracer
17    CHARACTER(LEN=maxlen) :: gen0Name    = ''              !--- First generation ancestor name
18    CHARACTER(LEN=maxlen) :: parent      = ''              !--- Parent name
19    CHARACTER(LEN=maxlen) :: longName    = ''              !--- Long name (with advection scheme suffix)
20    CHARACTER(LEN=maxlen) :: type        = 'tracer'        !--- Type  (so far: 'tracer' / 'tag')
21    CHARACTER(LEN=maxlen) :: phase       = 'g'             !--- Phase ('g'as / 'l'iquid / 's'olid)
22    CHARACTER(LEN=maxlen) :: component   = ''              !--- Coma-separated list of components (Ex: lmdz,inca)
23    INTEGER               :: iadv        = 10              !--- Advection scheme used
24    INTEGER               :: iGeneration = -1              !--- Generation number (>=0)
25    LOGICAL               :: isAdvected  = .FALSE.         !--- "true" tracers: iadv > 0.   COUNT(isAdvected )=nqtrue
26    LOGICAL               :: isInPhysics = .TRUE.          !--- "true" tracers: in tr_seri. COUNT(isInPhysics)=nqtottr
27    INTEGER               :: iqParent    = 0               !--- Parent index
28    INTEGER,  ALLOCATABLE :: iqDescen(:)                   !--- Descendants index (in growing generation order)
29    INTEGER               :: nqDescen    = 0               !--- Number of descendants (all generations)
30    INTEGER               :: nqChilds    = 0               !--- Number of childs    (first generation)
31    INTEGER               :: iso_iGroup  = 0               !--- Isotopes group index in isotopes(:)
32    INTEGER               :: iso_iName   = 0               !--- Isotope  name  index in isotopes(iso_iGroup)%trac(:)
33    INTEGER               :: iso_iZone   = 0               !--- Isotope  zone  index in isotopes(iso_iGroup)%zone(:)
34    INTEGER               :: iso_iPhase  = 0               !--- Isotope  phase index in isotopes(iso_iGroup)%phas
35    TYPE(keys_type)       :: keys                          !--- <key>=<val> pairs vector
36  END TYPE trac_type
37!------------------------------------------------------------------------------------------------------------------------------
38  TYPE :: isot_type                                        !=== TYPE FOR AN ISOTOPES FAMILY DESCENDING ON TRACER "parent"
39    CHARACTER(LEN=maxlen)              :: parent           !--- Isotopes family name (parent tracer name ; ex: H2O)
40    LOGICAL                            :: check=.FALSE.    !--- Triggering of the checking routines
41    TYPE(keys_type),       ALLOCATABLE :: keys(:)          !--- Isotopes keys/values pairs list     (length: niso)
42    CHARACTER(LEN=maxlen), ALLOCATABLE :: trac(:)          !--- Isotopes + tagging tracers list     (length: ntiso)
43    CHARACTER(LEN=maxlen), ALLOCATABLE :: zone(:)          !--- Geographic tagging zones names list (length: nzone)
44    CHARACTER(LEN=maxlen)              :: phase = 'g'      !--- Phases list: [g][l][s]              (length: nphas)
45    INTEGER                            :: niso  = 0        !--- Number of isotopes, excluding tagging tracers
46    INTEGER                            :: nzone = 0        !--- Number of geographic tagging zones
47    INTEGER                            :: ntiso = 0        !--- Number of isotopes, including tagging tracers
48    INTEGER                            :: nphas = 0        !--- Number phases
49    INTEGER,               ALLOCATABLE :: iqTraPha(:,:)    !--- Idx in "tracers(1:nqtot)" = f(name(1:ntiso)),phas)
50                                                           !---        "iqTraPha" former name: "iqiso"
51    INTEGER,               ALLOCATABLE :: itZonIso(:,:)    !--- Idx in "trac(1:ntiso)" = f(zone, name(1:niso))
52                                                           !---        "itZonIso" former name: "index_trac"
53  END TYPE isot_type
54
55END MODULE trac_types_mod
Note: See TracBrowser for help on using the repository browser.