Ignore:
Timestamp:
Feb 22, 2021, 5:28:31 PM (3 years ago)
Author:
dcugnet
Message:

Extension of the tracers management.

The tracers files can be:

1) "traceur.def": old format, with:

  • the number of tracers on the first line
  • one line for each tracer: <tracer name> <hadv> <vadv> [<parent name>]

2) "tracer.def": new format with one section each model component.
3) "tracer_<name>.def": new format with a single section.

The formats 2 and 3 reading is driven by the "type_trac" key, which can be a

coma-separated list of components.

  • Format 2: read the sections from the "tracer.def" file.
  • format 3: read one section each "tracer_<section name>.def" file.
  • the first line of a section is "&<section name>
  • the other lines start with a tracer name followed by <key>=<val> pairs.
  • the "default" tracer name is reserved ; the other tracers of the section inherit its <key>=<val>, except for the keys that are redefined locally.

This format helps keeping the tracers files compact, thanks to the "default"
special tracer and the three levels of factorization:

  • on the tracers names: a tracer name can be a coma-separated list of tracers => all the tracers of the list have the same <key>=<val> properties
  • on the parents names: the value of the "parent" property can be a coma-separated list of tracers => only possible for geographic tagging tracers
  • on the phases: the property "phases" is [g](l][s] (gas/liquid/solid)

Read information is stored in the vector "tracers(:)", of derived type "tra".

"isotopes_params.def" is a similar file, with one section each isotopes family.
It contains a database of isotopes properties ; if there are second generation
tracers (isotopes), the corresponding sections are read.

Read information is stored in the vector "isotopes(:)", of derived type "iso".

