CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   WENO code for Wave Equation (https://www.cfd-online.com/Forums/main/190600-weno-code-wave-equation.html)

ronak July 18, 2017 00:54

WENO code for Wave Equation
 
1 Attachment(s)
Hi there
I've written a code in Frtran for a wave Equation with WENO scheme but after running I get this error
"Array U has value 0 which is less than lower bound of 1"
Are you familar whith this error? I attached the code. I'll appreciate if you take a look and let me know if you find out the problem.
Best wishes

FMDenaro July 18, 2017 02:50

Quote:

Originally Posted by ronak (Post 657443)
Hi there
I've written a code in Frtran for a wave Equation with WENO scheme but after running I get this error
"Array U has value 0 which is less than lower bound of 1"
Are you familar whith this error? I attached the code. I'll appreciate if you take a look and let me know if you find out the problem.
Best wishes


That is your program error...the index of the vector has a value (zero) and violates the access to the array. Use the check_bound options in your compiler. If you really want to use the idex 0 you have to declare the array to start from 0 (you can also declare for nevative values).

naffrancois July 18, 2017 02:55

Hello,

This error typically means that you are trying to access unallocated memory. This happens in your loop because the index i-r+j goes outside of the prescribed dimension 1:150.

ronak July 18, 2017 03:58

Quote:

Originally Posted by naffrancois (Post 657459)
Hello,

This error typically means that you are trying to access unallocated memory. This happens in your loop because the index i-r+j goes outside of the prescribed dimension 1:150.

Yes. You're right but what should I do? I'm following the algorithm that is attached as a JPG file. there is a function with index i-r+j .
Thanks for ur time.

ronak July 18, 2017 04:03

Quote:

Originally Posted by FMDenaro (Post 657456)
That is your program error...the index of the vector has a value (zero) and violates the access to the array. Use the check_bound options in your compiler. If you really want to use the idex 0 you have to declare the array to start from 0 (you can also declare for nevative values).

Thanks a lot. I don't insist on 0 as the boundary. All I want is a plot from this program while it goes in a right way. :D
Do you have any suggestion to correct the error while I have U( i-r+j)?
Best

crazyshock October 16, 2017 16:35

Link to WENO code in fortran
 
Not sure if this helps but here is a link to my working code in fortran (Weno5, 1D) for reference

https://github.com/aranyadan/WENO51D_fortran


All times are GMT -4. The time now is 15:53.