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 

No Saturdays without devilry
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
DanRRight



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

PostPosted: Wed Dec 01, 2021 6:53 am    Post subject: Reply with quote

Rrrright, "punish allies, enemies will be scarier" as some proverb is saying (English version Fight a friend to fright a foe)
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2405
Location: Sydney

PostPosted: Thu Dec 02, 2021 9:15 am    Post subject: Reply with quote

Dan,

I modified your code to:
report the memory address of "EnergyInFocalSpot" which is different in 2 routines.
Commenting out the redefinition fixes the problem.

It is intersting how Fortran committee are so scathing of COMMON, but retain this feature of MODULE which is probably a more insideous feature/bug

Code:
   i = winio@ ('Energy, J %ta%rf%ff&',         EnergyInFocalSpot)
   i = winio@ ('Energy, J, simple %ta%rf%ff&', EnergyInFocalSpotSimple) !   I*s_FWHM*tau_FWHM
        loc_EnergyInFocalSpot   = loc(EnergyInFocalSpot)
   i = winio@ ('loc_EnergyInFocalSpot %ta%rd%ff&',loc_EnergyInFocalSpot) !   I*s_FWHM*tau_FWHM
   i = winio@ ('%1tl', 8)   
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1707

PostPosted: Thu Dec 02, 2021 10:41 am    Post subject: Reply with quote

I am curious to know if the erroneous re-declaration was introduced as a result of converting older code with COMMON to a modern version with modules.

Consider the limitations of Fortran 77 and older versions. We could specify dimension information in a COMMON declaration, but not type information. Therefore, if we wanted a REAL*8 variable in a common block, and we did not specify IMPLICIT REAL*8 (A-H,O-Z), we would need REAL*8 variables in COMMON to be covered by one or more type declaration statements.

It is likely that some such type declarations were left behind when old code with COMMON was converted to code with modules and contained subprograms.
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Thu Dec 02, 2021 12:11 pm    Post subject: Reply with quote

You don't need to specify IMPLICIT REAL*8 anything if you use OPTIONS (DREAL) and use implicit types. OK, so that is a Silverfrost thing, but once you start using ClearWin+, no other compiler will do, especially those where even the installation instructions are written in Klingon.

I rather liked it when there was only one kind of INTEGER, and effectively only one type of REAL (because DOUBLE PRECISION took up too much space. That was when you could get 48 or 60 bit single precision, of course, as 32 bit isn't much good even for my purposes, most of the calculations in which could be done with a slide rule (or logarithms at a pinch) if I had unlimited time, patience and could rely on myself not to make mistakes ...

Eddie

PS: My views relate to what I do, and I don't ever attempt to force them on others. But my codes have both predicted and prevented engineering disasters, and helped to win a war, among other things, so they aren't that daft.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2405
Location: Sydney

PostPosted: Mon Dec 06, 2021 1:55 am    Post subject: Reply with quote

Eddie,

"One kind of integer" was INTEGER*2. Even back to 70's we needed *4 for large arrays.

My use of COMMON include files has always been explicit "kind" definition, but with dimensions in the COMMON list of variables.

This has been a problem since compilers applied alignment to REAL*8. (back in 80's?) I still know where in the codes I use that have COMMON declared that is not in an include file. It's a bit OCD how many times I have rechecked these declarations.
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 -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 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