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 

Preconnected logical unit numbers
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
LitusSaxonicum



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

PostPosted: Sun Mar 04, 2018 7:03 pm    Post subject: Reply with quote

Fascinating. Hardly a complete list, though. And what the heck is it doing in Salflibc.dll (or not)?
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 941

PostPosted: Sun Mar 04, 2018 7:52 pm    Post subject: Reply with quote

Unlike John Campbell, I have a limited number of FTN95 releases installed. Here is the test code for someone to see if another version of SALFLIBC.DLL contains D1MACH:
Code:
program tmach
implicit none
double precision :: d1mach,xd
integer :: i,i1mach
!
print *,'           I        I1MACH(I)'
print *
do i=1,10
   print *,i,i1mach(i)
end do
print *
print *,'           I        D1MACH(I)'
print *
do i=1,5
   xd=d1mach(i)
   print *,i,xd
end do
end program tmach
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 941

PostPosted: Wed Mar 28, 2018 11:31 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:
Interesting that 0 isn't preconnected. How do you do the test with * ?

Provided you use 1 .. 6 and specifically OPEN them, FTN95 works just fine.


This question resurfaced after a couple of months, and there is some indication that Unit-2 and '*' are either the same or are related. A program opened an unformatted file with unit number = 2, and later tried to WRITE to unit = *. This failed.
Code:
      PROGRAM ORD77
      IMPLICIT NONE
      WRITE(*,10)
      call openu(2)
 10   FORMAT(' PROGRAM SWORD (4 Mar 96) : ')
      STOP
      END PROGRAM
!
      subroutine openu(n)
      implicit none
      integer, intent(in) :: n
      character*8 :: fname = 'FORT.   '
      integer :: i
      logical :: isopen,exists
      character*10 :: act,frm
!
      write(fname(6:6),'(I1)')n
      close(n)
      open(n,file=fname,form='unformatted')
      write(*,'(A,A,A)')'Opened ',trim(fname),' as unformatted'  ! <<<=== Error
      return
      end subroutine

The error message: " *** Error 90, File access and properties are incompatible" for the line with "WRITE(*,'(A,A,A)')...".
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 941

PostPosted: Sun Apr 01, 2018 4:02 pm    Post subject: Reply with quote

If the compiler sees an attempt to open a file with unit = 2, and the unit number is the literal constant 2, it issues a warning. Here is a test program.
Code:
program tst
implicit none
integer i,j,k
!
open(2,file='fort.2',status='replace',form='formatted')
do i=1,10
   print *, 'i = ',i
   j=i*i
   k=i*i*i
   write(2)i,j,k     ! *** ERROR ***: unformatted I/O on formatted file connection
end do
close(2)
end program tst

The compiler says:
Code:
0005) open(2,file='fort.2',status='replace',form='formatted')
WARNING - Opening unit 2 may affect the operation of output to the default unit '*' - are you sure you want to do this?
0012) close(2)
WARNING - Closing unit 2 may affect the operation of output to the default unit '*' - are you sure you want to do this?
    NO ERRORS, 2 WARNINGS
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 -> General 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