# ==================================================
#
# FLEXINVERT CONFIGURATION SETTINGS
#
# comment lines start with '#'
# each parameter line starts with 'parameter name:'
#
# ==================================================

# Run mode:
#  0 = run forward model
#  1 = run optimization
#  2 = randomly perturb for MC 
run_mode:    1

# Random number seed
# (only used if run_mode = 2)
seed:        100

# Run dates: format yyyymmdd
# datei = start date 
# datef = end date
datei:      20120101
datef:      20120131

# Inversion method ('analytic', 'congrad' or 'm1qn3')
method:     analytic

# Use lognormal distribution (true or false) (only for non-CO2 species)
# if true need to use m1qn3 method
lognormal:  .false.

# Average/select flexpart releases (true or false)
average_fp: .false.

# Number of iterations
# only used if method is 'congrad' or 'm1qn3'
maxiter:    2

# Include ocean boxes in the optimization (true or false)
inc_ocean:  .true.

# Optimize initial mixing ratios (true or false)
opt_cini:    .true.

# Use spatial correlation in error covariance matrix (true or false)
# if use regions based ecosystems then should be false
spa_corr:   .true.

# Use best guess estimate from previous inversion (congrad only)
# 0 = no prior best guess
# 1 = use prior best guess (file must be specified in SETTINGS_files)
prior_bg:    0

# Restart a crashed run
# for congrad/m1qn3 will pick-up from last iteration
# for analytic will only use pre-calculated covariance matrix and boundary conditions
# 0 = new run
# 1 = restart crashed run
restart:     0

# Verbose output
# only use for debugging small runs
verbose:    .false.

# Species ("co2" or "ghg")
spec:        ghg

# Molar mass in flux files (e.g. CO2-C=12, CH4=16)
molarmass:     16.

# Coefficient to convert from grid units of ppt to ppb
coeff:       1.e-3

# Use nested flexpart output (true or false)
nested:     .false.

# Inversion domain:
# if using nested output it must match the inversion domain
# w_edge_lon = lon of western edge of inversion grid
# s_edge_lat = lat of southern edge inversion grid
# e_edge_lon = lon of eastern edge of inversion grid
# n_edge_lat = lat of northern inversion grid
# xres  = longitudinal grid resolution 
# yres  = latitudinal grid resolution 
w_edge_lon:  -15
s_edge_lat:   30
e_edge_lon:   35
n_edge_lat:   75  
xres:         1.0
yres:         1.0

# Spatial aggregation of grid (true or false)
regions:    .true.

# State vector (days):
# temporal resolution at which NEE fluxes are optimized
# must be an integer multiple of 1 day
statres:     10.

# non-NEE prior fluxes:
# number of flux fields per year in input
nt_flx:      12

# Measurement error: unit same as obs 
# used if error in obs input <= zero
measerr:     5.0

# Scalar of initial conc error: fraction
cinierr:     0.01

# Prior flux error: fraction
flxerr:      0.5

# Lower limit flux error: unit (kg/m2/h)
flxerr_ll:   1.e-8

# Spatial correlation length for land: unit (km)
sigma_land:  250.

# Spatial correlation length for ocean: unit (km)
sigma_ocean: 1000.

# Temporal correlation length: unit (days)
sigmatime:   30.

# Total error for inversion domain (Tg/y)
globerr:     10.