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

    r3851 r3852  
    1414c   --------------------------------------------------------------------
    1515      USE parallel_lmdz
    16       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils, ! CRisi                 &
     16      USE infotrac, ONLY : nqtot,tracers, tra,        ! CRisi                 &
    1717     &                     qperemin,masseqmin,ratiomin ! MVals et CRisi
    1818      IMPLICIT NONE
     
    4444
    4545      REAL Ratio(ijb_u:ije_u,llm,nqtot) ! CRisi
    46       INTEGER ifils,iq2 ! CRisi
     46      INTEGER ichld,iq2 ! CRisi
     47      TYPE(tra), POINTER :: tr
    4748
    4849      Logical extremum
     
    5455
    5556      INTEGER ijb,ije,ijb_x,ije_x
    56      
     57
     58      tr => tracers(iq)
     59
    5760      !write(*,*) 'vlsplt 58: entree dans vlx_loc, iq,ijb_x=',
    5861!     &   iq,ijb_x
     
    330333! Il faut faire ça avant d'avoir mis à jour q et masse
    331334
    332        if (nqfils(iq).gt.0) then
    333        do ifils=1,nqdesc(iq)
    334        !do ifils=1,nqfils(iq) ! modif C Risi 22nov2020
     335       if (tr%ndesc > 0) then
     336       do ichld=1,tr%ndesc
     337       !do ichld=1,tr%nchld ! modif C Risi 22nov2020
    335338        ! attention: comme Ratio est utilisé comme q dans l'appel
    336339        ! recursif, il doit contenir à lui seul tous les indices de tous
    337340        ! les descendants!
    338          iq2=iqfils(ifils,iq)
     341         iq2=tr%idesc(ichld)
    339342c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
    340343         DO l=1,llm
     
    352355         enddo
    353356c$OMP END DO NOWAIT
    354         enddo !do ifils=1,nqdesc(iq)
    355         do ifils=1,nqfils(iq)
    356          iq2=iqfils(ifils,iq)
     357        enddo !do ichld=1,tr%ndesc
     358        do ichld=1,tr%nchld
     359         iq2=tr%idesc(ichld)
    357360         call vlx_loc(Ratio,pente_max,masse,u_mq,ijb_x,ije_x,iq2)
    358         enddo !do ifils=1,nqfils(iq)
    359       endif !if (nqfils(iq).gt.0) then
     361        enddo !do ichld=1,tr%nchld
     362      endif !if (tr%ndesc > 0) then
    360363! end CRisi
    361364
     
    383386      ! On calcule q entre ijb+1 et ije -> on fait pareil pour ratio
    384387      ! puis on boucle en longitude
    385       if (nqfils(iq).gt.0) then 
    386        do ifils=1,nqdesc(iq)
    387        !do ifils=1,nqfils(iq) ! modif C Risi 22nov2020
    388          iq2=iqfils(ifils,iq
     388      if (tr%ndesc > 0) then 
     389       do ichld=1,tr%ndesc
     390       !do ichld=1,tr%nchld ! modif C Risi 22nov2020
     391         iq2=tr%idesc(ichld
    389392c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
    390393         DO l=1,llm
     
    397400         enddo !DO l=1,llm
    398401c$OMP END DO NOWAIT
    399         enddo !do ifils=1,nqdesc(iq)
    400       endif !if (nqfils(iq).gt.0) then
     402        enddo !do ichld=1,tr%ndesc
     403      endif !if (tr%ndesc > 0) then
    401404
    402405      !write(*,*) 'vlsplt 399: iq,ijb_x=',iq,ijb_x
     
    422425c   --------------------------------------------------------------------
    423426      USE parallel_lmdz
    424       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils, ! CRisi                 &
     427      USE infotrac, ONLY : nqtot, tracers, tra,        ! CRisi                 &
    425428     &                     qperemin,masseqmin,ratiomin ! MVals et CRisi   
    426429      USE comconst_mod, ONLY: pi
     
    468471
    469472      REAL Ratio(ijb_u:ije_u,llm,nqtot) ! CRisi
    470       INTEGER ifils,iq2 ! CRisi
     473      INTEGER ichld,iq2 ! CRisi
     474      TYPE(tra), POINTER :: tr
    471475c
    472476c
     
    478482      INTEGER ijb,ije
    479483      INTEGER ijbm,ijem
     484
     485      tr => tracers(iq)
    480486
    481487      ijb=ij_begin-2*iip1
     
    732738! CRisi: appel récursif de l'advection sur les fils.
    733739! Il faut faire ça avant d'avoir mis à jour q et masse
    734       !write(*,*) 'vly 689: iq,nqfils(iq)=',iq,nqfils(iq)
     740      !write(*,*) 'vly 689: iq,tr%nchld=',iq,tr%nchld
    735741
    736742      ijb=ij_begin-2*iip1
     
    743749      if (pole_sud)  ijem=ij_end
    744750
    745       if (nqfils(iq).gt.0) then 
    746        do ifils=1,nqdesc(iq)
    747        !do ifils=1,nqfils(iq) ! modif C Risi 22nov2020
    748          iq2=iqfils(ifils,iq)
     751      if (tr%ndesc > 0) then 
     752       do ichld=1,tr%ndesc
     753       !do ichld=1,tr%nchld ! modif C Risi 22nov2020
     754         iq2=tr%idesc(ichld)
    749755c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
    750756         DO l=1,llm
     
    767773         enddo !DO l=1,llm
    768774c$OMP END DO NOWAIT
    769         enddo !do ifils=1,nqdesc(iq)
    770 
    771         do ifils=1,nqfils(iq)
    772          iq2=iqfils(ifils,iq)
     775        enddo !do ichld=1,tr%ndesc
     776
     777        do ichld=1,tr%nchld
     778         iq2=tr%idesc(ichld)
    773779         call vly_loc(Ratio,pente_max,masse,qbyv,iq2)
    774         enddo !do ifils=1,nqfils(iq)
    775       endif !if (nqfils(iq).gt.0) then
     780        enddo !do ichld=1,tr%nchld
     781      endif !if (tr%ndesc > 0) then
    776782! end CRisi
    777783     
     
    862868!      if (pole_sud)  ije=ij_end
    863869
    864       if (nqfils(iq).gt.0) then 
    865        do ifils=1,nqdesc(iq)
    866          iq2=iqfils(ifils,iq
     870      if (tr%ndesc > 0) then 
     871       do ichld=1,tr%ndesc
     872         iq2=tr%idesc(ichld
    867873c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
    868874         DO l=1,llm
     
    872878         enddo
    873879c$OMP END DO NOWAIT
    874         enddo !do ifils=1,nqdesc(iq)
    875       endif !if (nqfils(iq).gt.0) then
     880        enddo !do ichld=1,tr%ndesc
     881      endif !if (tr%ndesc > 0) then
    876882
    877883
     
    895901      USE parallel_lmdz
    896902      USE vlz_mod
    897       USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils, ! CRisi                 &
     903      USE infotrac, ONLY : nqtot, tracers, tra,        ! CRisi                 &
    898904     &                     qperemin,masseqmin,ratiomin ! MVals et CRisi
    899905     
     
    946952      ! Ces varibles doivent être déclarées en pointer et en save dans
    947953      ! vlz_loc si on veut qu'elles soient vues par tous les threads. 
    948       INTEGER ifils,iq2 ! CRisi
     954      INTEGER ichld,iq2 ! CRisi
    949955
    950956
     
    11591165! CRisi: appel récursif de l'advection sur les fils.
    11601166! Il faut faire ça avant d'avoir mis à jour q et masse
    1161       !write(*,*) 'vlsplt 942: iq,nqfils(iq)=',iq,nqfils(iq)
    1162       if (nqfils(iq).gt.0) then 
    1163        do ifils=1,nqdesc(iq)
    1164        !do ifils=1,nqfils(iq) ! modif C Risi 22 nov 2020
    1165          iq2=iqfils(ifils,iq)
     1167      !write(*,*) 'vlsplt 942: iq,tr%nchld=',iq,tr%nchld
     1168      if (tr%ndesc > 0) then 
     1169       do ichld=1,tr%ndesc
     1170       !do ichld=1,tr%nchld ! modif C Risi 22 nov 2020
     1171         iq2=tr%idesc(ichld)
    11661172c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
    11671173         DO l=1,llm
     
    11791185         enddo
    11801186c$OMP END DO NOWAIT
    1181         enddo !do ifils=1,nqdesc(iq)
     1187        enddo !do ichld=1,tr%ndesc
    11821188c$OMP BARRIER
    11831189
    1184         do ifils=1,nqfils(iq)
    1185          iq2=iqfils(ifils,iq)
     1190        do ichld=1,tr%nchld
     1191         iq2=tr%idesc(ichld)
    11861192         call vlz_loc(Ratio,pente_max,masse,w,ijb_x,ije_x,iq2)
    1187         enddo !do ifils=1,nqfils(iq)
    1188       endif !if (nqfils(iq).gt.0) then
     1193        enddo !do ichld=1,tr%nchld
     1194      endif !if (tr%ndesc > 0) then
    11891195! end CRisi 
    11901196
     
    12071213     
    12081214! retablir les fils en rapport de melange par rapport a l'air:
    1209       if (nqfils(iq).gt.0) then 
    1210        do ifils=1,nqdesc(iq)
    1211          iq2=iqfils(ifils,iq
     1215      if (tr%ndesc > 0) then 
     1216       do ichld=1,tr%ndesc
     1217         iq2=tr%idesc(ichld
    12121218c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
    12131219         DO l=1,llm
     
    12171223         enddo
    12181224c$OMP END DO NOWAIT
    1219         enddo !do ifils=1,nqdesc(iq)
    1220       endif !if (nqfils(iq).gt.0) then
     1225        enddo !do ichld=1,tr%ndesc
     1226      endif !if (tr%ndesc > 0) then
    12211227
    12221228      RETURN
Note: See TracChangeset for help on using the changeset viewer.