################################################################## Shortening an inversion ################################################################## .. role:: bash(code) :language: bash This case is typical of M1QN3. When a very small :bash:`epsg` has been asked for, the optimization may exit in mode 4 i.e. the convergence is not reached but the maximal number of simulations is reached. Examining the gradient norm ratio (in the logfile), a satisfying value can be found in the available iterations. It is then required to relaunch the job to stop on this value and generate the normal (netcdf) outputs of the CIF. In order to achieve this: 1) In case the directory :bash:`fwd_-002` (which contains the final results) has already been created, remove it. 2) Modify the yaml to re-read the available computations: - in :bash:`obsoper`, option :bash:`autorestart` must be True - in :bash:`simulator`, option :bash:`reload_from_previous` must be True. If :bash:`simulator` is not specified in the yaml (because it is not necessary when the default cost is used, as is generally the case), specify it as shown in the following example. .. container:: toggle .. container:: header Show/Hide Code .. code-block:: yaml mode: minimizer: df1: 0.5 epsg: 0.1 maxiter: 10 nsim: 25 plugin: name: M1QN3 version: std simulator: plugin: name: gausscost version: std reload_from_previous: true plugin: name: 4dvar version: std save_out_netcdf: true obsoperator: plugin: name: standard version: std type: obsoperator autorestart: True 3) Change the convergence criteria i.e. :bash:`epsg` for m1qn3, to stop on the targeted iteration. The chosen value must be larger than the targeted gradient norm ratio but smaller than all the previous ones. 4) If relevant, change the name of the logfile so that the details of all the available simulations are not overwritten by the logfile of the shortened inversion. 5) Launch the job.