Hello [name removed],
I am trying to impose spectral data (Wave significant height and direction) -variable in time & space- on the boundary, so I had a rough go at programming the subroutine Limwac to do so, providing the input file structure attached. However, simulation crashes when calling the subroutine with the following error:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
I would appreciate if someone can help me with this or suggest another approach.
[name removed]
Limwac_edit_1.f (12.4 KB)
DATA_TRIAL.txt (120 Bytes)
Hi
NPTFR is the number of boundary points and an already fixed number so I doubt you could change it and give the value 3 as programmed…
As the value is probably higher than 3 the read crash…
Regards
Hi [name removed],
Yes, you were right about that and also I had to use the variable “BOUNDARY_COLOUR” to refer to boundary nodes since I’m on parallel computation, thank you so much.
Now, when running the simulation I get the error attached. I was wondering if this DO LOOP to feed spectral data to the boundary is correct?
IF(AT .EQ. AT_WAVE(K)) THEN !AT_WAVE = time
IF(NCSIZE.GT.0) THEN ! PARALLEL
DO K = 1, NUMPOINTS !number of time steps in data
DO KK=1,NUMSTA !number of boundary nodes
DO S=1,NPTFR
IF (BOUNDARY_COLOUR%I(S) .EQ. [name removed])) THEN !XX:boundary numbering
HM0L = HM0L_TS(K,KK+1)
FPICL = FPICL_TS(K,KK+1) !to skip time step reading
TETA1L = TETA1L_TS(K,KK+1)
! WRITE(*,*) '###########', AT_PP(K), HM0L, FPICL,TETA1L
ENDIF
ENDDO
ENDDO
[name removed]
ENDIF
[name removed]
TOMAWAC_Error.txt (2.59 KB)
The compilation crash
there is a message about unexpected end of file so something is wrong in your limwacv5.f file
Regards
one endif is missing.
It reached the end of file while the “if loop” is opened
Hi [name removed],
Thanks for your responses,
Whenever I try to use the variable BOUNDARY_COLOUR since I’m considering parallelism I get the following error message:
Error: Unexpected ‘%’ for nonderived-type variable ‘boundary_colour’ at (1)
I’ve used this variable within the BORD subroutine for prescribing HBOR,VBOR..etc in the past with no problems, but here in LIMWAC it wouldn’t allow me to use it even in the simplest cases.
[name removed]
Hello
I guess the probleme comes from a confusion
BOUNDARY_COLOUR are not exactly the same in telemac2d and TOMAWAC
in telemac2d BOUNDARY_COLOUR is a bief_obj so to get/set the tabular you use
BOUNDARY_COLOUR%I(K)
When in tomawac BOUNDARY_COLOUR is the tabular of the bief_obj
(BOUNDARY_COLOUR => SBOUNDARY_COLOUR%I in point_tomawac.f )
So to get or set the tabular you use directly
BOUNDARY_COLOUR(K)
you can find an example of use of boundary_colour in fortran user of test case Manche
Hope it helps
1 Like
Hi [name removed],
Thank you for your response, that was very helpful as my program works fine now.
[name removed]
Hi [name removed],
I was wondering if there is a variable for prescribed values of significant wave height in TOMAWAC, similar to HBOR for prescribed water level in TELEMAC?
As I am guessing, I cannot use HM0l for prescribing spacio-temporal varying wave heights, as I would be needing something like HM0L_BOR(NPTFR) (a variable to refer to wave height at boundary node)- see the loop in time and over boundary points.
IF(AT .EQ. AT_WAVE(K)) THEN
IF(NCSIZE.GT.0) THEN ! PARALLEL
DO K = 1, NUMPOINTS !number of time steps in NFO1
DO KK=1,NUMSTA !number of boundary nodes in NFO1
DO S=1,NPTFR
IF ([name removed]) .EQ. BOUNDARY_COLOUR(S)) THEN
!XX= boundary node number in NFO1
HM0L = HM0L_TS(K,KK+1) !the +1 to skip reading time step
TETA1L = TETA1L_TS(K,KK+1)
ENDIF
ENDDO
ENDDO
ENDDO
ENDIF
ENDIF
[name removed]
Hi [name removed],
When trying to print test NBOR(NPTFR) in scalar or a loop over BOUNDARY_COLOUR(s) while s=1,NPTFR (parallel), the node numbering I get is completely different than what I have in my boundary conditions file!
As a result, the term "IF ([name removed]) .EQ. BOUNDARY_COLOUR(S)) THEN " in parallel is never achieved. I was wondering what is the reason that I can’t obtain the right boundary nodes numbers? (XX is boundary nodes numbers read from NFO1)
[name removed]
I am not sure to understand but it seems that would do the job
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE [IP removed] HM0L_BOR
ALLOCATE HM0L_BOR(NPTFR)
Hi [name removed],
Thank you for replies- here and on the other post.
I don’t think this approach would work as ultimately we’d be feeding data to an array that is not necessary defined within Tomawac-unless of course we’re willing to do the extra steps that follow, rather I’m starting to think that the spectrum should be calculated separately then fed to the variable FBOR, which is already allocated as FBOR(NPTFR). However, I held back from this approach entirely and resorted to imposing spectra via pre-written punctual spectra files.
[name removed]
Hi [name removed],
could you please share the code that worked for you eventually?
thanks,
So there really isn’t any way to impose time&space varying boundary conditions for tomawac other than an .spe file ?
Hello
There is another way than building a spe file to have time and space varying boundaries, you can make it using a user fortran for limwac. Some people proposed their user fortran on the forum for example in “[name removed] and temporally varying Wave height at boundary” you can also see an example in test case [name removed] with user_limwac.f .
cheers
1 Like
thank you,
I will go over these threads as you suggest,
[name removed]
Hi [name removed],
The documentation of imposing wave time series -ultimately as 2D spectra- onto the boundary and the scripts used should be available soon (it should be open-source as I believe) or at least I’ll be able to talk you through the different options and processes. I am currently on leave, but will sort things out and keep you updated once I’m back at it.
[name removed]