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 1, 2  Next
 
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: 1797
Location: Yateley, Hants, UK

PostPosted: Sun Jan 28, 2018 4:18 pm    Post subject: Preconnected logical unit numbers Reply with quote

In new programs, I have steered clear of single digit unit numbers knowing that there were assumptions about preconnection. I recently exhumed something decades old, that used luns of 5 and 6 for input and output respectively, and 2,3,4 for scratch files. Interestingly, while it worked, I couldn't insert a WRITE to the screen as 'unit neither Opened nor preconnected' until I made them 20 to 60 inclusive FTN95 even prohibited writing to * when there was a CLOSE statement left in the program inadvertently.

It occurred to me that I could not find a description of what unit numbers were preconnected.

When this was hard-coded in the OS, I remembered vaguely 5 and 6 being card reader and line printer, but my PC has neither. One nice computer I used has 2 and 7 for this, with 3 and 4 being tape readers, 5 for a tape punch and 9 for the plotter: 1 was the operator's console teletype and 8 a device we didn't have.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 924

PostPosted: Sun Jan 28, 2018 5:23 pm    Post subject: Reply with quote

FTN95 does not do implicit OPEN to files named FORTnn or something like that, as other compilers do.

Regarding your question: the FTN95 manual says "UNIT values should be greater than 6 to avoid the possibility of re-assigning standard input/output streams." Running the following program reveals that units 1, 2, 5 and 6 are pre-connected with READWRITE access
Code:
program preconn
implicit none
integer :: i,lun
logical :: exists,isopen
character(10) :: act
do i=0,20
   inquire(unit=i,exist=exists,opened=isopen,action=act)
   write(*,'(I3,2x,2L2,2x,A)')i,exists,isopen,act
end do
end program
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sun Jan 28, 2018 5:35 pm    Post subject: Reply with quote

Hi Mecej4,

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 ...

I never expected to read from a tape or card punch or lineprinter, nor to write to a card or tape reader, and it irritated me that they were different from computer to computer, especially when they had to be hard coded as actual numbers and not as a variable!

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



Joined: 13 Oct 2014
Posts: 454
Location: Morrison, CO, USA

PostPosted: Sun Jan 28, 2018 6:02 pm    Post subject: Reply with quote

Except for the console (I use Unit=1), I used unit numbers 10-*.

UNITS 1, 2, 5, AND 6 all appear to be attached to the console. All these units are opened for both READ and WRITE.
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 845

PostPosted: Sun Jan 28, 2018 11:53 pm    Post subject: Reply with quote

