my.meteo.dir: /scratch3/BMC/co2/METEO/tm5-nc
my.meteo.class:  ei
tm5.meteo.tinterp: T
ECLEVS : ml60

#if "${convective.fluxes.tiedtke}" == "T":
tiedtke:T
#else
tiedtke:F
#endif

!
! The keys that define meteo usage have the form:
!
!   <key(s)>.<name(s)>
!
! or, if the property depends on the zoom region:
!
!   <key(s)>.<region_name>.<name(s)>
!
! The region_name is either a '*' or names like 'glb300x200' etc.
!
! Multipe names could apply to the same field; see the table below.
! A '*' applies to all fields.
! If more than name applies to a field, the last one defines the value.
! For example, the following 3 keys all apply to the 'oro' field,
! but the resulting temporal interpolation will be 'const' :
!
!     meteo.tinterp.*              :  interp3
!     meteo.tinterp.sfc.an         :  interp6
!     meteo.tinterp.oro            :  const
!
! Summary of possible name(s) :
!
!  field     name(s) that apply to this field
!  --------  ------------------------------------------------------
!  sp        ml                                            sp
!  mfw       ml                                 mflux_w
!  tsp       ml                                 mflux_w
!  mfu       ml                                 mflux_uv
!  mfv       ml                                 mflux_uv
!  T         ml                                            temper
!  Q         ml                                            humid
!  CLWC      ml                                 cloud
!  CIWC      ml                                 cloud
!  CC        ml                                 cloud
!  CCO       ml                                 cloud
!  CCU       ml                                 cloud
!  eu        ml                                 convec
!  ed        ml                                 convec
!  du        ml                                 convec
!  dd        ml                                 convec
!  oro       sfc  sfc.const           sfc.an               oro
!  lsm       sfc  sfc.const           sfc.an               lsm
!  ci        sfc  sfc.inst sfc.day    sfc.fc               ci
!  sst       sfc  sfc.inst            sfc.fc               sst
!  u10m      sfc  sfc.inst            sfc.fc               u10m
!  v10m      sfc  sfc.inst            sfc.fc               u10m
!  g10m      sfc  sfc.inst            sfc.fc               g10m
!  src       sfc  sfc.inst            sfc.fc               src
!  d2m       sfc  sfc.inst            sfc.fc               d2m
!  t2m       sfc  sfc.inst            sfc.fc               t2m
!  skt       sfc  sfc.inst            sfc.fc               blh
!  blh       sfc  sfc.inst            sfc.fc               skt
!  sshf      sfc  sfc.aver            sfc.fc               sshf
!  slhf      sfc  sfc.aver            sfc.fc               slhf
!  ewss      sfc  sfc.aver            sfc.fc               ewss
!  nsss      sfc  sfc.aver            sfc.fc               nsss
!  cp        sfc  sfc.aver            sfc.fc               cp
!  lsp       sfc  sfc.aver            sfc.fc               lsp
!  sf        sfc  sfc.aver            sfc.fc               sf
!  ssr       sfc  sfc.aver            sfc.fc               ssr
!  sd        sfc  sfc.inst sfc.day    sfc.fc               sd
!  swvl1     sfc  sfc.inst sfc.day    sfc.fc               swvl1
!  tv        sfc  sfc.inst sfc.day    sfc.an    veg
!  cvl       sfc  sfc.inst sfc.day    sfc.an    veg
!  cvh       sfc  sfc.inst sfc.day    sfc.an    veg
!  albedo    sfc  sfc.inst sfc.day    sfc.an               albedo
!  sr        sfc  sfc.inst sfc.day    sfc.an               sr
!  srols     sfc  sfc.inst sfc.day    sfc.an               srols
!
! Background:
!  o 'ml' and 'sfc' indicate model levels and surface level
!  o surface fields could have a constant value (sfc.const),
!    have instananeous values (sfc.inst), 
!    or averaged over an accumulation interval (sfc.aver).
!  o when meteo was produced by TMPP, some fields were stored
!    as daily averages (sfc.day)
!  o surface fields could originate from an ecmwf forecast (sfc.fc)
!    or from the analysis (sfc.an)
!  o group names apply to fields that usually belong together,
!    for example the vegation fields (veg)
!


