Ignore:
Timestamp:
Nov 7, 2022, 3:09:43 AM (23 months ago)
Author:
dcugnet
Message:
  • simplify the parser usage:
    • the getKey_init routine is now embedded in the readTracersFile routine.
    • the initIsotopes routine is now embedded in the readIsotopesFile routine.
    • the database is now unique, but can be changed using the get/setKeysDBase.
    • the derived types descriptions, originally located in trac_types_mod, are moved to readTracFiles_mod.
    • few checkings moved from infotrac to the routine testIsotopes, contained in the readIsotopesFile function from readTracFiles_mod.
    • the readTracersFiles and readIsotopesFile routines no longer use a tracers/isotopes argument.
  • remove tnat and alpha_ideal from infotrac ; use instead getKey to get them where they are used (check_isotopes, dynetat0, iniacademic)
  • the trac_type field %Childs is renamed %Children
  • move the isoSelect routine and the corresponding variables routine from infotrac and infotrac_phy to readTracFiles_mod
  • infotrac_phy routine is now fully independant of the (very similar) routine infotrac (init_infotrac_phy has no arguments left).
  • all the explicit keys of the trac_type are now included in the embedded keys database, accessible using the getKey function.
  • the getKey/addKey routines are expanded to handle vectors of integers, reals, logicals or strings.
  • few subroutines converted into functions with error return value.
  • corrections for isotopic tagging tracers mode (to be continued).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmdiso/isotopes_routines_mod.F90

    r4149 r4325  
    1653216532 USE isotrac_mod, ONLY: strtrac,initialisation_isotrac,index_iso, &
    1653316533&       index_zone,izone_init
     16534 USE readTracFiles_mod, ONLY: newH2Oiso, oldH2Oiso
     16535 USE strings_mod, ONLY: strIdx, strHead, strTail
     16536
    1653416537#endif
    1653516538        implicit none
     
    1656316566        CHARACTER*5 str5
    1656416567        real xmin,xmax   
    16565         CHARACTER*50 outiso 
     16568        CHARACTER*50 outiso, oldIso
    1656616569        integer lnblnk
    1656716570        LOGICAL :: found,phyetat0_get,phyetat0_srf
     
    1658516588   do ixt=1,ntraciso
    1658616589
    16587       outiso=TRIM(isoName(ixt))
    16588       i = INDEX(outiso, '_', .TRUE.)
    16589       outiso = outiso(1:i-1)//outiso(i+1:LEN_TRIM(outiso))
    16590       write(*,*) 'phyiso_etat0_fichier 16621: ixt,outiso=',ixt,TRIM(outiso)
    16591 
     16590      outiso = isoName(ixt)
     16591      k = strIdx(newH2Oiso, strHead(outiso, '_'))
     16592      oldIso = outiso; IF(k /= 0) oldIso = oldH2Oiso(k)
     16593      IF(INDEX(outiso, '_') /= 0) THEN
     16594        outiso = TRIM(outiso)//TRIM(strTail(outiso, '_'))
     16595        oldIso = TRIM(oldIso)//TRIM(strTail(outiso, '_'))
     16596      END IF
    1659216597           
    1659316598      ! on lit seulement si ixt<=niso ou si on initialise les traceurs d'après
     
    1659816603
    1659916604      found=phyetat0_srf(1,iso_tmp_lonsrf,"XTSNOW"//TRIM(outiso),"Surface snow",0.)
    16600       if (.NOT.found) CALL abort_physic('isotopes_routines_mod', &
    16601                             'phyiso_etat0_fichier 16581: variable isotopique not found',1)
     16605      if (.NOT.found.AND.k/=0) found=phyetat0_srf(1,iso_tmp_lonsrf,"XTSNOW"//TRIM(oldIso),"Surface snow",0.)
     16606      if (.NOT.found) CALL abort_physic('isotopes_routines_mod', 'phyiso_etat0_fichier 16581: variable isotopique not found',1)
    1660216607      xtsnow(ixt,:,:)=iso_tmp_lonsrf(:,:)
    1660316608     
    1660416609      found=phyetat0_srf(1,iso_tmp_lonsrf,"XTEVAP"//TRIM(outiso),"evaporation",0.)
     16610      if (.NOT.found.AND.k/=0) found=phyetat0_srf(1,iso_tmp_lonsrf,"XTEVAP"//TRIM(oldIso),"evaporation",0.)
    1660516611      fxtevap(ixt,:,:)=iso_tmp_lonsrf(:,:)
    1660616612
    1660716613      found=phyetat0_get(1,iso_tmp,"xtrain_f"//TRIM(outiso),"xrain fall",0.)
     16614      if (.NOT.found.AND.k/=0) found=phyetat0_get(1,iso_tmp,"xtrain_f"//TRIM(oldIso),"xrain fall",0.)
    1660816615      xtrain_fall(ixt,:)=iso_tmp(:)
    1660916616
    1661016617      found=phyetat0_get(1,iso_tmp,"xtsnow_f"//TRIM(outiso),"snow fall",0.)
     16618      if (.NOT.found.AND.k/=0) found=phyetat0_get(1,iso_tmp,"xtsnow_f"//TRIM(oldIso),"snow fall",0.)
    1661116619      xtsnow_fall(ixt,:)=iso_tmp(:)
    1661216620
    1661316621      found=phyetat0_get(klev,iso_tmp_lonlev,"XTANCIEN"//TRIM(outiso),"QANCIEN",0.)
     16622      if (.NOT.found.AND.k/=0) found=phyetat0_get(1,iso_tmp_lonlev,"XTANCIEN"//TRIM(oldIso),"QANCIEN",0.)
    1661416623      xt_ancien(ixt,:,:)=iso_tmp_lonlev(:,:)
    1661516624
    1661616625      found=phyetat0_get(klev,iso_tmp_lonlev,"XTLANCIEN"//TRIM(outiso),"QLANCIEN",0.)
     16626      if (.NOT.found.AND.k/=0) found=phyetat0_get(1,iso_tmp_lonlev,"XTLANCIEN"//TRIM(oldIso),"QLANCIEN",0.)
    1661716627      xtl_ancien(ixt,:,:)=iso_tmp_lonlev(:,:)
    1661816628
    1661916629      found=phyetat0_get(klev,iso_tmp_lonlev,"XTSANCIEN"//TRIM(outiso),"QSANCIEN",0.)
     16630      if (.NOT.found.AND.k/=0) found=phyetat0_get(1,iso_tmp_lonlev,"XTSANCIEN"//TRIM(oldIso),"QSANCIEN",0.)
    1662016631      xts_ancien(ixt,:,:)=iso_tmp_lonlev(:,:)
    1662116632
    1662216633      found=phyetat0_get(1,iso_tmp,"XTRUNOFFLIC0"//TRIM(outiso),"RUNOFFLIC0",0.) 
     16634      if (.NOT.found.AND.k/=0) found=phyetat0_get(1,iso_tmp,"XTRUNOFFLIC0"//TRIM(oldIso),"RUNOFFLIC0",0.)
    1662316635      xtrun_off_lic_0(ixt,:)=iso_tmp(:)
    1662416636
    1662516637      found=phyetat0_get(klev,iso_tmp_lonlev,"WAKE_DELTAXT"//TRIM(outiso),"Delta hum. wake/env",0.) 
     16638      if (.NOT.found.AND.k/=0) found=phyetat0_get(1,iso_tmp_lonlev,"WAKE_DELTAXT"//TRIM(oldIso),"Delta hum. wake/env",0.)
    1662616639      wake_deltaxt(ixt,:,:)=iso_tmp_lonlev(:,:)
    1662716640
     
    1666616679       if (ixt.le.niso) then
    1666716680        found=phyetat0_get(1,iso_tmp,"XTSOL"//TRIM(outiso),"Surface hmidity / bucket",0.) 
     16681        if (.NOT.found.AND.k/=0) found=phyetat0_get(1,iso_tmp,"XTSOL"//TRIM(oldIso),"Surface hmidity / bucket",0.)
    1666816682        xtsol(ixt,:)=iso_tmp(:)
    1666916683
    1667016684        found=phyetat0_get(1,iso_tmp,"Rland_ice"//TRIM(outiso),"R land ice",0.)
     16685        if (.NOT.found.AND.k/=0) found=phyetat0_get(1,iso_tmp,"Rland_ice"//TRIM(oldIso),"R land ice",0.)
    1667116686        Rland_ice(ixt,:)=iso_tmp(:)
    1667216687
Note: See TracChangeset for help on using the changeset viewer.