5 aqnd 6 were always the defaults for input and output respectivley ,to the console , when I startd using fortran (late 70's). Isn't that in the standard ?
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Mon Jan 29, 2018 12:13 am    Post subject: Reply with quote

John,

Standard in the sense that many computers followed it, but not even IBM always followed it, for example the IBM 1130 manual of 1973 states:

1 Console Printer
2 1442 Card Read Punch, Model 6 or 7
3 1132 Printer
4 1134 Paper Tape Reader/1055 Paper Tape Punch
5 1403 Printer
6 Keyboard
7 1627 Plotter
8 2501 Card Reader
9 1442 Card Punch, Model 5
10 Unformatted I/O area on disk

and on the IBM 1800 (same document) the unit numbers were assigned during system installation! 5 is definitely a line printer.

Besides, FTN95 has inter alia both 5 and 6 READWRITE, which definitely wasn't the case when 5 was READ and 6 was WRITE. The idea of having the same device READWRITE when writing involved punching holes in media is rather frightening!

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



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

PostPosted: Tue Feb 06, 2018 6:46 pm    Post subject: Reply with quote

So despite all the frivolity and reflections on computers and compilers of the past (sorry), the point remains that in FTN95 you can connect the numbered console-preconnected logical unit numbers, but they are ganged, so connecting one or more of them to a file disconnects all the units that would otherwise be preconnected, including *.

Now where is that in the documentation?
Back to top
View user's profile Send private message
silicondale



Joined: 15 Mar 2007
Posts: 204
Location: Matlock, Derbyshire, UK

PostPosted: Fri Mar 02, 2018 1:05 pm    Post subject: Reply with quote

All rather strange.Yes, in the early days of IBM360, CDC3600 and 6600, and the DEC PDP11, unit 5 was card reader, 6 was lineprinter as standard, but even then it was possible explicitly to connect them to files. Since the early 1980s (on CP/M micros etc) I have always explicitly OPENed and CLOSEd every unit that I use, so haven't even thought about pre-connection. Never had a problem with this.
_________________
(just call me Steve)
Back to top
View user's profile Send private message Visit poster's website
mecej4



Joined: 31 Oct 2006
Posts: 924

PostPosted: Fri Mar 02, 2018 1:15 pm    Post subject: Re: Reply with quote

silicondale wrote:
All rather strange.Yes, in the early days of IBM360, CDC3600 and 6600, and the DEC PDP11, unit 5 was card reader, 6 was lineprinter as standard, but even then it was possible explicitly to connect them to files. Since the early 1980s (on CP/M micros etc) I have always explicitly OPENed and CLOSEd every unit that I use, so haven't even thought about pre-connection. Never had a problem with this.

On many of the older computers, there was no such thing as a file (other than the thick binders that contained the manuals and were chained to a stand to keep them from walking away). I remember struggling for months with the concept of "file" when I had to move from a CDC to a Univac. I knew rasps from bastard files, but all these properties: "permanent", "scratch", "mountable", "public", etc., disk drives with random access, tapes with only sequential access -- these attributes were difficult to understand and looking through the glass walls of the computer room did not enlighten one.


Last edited by mecej4 on Fri Mar 02, 2018 1:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
silicondale



Joined: 15 Mar 2007
Posts: 204
Location: Matlock, Derbyshire, UK

PostPosted: Fri Mar 02, 2018 1:27 pm    Post subject: Reply with quote

Indeed so! Tapes in particular were always a problem because you had to specify the type of tape (7 or 9 track), encoding (BCD, EBCDIC, etc), blocking factors, etc. and because no random access, a lot of processing required reel-to-reel copying with edits done 'on the fly'. But in 1973 I was involved in development of one of the first relational database systems, on an IBM 360. This used files - lots of files - but all of them had to be pre-defined in IBM JCL (job control language). Because you could never be sure in advance which files you needed, or even whether you were going to write a new file, this needed a whole separate program that did nothing but write all the JCL for a second job that actually did the processing - and then submit that job to the batch queue. Even though we wrote in standard Fortran 66, porting to different computers was a major task because their equivalents to JCL were all very different. I recall weeks of toiling over porting the system to a Univac 1108.
_________________
(just call me Steve)
Back to top
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 1959
Location: Sydney

PostPosted: Sat Mar 03, 2018 7:46 am    Post subject: Reply with quote

Steve,

I recall starting on an IBM 7030, where our only output was to a printer.
I then went to the CDC 6600 and wrote my first FEA program. I also learnt about variable length record, random access binary files. I still use a library I wrote that replicates this in "standard" Fortran, although it mixes variable types for arguments. I never knew where the files were stored or how big they could be.
Then, when my computer budget expired (and those of acquaintances that I "borrowed"), it was off to the new Prime in the Civil Engineering computer lab. I refused to use JCL ever since. Someone else's problem.

What we didn't know then !

John
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 924

PostPosted: Sat Mar 03, 2018 8:10 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:
... the point remains that in FTN95 you can connect the numbered console-preconnected logical unit numbers, but they are ganged, so connecting one or more of them to a file disconnects all the units that would otherwise be preconnected, including *.

Now where is that in the documentation?

By accident, I found other undocumented library routines that give part of the answer. I had to download 43 files from Netlib to build a test code. There were two more files that were needed, and I overlooked them. I built with FTN95 8.10, and the program could be compiled and run. It was only after I repeated the build/run with a different compiler and found two routines missing that I poked around and found that SALFLIBC.DLL contains the PORT library routines D1MACH() and I1MACH(). (It does not contain R1MACH(), the single-precision counterpart of D1MACH. )

Among other items, I1MACH gives the following preconnected unit numbers:

Code:
    I1MACH( 1) = 5 : THE STANDARD INPUT UNIT.
    I1MACH( 2) = 6 : THE STANDARD OUTPUT UNIT.
    I1MACH( 3) = 0 : THE STANDARD PUNCH UNIT.
    I1MACH( 4) = 0 : THE STANDARD ERROR MESSAGE UNIT.


Note that Punch and Standard Error are both assigned to Unit 0.

Therefore, the next time when you expect error messages and they are not forthcoming, please make sure to connect your card punch [ :o ]


Last edited by mecej4 on Sun Mar 04, 2018 12:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sun Mar 04, 2018 11:50 am    Post subject: Reply with quote

I wish I understood this, but sadly I donít Ė except if you are saying that FTN95 contains some relics of a former age, which I guess it must, rather like those unfathomable things in the human genome, or the appendix.

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



Joined: 31 Oct 2006
Posts: 924

PostPosted: Sun Mar 04, 2018 2:15 pm    Post subject: Reply with quote

The Salflibc.dll version that came with Version 7.20 does not contain D1MACH and I1MACH. Those routines are present in the DLL accompanying Version 8.10, but are not mentioned in the FTN95 help file.

The routines D1MACH, etc., were heavily used in the 1980-s. Many of the Netlib numerical analysis software packages require calls to D1MACH before doing anything else. The machines of those days had disparate floating point representations, and D1MACH provided similar information to what we get now from the intrinsics EPSILON, TINY, HUGE, etc. Before Fortran 90 became widely used, D1MACH was indispensable.

The source code of D1MACH may be instructive: http://www.netlib.org/slatec/src/d1mach.f . Before using the file, you had to find the DATA statements for your particular machine, and uncomment them. If you did not see your machine represented, it used to require quite a bit of work to ascertain what to use (there was no Internet, no Google to give you the answers).
Back to top
View user's profile Send private message
silicondale



Joined: 15 Mar 2007
Posts: 204
Location: Matlock, Derbyshire, UK

PostPosted: Sun Mar 04, 2018 3:13 pm    Post subject: Reply with quote

No Internet, no Google - but we did have printed manuals, some of them excellent. I recall using various DEC PDP-11 models during the 1970s, and it was possible to find absolutely everything you needed in the manuals, though they did take up quite a few metres of shelf space. I recall one of the DEC user courses I attended taught how to program in machine code using just the row of switches on the front of the computer - i.e. directly accessing the CPU instruction set (a lower level than Assembler). Fun! One of the exercises we were given was to write a program to zero the entire memory (including itself) in a minimum number of instructions.

For a couple of years I was using a PDP 11/10 as a remote terminal to the Rutherford Laboratory's IBM 360, and my first task every morning was to key in a program on the switches to load a card deck containing the communications program. Happy days!
_________________
(just call me Steve)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General 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