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/dynredem.F90

    r3851 r3852  
    77  USE IOIPSL
    88#endif
    9   USE infotrac
     9  USE infotrac, ONLY: nqtot, tracers
    1010  USE netcdf, ONLY: NF90_CREATE, NF90_DEF_DIM, NF90_INQ_VARID, NF90_GLOBAL,    &
    1111                    NF90_CLOSE,  NF90_PUT_ATT, NF90_UNLIMITED, NF90_CLOBBER,   &
     
    145145  CALL cre_var(nid,"teta" ,"Temperature",[rlonvID,rlatuID,sID,timID])
    146146  DO iq=1,nqtot
    147     CALL cre_var(nid,tname(iq),ttext(iq),[rlonvID,rlatuID,sID,timID])
     147    CALL cre_var(nid,tracers(iq)%name,tracers(iq)%lnam,[rlonvID,rlatuID,sID,timID])
    148148  END DO
    149149  CALL cre_var(nid,"masse","Masse d air"    ,[rlonvID,rlatuID,sID,timID])
     
    166166! Purpose: Write the NetCDF restart file (append).
    167167!-------------------------------------------------------------------------------
    168   USE infotrac
     168  USE infotrac, ONLY: nqtot, tracers, type_trac
    169169  USE control_mod
    170170  USE netcdf,   ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_GET_VAR, NF90_INQ_VARID,  &
     
    226226
    227227!--- Tracers in file "start_trac.nc" (added by Anne)
    228   lread_inca=.FALSE.; fil="start_trac.nc"
    229   IF(type_trac=='inca') INQUIRE(FILE=fil,EXIST=lread_inca)
     228  fil="start_trac.nc"
     229  INQUIRE(FILE=fil, EXIST=lread_inca)
     230  lread_inca = lread_inca .AND. type_trac == 'inca'
    230231  IF(lread_inca) CALL err(NF90_OPEN(fil,NF90_NOWRITE,nid_trac),"open")
    231232
    232233!--- Save tracers
    233   DO iq=1,nqtot; var=tname(iq); ierr=-1
     234  DO iq=1,nqtot; var=tracers(iq)%name; ierr=-1
    234235    IF(lread_inca) THEN                  !--- Possibly read from "start_trac.nc"
    235236      fil="start_trac.nc"
     
    237238      dum='inq'; IF(ierr==NF90_NoErr) dum='fnd'
    238239      WRITE(lunout,*)msg(dum,var)
    239 
    240 
    241240      IF(ierr==NF90_NoErr) CALL dynredem_read_u(nid_trac,var,q(:,:,:,iq),llm)
    242241    END IF
Note: See TracChangeset for help on using the changeset viewer.