示例#1
0
# Reproduce results from Sakov and Oke "DEnKF" paper from 2008.

from common import *

from mods.QG.core import model_config, shape, sample_filename
from mods.QG.liveplotting import LP_setup
from tools.localization import partial_direct_obs_nd_loc_setup as loc_setup

############################
# Time series, model, initial condition
############################

model = model_config("sak08", {})
f = {
    'm': np.prod(shape),
    'model': model.step,
    'noise': 0,
}

# Considering that I have 8GB mem on the Mac, and the estimate:
# ≈ (8 bytes/float)*(129² float/stat)*(7 stat/k) * K,
# it should be possible to run experiments of length (K) < 8000.
t = Chronology(dt=model.prms['dtout'], dkObs=1, T=1500, BurnIn=250)
# In my opinion the burn in should be 400.
# Sakov also used 10 repetitions.

X0 = RV(m=f['m'], file=sample_filename)

############################
# Observation settings
############################
示例#2
0
# Reproduce experiments from
# "Application of a hybrid EnKF-OI to ocean forecasting"
# by F. Counillon, P. Sakov, and L. Bertino (2009).

from common import *
from mods.QG.sak08 import setup
from mods.QG.core import model_config

dt = 1.25 * 10  # 10 steps between obs (also requires dkObs=1)
setup.t = Chronology(dt=dt, dkObs=1, T=1000 * dt, BurnIn=10 * dt)

setup.f.model = model_config("cou09_ens", {"dtout": dt, 'RKH2': 2.0e-11}).step
truth_model = model_config("cou09_truth", {"dtout": dt}).step

####################
# Suggested tuning
####################
# Reproduce Table 1 results.
# - Note that Counillon et al:
#    - Report forecast rmse's (but they are pretty close to analysis rmse anyways).
#    - Use enkf-matlab which has a bug which cause them to report the
#      wrong localization radius (see mods/QG/sak08.py).
#      Eg. enkf-matlab radius 15 (resp 25) corresponds to DAPPER radius 10.6 (resp 17.7).

# R = 17.7 # equiv. to R=25 in enkf-matlab
# from mods.QG.cou09 import setup, truth_model                        # Expected RMSE_f:
# cfgs += LETKF(mp=True, N=25,infl=1.15,taper='Gauss',loc_rad=R)      # 1.11
# cfgs += LETKF(mp=True, N=15,infl=1.35,taper='Gauss',loc_rad=R)      # 1.15
#
# - My N=15 rmse << rmse_from_paper. But I only tested a single repetition => maybe I got lucky.
#