fortran77

#ifdef with gfortran 77

I am using gfortran to compile FORTRAN 77 and would like to have DEBUG build options by using the preprocessor directive #ifdef. However, when I use them I get compile time warnings "Illegal preprocessor directive". Is it possible to have this functionality without deviating from the standard toolchain? ...

What is wrong with this Fortran '77 snippet?

I've been tasked with maintaing some legacy fortran code, and I'm having trouble getting it to compile with gfortran. I've written a fair amount of Fortran 95, but this is my first experience with Fortran 77. This snippet of code is the problematic one: CHARACTER*22 IFILE, OFILE IFILE='TEST.IN' OFILE='TEST.OUT' O...

fatal error F1002

Hi , I have a Fortran 77 program code , I am using fortran power station 4.0 on XP . I wrote this program because I am studying Master's degree in Mechanics , It is a very long Finite element method code. The code is the following : 1 -Main Program STARTS with : PARAMETER (HLENGTH=600.0,VLENGTH=600.0,NHELE=6,NVELE=6,NTYPE=1) PARA...

pass fortran 77 function to C/C++

hello. Is it possible to pass fortran 77 function as a callback function pointer to C/C++? if so, how? information I found on the web relates to fortran 90 and above, but my legacy code base is in 77. many thanks ...

OPEN and WRITE to files in FORTRAN DLL

I am writing in fortran and compiling using the g95 compiler. I need to have a log file output to a DLL i am writing, that is currently linking and running with the master program, but producing incorrect results. I don't know much about FORTRAN, but i did get the following code to produce output in an EXE i compiled: OPEN(UNIT=3, F...

Reading REAL's from file in FORTRAN 77 - odd results..

Hey Everyone! I'm currently messing around in FORTRAN 77 and I've ran into a problem that I can't seem to figure out. I'm trying to read from a file that looks similar to below: 000120 Description(s) here 18 7 10.15 000176 Description(s) here 65 20 56.95 ... The last column in each row is a monetary...

Fortran 77 debugger to check array bounds

I am still green to debugging F77 and am having some problems with array bounds. I recently modified a lengthy code to have new array sizes. Everything 'seemed' okay until I noticed methods to alter one array, altered another. Somewhere in this code, I assume, an assignment is out of bounds and writing to the other arrays. Is there a...

Call C/C++ code from a Fortran 77 code

Hi! I'm trying to make a Fortran 77 wrapper for C++ code. I have not found information about it. The idea is to use from functions from a lib that is written in C++ in a Fortran 77 progran. Does anyone know how to do it? Thanks! ...

Fortran compilation in all computers?

Heys, I've been following stackoverflow for a time, but for the first time I have a question that I haven't found the answer to here =) I've got a quick and a tiny question. I have a fortran program, which I can compile using f77, f95 or ifort, doesn't matter. It compiles properly on all the three operating systems that I have (one of ...

F77: problem to compile with g77 a program which was normally compiled with Absoft compiler

I am not a Fortran programmer (just a short experience), but I need to compile a program partly written in F77. Someone has compiled it with Absoft compiler before me, but now I need to repeat the procedure on another machine with g77. For Absoft, the makefile has f77 -f -w -O -B100 -B108 -c *.f mv *.f flib && mv *.o olib f77 -B100 -o...

Calling Fortran 77 from C

Hi, I have an ema function in fortran 77. How can I call to fortran function from C. I know that in fortran 2003 there is a iso_c_bindings but I need some solution for old 77 standard. subroutine ema(inarray,leninarray,n,outarray,lenoutarray) integer leninarray, lenoutarray, n, i double precision inarray(leninarray), outarray(lenoutar...

Dynamic memory allocation in fortran77

I am writing a Fortran77 program which uses a 3-dimensional array. I am declaring the array as follows Array_E(0:500,0:1000,0:100). When I execute the program it crashes instantly saying that it is "killed". When I ran strace, what I got was, execve("./yee", ["./yee"], [/* 65 vars */] +++ killed by SIGKILL +++ I suspect the problem i...

Error: Unexpected end of format string in format string, fortran 90

Getting this error while trying to compile a copied code from a fortran 77 program. code: 900 FORMAT(1H0,2X,'ABSOLUTE GRID LIMITS FOR DATA RETENTION FOR RADAR',I3,' XMIN-XMAX ',2F8.3,' YMIN-YMAX ',2F8.3,' ZMAX ',F8.3, /3X,'WITH AZIMUTH LIMITS OF',2F8.2, 3X,'AND RANGE LIMITS OF',2F10.3,/) compiler error: messy21.f90:529.132: N FOR R...

FORTRAN 77 - SWAP

With FORTRAN 77 is it possible to perform a swap on two arrays, in the same way swap works in c++? I have two large arrays, e.g. v1 and v2, and would like to swap v1 and v2 at the end of each iteration such that v2 is always the last iteration and v1 is the working array. How does one do this in F77? ...