[esp-r] Re: CFD problem

Macdonald, Iain Iain.Macdonald at nrc-cnrc.gc.ca
Fri Sep 21 15:57:48 BST 2012


My 2c's worth:

1) The tf issue could be a red herring - both commons would need to be defined in the subroutine (either directly or via a header file). This should cause a compile time error.
2) I always found gdb a pain for printing values in an array. I suggest adding an if statement so that only the cell you are interested in prints out (unless you want to manage a massive text file)
3) I've had a look in the code and if I'm looking in the correct place I see the following. The wall and air temperature are the same => Tq=0, qflux=0 and then Uq=0. There is then an term calculated in an if statement that has Uq on the denominator - this will produce a NaN if Uq=0. (Andrew I'll send you a file with a potential fix).

Iain

-----Original Message-----
From: esp-r-bounces at lists.strath.ac.uk [mailto:esp-r-bounces at lists.strath.ac.uk] On Behalf Of Aizaz Samuel
Sent: September-21-12 6:07 AM
To: Andrew Cowie
Cc: esp-r at lists.strath.ac.uk
Subject: [esp-r] Re: CFD problem

Andy,

I would second Achim's original recommendation of putting a write statement in. The format could be something like write(96,*)Tf [and other variables you wish to see at runtime] this generates a fort.96 file with values of the variables.

After a brief look at the code it seems there may be unanticipated variable overloading. The command grep -inIw tf ./*/*F | grep -i common from the src directory indicates there are two common blocks which hold the variable tf one is a scalar (in common block climi) and the other is a 3D array in tempf. The best way forward IMO is to replace the array name with a different name in all the code and see if that works. Even if it does not resolve the nan problem it should allow you to work with gdb.

Regards,
Aizaz

________________________________________
From: esp-r-bounces at lists.strath.ac.uk [esp-r-bounces at lists.strath.ac.uk] On Behalf Of Achim Geissler [achim.geissler at intergga.ch]
Sent: 20 September 2012 19:52
To: Andrew Cowie
Cc: esp-r at lists.strath.ac.uk
Subject: [esp-r] Re: CFD problem

Hi Andy

another thing, Tf is actually a scalar in the common /climi/ - again, could the difference between the working and non-working model lead to additional modules in the "name space"? I'm afraid, though, that my Fortran knowledge (which common is defined where at run time) is limited and this could absolutely be a wild goose chase (FORCHECK should report on such possible name clashes, though) - possibly the compiler, also, however.

Best
Achim



On Sep 20, 2012, at 6:49 PM, Andrew Cowie wrote:

> Hi all,
>
> I've managed to trace my CFD problem a good way back, but I've reached an impass and I'd be gratefull if anyone had any suggestions.
>
> The problem as described in my previous post occurs because the variable RESORW in CALCW is becoming NaN.  I've traced the NaN's back to BNDARTT in the file bndaryt.F; they first occur in the variable Uqstor(2,3,7).  The root of this is because Tq is calculated as 0 in the loop (8722 i think) where Uq is calculated.  The problem is the array Tf, but for some bizarre reason gdb doesn't recognize it as an array, it thinks it is a scalar of value 15.5.
>
> So this is my impass; i can't debug this in the code because it wont compile if i test Tf as a scalar, and i can't debug it in gdb becuase it won't recognize it as an array and hence i can't inspect the specific value Tf(2,3,7).
>
> I have tried compiling with extra debug options, and nothing is being flagged until the NaN's start cropping up, which obviously isn't helpful.
>
> Any ideas/comments/input-of-any-kind would be gratefully recieved, i have to present my work in a week and it's not gonna look good if i have to make "it doesnt work" last 20 mins.
>
> Thanks in anticipation,
> Andy Cowie
>
> _______________________________________________
> esp-r mailing list
> esp-r at lists.strath.ac.uk
> http://lists.strath.ac.uk/mailman/listinfo/esp-r
>

achim.geissler at intergga.ch





_______________________________________________
esp-r mailing list
esp-r at lists.strath.ac.uk
http://lists.strath.ac.uk/mailman/listinfo/esp-r

_______________________________________________
esp-r mailing list
esp-r at lists.strath.ac.uk
http://lists.strath.ac.uk/mailman/listinfo/esp-r



More information about the esp-r mailing list