Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

hf77_filter(1)

NAME

vos_hf77, f66_hf77, fix_octal − VOS Fortran to Hf77 Fortran translators

SYNOPSIS

vos_hf77
f66_hf77
fix_octal

DESCRIPTION

vos_hf77 is a shell script (utilizing awk) for converting a number of VOS Fortran extensions and architectural entities to the appropriate hf77 supported syntax.  VOS Fortran is the Fortran dialect accepted by Harris’ Fortran 77 compilers on H-series computer systems. 
 
f66_hf77 is a shell script (utilizing awk) for converting certain Fortran 66 constructs into appropriate Fortran 77 syntax. 
 
fix_octal is a shell script (utilizing tr and awk) for converting old style VOS Fortran octal constants into one of the forms hf77 will accept. 
 
Each script reads Fortran source from stdin and writes the translated source to stdout. 
 

vos_hf77 will convert the following VOS Fortran features :
 

$ADD into an INCLUDE statement.  By default, the VOS areaname is converted into a UNIX pathname by removing the asterisk and VOS qualifier, and converting the remainder to lower case.  The user can control this by editing a local copy of the awk script. 
 

SPECIAL COMMON
statements into comments.  There is no SPECIAL COMMON (nor any need for it) on CX machines. 
 

Inline Directives
into comments.  Note that inline assembly sequences will be commented out and a warning diagnostic written to the terminal after the script completes.
 

END$ statements into END statements.  The remainder of the input data is ignored. 
 

JOBCNTRL
commands appearing as the first portion of a file are skipped.
 

∗3 and ∗6
as a size specifier for INTEGER and LOGICAL datatypes into ∗4 or ∗2 (user selectable). 
 

∗6 and ∗9 and ∗12
as a size specifier for the REAL datatype into ∗4 or ∗8 (user selectable).  In addition, a size specifier on a DOUBLE PRECISION variable can be discarded, or the DOUBLE PRECISION declaration can be replaced by a REAL declaration. 
 

The user can customize the conversions mentioned above by copying the awk script into her own local directory, editing the script to set certain awk variables, and executing the changed script.  The initial portion of the awk script is well marked and easy to find and modify.  The commands needed to do this are :
 
     cat  /usr/bin/vos_hf77  >vos_hf77
     vi  vos_hf77
           (user makes appropriate changes to the script)
     ./vos_hf77  <vos_source.f  >hf77_source.f
     diff  vos_source.f  hf77_source.f
 
Of course, any available editor may be used instead of vi. 

 

f66_hf77 will convert the following Fortran 66 features to an hf77 compatible form :
 

PARAMETER statements
Some Fortran 66 compilers accepted a PARAMETER statement of the form "PARAMETER A=1, B=2".  Note that there are no parenthesis in the statement.  Fortran 77 requires parenthesis around the list, i.e.  "PARAMETER (A=1, B=2)".  f66_hf77 changes the blank immediately after the PARAMETER keyword to a "(", and adds a continuation line with a solitary ")" after the last line of the PARAMETER statement. 

 

fix_octal will convert octal constants of the form ’123 into the form ’123’O.  The user of this script is cautioned to carefully review the changes made by this script for correctness.  This transformation is impossible to perform correctly in all possible circumstances.  The script itself, /usr/bin/fix_octal, contains a list of assumptions and suggestions.  A knowledgeable awk user will be able to adapt the script to his individual circumstances.  In most cases; however, it is expected that 95+% of the changes made will be correct, and the remainder can most easily be corrected by hand. 
 

EXAMPLES

vos_hf77 < vos_fortran_source > hf77_source
f66_hf77 < fortran66_source > hf77_source
fix_octal < fortran66_source > hf77_source
 

FILES

/usr/bin/vos_hf77        awk script to convert VOS Fortran to hf77 source
/usr/bin/f66_hf77        awk script to convert Fortran 66 source to hf77 source
/usr/bin/fix_octalscript to convert old VOS style octal constants

SEE ALSO

CX/UX Hf77 Fortran Reference Manual. 
hf77(1)

DIAGNOSTICS

There are no diagnostics.  Source code passed into these translators is assumed to be correct Fortran. 

WARNING

Since these scripts modify the source code in a relatively simpleminded manner, the user is advised to diff the input and output files to verify the correctness of the changes made. 
 
vos_hf77 does not correctly handle files with imbedded tab characters.  Note that VOS Fortran programs do not have tabs, and this script should be used before any tabs are inserted.  Tabs are not required by but are allowed in hf77. 

BUGS

Currently, f66_hf77 does not correctly handle the different semantics of the PARAMETER statement in its conversion.  In Fortran 66, the variables in the PARAMETER statement are typed (INTEGER, REAL, ...) based on the type of the initializer value, while in hf77 the variables are typed the same as any other variable. 
 
fix_octal uses a simple minded heuristic to distinguish between octal constants and character strings.  This heuristic may not always work correctly.  Also, Hollerith fields are not recognized, so the appearance of an apparent octal constant within a Hollerith item will be changed. 

CX/UX Fortran Reference

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026