Fortran Definition and 876 Threads

  1. B

    Comp Sci Fortran Program for Least Squares Fit of Data

    (The usual format doesn't really fit this question, so I hope you won't mind if I set it up slightly differently) The task is to make a Fortran program that will read in a given set of data from a file, stopping when it reaches the end, and calculate the gradient and intercept of a best fit...
  2. V

    Fortran Read array from a file in Fortran

    Hi every one. I had try to make a simple program but it doesn't work because i am an amateur The program as following: PROGRAM: Sum_row_n_col ! ! PURPOSE: Read the 2-rank array from input disk file and calculate sums of all of the data in each row and each column in the array. ...
  3. S

    Fortran Help with Fortran: Generating Random Vectors w/ Binary Values

    Hi, I'm trying to generate a set of random vectors with binary values. I need to generate them such that each time, one new vector gets added to the existing matrix. I have been using call random_number(ranval) for the generation, but I haven't been able to get linearly independent vectors. (I...
  4. S

    Fortran Converting integer data to string in fortran 90

    hi all, i have the following code: do n = ninit,nlast character(len=20) :: filename integer :: n do n = 1,600 write (filename, "I0") n open (unit=110,file='wave'//trim(filename)//'.dat',action = 'write',status = 'old') do i = iinit+1,ilast-1 !boundary condition...
  5. P

    Comp Sci Solve Fortran 90 Homework Stuck on Calculating Tax

    Homework Statement The program should make should calculate the tax that corresponds to some income. The user gives 1. A natural number n is the length of the list to the bracket 2 (see next section) and one minus the length of the list percent to 3 (see the paragraph after next) and...
  6. S

    Fortran Segmentation fault problem in fortran 90

    dear all, i have a code with line segmentation fault error. please anyone advice me how to debug this code. thank you... Mentor note: Added code tags, combined numerous variable declarations, and indented some do loops !##################################################################...
  7. E

    Comp Sci How to Apply Leap-Frog Scheme for Estuary System Dynamics in Fortran 95?

    Homework Statement Use an explicit leap-frog scheme for the following two governing equations describing head and velocity in a estuary system (time and x-direction) due to tidal forces and river flow. The length of the system, L, is 100 km. Both the depth, a, and the width, B, vary linearly...
  8. D

    Comp Sci Fortran 90: Calculating Tax Brackets for Income

    Homework Statement The program should make should calculate the tax that corresponds to some income. The user gives 1. A natural number n is the length of the list at minus 2 and a length of 3 in the list below and equal to the number of rows in the table above non-header line and last...
  9. R

    Fortran Fortran files in Microsoft Visual Studio

    I'm new to Microsoft Visual Studio (2010) & I'm a bit confused by the way Visual Studio handles fortran files. I saved a set of data in one console and tried to read the data from the created file in another console. I receive the next message: file opened correctly! forrt1: severe<24>...
  10. E

    Comp Sci Arithmetic overflow in Fortran 95

    Homework Statement Wrote a code using Fortran 95 to solve for an advection-dispersion equation but at the spatial steps specified at dx = 20 m over a total length, L of 20000 m, I keep getting an arithmetic overflow error. I have run this same program at smaller spatial intervals (dx =...
  11. P

    Fortran Fortran: mistake in writting this formulas

    Do I made a mistake in writting this formulas. I don't see them. Tnx for your answer. V1=(Kps*(1-ra**2)*(1-cos(6.2831853*y(1))))/(6.2831853**2* (1+ra**2+2*ra* cos(6.2831853*y(1)/2))**2) V2=(Kps*ra*(1-ra**2)*(1-cos(6.2831853*y(1)))*...
  12. M

    Fortran Fortran 90 creating an array of unknown size

    I was given an assignment to create a program that solves the Josephus Problem ([URL="[PLAIN]http://en.wikipedia.org/wiki/Josephus_problem"].[/PLAIN] the program needs to work for n amount of people, and it must use an array. Problem: I need to create a subroutine that will allow the user...
  13. D

    Comp Sci Fortran 90 Description in program how to continue it)

    Fortran 90:(Description in program how to continue it) Homework Statement Write a program in Fortran 90 (not fortran 77) that reads from the user 4 integers a, b, c, d. The program should first check if applicable inequality a ≤ b, c ≤ d. If not then it should asking again numbers from the...
  14. E

    Comp Sci Fortran 95 - ADE Implicit Scheme Tridag. Matrix

    Homework Statement The problem statement is to use Fortran 95 to code a forward time, centered space numerical solution to the 1-D (x-direction) Advection-Dispersion Equation: dc/dt = u(dc/dx) + D(d2c/dx2) - kc where c is the concentration of contaminant, u is the advecting velocity, D is...
  15. S

    Fortran Unclassifiable Statement error in fortran 90

    I'm writing this program for an assignment and I have run into a roadblock. I thought it was a pretty simple program, but I think my lack of experience with fortran is working against me.. Here is the bare code: Program Readfile implicit none real(kind=8)::x,y,z,u,v integer::n...
  16. M

    Comp Sci Using fortran to Solve linear equations using gauss elimination and back substitution

    Homework Statement What will be the value of the variable ipvt and AMD when the input value of lud to the following subroutine (solver) is zero ? subroutine Solver (A,B,N,lud,Z) integer lda,N,ipvt(1000),info,lud,IDAMAX &j,k,kp1,l,nm1,kb double precision...
  17. A

    Fortran Help with FORTRAN: 200,100,100 & 1H1 Interpretation

    Please help ! FORTRAN .. SUBROUTINE PRGTAC COMMON IA(2),IB(2),J,JSUM,IFL NR=4000-JSUM IF(NR-51) 200,100,100 100 JSUM=0 RETURN 200 IF(NR.EQ.6 .OR. NR.EQ.7) PRINT 1 1 FORMAT(1H1) In the above given lines from a program.. What does the 4th line intepret ...
  18. M

    Fortran Advice needed setup fortran 2008? on window 7

    I am only partially computer literate. I wish to be able to learn to code Fortran 2008? What and where do I need to download free or buy to make this happen. I have searched but get confused with not enough basic detail, like goto ... and hit ... Anyone, thanks, mark
  19. G

    Fortran Understanding Fortran Factorials in Infinite Sums

    I don't understand at all how you tell the computer to evaluate a complicated factorial expression such as the one given in in the infinite sum of binomial theorem as Ʃ [n! / k!(n-k)! ] * x^k where n is the final value of the sum and k is where you are in the loop. It's supposed...
  20. M

    Unraveling the Mystery of 'rfac' in Fortran

    Hi guys, I know I may sound stupid to me many of you but can anybody tell me what does 'rfac' do in Fortran.
  21. P

    Fortran Why is My Fortran Code Not Working?

    I'm new in programing. Does enybody knows why this don't work. implicit none integer i,N,Ntot,istag real*8 t,U,tpin,k,eg,mstag real*8 rho,Umstag,Urho real*8 eaf,eaftot,lambdaminus write(6,*) 'N,Ntot,t,U' read (5,*) N,Ntot,t,U write(36,*) Ntot/2+1 tpin=8.d0*datan(1.do)/dfloat(N)...
  22. M

    Strange indexing in Fortran Code

    Hi all, I am totally new to fortran. I have to convert a code that is actually written in the fortran to matlab. There is only one subroutine that is totally mysterious for me. I am posting the part of code I have problem with, below: 1. subroutine...
  23. K

    Comp Sci How to Write a Fortran Program to Sum Numbers in Multiple Result Files?

    Homework Statement Hello. A student came to me by yesterday with a question like this: Here is a sample file (sample.dat), 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 and also with many result files, such as result_1.dat: 1 0.1 2...
  24. K

    Fortran What Is Actually Being Passed in a Fortran Sub Call?

    What Is Actually Being Passed in a Fortran Sub Call?? I'm trying to understand exactly what is being passed from a calling routine to a called routine in an older Fortran program. Perhaps if I could present a simple example to illustrate my dilemma: Say the calling routine includes this...
  25. S

    Fortran How to put a output file in a network path with Fortran f90

    Hello Folks I have a program code in Fortran f90, that program generate an output file and put that into the same directory where the program resides, I need to put that output file in a network path ex: \\server_name\resource_shared I will appreciate if you could provide me the commands...
  26. T

    Fortran Help with a very simple fortran program.

    Hey, been 6 semesters since I took a fortran class and it's come up again. I'm and engineering major so I don't know what about programming and what not. Anyways, I need a program that multiplies an NxN matrix by an N dimensional vector. This is what I have so far: Program Matrix IMPLICIT...
  27. A

    Fortran Figuring Out Missing Values in Fortran Array

    I am trying to figure out how to represent missing values in an array with a value I know won't be in there for example -99.9. A sample of my code, is below. The array "pro" has been read in from a data file of numeric values. I need the do loop range to stay fixed because other parts of the...
  28. J

    Fortran Fortran 77 - reading same file multiple times

    Hi all I am using some code that was originally written in F77, but as it is many thousands of lines long, I haven't the time to go changing it. There is one section of code that refuses to work, but I'm assuming it must have at some point since the code has been used in the past...
  29. B

    Fortran eigenvalue decomposition

    I've been trying to invert a real symmetric matrix and the inverse that I compute via eigenvalue decomposition is not the inverse (using QV^-1Q^T), the stranger thing is that QVQ^T gets back my orginal matrix matrix. Even more unusual is that the matrix starts off at approximately identity (in...
  30. F

    Fortran I have a question about FORTRAN

    So I'm starting to learn FORTRAN, and I'm starting to do makefile's and modules. Now the book I have that I've been learning from tells me all about Modules that I can put at the beginning of a file for use throughout the rest of that file, but seems to be glazing over how I can have a...
  31. C

    Fortran Why Does My Fortran Subroutine Return the Same Value?

    Hii, Having trouble with some code I am writing, where a subroutine returns the same value regardless of different variable inputs. ... C Calculate Yth and Chi values. Compute sum of Chi-squared. Subroutine Chisquared(CPREV,CHISQ) Real...
  32. S

    Comp Sci Help with Fortran compile error.

    1. Hello, I'm doing undergraduate research which requires the use of Fortran. I have one particle line of code that is not allowing me to compile the source. I was wonderding if someone can help? 909 FORMAT(i3,2x,<nvmax>(<nvmax>i1,2x),2x,i4) 2. Provides the error message...
  33. F

    Fortran FORTRAN 95: New to fortran, want to learn how to input a function

    Hey guys, this is my first post here. So I'm learning FORTRAN, and I'm writing a trapezoidal integration program as a learning exercise. What I want to do is in addition to asking the user to input the range and precision of the calculations they'd like, I'd also like to be able to enter in...
  34. K

    Comp Sci Fortran element by element array multiplication

    Homework Statement Hello, I'm having a problem in multiplying two vectors together in a specific way in Fortran. I can do it in Matlab, but can't work out how to do it in Fortran. The problem is that i want to multiply two vectors together, but only each element by it's corresponding...
  35. A

    Fortran Reading and Displaying text file in Fortran

    I am trying to read and display the content of a text file in Fotran 90 to make sure that fortran is interpreting the data correctly. Eventually I want to store the data in an array so I can calculate averages, but at the moment I am still working on getting the data displayed in Fortran. I've...
  36. T

    Fortran Fortran read from file problems

    I've been given a data file laid out as such: heading1 heading2 heading3 x1 y1 z1 x2 y2 z2 x3 y3 z3 .etc. where x=integer, y,z=real I need to count the number of lines to allocate x, y and z their sizes. My first attempt looked like: ... OPEN(21, FILE='data.dat', STATUS=OLD)...
  37. I

    Fortran Question on I descriptor in Fortran

    Hi I am learning fortran from Chapman's "fortran 90-95 for scientists and engineers". I have question about the I descriptor. In the attached image, look at the second format statement, 210 format. In the output, the variable index+12 is not printed. I don't understand that. The book says...
  38. P

    Comp Sci Graphs in Fortran: Making tcentre(i) vs. t(i)

    hello..here is a program.. and i need to make a graph of tcentre(i) against t(i)..how to do this... these variables are bold in the below code !here are the declaration of variables DIMENSION...
  39. Saladsamurai

    Fortran Is an IDE Necessary for Debugging Fortran Code?

    Alrighty then :smile: So in order to solve a problem in a previous thread, I simply reinstalled Eclipse, but this time i went with the Parallel Tools Platform since it is supposed to work with FOTRAN too. I created a C++ project first and did the 'Hello World' thing to make sure it was...
  40. H

    Fortran Fortran Module w/ user defined type

    I have a bunch of programs that initialize values of variables of a user defined type, so I thought I'd initialize them all in a module and have each program 'use' the module. But, it seems the only way to initialize the variables in a module is to put the initializations in a subroutine within...
  41. O

    Fortran How to run Fortran program on the website? Please help

    I have a simple command-line based Fortran 95 program. I would like my clients to be able to run it straight on the website. So that it can be executed on the server without downloading it. I have found out that most of the hosting packages and web browsers do not allow running .exe files...
  42. 6

    Fortran What Could Be Causing a Fortran Compilation Error During Image Processing?

    Hi I try to run an image processing algorithm (Cross-Correlation based) on fortran to analyze a 500 frames video, but after the 20th frame I get this error message:The program 'D:\Omri\19.12.11\Debug\Cross_Corr_Omri.exe' has exited with code -1073741800 (0xC0000018). anf in the debug window I...
  43. S

    Fortran What is causing my Fortran compiling error in my physics code?

    Dear physics forumers, I have some compiling error regarding my codes as below: gfortran -g -I/usr/include -c main.f90 main.f90:121.6: u(t+1,x) = alpha**2 * u(t,x+1) / 2.0D+00 + ( 1.0D+00-alpha**2 ) * u(t,x) & 1 Error: Unclassifiable statement at (1) main.f90:129.6...
  44. D

    Fortran How to swap number in the fortran memory?

    how to swap number in the fortran memory?? hello.. im new to fortran so how i swap number in do loop first the tracing is like this: x(1)=3 x(2)=8 then, how to i can swap the number in x(1) and x(2) can anyone help me please...
  45. D

    Fortran Fortran Simple Harmonic Oscillator Problem

    Hello fellow computer physics nerds, I'm trying to write a program to plot the positions of the three particles connected by two springs (one dimensional) in Fortran 90. I have a main program block and a module that calls a PGPLOT. My problem is that the positions of the second and third...
  46. J

    Fortran Array arrangement in Fortran 77

    Hello, I am working on a Fortran 77 program for my computational physics course in which the program is an averaging of distances walked by a number of walkers for an nth step. I have started the calculations of the program by having an input seed generate a sequence of pseudo-random numbers...
  47. S

    Fortran How are numbers stored in F2 and F3 matrix in Fortran programming?

    Hi all, I'm stuck on a fortran line code where I have a doubt on its interpretation. The line is the following: ----------------------------------------- dimension F2(4,6,2), F3(5,7,2) ... open(77,...) read(77, '(4I3)') F2,F3 ----------------------------------------- the...
  48. Z

    Fortran Can Fortran handle cross-referencing on a large array of data?

    Hi, I've no knowledge of Fortran but am researching its (theoretical) use to perform a 'cross- referencing' function on data in a four column array of one million rows. The program matches data in column A to Column D by referencing the matching values in columns B and C. Here's the program...
  49. D

    Fortran Help Compiling GNU Fortran Code with 2000 Lines

    Hi Everyone. I'm trying to compile an old Fortran code (~2000 lines) with GNU Fortran and could not make it work yet. The code is from an old book, and I do not know which Fortran compiler was used to make it work. I’m guessing it’s 77 cause in many places the program uses the “common...
  50. A

    Fortran Fortran 90, how do I use random_number and random_seed?

    Hello, I was given a program written by someone else that uses random_seed and random_number to generate a matrix. I thought the output of that program should change because each execution of that program should use a different random number to create the matrix, but the output is always the...
Back
Top