!
! ** which fiels should be read ?
!

meteodir : ${my.meteo.dir}

! o where to search for meteo files:

meteo_search : ${my.meteo.dir}


! by default, load nothing; 
! processes will set flags if meteo is needed:
meteo.read.*.*              : F

!! some fields not available in TMPP surf file:
!meteo.read.*.sst            : F
!meteo.read.*.skt            : F


!
! ** temporal interpolation
!

!
! Temporal interpolation is defined first by general key:
!
!   meteo.tinterp.*      :  const6
!
! Optionally, different settings might be chosen for specific meteo:
!
!   sp mflux_uv mflux_w temper humid cloud convec surf.inst surf.aver surf.day albedo sr
!
! Possible time interpolations:
!  o month      : constant in month
!  o const      : constant
!  o const24    : constant in 24hr intervals [00:00,24:00]
!  o const6     : constant in 6hr intervals  [21:00,03:00]  [03:00,09:00]  ...
!  o const3     : constant in 3hr intervals  [22:30,01:30]  [01:30,04:30] ...
!  o interp6    : interpoloated between 00,     06,     12,     18
!  o interp6_3  : interpoloated between     03,     09,     15,     21
!  o interp3    : interpoloated between 00, 03, 06, 09, 12, 15, 18, 21
!  o aver6      : time averages over intervals ]00,06], [06,12], ...
!  o aver3      : time averages over intervals [00,03], [03,06], ...
!  o aver24     : time averages over interval  [00,24]
!  o aver24_3   : time averages over interval  [21,21]
!
!!
!! ~~~ era2003 meteo processed by TM5
!!

! Key added 18 Feb 2013 by Andy Jacobson
!  Idea is to control whether or not TM5
!  uses temporal interpolation of meteo
!  at run time.  Temporal interpolation
!  screws up our emissions scheme, which
!  assume constant met fields during its
!  preprocessing.
!
! Set this in your run's rc file:
!   either
! tm5.meteo.tinterp : F
!   or
! tm5.meteo.tinterp : F

#if "${tm5.meteo.tinterp}" == "T"

! Read (possibly write) DKG files?
diffusion.write       : T
diffusion.dir         : ${my.meteo.dir}/ec/${my.meteo.class}/dkg-interp

! ~ fc fields are 3 hourly instantaneous,
!   except for the accumulated fields which have been averaged over 3 hour:
meteo.tinterp.*              :  interp3

#if "${tiedtke}" == "F":
meteo.tinterp.convec         :  aver3
#endif

meteo.tinterp.sfc.aver       :  aver3
! ~ an fields 6 hourly instantaneous,
!   except oro and lsm which are constant:
meteo.tinterp.sfc.an         :  interp6

! ~ constant
meteo.tinterp.oro           :  const
meteo.tinterp.lsm           :  const

! ~ surface roughness Olsson/Ganzeveld is per month:
meteo.tinterp.srols         :  month

#else

! Read (possibly write) DKG files?
diffusion.write       : T
diffusion.dir         : ${my.meteo.dir}/ec/${my.meteo.class}/dkg-partialconst

!! ~ fc 3 hourly
meteo.tinterp.*              :  interp3
! specials to preserve pre-computed emissions:
meteo.tinterp.t2m              :  const3
!meteo.tinterp.t2m              :  aver3
meteo.tinterp.ssr              :  aver3
meteo.tinterp.u10m              :  const3
meteo.tinterp.v10m              :  const3
meteo.tinterp.sfc.aver       :  aver3
! ~ for ecmwf convective fields:
meteo.tinterp.convec         :  aver3
!! ~ an 6 hourly
meteo.tinterp.veg            :  interp6
meteo.tinterp.albedo         :  interp6
meteo.tinterp.sr             :  interp6
!! ~ constant
meteo.tinterp.oro            :  const
meteo.tinterp.lsm            :  const
meteo.tinterp.srols          :  month

