fortran77

Linking LAPACK/BLAS libraries

ぐ巨炮叔叔 提交于 2020-01-05 08:32:20
问题 Background: I am working on a project written in a mix of C and Fortran 77 and now need to link the LAPACK/BLAS libraries to the project (all in a Linux environment). The LAPACK in question is version 3.2.1 (including BLAS) from netlib.org. The libraries were compiled using the top level Makefile (make lapacklib and make blaslib). Problem: During linking, error messages claimed that certain (not all) BLAS-routines called from LAPACK-routines were undefined. This gave me some headache but the

Linking LAPACK/BLAS libraries

北城以北 提交于 2020-01-05 08:32:13
问题 Background: I am working on a project written in a mix of C and Fortran 77 and now need to link the LAPACK/BLAS libraries to the project (all in a Linux environment). The LAPACK in question is version 3.2.1 (including BLAS) from netlib.org. The libraries were compiled using the top level Makefile (make lapacklib and make blaslib). Problem: During linking, error messages claimed that certain (not all) BLAS-routines called from LAPACK-routines were undefined. This gave me some headache but the

Convert FORTRAN DEC UNION/MAP extensions to anything else

陌路散爱 提交于 2020-01-05 05:28:07
问题 Edit: Gfortran 6 now supports these extensions :) I have some old f77 code that extensively uses UNIONs and MAPs. I need to compile this using gfortran, which does not support these extensions. I have figured out how to convert all non-supported extensions except for these and I am at a loss. I have had several thoughts on possible approaches, but haven't been able to successfully implement anything. I need for the existing UDTs to be accessed in the same way that they currently are; I can

FORTRAN WRITE()

牧云@^-^@ 提交于 2020-01-02 04:37:07
问题 Before I begin, I must preface by stating that I am a novice when it comes to FORTRAN. I am maintaining a legacy piece of code from 1978. It's purpose is to read in some data values from a file, process the values, and then output the processed values to another text file. Given the following FORTRAN code: INTEGER NM,STUBS,I,J,K PARAMETER (NM=67,STUBS=43) INTEGER*4 MDS(STUBS,NM) CALL OPEN$A(A$RDWR,'/home/test/data.txt', MAXPATHLEN,1) CALL OPEN$A(A$WRIT,'out',11,2) DO 90 I=1,2 READ(1,82) STUB

Return an array from a function and store it in the main program

血红的双手。 提交于 2019-12-29 09:41:47
问题 Here is the Main Program: PROGRAM integration EXTERNAL funct DOUBLE PRECISION funct, a , b, sum, h INTEGER n, i REAL s PARAMETER (a = 0, b = 10, n = 200) h = (b-a)/n sum = 0.0 DO i = 1, n sum = sum+funct(i*h+a) END DO sum = h*(sum-0.5*(funct(a)+funct(b))) PRINT *,sum CONTAINS END And below is the Function funct(x) DOUBLE PRECISION FUNCTION funct(x) IMPLICIT NONE DOUBLE PRECISION x INTEGER K Do k = 1,10 funct = x ** 2 * k End Do PRINT *, 'Value of funct is', funct RETURN END I would like the

How are the types in this COMMON statement specified?

孤者浪人 提交于 2019-12-25 11:01:36
问题 I have an old fortran code that I am attempting to decipher and understand what is going on so I can modify it. Unfortunately I am a bit of a neophyte in fortran so I am having trouble figuring out this statement. C 15/04/97 IBM VERSION ECIS96 CALC-000 SUBROUTINE CALC(W,NW,DW,IDMX) CALC-001 C MAIN SUBROUTINE OF THE PROGRAMME CALC-002 C W,NW,DW ARE THE WORKING SPACE IN EQUIVALENCE BY CALL,STARTING AS CALC-003 C REAL*8. THEY ARE RESPECTIVELY REAL, INTEGER AND DOUBLE PRECISION. CALC-004 C IDMX

Incompatible ranks 0 and 2 in assignment [duplicate]

别来无恙 提交于 2019-12-25 04:33:00
问题 This question already has answers here : Line truncated, Syntax error in argument list (2 answers) Closed 2 years ago . I have tried to write a code in fortran to calculate the coordination number. But a got these errors coord.f:43.72: read(13,*) ri(i), g(2,2,i), g(1,2,i), g(1,2,i), g(1, 1 Error: Expected array subscript at (1) coord.f:78.38: call integrate(npts-1,ri,gt,ans) 1 Warning: Rank mismatch in argument 'ans' at (1) (scalar and rank-2) coord.f:79.8: t1(ia,ib)=ans 1 Error: Incompatible

How to know that we reached EOF in Fortran 77?

谁说我不能喝 提交于 2019-12-25 03:02:19
问题 So let's assume that I have the following subroutine: subroutine foo(a_date) character*10 dummy, a_date open(unit=1,file='ifile.txt',status='old') read(1, 100) dummy 100 format(A10) a_date = dummy return end which only reads a line from the file. But I want to read all the lines recursively. So when I call the subroutine recursively in my main procedure, I get an error after reaching EOF. So is there a way to prevent it so that the program knows when I reach EOF? Basically, I want to be able

What is * in FORTRAN 77

試著忘記壹切 提交于 2019-12-25 02:49:10
问题 I'm using Radau.f Fortran ode-solver and my gfortran complains about the use of * For example in: FF(I)=TI711*Z1I+TI712*Z2I+TI713*Z3I+TI714*Z4I+TI715*Z5I * +TI716*Z6I+TI717*Z7I what is * standing for? Is it an & such that the line should be: FF(I)=TI711*Z1I+TI712*Z2I+TI713*Z3I+TI714*Z4I+TI715*Z5I+& & +TI716*Z6I+TI717*Z7I Or is it supposed to be a comment or something else? 回答1: An asterisk in column 6 is a line continuation symbol and equivalent to & in fixed form . See here for details. In

Paralelize mixed f77 f90 Fortran code?

∥☆過路亽.° 提交于 2019-12-24 13:58:34
问题 I have a code written mostly in f77 however there are also routines written with the f90 syntax. I've been reading how to use openMP for each case, but now I have the doubt how should I do it if I have both syntax in the same code? More specifically should I use use omp_lib or include 'omp_lib.h' but in the same .f file I have both sintaxys. what if I use both? I am compiling with gfortran 4.8.4. If I use let's say use omp_lib (meaning f90 syntax) Then I have to use the correspondent syntax !