forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New compilation - array problems
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Fri Jul 10, 2020 9:12 am    Post subject: New compilation - array problems Reply with quote

Hi, I have just recompiled/built a programme a wrote in F95 in 2011/2014 it seems fine expect it not passing a multi dimensional array from a subroutine to another subroutine, its values are zero. ok I am still using the common block method but it does not appear to complain enough, i do get warnings e.g. floating point concerns, but it does prevent compilation it runs except i have these arrays that were zeroed...no good of course.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6564
Location: Salford, UK

PostPosted: Fri Jul 10, 2020 10:45 am    Post subject: Reply with quote

If you can post a short program that illustrates the failure then someone may be able to help you.
Back to top
View user's profile Send private message AIM Address
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Fri Jul 10, 2020 3:56 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
If you can post a short program that illustrates the failure then someone may be able to help you.


PROGRAM ETA
WINAPP
DIMENSION PXYZ(3),PRPM(10),PRESS(10,8,721),PMEAN(10,1,721)
COMPLEX GENG(58,721),DIS(512,3,6),X(512,3,6),KE(6,3),TFC(512,3,6)
COMMON /INTG1/ NPT,NCYL,NBRG,IGRP,IANG(Cool,NPOS,ORMS
COMMON /REAL1/ RPM,P(8,721),BDIS(9),WR(9),RALPH(9),F1(9),F2(9),F3(9),F4(9),WROT,WREC,R,CL,D,PMOD(Cool,TILT,DVEE,TDIS(9),GR
COMMON /REAL2/ COG(3),EM,SM(6),TCOG(3)
COMMON /REAL3/ THETA(2,721)
COMMON /COMP1/ GENG
COMMON /COMP2/DIS,X,KE,TFC
........
The key function GENG is referenced in several subroutines...as COMMON/COMP1/GENG.... see example below

SUBROUTINE ENGINE
COMPLEX GENG(58,721)
COMMON /INTG1/ NPT,NCYL,NBRG,IGRP,IANG(Cool,NPOS,NRPM
COMMON /REAL1/ RPM,P(8,721),BDIS(9),WR(9),RALPH(9),F1(9),F2(9),F3(9),F4(9),WROT,WREC,R,CL,D,PMOD(Cool,TILT,DVEE,TDIS(9),GR
COMMON /REAL3/ THETA(2,721)
COMMON /COMP1/ GENG
COMMON /ENGR1/ FACTR,FIC(721),YM(8,721),FANG(Cool...

I am getting zeros...in GENG.
In earlier compilations e.g. 2014 This was fine...now itís not
Back to top
View user's profile Send private message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Fri Jul 10, 2020 10:49 pm    Post subject: Re: New compilation - array problems Reply with quote

colt1954 wrote:
Hi, I have just recompiled/built a programme a wrote in F95 in 2011/2014 it seems fine expect it not passing a multi dimensional array from a subroutine to another subroutine, its values are zero. ok I am still using the common block method but it does not appear to complain enough, i do get warnings e.g. floating point concerns, but it does prevent compilation it runs except i have these arrays that were zeroed...no good of course.


Further to the above is there anyway to compare how the latest compiler has changed since the new compiled version of my old code seems not to work fully.. though the program runs it does not return a key array variable's values correctly, just zeros. So should the compiler flag up the unacceptable condition? Hope this make some sense
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2227
Location: South Pole, Antarctica

PostPosted: Sat Jul 11, 2020 4:30 am    Post subject: Reply with quote

Compiler became since that time only deeper picky at user errors. Compile all files with /undef and use SDBG debugger. In debugger there exist options to stop at the place of first use or first change of specific variable. Try to use them to find which place zeroizes your array
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6564
Location: Salford, UK

PostPosted: Sat Jul 11, 2020 8:01 am    Post subject: Reply with quote

colt1954

If you use a) the same code b) the same data and c) the same FTN95 command line arguments, then you can expect to get the same results as before. If you change any of these then it may not "work" for various reasons.

The thing to do is to first reproduce exactly what you did before and then progress in small step changes.

I am puzzled by what appears in your code as an emoticon (you have an option to suppress them when you post). If it means the presence of a colon then how does that work?
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2180
Location: Yateley, Hants, UK

PostPosted: Sat Jul 11, 2020 1:14 pm    Post subject: Reply with quote

You say you wrote it 'in F95'. Did you use FTN95, or some other compiler?

As Paul notes, what appears as an emoticon is the combination of [colon : ] and [right bracket ) ], and that wouldn't have worked in 2011-14, just like it doesn't now.

Eddie
Back to top
View user's profile Send private message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Sat Jul 11, 2020 2:37 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
colt1954

If you use a) the same code b) the same data and c) the same FTN95 command line arguments, then you can expect to get the same results as before. If you change any of these then it may not "work" for various reasons.

