Changes between Version 4 and Version 5 of Lorenz_63_model
- Timestamp:
- Jan 29, 2020, 5:36:06 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Lorenz_63_model
v4 v5 3 3 [[PageOutline(2-3,Contents of this page)]] 4 4 5 Note: The data assimilation with the Lorenz-63 model has been added in version 1.14 of PDAF. 5 Note: 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`. 6 6 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/`).7 The implementation of the Lorenz-63 model coupled to PDAF is in the directory `models/lorenz63/` of the PDAF package. 8 8 Provided 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 9 9 localized filters, but it's a good test case for the particle filter. … … 29 29 to deactivate the coupling to PDAF in the model code. Now build the forward model program with 30 30 {{{ 31 cd testsuite/src31 cd models/lorenz63 32 32 make lorenz_63 PDAF_ARCH=linux_gfortran 33 33 }}} 34 in the directory `testsuite/src/` of the PDAF package.You have to ensure34 You have to ensure 35 35 that 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/`. 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 is generated in the directory. 38 37 39 38 '''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`. … … 41 40 To run the forward model use 42 41 {{{ 43 cd ../bin44 42 ./lorenz_63 -total_steps 10000 45 43 }}} … … 50 48 To build the executable to generate observations from the state trajectore use 51 49 {{{ 52 cd ../src/lorenz63/tools50 cd tools 53 51 make generate_obs PDAF_ARCH=linux_gfortran 54 52 }}} … … 65 63 Now do 66 64 {{{ 67 cd ../../ ../../make.arch65 cd ../../make.arch 68 66 }}} 69 67 and change in the file `linux_gfortran.h` the line … … 80 78 coupling to PDAF. First clean the directories for the main driver and the Lorenz-63 model using 81 79 {{{ 82 cd ../testsuite/src80 cd models/lorenz63 83 81 make cleandriver PDAF_ARCH=linux_gfortran 84 82 make cleanlorenz_63 PDAF_ARCH=linux_gfortran … … 94 92 To run the assimilation program, do 95 93 {{{ 96 cd ../bin 97 ../src/lorenz63/tools/run_ESTKF.sh 94 ./tools/run_ESTKF.sh 98 95 }}} 99 96 The 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. 100 97 Further you can run 101 98 {{{ 102 cd ../bin 103 ../src/lorenz63/tools/run_PF.sh 99 ./tools/run_PF.sh 104 100 }}} 105 101 to run a similar experiment with the particle filter. … … 111 107 To display the output of the assimilation experiments we provide plotting scripts for Matlab, Octave and Python. To use them do 112 108 {{{ 113 cd ../src/lorenz63/plotting/109 cd plotting/ 114 110 }}} 115 111 … … 139 135 140 136 '''!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]] 147 143 148 144 '''Python plotting'''[[BR]] … … 151 147 The module can either be imported, e.g. to use its functions interactively:[[BR]] 152 148 `>>> 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]] 154 150 155 151 Alternatively the script can be run from the command line, providing the function 156 152 name 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]] 158 154 (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` 161 157 162 158