!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!
!!! Settings for CSO tutorial program.
!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!-------------------------------------------------
! tutorial settings
!-------------------------------------------------

! time range:
tutorial.timerange.start           :  2018-06-01 00:00
tutorial.timerange.end             :  2018-06-04 00:00

! selected domain:
tutorial.domain.west               :  -10
tutorial.domain.east               :   30
tutorial.domain.south              :   35
tutorial.domain.north              :   65

! grid resolution:
tutorial.grid.dlon                 :  0.1
tutorial.grid.dlat                 :  0.1

! mapping from footprints to grid cells using sample points in polygon;
! sample points is centroid of footprint (level 0),
! or centroids of triangles in which footprint is recursevely devided;
! number of points for 4-sided footprint:
!  1 point (levels=0), 4 (1), 8 (2), 16 (3), 32 (4), 64 (5)
tutorial.mapping.levels            :  5


!-------------------------------------------------
! satellite product
!-------------------------------------------------

! template for listing with converted files:
tutorial.S5p.no2.listing           : ../CSO-data/S5p/listing-NO2-CAMS.csv

! also read info on original track (T|F)?
! if enabled, this will be stored in the output too:
tutorial.S5p.no2.with_track        :  T

! for testing: put out mapping arrays?
tutorial.S5p.no2.with_mapping      :  F

!~ data

! data variables:
!   qa_value :  quality flag
!   hp       :  half-level pressures for retrieval layers
!   yr       :  retrieval
!   vr       :  retrieval error covariance
!   A        :  averaging kernel
!   M        :  airmass factor
!   nla      :  number of layers in tropospheric column
tutorial.S5p.no2.dvars             :  qa_value hp yr vr A M nla

! quality flag:
!~ scalar value, no dimensions:
tutorial.S5p.no2.dvar.qa_value.dims      :  
!~ source variable:
tutorial.S5p.no2.dvar.qa_value.source    :  qa_value

! half-level pressures:
!~ dimensions, copied from data file:
tutorial.S5p.no2.dvar.hp.dims      :  layeri
!~ source variable:
tutorial.S5p.no2.dvar.hp.source    :  pressure

! retrieval: 
!~ dimensions, copied from data file:
tutorial.S5p.no2.dvar.yr.dims      :  retr
!~ source variable:
tutorial.S5p.no2.dvar.yr.source    :  vcd

! retrieval error covariance: 
!~ dimensions, copied from data file:
tutorial.S5p.no2.dvar.vr.dims      :  retr retr
!~ source variable:
tutorial.S5p.no2.dvar.vr.source    :  vcd_errvar

! kernel:
!~ dimensions, copied from data file:
tutorial.S5p.no2.dvar.A.dims       :  retr layer
!~ source variable:
tutorial.S5p.no2.dvar.A.source     :  kernel_trop

! tropospheric airmass factor
!~ dimensions, copied from data file:
tutorial.S5p.no2.dvar.M.dims       :  retr
!~ source variable:
tutorial.S5p.no2.dvar.M.source     :  amf_trop

! number of apriori layers in retrieval layer:
!~ dimensions, copied from data file:
tutorial.S5p.no2.dvar.nla.dims     :  retr
!~ source variable:
tutorial.S5p.no2.dvar.nla.source   :  nla


!~ state

! state varaiables to be put out from model:
!   mod_conc   : model concentrations       over footprint
!   mod_hp     : model half-level pressures over footprint
!   mod_*      : auxilary model data        over footprint
!   xs         : simulated profile at apriori layers
!   ys         : simulated retrieval profile
!   *_m        : entities related to alternative apriori profile
tutorial.S5p.no2.vars                         :  mod_conc mod_hp mod_tcc mod_cc xs ys Sx M_m A_m yr_m ys_m

! model concentration profile:
!~ model layer dimension:
tutorial.S5p.no2.var.mod_conc.dims            :  model_layer
!~ standard attributes:
tutorial.S5p.no2.var.mod_conc.attrs           :  long_name units
tutorial.S5p.no2.var.mod_conc.attr.long_name  :  model NO2 concentrations
tutorial.S5p.no2.var.mod_conc.attr.units      :  ppb

! model hpentration profile:
!~ model layer interfaces:
tutorial.S5p.no2.var.mod_hp.dims              :  model_layeri
!~ standard attributes:
tutorial.S5p.no2.var.mod_hp.attrs             :  long_name units
tutorial.S5p.no2.var.mod_hp.attr.long_name    :  model pressure at layer interfaces
tutorial.S5p.no2.var.mod_hp.attr.units        :  Pa

! total cloud cover:
!~ no extra dimensions:
tutorial.S5p.no2.var.mod_tcc.dims             :  
!~ standard attributes:
tutorial.S5p.no2.var.mod_tcc.attrs            :  long_name units
tutorial.S5p.no2.var.mod_tcc.attr.long_name   :  total cloud cover
tutorial.S5p.no2.var.mod_tcc.attr.units       :  1

! cloud cover profiles:
!~ model layer dimension:
tutorial.S5p.no2.var.mod_cc.dims              :  model_layer
!~ standard attributes:
tutorial.S5p.no2.var.mod_cc.attrs             :  long_name units
tutorial.S5p.no2.var.mod_cc.attr.long_name    :  cloud cover
tutorial.S5p.no2.var.mod_cc.attr.units        :  1

