Ignore:
Timestamp:
Feb 22, 2021, 5:28:31 PM (4 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/dyn3d/vlsplt.F

    r2603 r3852  
    44
    55      SUBROUTINE vlsplt(q,pente_max,masse,w,pbaru,pbarv,pdt,iq)
    6       USE infotrac, ONLY: nqtot,nqdesc,iqfils
     6      USE infotrac, ONLY: nqtot, tracers, tra
    77c
    88c     Auteurs:   P.Le Van, F.Hourdin, F.Forget
     
    5454      SAVE temps1,temps2,temps3
    5555      INTEGER iminn,imaxx
    56       INTEGER ifils,iq2 ! CRisi
     56      INTEGER ichld,iq2 ! CRisi
     57      TYPE(tra), POINTER :: tr
    5758
    5859      REAL qmin,qmax
     
    6162      DATA temps1,temps2,temps3/0.,0.,0./
    6263
     64       tr => tracers(iq)
    6365
    6466        zzpbar = 0.5 * pdt
     
    8385      CALL SCOPY(ijp1llm,masse,1,zm(1,1,iq),1)
    8486       
    85       if (nqdesc(iq).gt.0) then 
    86         do ifils=1,nqdesc(iq)
    87           iq2=iqfils(ifils,iq)
     87      if (tr%ndesc > 0) then 
     88        do ichld=1,tr%ndesc
     89          iq2=tr%idesc(ichld)
    8890          CALL SCOPY(ijp1llm,q(1,1,iq2),1,zq(1,1,iq2),1)
    8991        enddo 
    90       endif !if (nqfils(iq).gt.0) then
     92      endif !if (tr%ndesc > 0) then
    9193
    9294cprint*,'Entree vlx1'
     
    122124      ENDDO
    123125      ! CRisi: aussi pour les fils
    124       if (nqdesc(iq).gt.0) then
    125       do ifils=1,nqdesc(iq)
    126         iq2=iqfils(ifils,iq)
     126      if(tr%ndesc > 0) then
     127      do ichld=1,tr%ndesc
     128        iq2=tr%idesc(ichld)
    127129        DO l=1,llm
    128130         DO ij=1,ip1jmp1
     
    133135         ENDDO
    134136        ENDDO
    135       enddo !do ifils=1,nqdesc(iq)   
    136       endif ! if (nqdesc(iq).gt.0) then   
     137      enddo !do ichld=1,tr%ndesc
     138      endif ! if (tr%ndesc > 0)   
    137139
    138140      RETURN
    139141      END
    140142      RECURSIVE SUBROUTINE vlx(q,pente_max,masse,u_m,iq)
    141       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi
     143      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi
    142144
    143145c     Auteurs:   P.Le Van, F.Hourdin, F.Forget
     
    179181      ! CRisi
    180182      REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot)
    181       INTEGER ifils,iq2 ! CRisi
     183      INTEGER ichld,iq2 ! CRisi
     184      TYPE(tra), POINTER :: tr
    182185
    183186      Logical extremum,first,testcpu
     
    200203         first=.false.
    201204      ENDIF
     205
     206      tr => tracers(iq)
    202207
    203208c   calcul de la pente a droite et a gauche de la maille
     
    450455      !write(*,*) 'vlsplt 326: iq,nqfils(iq)=',iq,nqfils(iq)
    451456     
    452       if (nqdesc(iq).gt.0) then 
    453        do ifils=1,nqdesc(iq)
    454          iq2=iqfils(ifils,iq)
     457      if (tr%ndesc > 0) then 
     458       do ichld=1,tr%ndesc
     459         iq2=tr%idesc(ichld)
    455460         DO l=1,llm
    456461          DO ij=iip2,ip1jm
     
    460465          enddo   
    461466         enddo
    462         enddo !do ifils=1,nqdesc(iq)
    463         do ifils=1,nqfils(iq)
    464          iq2=iqfils(ifils,iq)
     467        enddo !do ichld=1,tr%ndesc
     468        do ichld=1,tr%nchld
     469         iq2=tr%idesc(ichld)
    465470         call vlx(Ratio,pente_max,masseq,u_mq,iq2)
    466         enddo !do ifils=1,nqfils(iq)
    467       endif !if (nqfils(iq).gt.0) then
     471        enddo !do ichld=1,tr%nchld
     472      endif !if (tr%nchld > 0) then
    468473! end CRisi
    469474
     
    489494      ! On calcule q entre iip2+1,ip1jm -> on fait pareil pour ratio
    490495      ! puis on boucle en longitude
    491       if (nqdesc(iq).gt.0) then 
    492        do ifils=1,nqdesc(iq)
    493          iq2=iqfils(ifils,iq
     496      if (tr%ndesc > 0) then 
     497       do ichld=1,tr%ndesc
     498         iq2=tr%idesc(ichld
    494499         DO l=1,llm
    495500          DO ij=iip2+1,ip1jm
     
    500505          enddo ! DO ij=ijb+iip1-1,ije,iip1
    501506         enddo !DO l=1,llm
    502         enddo !do ifils=1,nqdesc(iq)
    503       endif !if (nqfils(iq).gt.0) then
     507        enddo !do ichld=1,tr%ndesc
     508      endif !if (tr%ndesc > 0) then
    504509
    505510c     CALL SCOPY((jjm-1)*llm,q(iip1+iip1,1),iip1,q(iip2,1),iip1)
     
    510515      END
    511516      RECURSIVE SUBROUTINE vly(q,pente_max,masse,masse_adv_v,iq)
    512       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi
     517      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi
    513518c
    514519c     Auteurs:   P.Le Van, F.Hourdin, F.Forget
     
    562567
    563568      REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot) ! CRisi
    564       INTEGER ifils,iq2 ! CRisi
    565 
     569      INTEGER ichld,iq2 ! CRisi
     570      TYPE(tra), POINTER :: tr
    566571c
    567572c
     
    590595      ENDIF
    591596
     597      tr => tracers(iq)
    592598c
    593599cPRINT*,'CALCUL EN LATITUDE'
     
    770776      !write(*,*) 'vly 689: iq,nqfils(iq)=',iq,nqfils(iq)
    771777   
    772       if (nqfils(iq).gt.0) then 
    773        do ifils=1,nqdesc(iq)
    774          iq2=iqfils(ifils,iq)
     778      if (tr%ndesc > 0) then 
     779       do ichld=1,tr%ndesc
     780         iq2=tr%idesc(ichld)
    775781         DO l=1,llm
    776782         DO ij=1,ip1jmp1
     
    781787          enddo   
    782788         enddo
    783         enddo !do ifils=1,nqdesc(iq)
    784 
    785         do ifils=1,nqfils(iq)
    786          iq2=iqfils(ifils,iq)
     789        enddo !do ichld=1,tr%ndesc
     790
     791        do ichld=1,tr%nchld
     792         iq2=tr%idesc(ichld)
    787793         call vly(Ratio,pente_max,masseq,qbyv,iq2)
    788         enddo !do ifils=1,nqfils(iq)
    789       endif !if (nqfils(iq).gt.0) then
     794        enddo !do ichld=1,tr%nchld
     795      endif !if (tr%ndesc > 0)
    790796
    791797      DO l=1,llm
     
    855861 
    856862! retablir les fils en rapport de melange par rapport a l'air:
    857       if (nqfils(iq).gt.0) then 
    858        do ifils=1,nqdesc(iq)
    859          iq2=iqfils(ifils,iq
     863      if (tr%ndesc > 0) then 
     864       do ichld=1,tr%ndesc
     865         iq2=tr%idesc(ichld
    860866         DO l=1,llm
    861867          DO ij=1,ip1jmp1
     
    863869          enddo
    864870         enddo
    865         enddo !do ifils=1,nqdesc(iq)
    866       endif !if (nqfils(iq).gt.0) then
     871        enddo !do ichld=1,tr%ndesc
     872      endif !if (tr%ndesc > 0)
    867873
    868874      !write(*,*) 'vly 853: sortie'
     
    871877      END
    872878      RECURSIVE SUBROUTINE vlz(q,pente_max,masse,w,iq)
    873       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi
     879      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi
    874880c
    875881c     Auteurs:   P.Le Van, F.Hourdin, F.Forget
     
    907913
    908914      REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot) ! CRisi
    909       INTEGER ifils,iq2 ! CRisi
     915      INTEGER ichld,iq2 ! CRisi
     916      TYPE(tra), POINTER :: tr
    910917
    911918      LOGICAL testcpu
     
    923930
    924931      !write(*,*) 'vlz 923: entree'
     932
     933      tr => tracers(iq)
    925934
    926935#ifdef BIDON
     
    9921001! Il faut faire ça avant d'avoir mis à jour q et masse
    9931002      !write(*,*) 'vlsplt 942: iq,nqfils(iq)=',iq,nqfils(iq)
    994       if (nqfils(iq).gt.0) then 
    995        do ifils=1,nqdesc(iq)
    996          iq2=iqfils(ifils,iq)
     1003      if (tr%ndesc > 0) then 
     1004       do ichld=1,tr%ndesc
     1005         iq2=tr%idesc(ichld)
    9971006         DO l=1,llm
    9981007          DO ij=1,ip1jmp1
     
    10011010          enddo   
    10021011         enddo
    1003         enddo !do ifils=1,nqdesc(iq)
     1012        enddo !do ichld=1,tr%ndesc
    10041013       
    1005         do ifils=1,nqfils(iq)
    1006          iq2=iqfils(ifils,iq)         
     1014        do ichld=1,tr%nchld
     1015         iq2=tr%idesc(ichld)         
    10071016         call vlz(Ratio,pente_max,masseq,wq,iq2)
    1008         enddo !do ifils=1,nqfils(iq)
    1009       endif !if (nqfils(iq).gt.0) then
     1017        enddo !do ichld=1,tr%nchld
     1018      endif !if (tr%ndesc > 0)
    10101019! end CRisi 
    10111020
     
    10201029
    10211030! retablir les fils en rapport de melange par rapport a l'air:
    1022       if (nqfils(iq).gt.0) then 
    1023        do ifils=1,nqdesc(iq)
    1024          iq2=iqfils(ifils,iq) 
     1031      if (tr%ndesc > 0) then 
     1032       do ichld=1,tr%ndesc
     1033         iq2=tr%idesc(ichld)
    10251034         DO l=1,llm
    10261035          DO ij=1,ip1jmp1
     
    10281037          enddo
    10291038         enddo
    1030         enddo !do ifils=1,nqdesc(iq)
    1031       endif !if (nqfils(iq).gt.0) then
     1039        enddo !do ichld=1,tr%ndesc
     1040      endif !if (tr%ndesc > 0)
    10321041      !write(*,*) 'vlsplt 1032'
    10331042
Note: See TracChangeset for help on using the changeset viewer.