View previous topic :: View next topic |
Author |
Message |
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Thu Dec 10, 2020 4:26 pm Post subject: Namelist - global or only local? |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Fri Dec 11, 2020 8:11 am Post subject: |
|
|
Ken
Thanks for this report. I have logged these failures. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Dec 21, 2020 2:20 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Jan 04, 2021 12:16 pm Post subject: |
|
|
These issues have now been fixed for the next release of FTN95. |
|
Back to top |
|
|
|