The thing to do is to first reproduce exactly what you did before and then progress in small step changes.

I am puzzled by what appears in your code as an emoticon (you have an option to suppress them when you post). If it means the presence of a colon then how does that work?


Oh no, ignore not sure how they crept in i can assure you no such things exist in the code
Back to top
View user's profile Send private message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Sat Jul 11, 2020 2:39 pm    Post subject: Re: Reply with quote

DanRRight wrote:
Compiler became since that time only deeper picky at user errors. Compile all files with /undef and use SDBG debugger. In debugger there exist options to stop at the place of first use or first change of specific variable. Try to use them to find which place zeroizes your array


Sorry what's /undef....please, and how do you use the SDBG exactly
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 373
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sat Jul 11, 2020 8:06 pm    Post subject: Reply with quote

https://www.silverfrost.com/ftn95-help/devel/checking_for_undefined_variables_undef.aspx
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2227
Location: South Pole, Antarctica

PostPosted: Sun Jul 12, 2020 7:15 am    Post subject: Reply with quote

Suppose you have the program aaa.f95
Code:
a=1
b=a*c
Print*, 'b=', b
END

You compile it
Code:
FTN95 aaa.f95 /link /debug /undef

You can just run the program as usual and get error report in the form of crash but better run it via debugger and see all the variables
Code:
SDBG AAA.EXE

Use F7 and F6 keys to see the execution step by step or just run to the error.

/undef and /full_undef are the most powerful debugging options

Inside debugger there exist prompts how to set debugger to stop on first use of any variable (or similarly stop on any change by the code of specific variable). Point with mouse on any variable and use right mouse button for that. All that is intuitive and does not need any guide, just try and see


Last edited by DanRRight on Sun Jul 12, 2020 6:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 373
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sun Jul 12, 2020 2:58 pm    Post subject: Reply with quote

The second part of this video by Paul gives a basic introduction to using the debugger from within Plato.

https://www.youtube.com/watch?time_continue=1&v=7P8vPlCPxuk&feature=emb_logo
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 1450
Location: Aerospace Valley

PostPosted: Mon Jul 13, 2020 5:04 am    Post subject: Reply with quote

Colt1945 ....

Smile Cool Wink

I've had this before
Notice the difference ?

First one is a colon ...; second is 8 .... each followed by a close bracket !!! (no need for the '-' sign (even though it works too with one)
The third has a semi-colon

You need to just turn off the smileys in the options when you make your comment.

P.S.
I didn't know there were so many different styles of 'cool' ....
https://emojipedia.org/smiling-face-with-sunglasses/
All these megolopolies have to have their individuality don't they.
(scroll down on that link)
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1450
Location: Aerospace Valley

PostPosted: Mon Jul 13, 2020 5:23 am    Post subject: Reply with quote

as for ...
Quote:
is there anyway to compare how the latest compiler has changed

you can go here
https://www.silverfrost.com/19/ftn95/support/ftn95_revision_history.aspx
for the 'short' revision history between versions

Assuming you were using ftn95 then & now, that would put your 'old' version (between 2011/2014) anywhere between v6 and v7.1
ref. the 'Announcements' forum where each release date is recorded:
http://forums.silverfrost.com/viewforum.php?f=2

For more details of the changes, find the .enh files (there are different ones for ftn95 and clearwin) in the install sub-directories on your PC and open them in Notepad or Wordpad.
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 241

PostPosted: Mon Jul 13, 2020 9:43 am    Post subject: Reply with quote

colt1954,

some more remarks:

it might be worthwhile knowing the version of ftn95 used for your compile/linking step (which is printed if executing command ftn95 in a Windows cmd window);

to get more information about ftn95 I often use the ftn95 online help window (by executing command "ftn95 --help" in a Windows cmd window);

in order to see what is displayed to the forum before submitting a post I often use the "Preview" button (and in most cases I do some corrections to my posts before finally submitting them Smile

Regards,
Dietmar
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group