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...
i'm using the below program but i keep getting error.What is wrong with my progam?
real x
complex y
real m1,H0,Ms,P1,P2,P3,w0,wm,wh
complex w1,w2,o1,o2
integer i,n
real pi
n=4000000000
pi=4*atan(1.0)
m1=4*pi*1e-7
H0=39.79e3
Ms=1400e3
P1=0.7*0.12
P2=0.3*0.12
P3=P1-P2
w0=m1*(1.76e11)*H0
wm=m1*(1.76e11)*Ms...
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...
What is the best practice when doing a mixed language library where the library language requires a runtime initialization?
I have a problem where I'd like to create a certain library in Fortran which is to used from C++. I'd want to preserve platform independence and compiler independence if possible. Now, the two compilers I have play...
In the book Fortran 95/2003 for Scientists and Engineers, there is much talk given to the importance of recognizing that the first column in a format statement is reserved for control characters. I've also seen control characters referred to as carriage control on the internet.
To avoid confusion, by control characters, I refer to the c...
Trying to compile Xfoil and plotlib
The fortran files are compiled with MinGW gfortran 4.5.0, and I compiled W32win.c with MSVC (2008/15.00).
During linking with GCC I receive error:
../plotlib/libPlt.a(W32win.o):(.text+0x1469): undefined reference to `_chkstk'
../plotlib/libPlt.a(W32win.o):(.text+0x1509): undefined reference to `_c...
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...
I am linking some fortran code (f90) from matlab using mex and I am having matlab freeze occasionally.
In the past, I had freezing happening due to mismatch between data types (say integer*4 vs integer*8).
The code I am linking has many implicitly defined variables, so I am wondering if there is a hidden data type conflict that only o...
Hey you guys,
i think i wont find that in any textbook, because answering this takes experience.
i am currently in the stage of testing/validating my code / hunting bugs to get it into production state and any errors would lead to many people suffering e.g. the dark side.
What kind of flags do you set when you compile your program fo...
Hey everybody, i am deploying my code from a cluster running on ubuntu onto a cluster with identical hardware, but with red hat and as it seems older gfortran compiler. The source is actually compiled by ifort, but since it is not installed on the red had cluster, i may have to switch to gfortran.
Now the problem is that the code does ...
We got a 12-core MacPro to do some Monte Carlo calculations. Its Intel Xeon processors have Hyper-Threading (HT) enabled, so in fact there should be 24 processes running in parallel to make them fully utilized. However, our calcs are more efficient to run on 12x100% than 24x50%, so we tried to turn Hyper-Threading off via Processor pane ...
i use ifort and gfortran to compile my Fortran program.
However i also use a coworkers source and he has got a lot of unused variables.
How can i suppress these for the compile, seeing as they are not really an error?
However i dont want to disable -pedantic and -stan in the compiler options and thus want all the other warnings.
ch...
I have a function (in case anyone is interested, it is this function) in a module that looks like this
MODULE MYMODULE
IMPLICIT NONE
! Some random stuff
CONTAINS
CHARACTER*255 FUNCTION strtok ( source_string, delimiters )
[...]
END FUNCTION strtok
SUBROUTINE DO_SOMETHING ( )
CHA...