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/vlspltqs.F

    r2603 r3852  
    44       SUBROUTINE vlspltqs ( q,pente_max,masse,w,pbaru,pbarv,pdt,
    55     ,                                  p,pk,teta,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, F.Codron
     
    4545c
    4646      INTEGER i,ij,l,j,ii
    47       INTEGER ifils,iq2 ! CRisi
     47      INTEGER ichld,iq2 ! CRisi
     48      TYPE(tra), POINTER :: tr
    4849c
    4950      REAL qsat(ip1jmp1,llm)
     
    8485        rtt  = 273.16
    8586
     87        tr => tracers(iq)
     88
    8689c-- Calcul de Qsat en chaque point
    8790c-- approximation: au milieu des couches play(l)=(p(l)+p(l+1))/2
     
    121124      CALL SCOPY(ijp1llm,q(1,1,iq),1,zq(1,1,iq),1)
    122125      CALL SCOPY(ijp1llm,masse,1,zm(1,1,iq),1)
    123       if (nqdesc(iq).gt.0) then 
    124        do ifils=1,nqdesc(iq)
    125         iq2=iqfils(ifils,iq)
     126      if (tr%ndesc > 0) then 
     127       do ichld=1,tr%ndesc
     128        iq2=tr%idesc(ichld)
    126129        CALL SCOPY(ijp1llm,q(1,1,iq2),1,zq(1,1,iq2),1)
    127130       enddo 
    128       endif !if (nqfils(iq).gt.0) then
     131      endif !if (tr%ndesc > 0)
    129132
    130133c      call minmaxq(zq,qmin,qmax,'avant vlxqs     ')
     
    162165      ENDDO
    163166      ! CRisi: aussi pour les fils
    164       if (nqdesc(iq).gt.0) then
    165       do ifils=1,nqdesc(iq)
    166         iq2=iqfils(ifils,iq)
     167      if (tr%ndesc > 0) then
     168      do ichld=1,tr%ndesc
     169        iq2=tr%idesc(ichld)
    167170        DO l=1,llm
    168171         DO ij=1,ip1jmp1
     
    173176         ENDDO
    174177        ENDDO
    175       enddo !do ifils=1,nqdesc(iq) 
    176       endif ! if (nqfils(iq).gt.0) then
     178      enddo !do ichld=1,tr%ndesc
     179      endif ! if (tr%ndesc > 0)
    177180      !write(*,*) 'vlspltqs 183: fin de la routine'
    178181
     
    180183      END
    181184      SUBROUTINE vlxqs(q,pente_max,masse,u_m,qsat,iq)
    182       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi
     185      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi
    183186
    184187c
     
    218221      ! CRisi
    219222      REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot)
    220       INTEGER ifils,iq2 ! CRisi
     223      INTEGER ichld,iq2 ! CRisi
     224      TYPE(tra), POINTER :: tr
    221225
    222226      Logical first,testcpu
     
    238242         first=.false.
    239243      ENDIF
     244
     245      tr => tracers(iq)
    240246
    241247c   calcul de la pente a droite et a gauche de la maille
     
    485491      !write(*,*) 'vlspltqs 326: iq,nqfils(iq)=',iq,nqfils(iq)
    486492     
    487       if (nqfils(iq).gt.0) then 
    488        do ifils=1,nqdesc(iq)
    489          iq2=iqfils(ifils,iq)
     493      if (tr%ndesc > 0) then
     494       do ichld=1,tr%ndesc
     495         iq2=tr%idesc(ichld)
    490496         DO l=1,llm
    491497          DO ij=iip2,ip1jm
     
    495501          enddo   
    496502         enddo
    497         enddo !do ifils=1,nqdesc(iq)
    498         do ifils=1,nqfils(iq)
    499          iq2=iqfils(ifils,iq)
     503        enddo !do ichld=1,nqdesc(iq)
     504        do ichld=1,tr%nchld
     505         iq2=tr%idesc(ichld)
    500506         call vlx(Ratio,pente_max,masseq,u_mq,iq2)
    501         enddo !do ifils=1,nqfils(iq)
    502       endif !if (nqfils(iq).gt.0) then
     507        enddo !do ichld=1,tr%nchld
     508      endif !if (tr%ndesc > 0)
    503509! end CRisi
    504510
     
    523529      ! On calcule q entre iip2+1,ip1jm -> on fait pareil pour ratio
    524530      ! puis on boucle en longitude
    525       if (nqdesc(iq).gt.0) then 
    526        do ifils=1,nqdesc(iq)
    527          iq2=iqfils(ifils,iq) 
     531      if (tr%ndesc > 0) then
     532       do ichld=1,tr%ndesc
     533         iq2=tr%idesc(ichld)
    528534         DO l=1,llm
    529535          DO ij=iip2+1,ip1jm
     
    534540          enddo ! DO ij=ijb+iip1-1,ije,iip1
    535541         enddo !DO l=1,llm
    536         enddo !do ifils=1,nqdesc(iq)
    537       endif !if (nqfils(iq).gt.0) then
     542        enddo !do ichld=1,tr%ndesc
     543      endif !if (tr%ndesc > 0)
    538544
    539545c     CALL SCOPY((jjm-1)*llm,q(iip1+iip1,1),iip1,q(iip2,1),iip1)
     
    544550      END
    545551      SUBROUTINE vlyqs(q,pente_max,masse,masse_adv_v,qsat,iq)
    546       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi
     552      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi
    547553c
    548554c     Auteurs:   P.Le Van, F.Hourdin, F.Forget
     
    598604
    599605      REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot) ! CRisi
    600       INTEGER ifils,iq2 ! CRisi
     606      INTEGER ichld,iq2 ! CRisi
     607      TYPE(tra), POINTER :: tr
    601608c
    602609c
     
    623630      ENDIF
    624631
     632      tr => tracers(iq)
    625633c
    626634
     
    796804      !write(*,*) 'vlyqs 689: iq,nqfils(iq)=',iq,nqfils(iq)
    797805   
    798       if (nqfils(iq).gt.0) then 
    799        do ifils=1,nqdesc(iq)
    800          iq2=iqfils(ifils,iq)
     806      if (tr%ndesc > 0) then
     807       do ichld=1,tr%ndesc
     808         iq2=tr%idesc(ichld)
    801809         DO l=1,llm
    802810         DO ij=1,ip1jmp1
     
    805813          enddo   
    806814         enddo
    807         enddo !do ifils=1,nqdesc(iq)
    808 
    809         do ifils=1,nqfils(iq)
    810          iq2=iqfils(ifils,iq)
     815        enddo !do ichld=1,tr%ndesc
     816
     817        do ichld=1,tr%nchld
     818         iq2=tr%idesc(ichld)
    811819         !write(*,*) 'vlyqs 783: appel rec de vly, iq2=',iq2
    812820         call vly(Ratio,pente_max,masseq,qbyv,iq2)
    813         enddo !do ifils=1,nqfils(iq)
    814       endif !if (nqfils(iq).gt.0) then
     821        enddo !do ichld=1,tr%nchld
     822      endif !if (tr%ndesc > 0)
    815823
    816824      DO l=1,llm
     
    868876
    869877! retablir les fils en rapport de melange par rapport a l'air:
    870       if (nqdesc(iq).gt.0) then 
    871        do ifils=1,nqdesc(iq)
    872          iq2=iqfils(ifils,iq) 
     878      if (tr%ndesc > 0) then
     879       do ichld=1,tr%ndesc
     880         iq2=tr%idesc(ichld)
    873881         DO l=1,llm
    874882          DO ij=1,ip1jmp1
     
    876884          enddo
    877885         enddo
    878         enddo !do ifils=1,nqdesc(iq)
    879       endif !if (nqfils(iq).gt.0) then
     886        enddo !do ichld=1,tr%ndesc
     887      endif !if (tr%ndesc > 0)
    880888      !write(*,*) 'vly 879'
    881889
Note: See TracChangeset for help on using the changeset viewer.