1 | MODULE 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 (>=1) |
---|
25 | LOGICAL :: isAdvected = .FALSE. !--- "true" tracers: iadv > 0 . COUNT( isAdvected) =nqtrue |
---|
26 | LOGICAL :: isH2Ofamily = .FALSE. !--- H2O tracers/isotopes/tags. COUNT(.NOT.isH2Ofamily)=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: nitr) |
---|
43 | CHARACTER(LEN=maxlen), ALLOCATABLE :: zone(:) !--- Geographic tagging zones names list (length: nzon) |
---|
44 | CHARACTER(LEN=maxlen) :: phase = 'g' !--- Phases list: [g][l][s] (length: npha) |
---|
45 | INTEGER :: niso = 0 !--- Number of isotopes, excluding tagging tracers |
---|
46 | INTEGER :: nzon = 0 !--- Number of geographic tagging zones |
---|
47 | INTEGER :: nitr = 0 !--- Number of isotopes, including tagging tracers |
---|
48 | INTEGER :: npha = 0 !--- Number phases |
---|
49 | INTEGER, ALLOCATABLE :: iTraPha(:,:) !--- Idx in "trac(1:niso)" = f(name(1:nitr)),phas) |
---|
50 | !--- "iTraPha" former name: "iqiso" |
---|
51 | INTEGER, ALLOCATABLE :: iZonIso(:,:) !--- Idx in "trac(1:nitr)" = f(zone, name(1:niso)) |
---|
52 | !--- "iZonIso" former name: "index_trac" |
---|
53 | END TYPE isot_type |
---|
54 | |
---|
55 | END MODULE trac_types_mod |
---|