#!/bin/ksh ## FCO Fortran Compilation into Object module 2005/03/25 if [[ $# -ne 1 ]] then echo ' Usage: FCO file ' \ ' Fortran Compilation into Object module 2005/03/25' echo ' Compiler option "-static" is invoked.' exit ; fi if [[ ! -f $1 ]] then echo "File does not exist: $1" ; exit 1 ; fi ( FPRG=$1 ; FPRG=${FPRG%%.*} # = beginning of $1 up to first . FERR=$FPRG.ERR ; FOBJ=$FPRG.o ; FFOR=$FPRG.f ; FSAV=$1.COP if [[ $FFOR = $1 ]] then cp -p $1 $FSAV ; fi FTOC $1 $FFOR Options="-O3 -c -static -64 -mips4 -OPT:IEEE_arithmetic" ## SGI # Options="-O4 -c -static -convert big_endian" ## HP Compaq DEC Alpha # Options="-O3 -c -static -convert big_endian -save" ## Intel 8.0 # Options="-O3 -c -Bstatic" ## Sun # Options="-O3 -c -s" ## Mac Pro Fortran # Options="-O2 -c -qsave -qfixed" ## Mac G5 xlf f90 $Options $FFOR 2> $FERR ## All others # xlf90 $Options $FFOR 2> $FERR ## Mac G5 xlf if [[ $? -eq 0 ]] then echo "Object module: $FOBJ Created from: $1" cat $FERR ; rm -f $FERR else echo "Fortran error file: $FERR Source file: $1" rm -f $FOBJ ; fi rm -f $FFOR if [[ $FFOR = $1 ]] then mv $FSAV $1 ; fi ) &