Hello,
I wrote
this message in the forum that describes the basic approach to set boundary conditions varying in time. I copy and paste :
The simplest case is to impose non-stationary (varying with the time) and uniform (same value at each point of the boundaries) boundary conditions. In this case what you could do is to read the boundary conditions from a formatted file (e.g. a .txt file) that you create and in which, at each line, you specify the time step and the corresponding reduced input spectral parameters (significant wave height, peak period, mean propagation direction, ...).
The steps to follow are:
- you create your formatted file with the time depending boundary conditions
- in the steering file you specify the name of this formatted file via the keyword FORMATTED FILE 1 (see chapter 7.2.13 of the TOMAWAC guide)
- you modify LIMWAC in order to manage the read operations of this file within the FORTRAN program: at each time step LIMWAC read the spectral parameters from the file and use them as argument variables in the call to SPEINI.
Now, let's take the case of a model having boundary conditions that are constant in space (same values over all the boundaries) and varying in time, and let's suppose that you have your formatted file with the time series of the spectral parameters needed to define the boundary conditions in TOMAWAC.
TOMAWAC makes use of the formatted file at the step n°7 of WAC.f, when the boundary conditions are initialized via the call to LIMWAC, and at the step 11.2 of WAC.f, when the boundary conditions are updated at each time step, again via LIMWAC.
LIMWAC should be modified, in order to read the time series of the spectral parameters in the formatted file and to interpolate those values for each TOMAWAC simulation time step.
A basic example of this approach, which shows the way LIMWAC should be modified, is given here below:
IF (simulation time of TOMAWAC T.EQ.0) THEN
READ the header of formatted file
READ the spectral parameters values at the first time step T1 from the formatted file
READ the spectral parameters values at the next time step T2 from the formatted file
ENDIF
50 CONTINUE
IF (TOMAWAC time T is included in the interval T1<=T<T2) GOTO 60
T1 = T2
spectral parameters at time T1 = spectral parameters at time T2
READ the next time step T2 of the formatted file and the parameters associated
GOTO 50
60 CONTINUE
Interpolate the spectral parameters read from the formatted file at T1 and T2,
at the time T of the TOMAWAC simulation
Assign the values so calculated to the variables passed to SPEINI.f (HM0L, FPICL, TETA1L, …)
If you want to impose boundary conditions that vary not only in time, but also in space (spectra are not constant over the boundary nodes), the approach to follow is similar, but in this case you have to modify the code and, at each time step, make a loop over the boundary nodes.
Hope it helps.
Kind regards,
Giovanni