I'm trying to link in some legacy Fortran code with a Visual Studio C++ project. I tried using the Windows build of gfortran to build my static library but Visual Studio complains about unresolved external symbols. I guessing this is because mixing mingw and visual studio compilers is a horrible, horrible idea.
I've googled a bit an...
I have the following FORTRAN:
SUBROUTINE MYSUB(MYPARAM)
!DEC$ ATTRIBUTES DLLEXPORT::SetPaths
CHARACTER*50 MYPARAM
WRITE(6, *) MYPARAM
END SUBROUTINE
Then I have the following in C#
class Program
{
static void Main(string[] args)
{
StringBuilder sb = new StringBuilder(50);
sb.Append(@"something");
...
I have the following FORTRAN
SUBROUTINE SETPATHS(INPUT)
!DEC$ ATTRIBUTES DLLEXPORT::SetPaths
CHARACTER*20 INPUT
CHARACTER*20 DIRECTORY
DIRECTORY = 'ABCDEFG'
WRITE(6, *) 'INPUT LEN_TRIM = ', LEN_TRIM(INPUT)
WRITE(6, *) 'DIRECTORYLEN_TRIM = ', LEN_TRIM(DIRECTORY)
END SUBROUTINE
And I'm calling the function from C#, p...
Hello,
I have two very short questions:
1 - I just read that DEXP() is the archaic form of EXP(). Does it mean that it should not be used anymore? I always thought that DEXP() was the double precision equivalent to EXP().
2 - What is the range of the exponential function? Is it compiler dependent?
Thanks in advance for your help!
B...
I'm attempting to work in Fotran 77, and I've found the need for a tree based data structure. Aside from implementing a tree with an array, is there any way to build a tree with pointer nodes to other nodes, as per a standard implementation in most languages?
The documentation for this beast is scarce, and there doesn't appear to be any...
I have encountered the following statement in fortran:
integer iparam(11), ipntr(14)
logical select(maxncv)
Double precision
& ax(maxn), d(maxncv,3), resid(maxn),
& v(ldv,maxncv), workd(3*maxn),
& workev(3*maxncv),
& workl(3*maxncv*maxnc...
I am writing a parser using ply that needs to identify FORTRAN string literals. These are quoted with single quotes with the escape character being doubled single quotes. i.e.
'I don''t understand what you mean'
is a valid escaped FORTRAN string.
Ply takes input in regular expression. My attempt so far does not work and I don't unders...
I used gcc to compile a few fortran source files into *.lib and *.dll on Windows platform, using the latest version of mingw . The gcc used is version 3. The result of the output is arpack_win32.dll, blas_win32.dll and lapack_win32.dll.
I then want to compile sssimp.f against the arpack_win32.dll, blas_win32.dll and lapack_win32.dll usi...
Hi,
I have a p*p*n array in Fortran, and I want to extract k*k subarray from that bigger array. I tried like this, but not sure does it work:
do i=1,p
vp(i)=i
end do
help=y(1:p,t)*vp
do t = 1, n
A(1:k,1:k,t) = B(pack(help,help>0), pack(help,help>0), t)
end do
where y contains values 0 and 1, 1 meaning that row/column is wanted...
hi, I am analyzing a code in fortran and have a simple question.
I want to know what the "continue" statement at 100 and 200 in the code below does.
Does it increment the i and j counters? If so, wouldn't if( .not. flg ) then condition contain the flg value that is the "last value" of flg in the loop j = i+1 to N?
do 100 i = 1...
I have a DLL written in fortran that I know works because I am getting it from a working software package that we use daily. I am trying to call it from anything but am having problems i believe with passing the correctly formatted arguments in and out of it, so i decided to try and access it from a VB program. I chose VB because I hav...
I have a VB.net console app and I am opening a function in a dll written in fortran. I am passing 3 arrays through the function by reference. When they come back out the otherside they ahve all tunred to arrays of only one element. And that element is 0.
I read on the internet somewhere that when doing this kind of thing it is a good...
Can anyone provide link(s) to good CMake tutorial except very expensive and hard-to-get official one?
Especially interesting in using CMake for Fortran projects but will be grateful for any good tutorial.
Update.
What I already found is CMake articles in Kitware Public Wiki. Fortran example is absolutely useless. =( Also while waiting...
I am trying to replace some graphics code in a set of fortran programs (not my own code). I got one of the simpler ones ('psvdraw') to work just fine, replacing the fortran postscript-generating code with C calls that call the Cairo library (graphic_output.c). I have been able to successfully work out the cross-language calls without t...
I am trying to write a wrapper for 'allocate' function, i.e. function which receives an array and dimensions, allocates memory and returns allocated array. The most important thing is that the function must work with arrays of different rank. But I have to explicitly state rank of array in function interface, and in this case code only c...
I'm trying to run this MPI Fortran code. There are several problems:
1) when I run this code I expect the program to write 'Enter the number of intervals: (0 quits) ' to screen then ask me n. Instead it asks me n first!!! why?
2) if I don't comment out the line 'goto 10', the program keeps asking me n for ever and does not show me anyt...
I'm a relatively young programmer and so I don't really know much about languages like Fortran or Cobol that have their origins in the beginning of modern informatics.
I'm a bit confused because it seems like there are many people out there saying that these two languages are still very alive and being used all over the world whereas ot...
Hello everyone. i have a problem to using a dll fortran in matlab.
i couldn't use a dll ,that is built by fortran, in matlab. i use "loadlibrary" instruction in matlab but the error is related to header files.
what is header files??
please give me more information to load a dll fortran in matlab and call it.
...
Hi all,
I wonder if there is any reliable comparison of performance between "modern" multithreading-specialized languages like e.g. scala and "classic" "lower-level" languages like C, C++, Fortran using parallel libs like MPI, Posix or even Open-MP.
Any links and suggestions welcome.
...
Hello,
I am writing a new code in Fortran and hesitating between using allocatable arrays or pointer arrays. I read somewhere that allocatable arrays have significant advantages over pointer arrays:
1) More efficient because they are always contiguous in memory
2) No memory leaks are possible
Can someone confirm this? Which one wou...