The "getKey" function helps to get the values of the parameters stored in
"tracers" or "isotopes".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ-tracers/libf/dyn3dmem/vlspltqs_loc.F

    r3851 r3852  
    1212c   --------------------------------------------------------------------
    1313      USE parallel_lmdz
    14       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils, ! CRisi                 &
     14      USE infotrac, ONLY : nqtot, tracers, tra,        ! CRisi                 &
    1515     &                     qperemin,masseqmin,ratiomin ! MVals et CRisi
    1616      IMPLICIT NONE
     
    4040      REAL u_mq(ijb_u:ije_u,llm)
    4141      REAL Ratio(ijb_u:ije_u,llm,nqtot) ! CRisi
    42       INTEGER ifils,iq2 ! CRisi
    43 
     42      INTEGER ichld,iq2 ! CRisi
     43      TYPE(tra), POINTER :: tr
    4444
    4545      REAL      SSUM
     
    4747
    4848      INTEGER ijb,ije,ijb_x,ije_x
    49      
     49
     50      tr => tracers(iq)
     51
    5052      !write(*,*) 'vlspltqs 58: entree vlxqs_loc, iq,ijb_x=',
    5153!     &   iq,ijb_x
     
    337339! CRisi: appel récursif de l'advection sur les fils.
    338340! Il faut faire ça avant d'avoir mis à jour q et masse
    339       !write(*,*) 'vlspltqs 336: iq,ijb_x,nqfils(iq)=',
    340 !     &     iq,ijb_x,nqfils(iq) 
    341 
    342       if (nqfils(iq).gt.0) then 
    343        do ifils=1,nqdesc(iq)
    344          iq2=iqfils(ifils,iq)
     341      !write(*,*) 'vlspltqs 336: iq,ijb_x,tr%nchld=',
     342!     &     iq,ijb_x,tr%nchld 
     343
     344      if(tr%ndesc > 0) then 
     345       do ichld=1,tr%ndesc
     346         iq2=tr%idesc(ichld)
    345347c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
    346348         DO l=1,llm
     
    356358         enddo
    357359c$OMP END DO NOWAIT
    358         enddo !do ifils=1,nqfils(iq)
    359         do ifils=1,nqfils(iq)
    360          iq2=iqfils(ifils,iq)
     360        enddo !do ichld=1,tr%nchld
     361        do ichld=1,tr%nchld
     362         iq2=tr%idesc(ichld)
    361363         !write(*,*) 'vlxqs 349: on appelle vlx pour iq2=',iq2
    362364         call vlx_loc(Ratio,pente_max,masse,u_mq,ijb_x,ije_x,iq2)
    363         enddo !do ifils=1,nqfils(iq)
    364       endif !if (nqfils(iq).gt.0) then
     365        enddo !do ichld=1,tr%nchld
     366      endif !if(tr%ndesc > 0)
    365367! end CRisi
    366368
     
    389391
    390392! retablir les fils en rapport de melange par rapport a l'air:
    391       if (nqfils(iq).gt.0) then 
    392        do ifils=1,nqdesc(iq)
    393          iq2=iqfils(ifils,iq
     393      if(tr%ndesc > 0) then 
     394       do ichld=1,tr%ndesc
     395         iq2=tr%idesc(ichld
    394396c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
    395397         DO l=1,llm
     
    402404         enddo
    403405c$OMP END DO NOWAIT
    404         enddo !do ifils=1,nqdesc(iq)
    405       endif !if (nqfils(iq).gt.0) then
     406        enddo !do ichld=1,tr%ndesc
     407      endif !if(tr%ndesc > 0)
    406408
    407409      !write(*,*) 'vlspltqs 399: iq,ijb_x=',iq,ijb_x
     
    426428c   --------------------------------------------------------------------
    427429      USE parallel_lmdz
    428       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils, ! CRisi                 &
     430      USE infotrac, ONLY : nqtot, tracers, tra,        ! CRisi                 &
    429431     &                     qperemin,masseqmin,ratiomin ! MVals et CRisi
    430432      USE comconst_mod, ONLY: pi
     
    470472c
    471473      REAL Ratio(ijb_u:ije_u,llm,nqtot) ! CRisi
    472       INTEGER ifils,iq2 ! CRisi
     474      INTEGER ichld,iq2 ! CRisi
     475      TYPE(tra), POINTER :: tr
    473476
    474477      REAL      SSUM
     
    733736! CRisi: appel récursif de l'advection sur les fils.
    734737! Il faut faire ça avant d'avoir mis à jour q et masse
    735       !write(*,*) 'vlyqs 689: iq,nqfils(iq)=',iq,nqfils(iq)
     738      !write(*,*) 'vlyqs 689: iq,tr%nchld=',iq,tr%nchld
    736739     
    737740      ijb=ij_begin-2*iip1
     
    747750      !write(lunout,*) 'ij_begin,ij_end=',ij_begin,ij_end
    748751      !write(lunout,*) 'pole_nord,pole_sud=',pole_nord,pole_sud
    749       if (nqfils(iq).gt.0) then 
    750        do ifils=1,nqdesc(iq)
    751          iq2=iqfils(ifils,iq)
     752      if(tr%ndesc > 0) then 
     753       do ichld=1,tr%ndesc
     754         iq2=tr%idesc(ichld)
    752755c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
    753756         DO l=1,llm
     
    771774         enddo !DO l=1,llm
    772775c$OMP END DO NOWAIT
    773         enddo !do ifils=1,nqdesc(iq)
    774         do ifils=1,nqfils(iq)
    775          iq2=iqfils(ifils,iq)
     776        enddo !do ichld=1,tr%ndesc
     777        do ichld=1,tr%nchld
     778         iq2=tr%idesc(ichld)
    776779         !write(lunout,*) 'vly: appel recursiv vly iq2=',iq2
    777780         call vly_loc(Ratio,pente_max,masse,qbyv,iq2)
    778         enddo !do ifils=1,nqfils(iq)
    779       endif !if (nqfils(iq).gt.0) then
     781        enddo !do ichld=1,tr%nchld
     782      endif !if(tr%ndesc > 0)
    780783
    781784       
     
    856859!      if (pole_sud)  ije=ij_end-iip1
    857860 
    858       if (nqfils(iq).gt.0) then 
    859        do ifils=1,nqdesc(iq)
    860          iq2=iqfils(ifils,iq
     861      if(tr%ndesc > 0) then 
     862       do ichld=1,tr%ndesc
     863         iq2=tr%idesc(ichld
    861864c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
    862865         DO l=1,llm
     
    866869         enddo
    867870c$OMP END DO NOWAIT
    868         enddo !do ifils=1,nqdesc(iq)
    869       endif !if (nqfils(iq).gt.0) then
     871        enddo !do ichld=1,tr%ndesc
     872      endif !if(tr%ndesc > 0)
    870873
    871874
Note: See TracChangeset for help on using the changeset viewer.