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/phylmd/traclmdz_mod.F90

    r3581 r3852  
    6767   
    6868    USE dimphy
    69     USE infotrac_phy
     69    USE infotrac_phy, ONLY: nbtr
    7070   
    7171    ! Input argument
     
    8989    ! Initialization of the tracers should be done here only for those not found in the restart file.
    9090    USE dimphy
    91     USE infotrac_phy
     91    USE infotrac_phy, ONLY: tracers, nqo, nbtr, niadv, pbl_flg, conv_flg
    9292    USE regr_pr_comb_coefoz_m, ONLY: alloc_coefoz
    9393    USE press_coefoz_m, ONLY: press_coefoz
     
    175175!!       iiq=niadv(it+2)                                                            ! jyg
    176176       iiq=niadv(it+nqo)                                                            ! jyg
    177        IF ( tname(iiq) == "RN" ) THEN                                               
    178           id_rn=it ! radon
    179        ELSE IF ( tname(iiq) == "PB") THEN
    180           id_pb=it ! plomb
     177       !-----------------------------------------------------------------------
     178       SELECT CASE(tracers(iiq)%name)
     179       !-----------------------------------------------------------------------
     180         CASE("RN"); id_rn=it ! radon
     181       !-----------------------------------------------------------------------
     182         CASE("PB"); id_pb=it ! plomb
    181183! RomP >>> profil initial de PB210
    182184     open (ilesfil2,file='prof.pb210',status='old',iostat=irr2)
     
    198200     ENDIF
    199201! RomP <<<
    200        ELSE IF ( tname(iiq) == "Aga" .OR. tname(iiq) == "AGA" ) THEN
    201           ! Age of stratospheric air
    202           id_aga=it
     202       !-----------------------------------------------------------------------
     203         CASE("Aga","AGA");           id_aga   = it ! Age of stratospheric air
    203204          radio(id_aga) = .FALSE.
    204205          aerosol(id_aga) = .FALSE.
     
    213214             lev_1p5km=klev/2
    214215          END IF
    215        ELSE IF ( tname(iiq) == "BE" .OR. tname(iiq) == "Be" .OR.  &
    216             tname(iiq) == "BE7" .OR. tname(iiq) == "Be7" ) THEN 
    217           ! Recherche du Beryllium 7
    218           id_be=it
     216       !-----------------------------------------------------------------------
     217         CASE("BE","Be","BE7","Be7"); id_be    = it ! Recherche du Beryllium 7
    219218          ALLOCATE( srcbe(klon,klev) )
    220219          radio(id_be) = .TRUE.
     
    243242     ENDIF
    244243! RomP <<<
    245        ELSE IF (tname(iiq)=="O3" .OR. tname(iiq)=="o3") THEN
    246           ! Recherche de l'ozone : parametrization de la chimie par Cariolle
    247           id_o3=it
    248           CALL alloc_coefoz   ! allocate ozone coefficients
    249           CALL press_coefoz   ! read input pressure levels
    250        ELSE IF ( tname(iiq) == "pcsat" .OR. tname(iiq) == "Pcsat" ) THEN
    251           id_pcsat=it
    252        ELSE IF ( tname(iiq) == "pcocsat" .OR. tname(iiq) == "Pcocsat" ) THEN
    253           id_pcocsat=it
    254        ELSE IF ( tname(iiq) == "pcq" .OR. tname(iiq) == "Pcq" ) THEN
    255           id_pcq=it
    256        ELSE IF ( tname(iiq) == "pcs0" .OR. tname(iiq) == "Pcs0" ) THEN
    257           id_pcs0=it
    258           conv_flg(it)=0 ! No transport by convection for this tracer
    259        ELSE IF ( tname(iiq) == "pcos0" .OR. tname(iiq) == "Pcos0" ) THEN
    260           id_pcos0=it
    261           conv_flg(it)=0 ! No transport by convection for this tracer
    262        ELSE IF ( tname(iiq) == "pcq0" .OR. tname(iiq) == "Pcq0" ) THEN
    263           id_pcq0=it
    264           conv_flg(it)=0 ! No transport by convection for this tracer
    265        ELSE
    266           WRITE(lunout,*) 'This is an unknown tracer in LMDZ : ', trim(tname(iiq))
    267        END IF
     244       !-----------------------------------------------------------------------
     245         CASE("O3","o3");           id_o3      = it
     246           ! Recherche de l'ozone : parametrization de la chimie par Cariolle
     247           CALL alloc_coefoz   ! allocate ozone coefficients
     248           CALL press_coefoz   ! read input pressure levels
     249       !-----------------------------------------------------------------------
     250         CASE("pcsat"  ,"Pcsat");   id_pcsat   = it
     251       !-----------------------------------------------------------------------
     252         CASE("pcocsat","Pcocsat"); id_pcocsat = it
     253       !-----------------------------------------------------------------------
     254         CASE("pcq"    ,"Pcq");     id_pcq     = it
     255       !-----------------------------------------------------------------------
     256         CASE("pcs0"   ,"Pcs0");    id_pcs0    = it
     257           conv_flg(it)=0 ! No transport by convection for this tracer
     258       !-----------------------------------------------------------------------
     259         CASE("pcos0"  ,"Pcos0");   id_pcos0   = it
     260           conv_flg(it)=0 ! No transport by convection for this tracer
     261       !-----------------------------------------------------------------------
     262         CASE("pcq0"   ,"Pcq0");    id_pcq0    = it
     263           conv_flg(it)=0 ! No transport by convection for this tracer
     264       !-----------------------------------------------------------------------
     265         CASE DEFAULT
     266           WRITE(lunout,*) 'This is an unknown tracer in LMDZ : ', trim(tracers(iiq)%name)
     267       !-----------------------------------------------------------------------
     268       END SELECT
     269       !-----------------------------------------------------------------------
    268270    END DO
    269271
     
    309311       IF (zero) THEN
    310312          ! The tracer was not found in restart file or it was equal zero everywhere.
    311           WRITE(lunout,*) "The tracer ",trim(tname(iiq))," will be initialized"
     313          WRITE(lunout,*) "The tracer ",trim(tracers(iiq)%name)," will be initialized"
    312314          IF (it==id_pcsat .OR. it==id_pcq .OR. &
    313315               it==id_pcs0 .OR. it==id_pcq0) THEN
Note: See TracChangeset for help on using the changeset viewer.