|
[Sponsors] |
September 24, 2004, 17:18 |
Help: Phantom of divergance...
|
#1 |
Guest
Posts: n/a
|
Hi,
I hope someone will answer my querry this time... they cant be that stupid and they cant be that dificult that I hardly ever get any responds... Problem this time is that I have a subroutin calculating source terms for a scalar. It works great, converges nicely and looks the way it should. But then suddenly it gives NaN and diverges... Have no idea why.. Tried again and it worked... tried again with some write commands for out put and have the same problem... Sounds like an variable initialisation problem but already checked and all are initialised properly. Any idea, anyone? Extremely stressed, Sheila |
|
September 25, 2004, 12:46 |
Re: Help: Phantom of divergance...
|
#2 |
Guest
Posts: n/a
|
This answer has nothing to do with the code but when one codes and the output/errors seem to change with print/write statements this usually means that you are somehow trying to enter values into an array past the specified size ie write to A(11) when you only declared A as A(10). If possible when you compile your subroutine turn on array bounds checking on your compiler.
|
|
September 26, 2004, 00:54 |
Re: Help: Phantom of divergance...
|
#3 |
Guest
Posts: n/a
|
Hi Peter,
thanks for your reply. But perhaps I was'nt being clear enough. My code did'nt start diverging after using the write statements but even before... The same program works fine with coarser mesh. All my dimensions are using NCMAX, NBMAX etc... I have since changed the differencing scheme to MARS for scalars with under relaxation factor of 0.5 and it seems to do the trick. Anyhow, how do I turn on array bound checking? Sheila |
|
September 26, 2004, 13:08 |
Re: Help: Phantom of divergance...
|
#4 |
Guest
Posts: n/a
|
oh ok..I probably did not read it clear enough...array bounds checking can be turned on via compiler flags..check out the compiler help. It slows things down though so only use these for debugging.
|
|
September 26, 2004, 17:39 |
Re: Help: Phantom of divergance...
|
#5 |
Guest
Posts: n/a
|
Thank you Peter
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|