fortran

Array of Strings in Fortran 77

I've a question about Fortran 77 and I've not been able to find a solution. I'm trying to store an array of strings defined as the following: character matname(255)*255 Wich is an array of 255 strings of length 255. Later I read the list of names from a file and I set the content of the array like this: matname(matcount) = mname ...

What's the easiest way to read .dbf file from gfortran

Hi! I'm using gfortran, I need to write a function that reads records from a .dbf file associated with an ESRI Shapefile. The file I should be able to read is available from internet http://diss.rm.ingv.it/diss/DISS_3.0.4.shp.zip The opinion of the file command about the format of the file is: $ file GGSources_polyline.dbf GGSources_p...

Fortran 90, Questions about Array & Derived Type

I have questions about Arrays and Derived Types. For my new project, I have to use an array instead of a scratch file to store information from users. To do this, I need to create derived types, too. However, I haven't understood what an array is and what a derived type is, how to use them, what they can do, and some other basic ideas. ...

C to Fortran calling problem

Using Visual Studio 9 on Windows 64 with Intel Fortran 10.1 I have a C function calling Fortran, passing a literal string "xxxxxx" (not null terminated) and the hidden passed length arg 6. Fortran gets it right since the debugger recognizes it's a character(6) var and has the correct string, but when I try to assign another Fortran cha...

What does the period do in this line of Fortran?

I am not sure what version of Fortran this is, but the line is: Term = F*F - 4.*E*G I know that it multiplies F by F and then subtracts something, but I don't know what the period after the 4 is doing there. ...

What is Fortran reserved word/variable ACCY?

I was trying to look through some very old FORTRAN code and came across the following statement: IF (XKJ.GT.ACCY) THEN I looked through the entire code and didn't find a declaration for 'ACCY'. I am assuming it is a built-in variable/constant/function, but wasn't able to find the definition. I 'googled' it and came across other FORT...

Help need Allocatable Array in FORTRAN

Hi, All. I'm really having trouble with Allocatable array. I have to copy all information from a file into allocatable array. The file is like this: 3 3 5 2 1 4 0 3 is the number of points other six numbers shows points on the graph in (x, y) form. So (3,5), (2, 1), (4,0) are the points. But I have problem to make these number as...

how do you iterate through an array in fortran?

really simple question. say I have real, dimension(0:100) :: realResults and I want to iterate over realResults, ultimately to create json of the array of the form [[x1,y1], [x2,y2], [x3, y3], ... ] I'm pretty sure I want to use "do" but I'm not sure how thanks ...

Can Vim do Fortran completion of subroutine arguments

I don't know if this is possible at all, but still ... no harm in asking. I'm using Vim to edit fortran files, old and new (.for and .f90). I'm trying to get completion, something alike Visual Studio's, so that when I have several subroutines defined in a file: subroutine init ( ibc, nquad, ul, ur, xl, xr ) subroutine output ( f, ibc, ...

Fortran dim(x,y), to what end?

In Fortran dim(x,y) returns the difference x-y if the result is positive; otherwise returns zero. What was it intended to be used for? What is the meaning behind the name dim? ...

fortran 90 KIND type

I have a question about FORTRAN 90, which I'm learning as part of my numerical mathematics (well, something similar, but I don't know how to translate it to english exactly). It is ok going, but I don't understand its KIND parameter. As far as I could understand it from the papers I have and some googling, it does not determine precis...

VS 2008 + Intel Fortran questions

I'm using VS 2008 with Intel's Visual Fortran compiler. Its integration with VS is prettty good, but there are few things I'd still like to sort out. Hoping you could help me with some of them. Is there a way to define new outlining (folding) rules in VS, so that it automatically folds from, let's say, CALL SUBROUTINE till END SUBROUTI...

Autodocumentation type functionality for Fortran?

In the past I've used Doxygen for C and C++, but now I've been thrown on Fortran project and I would like to get a quick all encompassing look at the architecture. In the past I've found reverse engineering tools to be useful where no documentation of the architecture exists. So, is there a tool out there that will reverse engineer Fo...

Compaq Visual Fortran Install on Vista?

Anyone successfully able to install Compaq Visual FORTRAN 6.x on Vista? Tried the other day, but did not have any luck, so just wondering if obsolescence is upon this ol' compiler. Thanks again. ...

Generating random number in a given range in Fortran 77

I am a beginner trying to do some engineering experiments using fortran 77. I am using Force 2.0 compiler and editor. I have the following queries: How can I generate a random number between a specified range, e.g. if I need to generate a single random number between 3.0 and 10.0, how can I do that? How can I use the data from a text f...

editor with good fortran support

Can anyone recommend an editor (or an IDE) with good support for fortran ? Most newer editors I find and try lack language support for it. ...

Implementation of excel's ROUND function

How would you implement a ROUND function: ROUND(value, number of digits) pi=3.14159265358979323 so, for example, ROUND(pi, 3) = 3.142 if you had these functions at your disposal: AINT - truncates a value to a whole number ANINT - calculates the nearest whole number NINT - returns the nearest integer to the argument or never minding...

postfix 'd+0' in Fortran real literal expressions

Does anyone knwow what the postfix "d+0" means in the assignments to M1, M2 and M4 below or is there any resource on the web or a book where one is very likely to find this information? subroutine plot( t, x, p, q, nga, nt, wron, & ngq, gq, ngaq1, ngaq2, gaq, rwh, iwh ) implicit none intege...

Why was Matlab written in C instead of Fortran?

As you may know, Fortran is a language for scientific computing. however, the kernel of the most famous high level language for scientific computing has been written in C instead of Fortran. Why? ...

How to test if matrix is diagonal?

I need to test if one variance matrix is diagonal. If not, I'll do Cholesky LDL decomposition. But I was wondering which would be most reliable and fastest way to test is matrix diagonal? I'm using Fortran. First thing that come to my mind is to take sum of all elements of matrix, and substract diagonal elements from that sum. If the an...