Learning just a little bit of Fortran-90 can help you a lot. ------------------------------------------------------------ New Free Format **************************** *.f files abide by the old f77 punch-card format (coding in columns 7-72). *.f90 files use the new free-format. Commands begin in any column. Comments start with "!" only (c in column 1 no longer works). "&" at the end of of a line is used to indicate continuation to the next line (and an optional "&" can be used at the beginning of the continued line). To convert *.f format files to a format which can be read either as the old fixed format or the new format, do the following steps: 1. Convert "c" or "C" in column 1 to a "!", using: sed -e "s/^c/!/" -e "s/^C/!/" sub.f > sub.f90 2. Search for tabs and convert them all to blanks. 3. Convert old continuation characters in column 6 to "&". 4. Put a "&" in column 73 (or the end, which ever is greater) of lines which are to be continued. 5. Either make sure that no line exceed 72 columns, or just before using fixed-format, used sed to strip off any "&" at the end of a line. There are utilities here (convert.f90, and ftof90), but you might need to be careful using them... MODULES ***************************** Can replace all common blocks with "Module" statements. (Unless there is a reason for variables to be stored in a particular order, the actual "common" statements can be deleted, leaving just their variable specifications): MODULE MODELS COMPLEX :: GTX(100, 6) REAL :: X(100) COMMON /BLOCK1/ GTX, X ! This statement is usually not needed. REAL, ALLOCATABLE :: Y(:), Z(:, :) INTEGER CRX, GT, MR2 END MODULE Then a subroutine could access the data in module MODELS with the statements: USE MODELS ! access to all variables in the module USE MODELS, ONLY: X, Y ! access only to X and Y USE MODELS, T => Z ! T is the local name which points to Z ! All other variables still have their original name NAMELISTS ***************************** Namelists are now standard with Fortran-90, including "!" delimited comments in Fortran-95. But the format of previous namelists may be incompatible. The standard form for a Fortran-95 namelist is: &listname x(3)= 1, 2, 3 / ********************************** Synonyms for relational operators: f77 f90 .lt. < .le. <= .eq. == .gt. > .ge. >= .ne. /= Makefiles and f90 ================= With GNU make, add the following pattern rule to the end of a make file: %.o : %.f90 $(FC) $(FFLAGS) -c $< With the other make, use the old style suffix rules: On Suns ------- .SUFFIXES: .SUFFIXES: .f90 $(SUFFIXES) .f90.o: f90 $(F90flags) $< On SGIs ------- .SUFFIXES: .SUFFIXES: .f90 .o .f90.o: f90 $(F90flags) $<