#endif
!
! ** source keys : how to form a file name ?
!

!
! TMM requires keys on how to form a meteo filename.
! A key should be defined for each region (names are in 'dims_grid.F90'):
!
!    tmm.sourcekey.glb600x400.*   : tmpp:class=od;type=fc;levs=ml60;grid=glb3x2;tres=_21p06
!
! Optionally, some specific fields might be read from a different set:
!
!    tmm.sourcekey.glb600x400.sp   : ecmwf:form=3hr;class=od;type=fc;nlev=60;sh=159;tres=_fc012up2tr3
!  
! Possible specific fields:
!
!    sp mflux_uv mflux_w temper humid cloud convec
!    surf oro lsm albedo sr 
!   
! Examples of source keys:
!
!   * tmpp:class=od;type=fc;levs=ml60;grid=glb3x2;tres=_21p06
!
!       Identifies the regular TMPP hdf files:
!          xxxx/od-fc-2000-01-ml60-glb3x2-uvsp_20000101_21p06.hdf
!             etc
!
!   * tmpp:class=od;type=fc;levs=ml60;grid=glb3x2;tres=_21p06;pathsep=\;namesep=\
!
!       Idem, but then for full Windows path names:
!          xxxx\od\fc\2000\01\ml60\glb3x2\uvsp_20000101_21p06.hdf
!             etc
!
!   * tm5:mdir=ec-fc012up2-ml60_tropo25-glb6x4;tres=_00p06
!
!   * msc-data:nlev=71;sh=47;mdir=cmam;type=iau;tres=_6hrly;sp_unit=hPa
!    
!   * ncep-gfs:
!   * ncep-cdc:
!


!
! ~~~ TM5 produced
!
!tmm.sourcekey.glb600x400.ml         :  tm5:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb600x400;tres=_00p03
!tmm.sourcekey.eur300x200.ml         :  tm5:mdir=ec/ei/fc012up2tr3/${ECLEVS}/eur300x200;tres=_00p03
!tmm.sourcekey.eur100x100.ml         :  tm5:mdir=ec/ei/fc012up2tr3/${ECLEVS}/eux100x100;tres=_00p03

tmm.sourcekey.*.sfc.fc               :  tm5-nc:mdir=ec/ei/fc012up2tr3/sfc/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.*.sfc.an               :  tm5-nc:mdir=ec/ei/an0tr6/sfc/glb100x100/<yyyy>/<mm>;tres=_00p06;pathsep=/;namesep=/
tmm.sourcekey.*.oro                  :  tm5-nc:mdir=ec/ei/an0tr6/sfc/glb100x100;tres=_00p06;pathsep=/;namesep=/
tmm.sourcekey.*.lsm                  :  tm5-nc:mdir=ec/ei/an0tr6/sfc/glb100x100;tres=_00p06;pathsep=/;namesep=/

! abbreviated grid names
!tmm.sourcekey.glb6x4.ml              :  tm5-nc:mdir=ec/ei/fc012up2tr3-${ECLEVS}-glb100x100;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.glb6x4.ml              :  tm5-nc:mdir=ec/ei/fc012up2tr3/${my.levs}/glb600x400/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.glb3x2.ml              :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.glb1x1.ml              :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.asi1x1.ml              :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.arc1x1.ml              :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.nam1x1.ml              :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/

! full grid names
!tmm.sourcekey.glb600x400.ml          :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.glb600x400.ml          :  tm5-nc:mdir=ec/ei/fc012up2tr3/${my.levs}/glb600x400/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.glb300x200.ml          :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.glb100x100.ml          :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.asi100x100.ml          :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.arc100x100.ml          :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/
tmm.sourcekey.nam100x100.ml          :  tm5-nc:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb100x100/<yyyy>/<mm>;tres=_00p03;pathsep=/;namesep=/


!
! ** install meteo files
!

! location of meteo files;
! either a permanent archive, or a temporary scratch:
tmm.dir        : ${meteodir}

