Changeset 4169


Ignore:
Timestamp:
Jun 16, 2022, 2:45:08 PM (2 years ago)
Author:
dcugnet
Message:
  • Fix for multi-sections "tracer.def" files: type_trac is no longer a coma-saparated list (","), but is now a pipe-separated list ("|"), because the "getin" function replaces the comas by spaces.
  • Small fix for INCA: keep the "config_inca" value different from "none" if ALL the sections names differ from "inca" or "inco".
Location:
LMDZ6/trunk/libf
Files:
2 edited

Legend:

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

    r4158 r4169  
    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, '|', str, n=nt)) CALL abort_gcm(modname,'can''t parse "type_trac = '//TRIM(type_trac)//'"',1)
    204204
    205205   !---------------------------------------------------------------------------------------------------------------------------
     
    238238      END SELECT
    239239
    240       !--- DISABLE "config_inca" OPTION FOR A RUN WITHOUT "INCA" IF IT DIFFERS FROM "none"
    241       IF(fmsg('Setting config_inca="none" as you do not couple with INCA model', &
    242               modname, ALL(['inca', 'inco'] /= str(it)) .AND. config_inca /= 'none')) config_inca = 'none'
    243 
    244240   !---------------------------------------------------------------------------------------------------------------------------
    245241   END DO
    246242   !---------------------------------------------------------------------------------------------------------------------------
     243
     244   !--- DISABLE "config_inca" OPTION FOR A RUN WITHOUT "INCA" IF IT DIFFERS FROM "none"
     245   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'
    247247
    248248   nqCO2 = 0; IF(ANY(str == 'inco')) nqCO2 = 1
  • LMDZ6/trunk/libf/misc/readTracFiles_mod.f90

    r4159 r4169  
    107107
    108108  !--- Required sections + corresponding files names (new style single section case)
    109   IF(test(strParse(type_trac, ',', sections), lerr)) RETURN          !--- Parse "type_trac" list
     109  IF(test(strParse(type_trac, '|', sections), lerr)) RETURN          !--- Parse "type_trac" list
    110110
    111111  nsec = SIZE(sections, DIM=1)
     
    193193!==============================================================================================================================
    194194LOGICAL FUNCTION feedDBase(fnames, snames, modname) RESULT(lerr)
    195 ! Purpose: Read the sections "snames(is)" (coma-separated list) from each "fnames(is)"
     195! Purpose: Read the sections "snames(is)" (pipe-separated list) from each "fnames(is)"
    196196!   file and create the corresponding tracers set descriptors in the database "dBase":
    197197! * dBase(id)%name                : section name
     
    201201!------------------------------------------------------------------------------------------------------------------------------
    202202  CHARACTER(LEN=*), INTENT(IN)  :: fnames(:)                         !--- Files names
    203   CHARACTER(LEN=*), INTENT(IN)  :: snames(:)                         !--- Coma-deparated list of sections (one list each file)
     203  CHARACTER(LEN=*), INTENT(IN)  :: snames(:)                         !--- Pipe-deparated list of sections (one list each file)
    204204  CHARACTER(LEN=*), INTENT(IN)  :: modname                           !--- Calling routine name
    205205  INTEGER,  ALLOCATABLE :: ndb(:)                                    !--- Number of sections for each file
     
    211211!------------------------------------------------------------------------------------------------------------------------------
    212212  !=== READ THE REQUIRED SECTIONS
    213   ll = strCount(snames, ',', ndb)                                    !--- Number of sections for each file
     213  ll = strCount(snames, '|', ndb)                                    !--- Number of sections for each file
    214214  ALLOCATE(ixf(SUM(ndb)))
    215215  DO i=1, SIZE(fnames)                                               !--- Set %name, %keys
     
    239239!------------------------------------------------------------------------------------------------------------------------------
    240240  CHARACTER(LEN=*),           INTENT(IN) :: fnam                     !--- File name
    241   CHARACTER(LEN=*),           INTENT(IN) :: snam                     !--- Coma-separated sections list
     241  CHARACTER(LEN=*),           INTENT(IN) :: snam                     !--- Pipe-separated sections list
    242242  CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: defName                  !--- Special section (default values) name
    243243!------------------------------------------------------------------------------------------------------------------------------
     
    254254    DO idb=n0,ndb; CALL addDefault(dBase(idb)%trac, defName); END DO !--- and remove the virtual tracer "defName"
    255255  END IF
    256   ll = strParse(snam, ',', keys = sec)                               !--- Requested sections names
     256  ll = strParse(snam, '|', keys = sec)                               !--- Requested sections names
    257257  ix = strIdx(dBase(:)%name, sec(:))                                 !--- Indexes of requested sections in database
    258258  IF(test(checkList(sec, ix == 0, 'In file "'//TRIM(fnam)//'"','section(s)', 'missing'), lerr)) RETURN
     
    893893  !--- READ THE FILE SECTIONS, ONE EACH PARENT TRACER
    894894  nb0 = SIZE(dBase, DIM=1)+1                                         !--- Next database element index
    895   IF(test(readSections(fnam,strStack(isot(:)%parent,',')),lerr)) RETURN !--- Read sections, one each parent tracer
     895  IF(test(readSections(fnam,strStack(isot(:)%parent,'|')),lerr)) RETURN !--- Read sections, one each parent tracer
    896896  ndb = SIZE(dBase, DIM=1)                                           !--- Current database size
    897897  DO idb = nb0, ndb
Note: See TracChangeset for help on using the changeset viewer.