fengyanshi / FUNWAVE-TVD

43 stars 51 forks source link

Hot start #57

Closed rafa-guedes closed 10 months ago

rafa-guedes commented 1 year ago

I mentioned today on the email list about a typo in the docs where INI_UVZ is defined as INT_UVZ, and also about the file format description - the docs mention the files should be the same format as the output/depth files, but binary output doesn't seem to be accepted for the hotstart files.

Another thing I noticed was that the HotStartTime input argument is not described in the docs.

After managing to run a few hotstart tests I noticed the new output files are written starting with suffix _00001. This implies that if say a model crashes and we try to restart the simulation from one of the last output files written without specifying a new output directory, all initial output files will be overwritten. I was wondering if it would make sense and be feasible for funwave to start writing the output files using HotStartTime and PLOT_INTV when a hotstart run is defined. In the following example:

PLOT_INTV = 2.0
TOTAL_TIME = 3600
PLOT_START_TIME = 0.0
HotStartTime = 3000.0
ETA_FILE = output/eta_01500
U_FILE = output/u_01500
V_FILE = output/v_01500
MASK_FILE = output/mask_01500

The model would hot start at time 3000s, and the first new output files to be written would be:

output/eta_01501
output/u_01501
output/v_01501
output/mask_01501

Thanks

mayhl commented 1 year ago

You can use the input parameter

OutputStartNumber = 1501

to change the starting index. It would be convenient to use HotStartTime and PLOT_INTV to generate a starting index; however, this assumes that a user is continuing a previous run with the same PLOT_INTV. The Hot Start feature can be used for custom initial conditions/wave profiles that are not covered by the built-in wavemaker.

rafa-guedes commented 10 months ago

Thanks @mayhl your suggestion works great. It could be helpful a quick note on this parameter in the Hot Start section of the docs for others trying to do the same.