! Clean up the temporary meteo ?
!  o Set the clean flag (T|F) such that files that have not been accessed
!    for a long time are removed if a maximum buffer usage is exceeded.
!  o specify a maximum size: 500k, 1M, 2G
!
tmm.dir.clean  : F
tmm.dir.size   : 4G

!
! Meteo files could be setup before the actual program is started.
! First set the main switch to apply this or not.
! If to be applied, specify details for a number of sets;
! each set can be applied by a seperate flag.
!
tmm.setup.apply        :  F
tmm.setup.verbose      :  T
tmm.setup.nset         :  3
!
! ** TM5 produced hdf files:
!
tmm.setup.001.apply    :  T
tmm.setup.001.files    :  sp mfuv mfw t q cld !sub
tmm.setup.001.sources  :  tm5:mdir=ec/ei/fc012up2tr3/${ECLEVS}/glb600x400;tres=_00p03 tm5:mdir=ec/ei/fc012up2tr3/${ECLEVS}/eur300x200;tres=_00p03 tm5:mdir=ec/ei/fc012up2tr3/${ECLEVS}/eux100x100;tres=_00p03
tmm.setup.001.search   :  ${meteo_search}
!
tmm.setup.002.apply    :  T
tmm.setup.002.files    :  ci cp d2m lsp sd skt slhf src sshf ssr sst ewss nsss swvl1 t2m u10m v10m
tmm.setup.002.sources  :  tm5:mdir=ec/ei/fc012up2tr3/sfc/glb100x100;tres=_00p03
tmm.setup.002.search   :  ${meteo_search}
!
tmm.setup.003.apply    :  T
tmm.setup.003.files    :  oro lsm albedo sr srols veg
tmm.setup.003.sources  :  tm5:mdir=ec/ei/an0tr6/sfc/glb100x100;tres=_00p06
tmm.setup.003.search   :  ${meteo_search}

!
! ** output meteo
!

! By default, write none:
tmm.output.*                     :  F


! Define output format and/or first part of file name:
!
!   tmm.destkey.glb600x400.*      :  tm5:mdir=ec-fc012up2-tropo25-glb6x4;tres=_00p06
!
! ~ od production
GLBGRID : glb100x100
GLBSURF : glb100x100
!tmm.destkey.${GLBGRID}.ml        :  tm5:mdir=ec/ei/fc012up2tr3/${ECLEVS}/${GLBGRID};tres=_00p03
!tmm.destkey.${GLBSURF}.sfc       :  tm5:mdir=ec/ei/fc012up2tr3/sfc/${GLBSURF};tres=_00p03
!tmm.destkey.${GLBSURF}.sfc.an    :  tm5:mdir=ec/ei/an0tr6/sfc/${GLBSURF};tres=_00p06
tmm.destkey.${GLBGRID}.ml        :  tm5:mdir=ec/ei/fc012up2tr3/${ECLEVS}/${GLBGRID};tres=_00p03
tmm.destkey.${GLBSURF}.sfc       :  tm5:mdir=ec/ei/fc012up2tr3/sfc/${GLBSURF};tres=_00p03
tmm.destkey.${GLBSURF}.sfc.an    :  tm5:mdir=ec/ei/an0tr6/sfc/${GLBSURF};tres=_00p06

! TM5 writes new meteo files to:
tmm.output.dir        :  ${rundir}/tm5_meteo_out

! Call storage script 'tm5-tmm-store' to store copies in archive ?
! Specify one or more archives.
! Files are stored in monthly tar files if an archive ends with '/*.tar';
! large 3D files per 10 or 5 days for '/*.tar10' or '/*.tar5' .
! A seperate destination for forecast files could be provided too.
! Examples:
!    ${SCRATCH}/TM/meteo_day
!    ecfs:/nlh/TM/meteo/*.tar
!    mos:umask=002%/fa/ks/meteo/*.tar
! NOTE: files are removed from <tmm.output.dir> after storage ...
tmm.output.store              :  F
tmm.output.store.verbose      :  T
tmm.output.store.archives     :  ecfs:umask=002%/nlh/TM/meteo/*.tar5
tmm.output.store.archives.fc  :  ecfs:umask=002%/tmp/nlh/TM/meteo
