.ENABLE SUBSTITUTION
.ENABLE GLOBAL
;
; Command file to compile and link a Fortran program
;
.START:
.ASKS MOD Enter Fortran program name
.IF <STRLEN> EQ 0 .GOTO EXIT
.IF <STRLEN> GT 9. .GOTO SYNTAX
.IFT <ALPHAN> .GOTO TEST

.SYNTAX:
;
; ***** SYNTAX ERROR - reenter name or return to exit
;
.GOTO START

.TEST:
DEL 'MOD'.OBJ;*
FORTRAN 'MOD'
.IF <EXSTAT> EQ 1 .GOTO CREATE
;
;	******** Compile Was Not Sucessful ********
;
.ASK Q Continue with Link anyway ?
.IFT Q .GOTO CREATE
.GOTO EXIT

.NOSUCH:
;
;	NO Fortran file by that name exists
;
.GOTO START

.CREATE:
.TESTFILE 'MOD'.BLD
.IF <FILERR> EQ 1 .GOTO LINKR
.OPEN 'MOD'.BLD
.DATA 'MOD'/FP='MOD'/MP
.DATA ;
.DATA TASK='MOD'		; ASSIGN TASK NAME
.DATA ;
.IFNDF $MENU .GOTO 10
.DATA ; ALLOCATE BUFFER SPACE FOR
.DATA ;
.DATA EXTSCT=MN$BUF:4540	; STATIC SINGLE-CHOICE MENU
.DATA EXTSCT=HL$BUF:3410	; HELP TEXT OR MENU
.DATA EXTSCT=MM$BUF:1000	; MULTI-CHOICE MENU
.DATA ;
.10:
.ENABLE DATA
; NUMBER OF TASK UNITS = NUMBER OF APP. UNITS + 4,
;  PLUS ONE FOR CGL
;
UNITS=11
;
ASG=TI:7:11	; DEFINE TT$LUN AS NUMBER OF APP. UNITS + 1
		; DEFINE G$LUN AS LAST LUN
;
; EQUATE P/OS SYMBOLS TO LUNS
;
GBLDEF=TT$LUN:7
GBLDEF=WC$LUN:0		; NOT NEEDED
GBLDEF=MS$LUN:10
GBLDEF=HL$LUN:11
GBLDEF=MN$LUN:12
;
; DEFINE GLOBAL FOR GRAPHICS
;GBLDEF=G$LUN:13
;
; DEFINE EVENT FLAG
;
GBLDEF=TT$EFN:1
;
; DEFINE CLUSTER SCHEME
;
;CLSTR=PROF77,CGLFPU,POSRES,RMSRES:RO
CLSTR=PROF77,POSRES,RMSRES:RO
//
.DISABLE DATA
.CLOSE
.OPEN 'MOD'.ODL
.ENABLE DATA
	.ROOT	USER-OTSROT-RMSROT,OTSALL
USER:	.FCTR	'MOD'
@LB:[1,5]PROF77
@LB:[1,5]RMSRLX
	.END
.DISABLE DATA
.CLOSE

.LINKR:
SPAWN LINK @'MOD'.BLD
PURGE 'MOD'.FTN/KEEP:2
.EXIT:
