FCASPLIT is a program that splits a file containing a mixture of routines in various languages, such as Fortran, C and Assembler (from whence the name is derived), into separate files. The file names are composed of the routine name with a suffix to identify the language, such as .f for Fortran etc. In addition, FCASPLIT will create both a shell script and a MakeFile, either of which may be used to compile the various routines. The default file extensions, listed below, are machine dependant.
The FCASPLIT header lines are automatically created by PATCHY on VMS and Unix machines for Fortran and C streams. The following PATCHY control statement shows how to request FCASPLIT header lines should they not be generated automatically.
Requesting FCASPLIT header lines
+ASM,34,R=! ./*DECK ID>, !.h */
Default file extensions (most Unix systems):
Default file extensions (VMS systems):
Options:
Each routine must start with an identifying line :
Header lines for FCASPLIT
CDECK ID>, in cols. 1-12 for Fortran /*DECK ID>, in cols. 1-12 for C ;DECK ID>, in cols. 1-12 for assembler DECK ID>, in cols. 2-12 or DECK ID>, in cols. 3-12 for anything else name in cols. 13-40 gives the name
In the last two cases, or if name contains an extension, the file created will be name without extension .f, .c or .s added to it and without an entry into the script.
Example input file to FCASPLIT
CDECK ID>, FMCLR. SUBROUTINE FMCLR INTEGER SYSTEMF IC = SYSTEMF('clear') END /*DECK ID>, FMH.H*/ #define MAXNAME 8 #define MAXJOBN 8 /* Was 16 */ #define MAXHOST 8 #define MAXINFO 8 /* Was 16 */ /*DECK ID>, FAEXIT. */ void faexit_(icode) int *icode; { exit(*icode); }
Running FCASPLIT on this input file produces the following output files:
Output from FCASPLIT
:::::::::::::: faexit.c :::::::::::::: /*DECK ID>, FAEXIT. */ void faexit_(icode) int *icode; { exit(*icode); } :::::::::::::: fmclr.f :::::::::::::: CDECK ID>, FMCLR. SUBROUTINE FMCLR INTEGER SYSTEMF IC = SYSTEMF('clear') END :::::::::::::: fmh.h :::::::::::::: #define MAXNAME 8 #define MAXJOBN 8 /* Was 16 */ #define MAXHOST 8 #define MAXINFO 8 /* Was 16 */ :::::::::::::: temp.mkfca :::::::::::::: ROUTINES = fmclr.o faexit.o .f.o: xlf -c -O -qextname -qcharlen=8192 $*.f .c.o: cc -c -O $*.c .s.o: as $*.s temp: $(ROUTINES) :::::::::::::: temp.shfca :::::::::::::: xlf -c -O -qextname -qcharlen=8192 fmclr.f cc -c -O faexit.c
Example of running FCASPLIT on an RS6000
zfatal:/home/cp/jamie/fatmen (42) fcasplit fmkuip.f FCASPLIT executing. Input file : fmkuip.f Shell script : fmkuip.shfca Make file : fmkuip.mkfca Fortran name : xlf Fortran options : -c -O -qextname -qcharlen=8192 CC name : cc CC options : -c -O Assembler name : as Assembler options : 10315 lines written for 63 decks 16 trailing comment lines ignored.
Example of running FCASPLIT on an HP
[csf] (358) /cern/pro/bin/fcasplit fmkuip.f FCASPLIT executing. Input file : fmkuip.f Shell script : fmkuip.shfca Make file : fmkuip.mkfca Fortran name : f77 Fortran options : -c -O -w +ppu CC name : cc CC options : -c -O Assembler name : as Assembler options : 10315 lines written for 63 decks 16 trailing comment lines ignored
Makefile generated by FCASPLIT on an HP
[csf] (359) more fmkuip.mkfca ROUTINES = fatmen.o fmcd.o fmclr.o fmcopc.o fmcpc.o fmdumc.o \ fmedit.o fmexit.o fmextr.o fmfc.o fmfndc.o fmgime.o fminic.o \ fmkadd.o fmkadt.o fmkatt.o fmkcpl.o fmkdst.o fmkend.o fmkloc.o \ fmkmod.o fmkmtp.o fmksrc.o fmkuwd.o fmld.o fmlogc.o fmlogn.o \ fmlsc.o fmmakc.o fmmkdr.o fmmvc.o fmpwd.o fmquit.o fmrmc.o \ fmrmdc.o fmrmtc.o fmrzld.o fmscat.o fmscpl.o fmsdst.o fmseac.o \ fmsloc.o fmsmdk.o fmsmtp.o fmssrc.o fmstat.o fmsuwd.o fmtagc.o \ fmtchc.o fmthrg.o fmtrek.o fmulcc.o fmupdc.o fmzoom.o zabend.o \ fmslcc.o fmlokk.o fmsupd.o fmlnc.o fmrmlc.o fmnikk.o fmskan.o \ fmklcc.o .f.o: f77 -c -O -w +ppu $*.f .c.o: cc -c -O $*.c .s.o: as $*.s fmkuip_all: $(ROUTINES)
Shell script generated by FCASPLIT on an HP
[csf] (360) more fmkuip.shfca f77 -c -O -w +ppu fatmen.f f77 -c -O -w +ppu fmcd.f f77 -c -O -w +ppu fmclr.f f77 -c -O -w +ppu fmcopc.f f77 -c -O -w +ppu fmcpc.f f77 -c -O -w +ppu fmdumc.f f77 -c -O -w +ppu fmedit.f f77 -c -O -w +ppu fmexit.f f77 -c -O -w +ppu fmextr.f f77 -c -O -w +ppu fmfc.f f77 -c -O -w +ppu fmfndc.f f77 -c -O -w +ppu fmgime.f f77 -c -O -w +ppu fminic.f f77 -c -O -w +ppu fmkadd.f f77 -c -O -w +ppu fmkadt.f f77 -c -O -w +ppu fmkatt.f f77 -c -O -w +ppu fmkcpl.f f77 -c -O -w +ppu fmkdst.f f77 -c -O -w +ppu fmkend.f f77 -c -O -w +ppu fmkloc.f ...