Ignore:
Timestamp:
Jul 11, 2021, 11:39:01 PM (3 years ago)
Author:
dcugnet
Message:

In readTracFiles: the separator between the tracer name and its phase is no longer hardcoded and equal to "-",
but is a parameter ("phases_sep") which default value is "_".
Few more fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ-tracers/libf/dyn3d_common/infotrac.F90

    r3891 r3957  
    11MODULE infotrac
    22
    3   USE       strings_mod, ONLY: msg, find, strIdx,  strFind,  strHead, dispTable, testFile, cat, get_in,  &
     3  USE       strings_mod, ONLY: msg, find, strIdx,  strFind,  strHead, dispTable, testFile, cat, get_in,   &
    44                              fmsg, test, int2str, strParse, strTail, strReduce, strStack, modname
    5   USE readTracFiles_mod, ONLY: readTracersFiles, getKey_init, nphases, delPhase, aliasTracer, &
    6                         tran0, readIsotopesFile, getKey, known_phases, addPhase, indexUpdate, initIsotopes
     5  USE readTracFiles_mod, ONLY: readTracersFiles, getKey_init, nphases, delPhase, old_phases, aliasTracer, &
     6            phases_sep, tran0, readIsotopesFile, getKey, known_phases, addPhase, indexUpdate, initIsotopes
    77  USE trac_types_mod,    ONLY: tra, iso, kys
    88
     
    4545!  |--------------------+----------------------+-----------------+---------------+----------------------------|
    4646!  | water in different |    water tagging     |  water isotopes | other tracers | additional tracers moments |
    47 !  | phases: H2O-[gls]  |      isotopes        |                 |               |  for higher order schemes  |
     47!  | phases: H2O_[gls]  |      isotopes        |                 |               |  for higher order schemes  |
    4848!  |--------------------+----------------------+-----------------+---------------+----------------------------|
    4949!  |                    |                      |                 |               |                            |
     
    184184  CHARACTER(LEN=2)   ::   suff(9)                                    !--- Suffixes for schemes of order 3 or 4 (Prather)
    185185  CHARACTER(LEN=3)   :: descrq(30)                                   !--- Advection scheme description tags
    186   CHARACTER(LEN=4)  :: oldH2O(3)                                    !--- Old water name for the three phases
     186  CHARACTER(LEN=256) :: oldH2O(3)                                    !--- Old water name for the three phases
    187187  CHARACTER(LEN=256) :: newH2O                                       !--- New water name
    188188  CHARACTER(LEN=256) :: msg1, msg2                                   !--- Strings for messages
     
    283283      IF(planet_type=='earth') THEN                                  !--- Default for Earth
    284284        nqo = 2; nbtr = 2
    285         tracers(:)%name = ['H2O-g','H2O-l','RN   ','PB   ']
    286         tracers(:)%prnt = [tran0  ,tran0  ,tran0  ,tran0  ]
    287         tracers(:)%igen = [1      ,1      ,1      ,1      ]
    288         hadv            = [14     ,10     ,10     ,10     ]
    289         vadv            = [14     ,10     ,10     ,10     ]
     285        tracers(:)%name = ['H2O'//phases_sep//'g', 'H2O'//phases_sep//'l', 'RN   ', 'PB   ']
     286        tracers(:)%prnt = [tran0, tran0, tran0, tran0]
     287        tracers(:)%igen = [1    , 1    , 1    , 1    ]
     288        hadv            = [14   , 10   , 10   , 10   ]
     289        vadv            = [14   , 10   , 10   , 10   ]
    290290      ELSE                                                           !--- Default for other planets
    291291        nqo = 0; nbtr = 1
     
    329329        DO ip = 1, SIZE(oldH2O)
    330330          ix = strIdx(tracers(:)%name,oldH2O(ip))                    !--- Old name of water in a specific phase (ix/=0)
     331          newH2O = 'H2O'//phases_sep//known_phases(ip:ip)            !--- Corresponding new name
     332          IF(ix == 0) ix = strIdx(tracers(:)%name,newH2O)            !--- New name in an old format file (to be avoided...)
    331333          IF(ix == 0) CYCLE
    332           newH2O = 'H2O-'//known_phases(ip:ip)                       !--- Corresponding new name
    333334          nqo = nqo+1; tracers(ix)%name = newH2O                     !--- One more water phase ; replace old name with one
    334335          tracers(strFind(tracers(:)%nam1,oldH2O(ip)))%nam1 = newH2O
     
    341342    CASE DEFAULT                                                     !=== FOUND NEW STYLE TRACERS CONFIG FILE(S)
    342343    !--------------------------------------------------------------------------------------------------------------------------
    343       nqo    = 2; IF(ANY(tracers(:)%name == 'H2O-s')) nqo=3
     344      nqo    = 2; IF(ANY(tracers(:)%name == 'H2O'//phases_sep//'s')) nqo=3
    344345      nqtrue = SIZE(tracers, DIM=1)
    345346      nbtr   = nqtrue - nqo
     
    353354  IF(.NOT.ALLOCATED(conv_flg)) conv_flg = [(1, it=1, nbtr)]
    354355  IF(.NOT.ALLOCATED( pbl_flg))  pbl_flg = [(1, it=1, nbtr)]
     356!print*,'nqo, nbtr = ',nqo,nbtr
     357!stop
    355358
    356359#ifdef CPP_StratAer
     
    466469
    467470    !--- iadv = 14 IS ONLY VALID FOR WATER VAPOUR
    468     IF(fmsg(iad==14 .AND. t1%name(1:5)/='H2O-g', 'WARNING ! '//TRIM(msg1)//', found for "' &
     471    IF(fmsg(iad==14 .AND. t1%name(1:5)/='H2O'//phases_sep//'g', 'WARNING ! '//TRIM(msg1)//', found for "' &
    469472                 //TRIM(t1%name)//'" but only valid for water vapour ! Setting iadv=10 for "'//TRIM(t1%name)//'".')) t1%iadv=10
    470473  END DO
Note: See TracChangeset for help on using the changeset viewer.