! model concentrations at apriori layers:
!~ apriori layers:
tutorial.S5p.no2.var.xs.dims                  :  layer
!~ how computed:
tutorial.S5p.no2.var.xs.formula               :  LayerAverage( hp, mod_hp, mod_conc )
tutorial.S5p.no2.var.xs.formula_terms         :  hp: hp mod_hp: mod_hp mod_conc: mod_conc
!~ standard attributes:
tutorial.S5p.no2.var.xs.attrs                 :  long_name units
tutorial.S5p.no2.var.xs.attr.long_name        :  model simulations at apriori layers
tutorial.S5p.no2.var.xs.attr.units            :  mol m-2

! simulated retrievals
!~ retrieval layers:
tutorial.S5p.no2.var.ys.dims                  :  retr
!~ how computed:
tutorial.S5p.no2.var.ys.formula               :  A x
tutorial.S5p.no2.var.ys.formula_terms         :  A: A x: xs
!~ standard attributes:
tutorial.S5p.no2.var.ys.attrs                 :  long_name units
tutorial.S5p.no2.var.ys.attr.long_name        :  simulated retrieval
tutorial.S5p.no2.var.ys.attr.units            :  mol m-2

! partial columns as sum over apriori layers
!~ retrieval layers:
tutorial.S5p.no2.var.Sx.dims                 :  retr
!~ how computed:
tutorial.S5p.no2.var.Sx.formula              :  PartialColumns( nla, x )
tutorial.S5p.no2.var.Sx.formula_terms        :  nla: nla x: xs
!~ standard attributes:
tutorial.S5p.no2.var.Sx.attrs                :  long_name units
tutorial.S5p.no2.var.Sx.attr.long_name       :  tropospheric column in local model
tutorial.S5p.no2.var.Sx.attr.units           :  mol m-2

! airmass factor from local model
!~ retrieval layers:
tutorial.S5p.no2.var.M_m.dims                 :  retr
!~ how computed:
tutorial.S5p.no2.var.M_m.formula              :  AltAirMassFactor( M, A, x, Sx )
tutorial.S5p.no2.var.M_m.formula_terms        :  M: M A: A x: xs Sx: Sx
!~ standard attributes:
tutorial.S5p.no2.var.M_m.attrs                :  long_name units
tutorial.S5p.no2.var.M_m.attr.long_name       :  airmass factors from local model
tutorial.S5p.no2.var.M_m.attr.units           :  1

! kernel using airmass factor from local model
!~ retrieval layers times apriori layers
tutorial.S5p.no2.var.A_m.dims                 :  retr layer
!~ how computed:
tutorial.S5p.no2.var.A_m.formula              :  AltKernel( A, M, M_m )
tutorial.S5p.no2.var.A_m.formula_terms        :  A: A M: M M_m: M_m
!~ standard attributes:
tutorial.S5p.no2.var.A_m.attrs                :  long_name units
tutorial.S5p.no2.var.A_m.attr.long_name       :  averaging kernel using local airmass factors
tutorial.S5p.no2.var.A_m.attr.units           :  1

! retrieval using airmass factor from local model
!~ retrieval layers:
tutorial.S5p.no2.var.yr_m.dims                :  retr
!~ how computed:
tutorial.S5p.no2.var.yr_m.formula             :  AltRetrieval( y, M, M_m )
tutorial.S5p.no2.var.yr_m.formula_terms       :  y: yr M: M M_m: M_m
!~ standard attributes:
tutorial.S5p.no2.var.yr_m.attrs               :  long_name units
tutorial.S5p.no2.var.yr_m.attr.long_name      :  retrieval using local airmass factors
tutorial.S5p.no2.var.yr_m.attr.units          :  mol m-2

! retrieval covariance using airmass factor from local model
!~ retrieval layers:
tutorial.S5p.no2.var.R_m.dims                 :  retr retr
!~ how computed:
tutorial.S5p.no2.var.R_m.formula              :  AltRetrievalCovar( R, M, M_m )
tutorial.S5p.no2.var.R_m.formula_terms        :  R: vr M: M M_m: M_m
!~ standard attributes:
tutorial.S5p.no2.var.R_m.attrs                :  long_name units
tutorial.S5p.no2.var.R_m.attr.long_name       :  retrieval error covariance using local airmass factors
tutorial.S5p.no2.var.R_m.attr.units           :  (mol m-2)**2

! simulated retrievals using airmass factor from local model
!~ retrieval layers:
tutorial.S5p.no2.var.ys_m.dims                :  retr
!~ how computed:
tutorial.S5p.no2.var.ys_m.formula             :  A x
tutorial.S5p.no2.var.ys_m.formula_terms       :  A: A_m x: xs
!~ standard attributes:
tutorial.S5p.no2.var.ys_m.attrs               :  long_name units
tutorial.S5p.no2.var.ys_m.attr.long_name      :  simulated retrieval based on local airmass factors
tutorial.S5p.no2.var.ys_m.attr.units          :  mol m-2


!~ output

! pack variables?
tutorial.S5p.no2.output.packed                :  T

! compression level (0 for no, 1-9 for zipped)
tutorial.S5p.no2.output.deflate_level         :  1


!-------------------------------------------------
! end
!-------------------------------------------------
