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


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

! time range:
tutorial.timerange.start           :  2018-06-01 10: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
!   eps        : gradient forcing at retrieval layers
!   f          : gradient forcing at apriori layers
!   mod_g      : gradient forcing at model layers
tutorial.S5p.no2.vars                         :  mod_conc mod_hp mod_tcc mod_cc xs ys eps f mod_g

! 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 multiplication_factor_to_convert_to_molecules_percm2
tutorial.S5p.no2.var.ys.attr.long_name        :  simulated retrieval
tutorial.S5p.no2.var.ys.attr.units            :  mol m-2
tutorial.S5p.no2.var.ys.attr.multiplication_factor_to_convert_to_molecules_percm2 : float: 6.022141e+19

! adjoint forcing:
!    eps =  R^{-1} ( ys - yr )
!~ retrieval layers:
tutorial.S5p.no2.var.eps.dims                  :  retr
!~ how computed:
tutorial.S5p.no2.var.eps.formula               :  R^{-1} ( ys - yr )
tutorial.S5p.no2.var.eps.formula_terms         :  R: vr ys: ys yr: yr
!~ standard attributes:
tutorial.S5p.no2.var.eps.attrs                 :  long_name units
tutorial.S5p.no2.var.eps.attr.long_name        :  simulated retrieval
tutorial.S5p.no2.var.eps.attr.units            :  (mol m-2)**-1

! adjoint operator:
!    f = A^T eps
!~ apriori layers:
tutorial.S5p.no2.var.f.dims                    :  layer
!~ how computed:
tutorial.S5p.no2.var.f.formula                 :  A^T eps
tutorial.S5p.no2.var.f.formula_terms           :  A: A eps: eps
!~ standard attributes:
tutorial.S5p.no2.var.f.attrs                   :  long_name units
tutorial.S5p.no2.var.f.attr.long_name          :  forcing profile
tutorial.S5p.no2.var.f.attr.units              :  (mol m-2)**-1

! adjoint operator:
!    mod_g = V^T gx
!~ model layers:
tutorial.S5p.no2.var.mod_g.dims                :  model_layer
!~ how computed:
tutorial.S5p.no2.var.mod_g.formula             :  LayerAverageAdj( mod_hp, hp, f )
tutorial.S5p.no2.var.mod_g.formula_terms       :  mod_hp: mod_hp hp: hp f: f
!~ standard attributes:
tutorial.S5p.no2.var.mod_g.attrs               :  long_name units
tutorial.S5p.no2.var.mod_g.attr.long_name      :  forcing at model layers
tutorial.S5p.no2.var.mod_g.attr.units          :  (ppb)**-1


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