Ignore:
Timestamp:
Sep 22, 2021, 6:11:35 PM (3 years ago)
Author:
dcugnet
Message:
  • fix of the delPhase function.
  • getvar1 and getvar2 fixed and modified to avoid the usage of files with several time records and make the calls rather short.
  • works again with iadv==0
  • no more issues with tracers numbers (nqo, nqtot, etc.)
  • fixes in the algebrical reduction routine used for "isotopes_parems.def" (containing simple expressions with variables that have to be substituted).
  • still to be validated numerically
File:
1 edited

Legend:

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

    r3963 r3985  
    22
    33  USE       strings_mod, ONLY: msg, find, strIdx,  strFind,  strHead, dispTable, testFile, cat, get_in,   &
    4                               fmsg, test, int2str, strParse, strTail, strReduce, strStack, modname
     4                              fmsg, test, int2str, strParse, strTail, strReduce, strStack, modname, reduceExpr
    55  USE readTracFiles_mod, ONLY: readTracersFiles, getKey_init, nphases, delPhase, old_phases, aliasTracer, &
    66            phases_sep, tran0, readIsotopesFile, getKey, known_phases, addPhase, indexUpdate, initIsotopes
     
    202202  oldH2O        = ['H2Ov','H2Ol','H2Oi']
    203203
     204!  lerr = reduceExpr('1.0+-470.0/1000.',msg1)
     205!print*,msg1
     206!stop
     207
    204208  !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION
    205209  CALL msg('type_trac='//TRIM(type_trac))
     
    279283      IF(planet_type=='earth') THEN                                  !--- Default for Earth
    280284        nqo = 2; nbtr = 2
     285        ALLOCATE(tracers(nqo+nbtr))
    281286        tracers(:)%name = ['H2O'//phases_sep//'g', 'H2O'//phases_sep//'l', 'RN   ', 'PB   ']
    282287        tracers(:)%prnt = [tran0, tran0, tran0, tran0]
     
    286291      ELSE                                                           !--- Default for other planets
    287292        nqo = 0; nbtr = 1
     293        ALLOCATE(tracers(nqo+nbtr))
    288294        tracers(:)%name = ['dummy']
    289295        tracers(:)%prnt = ['dummy']
     
    354360  IF(.NOT.ALLOCATED(conv_flg)) conv_flg = [(1, it=1, nbtr)]
    355361  IF(.NOT.ALLOCATED( pbl_flg))  pbl_flg = [(1, it=1, nbtr)]
    356 !print*,'nqo, nbtr = ',nqo,nbtr
    357 !stop
    358 
    359 #ifdef CPP_StratAer
    360   IF (type_trac == 'coag') THEN
    361     nbtr_bin=0
    362     nbtr_sulgas=0
    363     DO iq = 1, nqtrue
    364       IF(tracers(iq)%name(1:3)=='BIN') nbtr_bin    = nbtr_bin   +1
    365       IF(tracers(iq)%name(1:3)=='GAS') nbtr_sulgas = nbtr_sulgas+1
    366       SELECT CASE(tracers(iq)%name)
    367         CASE('BIN01');    id_BIN01_strat = iq - nqo; CALL msg('id_BIN01_strat=', id_BIN01_strat)
    368         CASE('GASOCS');   id_OCS_strat   = iq - nqo; CALL msg('id_OCS_strat  =', id_OCS_strat)
    369         CASE('GASSO2');   id_SO2_strat   = iq - nqo; CALL msg('id_SO2_strat  =', id_SO2_strat)
    370         CASE('GASH2SO4'); id_H2SO4_strat = iq - nqo; CALL msg('id_H2SO4_strat=', id_H2SO4_strat)
    371         CASE('GASTEST');  id_TEST_strat  = iq - nqo; CALL msg('id_TEST_strat=' , id_TEST_strat)
    372       END SELECT
    373     END DO
    374     CALL msg('nbtr_bin      =',nbtr_bin)
    375     CALL msg('nbtr_sulgas   =',nbtr_sulgas)
    376   END IF
    377 #endif
    378362
    379363  !--- Transfert number of tracers to Reprobus
     
    459443    WRITE(msg2,'(a,i2,a)')'iadv=',iad,' not implemented yet for'
    460444
    461     !--- ONLY TESTED VALUES FOR TRACERS FOR NOW: iadv = 14, 10 (and 0)
     445    !--- ONLY TESTED VALUES FOR TRACERS FOR NOW:               iadv = 14, 10 (and 0 for non-transported tracers)
    462446    IF(ALL( [10,14,0] /= iad) ) CALL abort_gcm(modname, TRIM(msg1)//' ; only iadv=10 and iadv=14 are tested !', 1)
    463447
    464     !--- ONLY TESTED VALUES FOR CHILDS  FOR NOW: iadv = 10     (CHILDS:  TRACERS OF GENERATION GREATER THAN 1)
     448    !--- ONLY TESTED VALUES FOR CHILDS FOR NOW:                iadv = 10     (CHILDS:  TRACERS OF GENERATION GREATER THAN 1)
    465449    IF(fmsg(iad/=10.AND.t1%igen>1,'WARNING ! '//TRIM(msg2)//' childs.  Setting iadv=10 for "'//TRIM(t1%name)//'".')) t1%iadv=10
    466450
    467     !--- ONLY TESTED VALUES FOR PARENTS FOR NOW: iadv = 14, 10 (PARENTS: TRACERS OF GENERATION 1)
    468     IF(t1%igen==1 .AND. ALL([10,14]/=iad)) CALL abort_gcm(modname, TRIM(msg2)//' parents: schemes 10 or 14 only !', 1)
    469 
    470     !--- iadv = 14 IS ONLY VALID FOR WATER VAPOUR
     451    !--- ONLY TESTED VALUES FOR PARENTS HAVING CHILDS FOR NOW: iadv = 14, 10 (PARENTS: TRACERS OF GENERATION 1)
     452    IF(ANY(ttr(:)%igen>1) .AND. t1%igen==1 .AND. ALL([10,14]/=iad)) &
     453      CALL abort_gcm(modname, TRIM(msg2)//' parents: schemes 10 or 14 only !', 1)
     454
     455    !--- ONLY VALID SCHEME NUMBER FOR WATER VAPOUR:            iadv = 14
    471456    IF(fmsg(iad==14 .AND. t1%name(1:5)/='H2O'//phases_sep//'g', 'WARNING ! '//TRIM(msg1)//', found for "' &
    472457                 //TRIM(t1%name)//'" but only valid for water vapour ! Setting iadv=10 for "'//TRIM(t1%name)//'".')) t1%iadv=10
Note: See TracChangeset for help on using the changeset viewer.