Ignore:
Timestamp:
Jun 16, 2022, 8:16:59 PM (3 years ago)
Author:
dcugnet
Message:

The variable "types_trac" is the equivalent of "type_trac" in case multiple sections must be read
and used in "tracer.def" file.
Tests on the "type_trac" were replaced with tests on the vector "types_trac".
Most of the time, there are two components: 'lmdz' and a second one. The later has priority on 'lmdz'
and must be used for the tests. For more components, care must be taken to execute specific parts
of the code on the right tracers ; the tracers(:)%component has been created in that respect.

File:
1 edited

Legend:

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

    r4169 r4170  
    1414   !=== FOR TRACERS:
    1515   PUBLIC :: infotrac_init                                 !--- Initialization of the tracers
    16    PUBLIC :: tracers, type_trac                            !--- Full tracers database, tracers type keyword
     16   PUBLIC :: tracers, type_trac, types_trac                !--- Full tracers database, tracers type keyword
    1717   PUBLIC :: nqtot,   nbtr,   nqo,   nqCO2,   nqtottr      !--- Main dimensions
    1818   PUBLIC :: conv_flg, pbl_flg                             !--- Convection & boundary layer activation keys
     
    108108                                    nqtottr, &                  !--- Number of tracers passed to phytrac (TO BE DELETED ?)
    109109                                    nqCO2                       !--- Number of tracers of CO2  (ThL)
    110    CHARACTER(LEN=maxlen),   SAVE :: type_trac                   !--- Keyword for tracers type
     110   CHARACTER(LEN=maxlen),   SAVE :: type_trac                   !--- Keyword for tracers type(s)
     111   CHARACTER(LEN=maxlen),   SAVE, ALLOCATABLE :: types_trac(:)  !--- Keyword for tracers type(s), parsed version
    111112
    112113   !=== DERIVED TYPES EMBEDDING MOST INFORMATIONS ABOUT TRACERS AND ISOTOPES FAMILIES
     
    175176   CHARACTER(LEN=3)      :: descrq(30)                               !--- Advection scheme description tags
    176177   CHARACTER(LEN=maxlen) :: msg1                                     !--- String for messages
    177    CHARACTER(LEN=maxlen), ALLOCATABLE :: str(:)                      !--- Temporary storage
    178178   INTEGER :: fType                                                  !--- Tracers description file type ; 0: none
    179179                                                                     !--- 1/2/3: "traceur.def"/"tracer.def"/"tracer_*.def"
     
    201201   
    202202   CALL msg('type_trac = "'//TRIM(type_trac)//'"', modname)
    203    IF(strParse(type_trac, '|', str, n=nt)) CALL abort_gcm(modname,'can''t parse "type_trac = '//TRIM(type_trac)//'"',1)
     203   IF(strParse(type_trac, '|', types_trac, n=nt)) CALL abort_gcm(modname,'can''t parse "type_trac = '//TRIM(type_trac)//'"',1)
    204204
    205205   !---------------------------------------------------------------------------------------------------------------------------
     
    207207   !---------------------------------------------------------------------------------------------------------------------------
    208208      !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION
    209       msg1 = 'For type_trac = "'//TRIM(str(it))//'":'
    210       SELECT CASE(str(it))
     209      msg1 = 'For type_trac = "'//TRIM(types_trac(it))//'":'
     210      SELECT CASE(types_trac(it))
    211211         CASE('inca'); CALL msg(TRIM(msg1)//' coupling with INCA chemistry model, config_inca='//config_inca, modname)
    212212         CASE('inco'); CALL msg(TRIM(msg1)//' coupling jointly with INCA and CO2 cycle',  modname)
     
    215215         CASE('coag'); CALL msg(TRIM(msg1)//' tracers are treated for COAGULATION tests', modname)
    216216         CASE('lmdz'); CALL msg(TRIM(msg1)//' tracers are treated in LMDZ only',          modname)
    217          CASE DEFAULT; CALL abort_gcm(modname,'type_trac='//TRIM(str(it))//' not possible yet.',1)
     217         CASE DEFAULT; CALL abort_gcm(modname,'type_trac='//TRIM(types_trac(it))//' not possible yet.',1)
    218218      END SELECT
    219219
    220220      !--- COHERENCE TEST BETWEEN "type_trac" AND "config_inca"
    221       IF(ANY(['inca', 'inco'] == str(it)) .AND. ALL(['aero', 'aeNP', 'chem'] /= config_inca)) &
     221      IF(ANY(['inca', 'inco'] == types_trac(it)) .AND. ALL(['aero', 'aeNP', 'chem'] /= config_inca)) &
    222222         CALL abort_gcm(modname, 'Incoherence between type_trac and config_inca. Please modify "run.def"',1)
    223223
    224224      !--- COHERENCE TEST BETWEEN "type_trac" AND PREPROCESSING KEYS
    225       SELECT CASE(str(it))
     225      SELECT CASE(types_trac(it))
    226226         CASE('inca', 'inco')
    227227#ifndef INCA
     
    244244   !--- DISABLE "config_inca" OPTION FOR A RUN WITHOUT "INCA" IF IT DIFFERS FROM "none"
    245245   IF(fmsg('Setting config_inca="none" as you do not couple with INCA model', &
    246            modname, ALL(str /= 'inca') .AND. ALL(str /= 'inco') .AND. config_inca /= 'none')) config_inca = 'none'
    247 
    248    nqCO2 = 0; IF(ANY(str == 'inco')) nqCO2 = 1
     246         modname, ALL(types_trac /= 'inca') .AND. ALL(types_trac /= 'inco') .AND. config_inca /= 'none')) config_inca = 'none'
     247
     248   nqCO2 = 0; IF(ANY(types_trac == 'inco')) nqCO2 = 1
    249249
    250250!==============================================================================================================================
Note: See TracChangeset for help on using the changeset viewer.