I work with many different models and simulations. Some of the older models and simulations are written in FORTRAN. Some of those models have been converted to C++, but the current trend is to create these models using MATLAB/SIMULINK. From a computer science perspective I have always felt MATLAB/SIMULINK was not a good solution. Wha...
At my current place of employment there are a handful of maybe two to three employees that add and maintain functionality of legacy fortran77 code. When I was first hired I briefly considered trying to become fluent in the ancient language, soon after I changed my mind.
This conclusion came from a combination of reasons; initially I ad...
Platform: WinXP SP2, Intel Fortran 11, Excel 2007
I'm having trouble connecting a dll file with excel.
The dll file is relatively simple:
subroutine FortranCall (r1, num)
!DEC$ ATTRIBUTES DLLEXPORT, STDCALL, REFERENCE, ALIAS:"FortranCall" :: FortranCall
integer, intent(in) :: r1
character(10), intent(out) :: num
!DEC$ ATTRIBUTES REFER...
Hi,
I'm trying to figure out how to redirect output from some FORTRAN code for which I've generated a Python interface by using F2PY. I've tried:
from fortran_code import fortran_function
stdout_holder = sys.stdout
stderr_holder = sys.stderr
sys.stdout = file("/dev/null","w")
fortran_function()
sys.stdout.close()
sys.stderr.close()
sys...
I have the following C code:
#include <sys/times.h>
#include <time.h>
float etime_( float *tarray )
{ struct tms buf;
times( &buf );
tarray[0] = 1.0 * buf.tms_utime / CLOCKS_PER_SEC;
tarray[1] = 1.0 * buf.tms_stime / CLOCKS_PER_SEC;
return tarray[0] + tarray[1];
}
Trying to port this Fortran code to Haskell:
...
Hi,
I have a Fortran subroutine which uses BLAS' subroutines dgemm, dgemv and ddot, which calculate matrix * matrix, matrix * vector and vector * vector. I have m * m matrices and m * 1 vectors. In some cases m=1. It seems that those subroutines doesn't work well in those cases. They doesn't give errors, but there seems to be some numer...
Well the title says it, I'm doing following kind of operations in Fortran:
a(:,t) = b(:,t)
c(:,t) = x(i,t)*d(:,t)
Is there any benefits of using daxpy and dcopy subroutines from BLAS in this case where inc=1?
...
Hey.
After searching for a while in books, here on stackoverflow and on the general web, I have found that it is difficult to find a straightforward explanation to the real differences between the fortran argument intents. The way I have understood it, is this:
`intent(in)` -- The actual argument is copied to the dummy argument at ent...
I have code that calls an ENTRY in a SUBROUTINE before the SUBROUTINE. Are the variables allocated?
SUBROUTINE foo
character*5 A,B,C
DIMENSION IA(50),IB(50)
print* A,B,C
RETURN
ENTRY bar
DO 50 I=1,50
TOTAL = TOTAL + IA(I)
50 CONTINUE
print* TOTAL
RETURN
END
So if I CALL bar before foo is IA allocated?
...
I am getting stack overflow when executing the following code in Compac Fortran.
Specially for the line:
DIMENSION IZ(NX,NY),VX(NX-1,NY-1),VY(NX-1,NY-1),VZ(NX-1,NY-1)
What I am doing is to read the NX,NY,DX,DY from a parameter file.
Any suggestions?
PARAMETER(NGMAX=30000)
INTEGER NX,NY,DX,DY
OPEN(6,FILE='MGSTAO...
I typed the source code in WordPad and saved it as addition.f90, but, unfortunately, the only options Windows provides are text files, rtf's, and so forth.
I am using the G95 compiler for Windows.
...
I have stumbled upon the following F77 yacc grammar: http://yaxx.cvs.sourceforge.net/viewvc/yaxx/yaxx/fortran/fortran.y?revision=1.3&view=markup.
How can I make a Fortran 77 parser out of this file using Happy?
Why is there some C?/C++? code in that .y file?
UPDATE: Thank you for your replies!
I've been playing with two fresh app...
Does an assignment of a real to a variable starting with I convert to integer?
real vx;
vx = 2.59808
ix = vx
is ix == 2?
...
In a .f file there is code that does this:
real Bob, avar
...
avar = Bob( 8.3 )
...
Bob appears to be a function but it is declared at the beginning of the file as a real.
Then there is a .d file that has a reference to Bob. Also I know avar holds a value that appears is interpolated, The problem is the interpolation is not always r...
I would like to setup some automated testing of test cases upon Fortran binaries within an SVN Repository, on demand, or with a Cron job. To complicate the issue slightly, the test cases would be run on a computational cluster, so that each test case would need to generate a PBS script. (Linux Environment)
There are a lot of web testin...
I suppose the type of Y below is REAL.
SUBROUTINE F(X, Y)
C IMPLICIT NONE
REAL :: X, Y
C REAL :: A, B
C REAL, PARAMETER :: C = 3.14E0
C X = Y + 2 * SIN(Y)
END
But what is it's type here?
SUBROUTINE F(X, Y)
C IMPLICIT NONE
REAL X, Y
C REAL :: A, B
C REA...
Can someone explain to me what sort of an abstraction in the parser / compiler a dummy variable or attribute corresponds to?
PURE SUBROUTINE F(X, Y)
IMPLICIT NONE
REAL, INTENT(INOUT) :: X, Y, C
C REAL :: A, B
C REAL, SAVE :: C = 3.14E0
PARAMETER (C = 3.14E0, X = 32, Y = X)
X = Y + 2 * ...
Is there a way to tell ifort or gfortran to just try to parse a source file (no include following, no compilation, no linking, etc) to tell us whether they find the syntax of the file acceptable / valid for a given Fortran version (77, 90, 95, ...) or at least valid at all?
I'm working on a piece of software that will parse and analyze ...
Hi,
I am porting the application with old fortran compiler and old visual studio(VC5) to new fortran compiler 11 and visual studio 2005. Application contains both 'C' and fortran code. I am compiling the fortran code and creating library called server_lib.lib(library is createing with some warnings) and linking to the 'C' code. while l...
Dupe of http://stackoverflow.com/questions/1077874/linking-errors-from-c-language-in-fortran-lib
Hi,
I have below code in fortran file called server.for
INTEGER iErrPipe !error code for pipe i/o
INTEGER clientIndex !index into client list
CHARACTER*136 Buffer(17) !buffer for pipe i/o
CHARACTER dBuffer(2313) !bu...