Changeset 2 for trac_types_mod.F90
- Timestamp:
- Dec 8, 2021, 9:25:11 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trac_types_mod.F90
r1 r2 1 1 MODULE trac_types_mod 2 2 3 USE strings_mod, ONLY: maxlen 4 PRIVATE 5 3 6 !=== TRACERS DESCRIPTOR DERIVED TYPE AND ASSOCIATED ROUTINES INTERFACES ======================================================= 4 PRIVATE 5 PUBLIC :: tra, iso, kys 7 PUBLIC :: trac_type, isot_type, keys_type 6 8 !------------------------------------------------------------------------------------------------------------------------------ 7 TYPE kys!=== TYPE FOR A SET OF KEYS ASSOCIATED TO AN ELEMENT8 CHARACTER(LEN= 256) :: name!--- Tracer name9 CHARACTER(LEN= 256), ALLOCATABLE :: key(:)!--- Keys string list10 CHARACTER(LEN= 256), ALLOCATABLE :: val(:)!--- Corresponding values string list11 END TYPE k ys9 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 12 14 !------------------------------------------------------------------------------------------------------------------------------ 13 TYPE tra !=== TYPE FOR SINGLE TRACER 14 CHARACTER(LEN=256) :: name = '' !--- Name 15 CHARACTER(LEN=256) :: nam1 = '' !--- Generation 1 ancestor name 16 CHARACTER(LEN=256) :: prnt = '' !--- Parent name 17 CHARACTER(LEN=256) :: lnam = '' !--- Long name (with adv. scheme) 18 CHARACTER(LEN=256) :: type = 'tracer' !--- Type (so far: 'tracer'/'tag') 19 CHARACTER(LEN=256) :: phas = 'g' !--- Phase ('g'as/'l'iquid/'s'olid) 20 CHARACTER(LEN=256) :: comp !--- Coma-separated list of components (Ex: lmdz,inca) 21 INTEGER :: iadv = 10 !--- Advection scheme used 22 INTEGER :: igen = 1 !--- Generation number (>=1) 23 INTEGER :: itr = 0 !--- Index in tr_seri (0: not in physics) 24 INTEGER :: iprnt = 0 !--- Parent index 25 INTEGER, ALLOCATABLE :: idesc(:) !--- Descendants index (in growing generation order) 26 INTEGER :: ndesc = 0 !--- Number of descendants (all generations) 27 INTEGER :: nchld = 0 !--- Number of childs (first generation) 28 INTEGER :: iso_igr = 0 !--- Isotopes group index in isotopes(:) 29 INTEGER :: iso_num = 0 !--- Isotope name index in isotopes(iso_igr)%trac(:) 30 INTEGER :: iso_zon = 0 !--- Isotope zone index in isotopes(iso_igr)%zone(:) 31 INTEGER :: iso_pha = 0 !--- Isotope phase index in isotopes(iso_igr)%phas 32 TYPE(kys) :: keys !--- <key>=<val> pairs vector 33 END TYPE tra 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 34 37 !------------------------------------------------------------------------------------------------------------------------------ 35 TYPE iso !=== TYPE FOR ISOTOPES FAMILY DESCENDING ON TRACER "prnt" 36 CHARACTER(LEN=256) :: prnt !--- Isotopes family name (parent tracer name ; ex: H2O) 37 LOGICAL :: check=.FALSE. !--- Triggering of the checking routines 38 TYPE(kys), ALLOCATABLE :: keys(:) !--- Isotopes keys/values pairs list (length: niso) 39 CHARACTER(LEN=256), ALLOCATABLE :: trac(:) !--- Isotopes + tagging tracers list (length: nitr) 40 CHARACTER(LEN=256), ALLOCATABLE :: zone(:) !--- Geographic tagging zones names list 41 CHARACTER(LEN=256) :: phas = 'g' !--- Phases list: [g][l][s] 42 INTEGER :: niso=0, nzon=0, nitr=0, npha=0!--- Number of isotopes, zones, total isotopes and phases 43 INTEGER, ALLOCATABLE :: iTraPha(:,:) ! (iqiso) !--- Idx in "trac(1:niso)" = f(name(1:nitr)),phas) 44 INTEGER, ALLOCATABLE :: iZonIso(:,:) ! (index_trac) !--- Idx in "trac(1:nitr)" = f(zone, name(1:niso)) 45 END TYPE iso 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 46 54 47 55 END MODULE trac_types_mod
Note: See TracChangeset
for help on using the changeset viewer.