## 4 Calculation of Potential at Measurement Points Position
A bash-python script called wrapper [52] for calibration phase was developed, shown in Figure 11. The input variables in the wrapper are the corrected filtration coefficients (ENTER.CSV, Figure 11), the reservoir water level, and the lower water level (BOUNDARYCON.CSV, Figure 11). Different values of the water level in the reservoir (WLR) and the tailwater (TW) were used for calibration and subsequent verification. Each water level in the reservoir/tailwater corresponds to a prescribed potential on the wetted area of concrete and rock. For the purposes of calibration (and DMS), an algorithm for automatic conditional prescription of boundary conditions was developed. Only one input file is created. The \"possible\" potential is set at all nodes (NPZAD) of concrete and rock below the elevation of the Full Reservoir Level (FLR) upstream, and the maximum possible elevation of the tailwater downstream. These values are saved in K9-12.DAT file; see Figure 11. During the execution of the PAKV program, a check is performed if the z coordinate of the nodes on which the \"possible\" potential is prescribed is lower than the set water level in the reservoir and tailwater, i.e., whether the node is wetted. If the node is wetted, the potential is set to be equal to the water level in the reservoir or the tailwater, else it is not prescribed; see Figure 12a. The calculation of the groundwater flow was performed in stationary, which means that in practice, if commercial software was used, it would be necessary to create a new input file with every change in the water level. During the calibration phase of the FE model, the correction of the FE model's filtration coefficients (ENTER.CSV) was performed based on the difference between the measured and calculated potential values, with the aim of achieving the best match between the measured and numerically obtained values. Non-stationary analysis was performed to calibrate the values of thermal processes. Boundary conditions were defined for each discrete time step based on historical measurements, which included the following: upper and lower water levels; air temperature at two measuring points; upper water temperature at two measuring points; and foundation temperatures at a larger number of measuring points. On the body of the dam, the conduction concrete-air for the parts above the water was set, while for the submerged parts, the conduction concrete-water was set. The calibration procedure was carried out after the previously completed analysis of the available data. Figure 10: DMS flow chart: (**a**) interpolation algorithm function within DMS, (**b**) genetic algorithm used for neural network training. For the appropriate set of parameters and the given series of measured temperatures as contour conditions, a non-stationary thermal calculation was performed. A script was created, similar to the script shown in Figure 11, which runs PAKT. The temperature field inside the model was obtained by thermal calculation, based on which the values at the measuring points were calculated according to Equation (8). The resulting time series of temperature for each measuring point (thermometer in concrete) was printed in a separate file whose name was the symbol of the thermometer. When calculating the temperature field in the concrete dam, another wrapper was created for the automatic prescription of boundary conditions analogous to the previously described calculation of underground water flow (seepage). An input file is also created for the calculation of the temperature field. On the elements (EPZAD) in the reservoir, \"possible\" heat transfer coefficients between water and concrete, as well as water and rock, are assigned. During the execution of the PAKT program, a check is performed if the z coordinate of the element center of gravity is lower than the water level in the reservoir (upstream) or tailwater (downstream), i.e., whether the element center of gravity is wetted.