Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

[Licence| Download | New Version Template] acwp_v1_0.gz(17 Kbytes)
Manuscript Title: Converter of FORTRAN format and data statements to standard form.
Authors: M. Salem
Program title: FORMAT AND DATA CONVERTER
Catalogue identifier: ACWP_v1_0
Distribution format: gz
Journal reference: Comput. Phys. Commun. 11(1976)199
Programming language: Fortran.
Computer: IBM 360/65.
Operating system: OS.
RAM: 22K words
Word size: 32
Keywords: General purpose, Utility, Format, Data, Ansi standard fortran, Conversion.
Classification: 4.14.

Nature of problem:
Fortran programs to be used at more than one installation are best written in ANSI Fortran IV. Most statements are easily written in standard Fortran, but literal expressions require the counting of characters, and most programmers prefer to enclose literals between standard characters (apostrophes, asterisks, etc.), as allowed by many compilers. The present program converts FORMAT and DATA statements containing such literals to standard form. For example, '0TITLE.' becomes 7H0TITLE.
 The standard DATA statement requires as many variables to be           
 initialized as there are constants  DIMENSION VEC(3)                    
 DATA VEC(1), VEC(2), VEC(3)/1.0, 2.0, 3.0/                (1)           
 while most compilers allow arrays to be initialized as follows:         
 DATA VEC/1.0, 2.0, 3.0/                                   (2)           
 or                                                                      
 DATA (VEC(I),I= 1, 3)/1.0, 2.0, 3.0/                      (3)
The present program expands most statements of types(2) and (3) to the standard form (1). Punch code conversion can also be carried out, although less efficiently than by non-FORTRAN utility programs.

Restrictions:
Incorrect FORTRAN may give unpredictable results. DATA statements involving arrays with two or more subscripts, or containing two or more arrays separated by commas, are not processed. Expansion of large arrays is not recommended [DATA(VECTOR(I), I= 1,1000)/1000*1.0/ would require some 150 cards]. Card columns 73-80 are ignored.

Running time:
Compilation: 17 s. Running time for example provided: 7 s (IBM 360/65).