################################################################## Shortening an inversion ################################################################## This case is typical of M1QN3. When a very small :bash:`epsg` is requested, the optimization may exit in mode 4: convergence is not reached but the maximum number of simulations is exhausted. By examining the gradient norm ratio in the logfile, you can identify a satisfactory iteration to stop at. Relaunch the job to stop at that iteration and generate the standard NetCDF outputs. To do this: 1) If directory :bash:`fwd_-002` (which contains the final results) has already been created, remove it. 2) Modify the YAML to reload the available computations: - in :bash:`obsoperator`, set :bash:`autorestart` to ``True`` - in :bash:`simulator`, set :bash:`reload_from_previous` to ``True``. If :bash:`simulator` is not specified in the YAML (the usual case when using the default cost function), add it as shown in the example below. .. container:: toggle .. 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) Set the convergence criterion (:bash:`epsg` for M1QN3) to stop at the targeted iteration. The value must be greater than the target gradient norm ratio but smaller than all previous ones. 4) If needed, rename the logfile so the details of existing simulations are not overwritten by the new run. 5) Launch the job.