I need to prescribe the wave condition (HM0, TP, DIR) at the open boundary nodes (LIFBOR = 5) using a modified LIMWAC (newmeanWAVE.f) subroutine and an ascii file containing the datat at a hourly timestep (boundaryWaves_meanPeakDirection.dat). This triplet is then replicated to the liquid nodes, and a call to SPEINI is made to compute the directional variance spectrum.
However, an inevitable “Segmentation fault - invalid memory reference” occurs…
Please see attached file (out).
Could anyone provide a tip on how to resolve this issue?
[name removed]
newmeanWAVE-4.f (10.8 KB)
Hello
It is difficult to see the error without running the full case
but I think you should add a save, so that you keep the value of your array from a call to another.
regards
1 Like
Dear [name removed]
I am attaching the various files needed to run my [name removed] case.
Thank you in advance for your time and assistance.
[name removed]
case.zip (1.16 MB)
Does TOMAWAC interpolate the different parameters (Hm0, [name removed], Dir) between time steps to match the specified timestep in the cas file?
hello
you will find your fortran so that it works. I have some comments :
-
it is better to use user_limwac instead of modifying limwac see examples/tomawac/calais_test/tom_variable.cas for an example
-
I delete one useless call to speinit, this useless call was the reason of the segmentation fault since there was not the good number of arguments in the call
-
I added the save so that you keep your values a time step to another.
-
I deleted the 2nd loop on HOURLY_TIMESTEPS that you were doing at each timestep, since you know you go forward in time.
regards
newmeanWAVE.f (10.9 KB)
1 Like
Tomawac does not do anything, it is up to you to interpolate,
instead of
HM0L = HM0L_MB(TT)
you can write something like
HM0L = coef * HM0L_MB(TT) +(1-coeff)* HM0L_MB(TT+1)
1 Like
Dear [name removed],
Thank you very much for your help. Your guidance was clear and extremely helpful, and I truly appreciate the time you took to assist me. It made a real difference.
Thanks again for your support and for making the forum such a great resource.
[name removed]