Ignore:
Timestamp:
Jul 3, 2025, 3:25:59 PM (5 days ago)
Author:
dcugnet
Message:

Add "isoFamilies", the list of defined isotopes families (==H2O? for now).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/dyn3d_common/infotrac.f90

    r5748 r5756  
    33MODULE infotrac
    44
    5    USE       strings_mod, ONLY: msg, maxlen, cat, dispTable, num2str,  strStack, strParse, strCount, strIdx
    6    USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, tracers,  addPhase,  addKey, iH2O,  &
    7        isoSelect,  indexUpdate, isot_type, testTracersFiles, isotope,  delPhase,  getKey, tran0, &
    8        isoKeys, isoName, isoZone, isoPhas, processIsotopes,  isoCheck, itZonIso,  nbIso,         &
    9           niso,   ntiso,   nzone,   nphas,   maxTableWidth,  iqIsoPha, iqWIsoPha, ixIso, new2oldH2O, newHNO3, oldHNO3
     5   USE       strings_mod, ONLY: msg, maxlen, cat, dispTable, num2str, strStack, strParse, strCount, strIdx, maxTableWidth
     6   USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, tracers,  addPhase,  addKey, iH2O,    &
     7       isoSelect,  indexUpdate, isot_type, testTracersFiles, isotope,  delPhase,  getKey, tran0,   &
     8       isoKeys, isoName, isoZone, isoPhas, processIsotopes,  isoCheck, itZonIso,  nbIso, newHNO3,  &
     9          niso,   ntiso,   nzone,   nphas, isoF=>isoFamilies,iqIsoPha, iqWIsoPha, ixIso, oldHNO3, new2oldH2O
    1010   IMPLICIT NONE
    1111
     
    2222   !=== FOR ISOTOPES: General
    2323   PUBLIC :: isot_type, nbIso                              !--- Derived type, full isotopes families database + nb of families
    24    PUBLIC :: isoSelect, ixIso                              !--- Isotopes family selection tool + selected family index
     24   PUBLIC :: isoSelect, ixIso, isoFamilies                 !--- Isotopes families selection tool + selected family index
    2525   !=== FOR ISOTOPES: Specific to water
    2626   PUBLIC :: iH2O                                          !--- Value of "ixIso" for "H2O" isotopes class
     
    8181!  | iso_iName   | Isotope  name  index in isotopes(iso_iGroup)%trac(:) | iso_indnum  | 1:niso                 |
    8282!  | iso_iZone   | Isotope  zone  index in isotopes(iso_iGroup)%zone(:) | zone_num    | 1:nzone                |
    83 !  | iso_iPhas   | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
     83!  | iso_iPhase  | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
    8484!  +-------------+------------------------------------------------------+-------------+------------------------+
    8585!
     
    9898!  +-----------------+--------------------------------------------------+--------------------+-----------------+
    9999
     100   !=== THRESHOLDS FOR WATER
    100101   REAL, PARAMETER :: min_qParent = 1.e-30, min_qMass = 1.e-18, min_ratio = 1.e-16 ! MVals et CRisi
    101102
    102    !=== DIMENSIONS OF THE TRACERS TABLES AND OTHER SCALAR VARIABLES
     103   !=== DIMENSIONS OF THE TRACERS TABLES, TRACERS TYPE(S)
    103104   INTEGER, SAVE :: nqtot                                       !--- Tracers nb in dynamics (incl. higher moments + H2O)
    104105   INTEGER, SAVE :: nbtr                                        !--- Tracers nb in physics  (excl. higher moments + H2O)
     
    111112   INTEGER, SAVE, ALLOCATABLE :: conv_flg(:), pbl_flg(:)        !--- Convection / boundary layer activation (nbtr)
    112113
     114   !=== LIST OF DEFINED ISOTOPES FAMILIES
     115   CHARACTER(LEN=maxlen), SAVE, ALLOCATABLE :: isoFamilies(:)   !--- Generation 0 tracer name for each isotopes family (nbIso)
     116
    113117CONTAINS
    114118
     
    116120   USE iniprint_mod_h
    117121   USE control_mod, ONLY: planet_type
     122   USE ioipsl, ONLY: getin
    118123   USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_trac
    119124   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS, CPPKEY_STRATAER
    120125   USE dimensions_mod, ONLY: iim, jjm, llm, ndm
    121 IMPLICIT NONE
     126   IMPLICIT NONE
    122127!==============================================================================================================================
    123128!
     
    152157   INTEGER :: nqtrue                                                 !--- Tracers nb from tracer.def (no higher order moments)
    153158   INTEGER :: iad                                                    !--- Advection scheme number
    154    INTEGER :: iq, jq, nt, im, nm, ig                                 !--- Indexes and temporary variables
     159   INTEGER :: iq, jq, it, nt, im, nm, ig                             !--- Indexes and temporary variables
    155160   LOGICAL :: lerr
    156161   TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:)
     
    284289      IF(iad == -1) CALL abort_gcm(modname, msg1, 1)
    285290
    286       !--- SET FIELDS longName and iadv
     291      !--- SET FIELDS longName AND iadv
    287292      t1%longName   = t1%name; IF(iad > 0) t1%longName=TRIM(t1%name)//descrq(iad)
    288293      t1%iadv       = iad
     
    329334   END DO
    330335
    331    !=== READ PHYSICAL PARAMETERS FOR ISOTOPES ; DONE HERE BECAUSE dynetat0 AND iniacademic NEED "tnat" AND "alpha_ideal"
    332    niso = 0; nzone = 0; nphas = nqo; ntiso = 0; isoCheck = .FALSE.
     336   !=== DETERMINE ISOTOPES RELATED PARAMETERS ; DEFINE THE EXPLICIT KEYS iso_i*
    333337   IF(processIsotopes()) CALL abort_gcm(modname, 'problem when processing isotopes parameters', 1)
     338   iH2O = -1
     339   IF(nbIso /= 0) THEN
     340      IF(isoSelect('H2O', .TRUE.)) THEN
     341         IF(isoSelect(1, .TRUE.)) CALL abort_physic(modname, "Can't select the first isotopes family", 1)
     342      ELSE
     343         iH2O = ixIso; CALL getin('ok_iso_verif', isotope%check)
     344      END IF
     345   END IF
     346   isoFamilies = isoF(:)
    334347
    335348   !--- Convection / boundary layer activation for all tracers
     
    362375   CALL msg('No isotopes identified.', modname, nbIso == 0)
    363376   IF(nbIso == 0) RETURN
    364    CALL msg('For isotopes family "H2O":', modname)
    365    CALL msg('  isoKeys%name = '//strStack(isoKeys%name), modname)
    366    CALL msg('  isoName = '//strStack(isoName),      modname)
    367    CALL msg('  isoZone = '//strStack(isoZone),      modname)
    368    CALL msg('  isoPhas = '//TRIM(isoPhas),          modname)
     377   DO it = 1, nbIso
     378      IF(isoSelect(it, .TRUE.)) CALL abort_physic(modname, 'Problem when selecting isotopes class', 1)
     379      CALL msg('For isotopes family "'//TRIM(isoFamilies(it))//'":', modname)
     380      CALL msg('  isoKeys%name = '//strStack(isoKeys%name), modname)
     381      CALL msg('  isoName = '//strStack(isoName), modname)
     382      CALL msg('  isoZone = '//strStack(isoZone), modname)
     383      CALL msg('  isoPhas = '//TRIM(isoPhas),     modname)
     384   END DO
     385   IF(isoSelect(iH2O, .TRUE.)) lerr = isoSelect(1, .TRUE.)
    369386
    370387END SUBROUTINE init_infotrac
Note: See TracChangeset for help on using the changeset viewer.