Changes between Version 4 and Version 5 of Lorenz_63_model


Ignore:
Timestamp:
Jan 29, 2020, 5:36:06 PM (4 weeks ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Lorenz_63_model

    v4 v5  
    33[[PageOutline(2-3,Contents of this page)]]
    44
    5 Note: The data assimilation with the Lorenz-63 model has been added in version 1.14 of PDAF.
     5Note: The data assimilation with the Lorenz-63 model has been added in version 1.14 of PDAF. Here, the use is described for PDAF 1.15 where we moved the Lorenz-63 case into the directory `models`.
    66
    7 The implementation of the Lorenz-63 model coupled to PDAF is in the directory `models/lorenz63/` of the PDAF package (in PDAF 1.14 it was in `testsuite/src/lorenz63/`).
     7The implementation of the Lorenz-63 model coupled to PDAF is in the directory `models/lorenz63/` of the PDAF package.
    88Provided is a full implementation of PDAF with the nonlinear Lorenz-63 model (E. N. Lorenz (1963) Deterministic non-periodic flows. J. Atmos. Sci. 20, 130-141) providing various filter and smoother methods. The model has state dimenion 3. So it's not usable for
    99localized filters, but it's a good test case for the particle filter.
     
    2929to deactivate the coupling to PDAF in the model code. Now build the forward model program with
    3030{{{
    31   cd testsuite/src
     31  cd models/lorenz63
    3232  make lorenz_63 PDAF_ARCH=linux_gfortran
    3333}}}
    34 in the directory `testsuite/src/` of the PDAF package. You have to ensure
     34You have to ensure
    3535that in the machine-specific make include file `linux_gfortran.h` `-DUSE_PDAF` is not defined
    36 for CPP_DEFS (such that calls to PDAF are not active). You can replace `linux_gfortran` by any other make include file from `make.arch/`, e.g. specify `macos_gfortran` for compiling on MacOS. The executable
    37 is generated in `testsuite/bin/`.
     36for CPP_DEFS (such that calls to PDAF are not active). You can replace `linux_gfortran` by any other make include file from `make.arch/`, e.g. specify `macos_gfortran` for compiling on MacOS. The executable is generated in the directory.
    3837
    3938'''Note''': The implementation uses the NetCDF library for file outputs. If the compilation above fails, please ensure the netcdf-library ist installed. On computers running Linux, it is usually available as a package of the operating system. On MacOS one can install the netcdf library e.g. using Fink or !MacPorts. NetCDF is a self-describing binary output format, but here it is not required that you know details about it. Anyway, if you like to look 'into' a NetCDF file, please try to use `ncdump FILENAME | less`. 
     
    4140To run the forward model use
    4241{{{
    43   cd ../bin
    4442  ./lorenz_63 -total_steps 10000
    4543}}}
     
    5048To build the executable to generate observations from the state trajectore use
    5149{{{
    52   cd ../src/lorenz63/tools
     50  cd tools
    5351  make generate_obs PDAF_ARCH=linux_gfortran
    5452}}}
     
    6563Now do
    6664{{{
    67   cd ../../../../make.arch
     65  cd ../../make.arch
    6866}}}
    6967and change in the file `linux_gfortran.h` the line
     
    8078coupling to PDAF. First clean the directories for the main driver and the Lorenz-63 model using
    8179{{{
    82   cd ../testsuite/src
     80  cd models/lorenz63
    8381  make cleandriver PDAF_ARCH=linux_gfortran
    8482  make cleanlorenz_63 PDAF_ARCH=linux_gfortran
     
    9492To run the assimilation program, do
    9593{{{
    96   cd ../bin
    97   ../src/lorenz63/tools/run_ESTKF.sh
     94  ./tools/run_ESTKF.sh
    9895}}}
    9996The script run_ESTKF.sh runs an experiment with the ESTKF filter method for ensmeble size 20 in which only the variable X os the model is observed at each 10th time step. The execution should only take seconds.
    10097Further you can run
    10198{{{
    102   cd ../bin
    103   ../src/lorenz63/tools/run_PF.sh
     99  ./tools/run_PF.sh
    104100}}}
    105101to run a similar experiment with the particle filter.
     
    111107To display the output of the assimilation experiments we provide plotting scripts for Matlab, Octave and Python. To use them do
    112108{{{
    113 cd ../src/lorenz63/plotting/
     109cd plotting/
    114110}}}
    115111
     
    139135
    140136'''!Matlab/Octave plotting examples:'''[[BR]]
    141 `plot_obs('../../../bin/obs.nc',100)` plots the observation at time step 100[[BR]]
    142 `plot_obs_series('../../../bin/obs.nc',1)` plots the time series of observations for variable X (likely set 2=Y, 3=Z) [[BR]]
    143 `plot_state('../../../bin/ESTKF_N20.nc',100,'f')` plots the forecast state estimate from the ESTKF run example at the 100th analysis step[[BR]]
    144 `plot_rms('../../../bin/t1_N30_f0.97.nc')` plots the true and estimated RMS errors over time for the chosen experiment[[BR]]
    145 `plot_state('../../../bin/state_l63.nc',1101)` plots the true state at model time step 1101 (= analysis step 100)[[BR]]
    146 `plot_state_series('../../../bin/ESTKF_N20.nc',1,'f')` plots the time series for the ESTKF run example of the forecast state for variable X[[BR]]
     137`plot_obs('../obs.nc',100)` plots the observation at time step 100[[BR]]
     138`plot_obs_series('../obs.nc',1)` plots the time series of observations for variable X (likely set 2=Y, 3=Z) [[BR]]
     139`plot_state('../ESTKF_N20.nc',100,'f')` plots the forecast state estimate from the ESTKF run example at the 100th analysis step[[BR]]
     140`plot_rms('../t1_N30_f0.97.nc')` plots the true and estimated RMS errors over time for the chosen experiment[[BR]]
     141`plot_state('../state_l63.nc',1101)` plots the true state at model time step 1101 (= analysis step 100)[[BR]]
     142`plot_state_series('../ESTKF_N20.nc',1,'f')` plots the time series for the ESTKF run example of the forecast state for variable X[[BR]]
    147143
    148144'''Python plotting'''[[BR]]
     
    151147The module can either be imported, e.g. to use its functions interactively:[[BR]]
    152148`>>> import plot_l63`[[BR]]
    153 `>>> plot_l63.plot_obs('../../../bin/obs_l63.nc', 4)`[[BR]]
     149`>>> plot_l63.plot_obs('../obs_l63.nc', 4)`[[BR]]
    154150
    155151Alternatively the script can be run from the command line, providing the function
    156152name and its argument as command line parameters:[[BR]]
    157 `./plot_l63.py plot_obs ../../../bin/obs_l63.nc 4`[[BR]]
     153`./plot_l63.py plot_obs ../obs_l63.nc 4`[[BR]]
    158154(If this fails you can also try to run the script as
    159 `python plot_l63.py plot_obs ../../../bin/obs_l63.nc 4`). To plot only the Analysis RMS error one can use[[BR]]
    160 `plot_rms ../../../bin/ESTKF_N20.nc False True`
     155`python plot_l63.py plot_obs ../obs_l63.nc 4`). To plot only the Analysis RMS error one can use[[BR]]
     156`plot_rms ../ESTKF_N20.nc False True`
    161157
    162158