# Adjustment of Computing Parameters at Run-time

TOUGH4 allows adjustment/change of several key computing parameters, options or temporary monitoring of variables at an element or connection during run-time. These parameters include:  simulation end time (SimulationTimeEnd), maximum time-step size (MaxTimeStep), relative Newton iteration convergence criteria (rel\_convergence\_crit), absolute Newton iteration convergence criteria (abs\_convergence\_crit), maximum primary variable change criteria for Newton iteration convergence (pv\_convergence\_cr1, pv\_convergence\_cr2, pv\_convergence\_cr3), time-step cutting factor (dt\_reduced\_Factor), maximum number of  time steps (Max\_NumTimeSteps), maximum number of Newton iterations (Max\_NumNRIterations), maximum number of Newton iterations for increasing time step size (MOP\_16), frequency for writing SAVE file (SAVE\_frequency), frequency for writing time-series output file (TimeSeries\_frequency), options controlled by IE array, and monitoring of simulation results at a given element (monitoringElem) or connection (monitoringConn) by providing the element name and/or connection name. The simulation results of primary variables, phase state, fluxes at the connection will be written out for the provided monitoring element/connection.  Elements of IE array provide many program options (see [Appendix C](https://lbl-2.gitbook.io/tough4-user-manual/appendix/c-additional-program-options)). User may change these options at run-time through change of value of an element. Only one element value can be changed at each time by providing  subscript of the IE array and it value.   &#x20;

The parameter changes or giving an element or connection name for monitoring are through a text file named "Parameter\_Update\_File". Figure 29 shows the contents of this file.

<figure><img src="https://1426683494-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsXs77Ll4m52277QW0AIl%2Fuploads%2FoZVM0i9SkrkRUP9d8rlJ%2Fimage.png?alt=media&#x26;token=525e912d-9dc6-464b-b710-dbc989e48c2f" alt=""><figcaption><p>Figure 29. Contents of File "Parameter_Update_File" for computing parameter adjustment or monitoring at run-time</p></figcaption></figure>

A template of this file was included in the software distribution package. Users need copy it to the working folder where the model input files are located. TOUGH4 will scan this file during run-time for every given time (scan frequency). If it was changed, the new parameters will be read and replace the original values. Only the file updated after the start of running simulation will take effect.   Users may adjust the parameters multiple times in one simulation run.  If a parameter does not change, one may leave the input parameter empty.  As these computing parameters/options  may be sensitive to the simulation performance, an error value may lead to unpredictable model running behavior. Users should make the parameter adjustments carefully. &#x20;

The default frequency for scanning the file "Parameter\_Update\_File" is 10 minutes per scan. Users may use IE(30) to increase or decrease the scanning frequency. &#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lbl-2.gitbook.io/tough4-user-manual/preparation-of-model-input/adjustment-of-computing-parameters-at-run-time.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
