Fortran Definition and 876 Threads

  1. Z

    Fortran Fortran (gfortran) compiling error

    Hello, I need help for programming my first program in Fortran, because it doesn't run. I think it's a problem with the compiler. What do you think? This is my code program Steifigkeitsmatrix implicit none real :: E,I,l,p real...
  2. M

    Fortran Read File in Fortran & Rewritecross.dat

    I'm trying to read the next data text file :cross.dat 1.000000-5 0.000000+0 2.530000-2 0.000000+0 7.712958+1 0.000000+0 2.250000+3 0.000000+0 2.250000+3 1.838880+1 2.300000+3 1.936710+1 2.500000+3 1.986000+1 2.650000+3 1.843220+1 2.900000+3 1.832230+1 3.000000+3 1.816280+1...
  3. N

    Fortran Fortran: variables in the list of arguments for Subroutines

    Hi all, Suppose I declare X in the main program. Then in the following subroutine: Call example(list of arguments) ------------------------------------ subroutine example(list of arguments) x=y+z end subroutine ------------------------------------- I have two options: (a)...
  4. N

    Fortran Solving Negative Infinity in Fortran Calculation

    Dear all, I can not figure out why I got negative infinity in my output, so please help. Here is my calculation for FAMAX: FAMAG=SQRT(FX**2+FY**2+FZ**2) FAMAX=MAXVAL(FAMAG(1:NATOM)) and for FPBPMAX...
  5. B

    Fortran Having some trouble with Fortran

    I am sitting down and working my way through a Fortran 90/95 book for a research project I will be involved in at my university in a few weeks. However, I can't even seem to get the most basic program to work even when copying the template directly from the book. It always says invalid character...
  6. belliott4488

    Fortran How to move on from Compaq Visual Fortran

    My group at work uses several pieces of legacy Fortran code which we've always compiled using Compaq Visual Fortran. Since CVF has not been supported for while now and is not (easily) compatible with Windows 7, I'd like to move to a more up-to-date compiler and IDE. I'm trying Simply Fortran...
  7. C

    Fortran Fortran Programming Silverfrost Error 112

    I'm new to Fortran, trying to run this program but when I enter the variables it gives me an error 112. Please help me find where is the mistake. I copied the program from an old book. DIMENSION S(50),V(50) ! Element stress and velocity DIMENSION U(51) ! Nodal displacement ! Double...
  8. A

    Fortran Identify explicit shape spec list in the FORTRAN code

    Identify "explicit shape spec list" in the FORTRAN code Hi, I'm trying to do some source code analysis using the ROSE compiler infrastructure on some of the kernels in NAS Parallel benchmark. I get an error while parsing the Embarrassingly Parallel kernel. Digging further, I gathered that...
  9. K

    Fortran FORTRAN Problem Runtime Error: End of File

    FORTRAN Problem! "Runtime Error: End of File" Hey everyone, back again with another Fortran question. I am getting the runtime error in Fortran "End of Line". I have tried to simply understand what this means, but I am not getting much help from Google. I have pasted my code below, and...
  10. K

    Fortran Can't get Fortran code to give me desired output file

    Hey everyone, I have written a Fortran code for a project I am working on, but am having an issue: I can't get the code to output my data to the file I have opened. Here is what I am trying to do. I am setting up a Monte-Carlo code that selects a random x- and y-value. These values are...
  11. S

    Fortran How to read data from various files of different sizes in fortran

    In my Fortran program, I want to read data from various files whose size I do not know in prior. The input files which I am trying to read may contain different number of entries. If I have same and known number of entries in all files (say 386), I can use something like...
  12. L

    Fortran Segmentation error form the fortran code

    Hi Forum users I have a velocity autocorrelation code which was made to read a three component velocity vectors and I have modified to read a 9 component stress tensor data. I can compile it successfully but when I try to run it and compute a stress correlation function I get an error: i.e...
  13. R

    Fortran To read a binary file using fortran

    I am trying to read a binary file using fortran. this is how the binary file looks like. 1901 109.1000 241.4000 284.2000 121.9000 1902 104.0000 283.7000 202.6000 201.9000 1903 114.8000 293.0000 279.6000...
  14. N

    Fortran Why Is MPI_COMM_RANK Not Working Correctly on Mac OSX?

    Hi all, I have been running mpi fortran code on Linux based systems without any trouble for some time but making the same code run on a Mac is causing me some headaches. I installed mpi using the guide at: http://www.macresearch.org/compiling-mpi-f90-support-snow-leopard I am trying to run...
  15. B

    Fortran Fortran, passing an array to multiple subroutines

    Hi guys, I am kind of a newbie to fortran and I'd like to ask a simple question. In the code below, I have a main program with one subroutine. It's a simple one. In the main code I am filling an array with elements from 1 to 10. Then I am passing this array to a subroutine "sub", where...
  16. S

    Fortran Porting fortran program-compile error ambiguous use of intrinsic Real

    Hello, I had started an earlier thread on porting this same program to linux. In that thread I had asked about padding (align) issues. It may turn out that the padding messages may only be warnings and I have shelved that problem. A more critical issue is the one error on ambiguous use of...
  17. S

    Fortran Porting fortran program-problem with padding in common

    Hello, I must start by stating that I know almost nothing about fortran. I am trying to help port a fortran program to linux. It compiles and runs fine on irix (64 bit sgi origin 2000). There are two make files and both of them give padding warnings. --------- Padding of 4 bytes required...
  18. K

    Fortran [Fortran] subroutine needs fixing

    I am trying to use this subroutine which I found online in my model but I am not experienced in programming and I need to know how can I check for errors or debug the code and try to find the mistakes or syntax errors , I have attached the code for your review Thank you
  19. V

    Fortran Create a makefile with allocatable memory in fortran

    I have many subroutines which I want to compile individually using makefile. But the memory allocation is not specified in ".INC" file but as separate subroutine depending on the user input. The "gfortran" compiler is showing the following error...
  20. M

    Fortran [Fortran] subroutines within the same module

    Hi all, I am working on a Fortran 90 program that has many subroutines within the same module. The question is "are all the variables of a called subroutine are available to the calling subroutine without declaring them in the argument list of the called surboutine"? even though they are...
  21. N

    Fortran How to read files while running fortran program?

    Hi, I am trying to run a simulation written mostly in Fortran on Linux. The User's Manual says that "To run a simulation one needs to read several input files." Then, it lists a bunch of files. I was wondering what it means by that and how I "read" the files? Thanks in advance, Naomi
  22. N

    Fortran Integrating User-Defined Functions in Fortran 95: Troubleshooting Runtime Errors

    Hi! I'm trying to write a function that will integrate a user given function. I am having trouble with reading the function. Here is a section of my code: function f(x) implicit none real :: x,f,p print *,'Type a probability density function' read *, p !It doesn't like line 34... f = p...
  23. Z

    Fortran Memory Allocation issues in FORTRAN 90

    I'm having trouble allocating memory for a dynamic two dimensional array in FORTRAN 90; the odd thing is that when I did the same thing using three on dimensional arrays instead of an array with the dimensions 3*x, I didn't have a problem. read (1,*) ndat1 !The first line of every file is...
  24. P

    Fortran Optimizing Programs: Fortran or Visual Basic?

    Fortran / Visual Basic ?? I wrote more then few dosens programs in all flavors of Basics, mostly in DOS. Unfortunatelly with the new Windows systems, 32, 64 bit they are no longer usable. I would like to rewrite some of them. It is mostly structural engineering, cams, linkages. The codes are...
  25. N

    Fortran Getting an unclassifiable statement error in Fortran 95

    Getting an "unclassifiable statement" error in Fortran 95 I am trying to integrate the function x from 0 to 1. Here is my code: program myownmonte !This program will integrate the function x from 0 to 1 implicit none real :: ans0,y,f,x,xmax integer :: icount,nmax,i,iseed iseed = 89237...
  26. N

    Fortran Fortran output has lots of errors that I don't understand

    I am trying to write a program that in Fortran 95 will integrate x^2 from 0 to 1. Easy right?? I'm getting errors, though, that I really don't understand. Here is my code: program montecarlo2 implicit none real :: fmax,iseed,srand,xmax,x2,x,y !why do we need pi?? integer ...
  27. fluidistic

    Fortran Fortran, reading a particular column of a matrix, allocatable

    I have a program that makes a histogram from data taken in a file but it only works if the data is an array (nx1 matrix). I've downloaded a data file which is a 159663x12 matrix but only the 8th column contains numbers I'm interested it. The other columns contain either letters and/or numbers...
  28. fluidistic

    Fortran Fortran, is it possible to count the number of times a particular valu

    I have a data file with 21 values in it, which range from 2 to 10 by integers values. I would like to know whether it's possible to write a Fortran code to count the number of times a particular value (for instance "6") appear in the file. Let's call x_i the number of times the value i appears...
  29. J

    Fortran Solve FORTRAN READ Problems: Troubleshooting & Manual

    Hi, I'm having trouble with some FORTRAN code I'm trying to use. I receive an error: At line 769 of file ../src/mpolar.f (unit = 11, file = 'polarx.387') Fortran runtime error: Sequential READ or WRITE not allowed after EOF marker, possibly use REWIND or BACKSPACE Upon inspection...
  30. N

    Fortran Fortran 77 compatibility with Fortran 95

    Hi, I have a program written in Fortran 77 that I need to include in my Fortran 95 program. I don't have an F77 compiler, but I was told that F95 should be able to read F77 programs. I'd like to write INCLUDE 'vegas.f' in the first line of my program, but it's not compiling. I keep getting...
  31. G

    Fortran Problem setting integer precision in Fortran

    I'm trying to work with big integers but for some reason this program won't compile: program prob003 implicit none integer, parameter :: k32 = selected_int_kind(32) integer(kind=k32) :: num = 600851475143 end program prob003 The file name is prob003.f90 and I'm trying to...
  32. O

    HTML/CSS Can a Fortran 95 Program Run Online Using a HTML Form?

    I've got a Fortran 95 program (which basically does few calculations) and I'd like to use it online. So that, the users will input data into a HTML form, the program will run, and it will display the results. Would it be possible to do it in the following way? To run a little program (e.g...
  33. Nugso

    Comp Sci Multiplying Matrices in Fortran: How to Create a Function for Any Dimension

    Hi. Write an external function that takes two matrices, multiplies them and returns the resulting matrix. Matrices can be of any dimension. Print the resulting matrix The above is what I have to do. http://paste.servut.us/pgmm This is what I've done so far. But it seems like...
  34. E

    Fortran Problem in Extracting Numercial Values in fortran

    Hello all,I have a small doubt. I use F95/90 and IBM compiler.This is a portion of my text file ----------------------- Alpha Singles Amplitudes 15 3 23 4 -0.186952 15 3 26 4 0.599918 15 3 31 4 0.105048 15 3 23 4...
  35. S

    Fortran Finding Maximum Acceleration Values in Fortran

    Hello I am currently working on a program that will take the values from a .csv file containing multiple data and analyzing them. The file can be found here: https://docs.google.com/file/d/0BzuDEPd26OcheVhiWlZ3STlZU0k/edit?usp=sharing The data in question starts in row 11 and is in the first 4...
  36. S

    Comp Sci How to tell Fortran to get rid of composite numbers?

    Problem Statement: Do the sieve of Eratosthenes from 2 to 100 and find all the primesSo I'm trying to do the sieve of Eratosthenes in fortran 90 (I'm using Plato IDE)My efforts to solve this/ method to use: Obviously, I want the program to do a LOOP starting with every whole number from 2...
  37. M

    Fortran Fortran help: Open and Write functions

    How can I have an open statement: OPEN(Unit=1,File='data.txt',...) and be able to later have a write statement: WRITE(*,15) 15 FORMAT('Data was collected from ',?,'file:') where the ? would call in the file name. Also, when I type 'file:', it creates a link to something. How...
  38. Nugso

    Comp Sci How to Search Database & Find Phone Number in Fortran Program?

    Write a program that creates a phone-book (Name, Surname, Phone Number). Ask the user the number of entries Read user input to an array Write this array into a file in the hard-disk Your program should avoid multiple entries! If a record already exists in the phone-book, the program should...
  39. fluidistic

    Fortran What's causing my Fortran bisection method to give incorrect results?

    I'm rusty with fortran and programming in general. I can't see my "error" in a code that I wrote from scratch. Basically I wanted to get some fun and solve for a temperature in thermodynamics where I must get "T_f" which appear in a transcendental equation: ##A\ln \left ( \frac{T_f^2}{T_1T_2}...
  40. T

    Fortran What is the purpose of the Fortran 77 commands expg and dexp?

    Hi! I have the next expression and I don't know what exactly mean the commands a= dexp ((const1)* (b-298) / (b*298)) This one, I guess it's to calculate the exponential value of the expression giving a double precission. But i didn't find any info about the command expg, i.e: a =...
  41. J

    Fortran Does FORTRAN 95 Support Hardware Serial Ports and Configuration?

    Does FORTRAN support use of hardware serial ports? I need to write and read to a COM port. If so, can you configure the port as well? (ie baud rate , parity ,data bits, stop bits ) Thanks, Jim
  42. S

    Fortran How to Find an Effective 2D FFT Subroutine in Fortran 77?

    Does someone have an effective two-dimensional FFT subroutine in Fortran 77?
  43. S

    Calculate ERFC in Fortran 77 | Help ERFC Fortran 77

    Is there anybody know how to calculate ERFC in Fortran 77?
  44. M

    Fortran Fortran 90 (floating point error)

    Hello, I am dealing with the code below and i am receiving 'runtime error M6104:MATH floating point error:overflow'. i searched the error online and it is written the output values have high range than input values that i represent as input. I am using Microsoft Developer Studio and since my...
  45. I

    Fortran Where Can I Find Affordable Fortran Compilers for Scientific Computing?

    Hello all, I need to learn to code in fortran 77 preferably or fortran 99 if 77 isn't available easily for a scientific computing course this fall. Does anyone know where I can obtain one of these compliers for somewhere between free and a few hundred dollars?
  46. N

    Fortran [FORTRAN] Determining Apoapsis + Periapsis (Astrophysics)

    Say the focus point - the Sun - is at P(0,0), would I then determine the apoapsis (periapsis) by implementing the Pythagorean Theorem on each point to determine which point's distance is largest (smallest for periapsis) from the origin, then output the coordinates for each? Each coordinate to be...
  47. N

    Fortran [FORTRAN] Character Substring Extracting

    How would I go about extracting the 3 substrings delimited by the slashes in the date? The date is a string in the format "d/m/y" This subprogram checks if there are at least 2 slashes for correct format, and then, if the format is correct, the program would then extract the day, month, and...
  48. T

    Fortran What does the Fortran 77 command 'write' do and how is it used?

    Hello, I'm new using fortran and I don't know what does it mean: write (4,*) ' ' write (4,310) write (4,311) this lines go consecutive in the programm I have to understand. - might say that 4 is not a reference to a line of the code. - 310,311 are references about how the...
  49. S

    Fortran Multi-Dimensional array multiplication in fortran

    Hi; Is there anyone who knows multi-dimensional array multiplication in fortan ? such as; A(5,5,3,3) * B(5,5,3,3) thanks
  50. B

    Fortran Fortran bug: rank problem gfortran

    This is my own code, and it won't compile with gfortran. All I want to do is extract the location of the cell with the minimum value in an array. A seemingly simple task but one that does not work with the intrinsic function minloc, for reasons I do not understand. The error message...
Back
Top