View previous topic :: View next topic |
Author |
Message |
Sidney_Smith
Joined: 11 Mar 2010 Posts: 2
|
Posted: Thu Apr 15, 2010 10:22 am Post subject: fortran 95 |
|
|
I have made a comprehensive conversion of a mixed fortran 4/77 simulation program containing heaps of spaghetti code, to fortran 95. The code has about 132 subroutines and 30 common blocks which I have converted to modules. I am able to compile and debug both the old and new in silverfrost ftn95 anf ftn95 express, so I can just about do a to do a comparitive debug. The two programs perform an initial trim to a balanced system state with nearly identical results, but in the ft95 code, despite the fact that i can write out local variables, when i inspect the same variables using the visualdisplay with the mouse they are usually all zeros. One of the reasons for upgrading the code was to make it portable and compileable opn any machine/compiler. e.g Intel visual fortran as well as silverfrost, without any special compiler options e.g global save and zeroise, and elimination of undefined variables by initialising in the modules. There are still code errors but is the initialisation to zero in the variable declaration having some effect of the debugger output ? Can anybody help ? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Apr 15, 2010 10:36 am Post subject: |
|
|
If you remove /SAVE and /ZEROISE from the command line then /CHECKMATE should reveal all of the undefined variables at runtime.
Perhaps you should remove /SAVE later because this could be necessary for a different reason. i.e. some of the local variables may need to persist thoughout the runtime. |
|
Back to top |
|
 |
Sidney_Smith
Joined: 11 Mar 2010 Posts: 2
|
Posted: Thu Apr 15, 2010 1:22 pm Post subject: fortran 95 conversion |
|
|
I'm debugging with the .net option in silverefrost express and I set the global zeroise and save options off in the project properties/numerical options but it makes no difference .. In fact if I compile and debug with fn95 in plato on another machine the variables are visible so perhaps its a visual studio bug. All very frustrating. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Sun Apr 18, 2010 1:22 am Post subject: |
|
|
Have you tried /undef what Paul suggests and i'd back him? That's the mandatory step before doing or guessing for anything else. |
|
Back to top |
|
 |
|