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 

Namelist - global or only local?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Kenneth_Smith



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

PostPosted: Thu Dec 10, 2020 4:26 pm    Post subject: Namelist - global or only local? Reply with quote

The following code runs as I expected it to:
Code:
program main
implicit none
real     :: freq_hz = 50
real     :: volts_kv = 0.415
integer  :: no_of_poles  = 2
namelist /input_data/ freq_hz, volts_kv, no_of_poles
  write(6,input_data)
end program main

The following, where the variables and namelist are global fails. FTN95 8.70 Win32 outputs the last element in the namelist, while X64 crashes with an access violation.
Code:
module test_mod
  implicit none
  real :: freq_hz = 50
  real :: volts_kv = 0.415
  integer  :: no_of_poles  = 2
  namelist /input_data/ freq_hz, volts_kv, no_of_poles
  contains
  integer function run()
     write (6,input_data)
     run = 1
   end function run
end module test_mod

program main
use test_mod
implicit none
integer i
  i = run()
end program main

This second example does appear to be acceptable to one of two alternative compilers.

Should it be possible to use a namelist as a global variable at FTN95 or not? A possible bug?
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Fri Dec 11, 2020 8:11 am    Post subject: Reply with quote

Ken

Thanks for this report. I have logged these failures.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Dec 21, 2020 2:20 pm    Post subject: Reply with quote

At the moment FTN95 does not find the host NAMELIST. It must be defined within the module function that uses it. Everything else seems OK.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Jan 04, 2021 12:16 pm    Post subject: Reply with quote

These issues have now been fixed for the next release of FTN95.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
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