Fortran Definition and 858 Threads

  1. 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>...
  2. 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 =...
  3. 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)))*...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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 ...
  9. 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
  10. 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...
  11. 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.
  12. 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)...
  13. 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...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...
  21. 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...
  22. 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...
  23. 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...
  24. 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...
  25. 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...
  26. 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)...
  27. 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...
  28. 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...
  29. 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...
  30. 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...
  31. 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...
  32. 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...
  33. 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...
  34. 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...
  35. 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...
  36. 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...
  37. 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...
  38. 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...
  39. 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...
  40. 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...
  41. A

    Fortran Why Does My Fortran 95 Program Show Random_seed(): PUT Array Too Small?

    Hello everone!So i am writing this code where I am producoing random numbers from a generator through a subroutine.Then I call the subroutine and pass them through a Gaussian distribution.I have problem with my seed subroutine: my program compiles but when i try to execute it complain that...
  42. J

    Fortran Small FORTRAN code for combinations. BUG

    small FORTRAN code for combinations. BUG! PROGRAM test implicit double precision(a-h,o-z) INTEGER :: r=2,n=4,k=1 INTEGER,allocatable :: comb(:) !array to hold a set of combinations allocate(comb(r)) comb(1)=1 CALL iterate(1,n-r+1,1) CONTAINS...
  43. L

    Fortran Fortran - compilator dependent, intrinsic array manipulation, memory problem

    Welcome all, I have a following code: program aaaa implicit none double precision, dimension(:), allocatable :: inp,outp integer ::n,i read(*,*) n allocate(inp(n),outp(n)) write(*,*) allocated(inp), allocated(outp) write(*,*) inp(1) inp=cshift(outp,-size(outp)/2)...
  44. C

    Fortran Fortran: separate acids from a list of chemicals in a text file

    Dear Fellow Members, I am presently trying to write a Fortran 95 program to separate acids from a list of chemicals in a text file and then write them to a second text file. The program first matches the word "acid" and is then supposed to check if the word preceding the word...
  45. A

    Fortran Getting NaN for a write output in FORTRAN

    Hi all, I'm writing a program in FORTRAN to calculate neutron flux in a reactor, but when I try to get a numerical output it simply says NaN. Anyone know what this means or how to fix it? Code is below, and this is happening on the flux2(N) output on the last write statement. Thanks...
  46. M

    FORTRAN 90 help- matrix-mul-add- input from user defined file name

    Hi everyone I am completely new to the Fortran. I have to make a program in fortran 90 to either add or multiply the matrix on user demand and ask user to enter the file name inorder to read the desired matrices. I came up with the the following code which does not read the program and...
  47. T

    Fortran How to Execute an Nbody Simulation in Fortran Without Prior Experience?

    Hi! I've never done any programming in fortran and got stuck trying to test run a program. Note that I am not learning how to program in fortran, this is for an astrophysics course. Basically what I need is an instruction how to run a fortran code if I have some .f files and .o files as well...
  48. R

    Fortran Fortran - c interprocess communication

    there is a program in written in fortran 90 and a program written in c, the first program is able to modify .xyz (mol files) and the C program can read those, so is it possible to make an interprocess communication between these 2 program to let one update instantly if i change anything in the...
  49. T

    Comp Sci Basic fortran help: reading columns of data from a text file

    Hi everybody, I have 3 columns of data (3 different variables) and 400 rows. How would I set up a matrix/array sort of thing to read each row individually and store it in my fortran program to calculate equations at each step? What I have basically tried and can't get to work, I think it...
  50. N

    Fortran Fortran 77 subroutine for calculating spherical harmonics

    Hey guys I am trying to understand a code for a Fortran 77 subroutine which calculates spherical harmonics using the CERN library RASLGF for legendre functions. The code looks like this subroutine harmonics(max,theta,phi,Yr,Yi) implicit none integer max,k,nn,n,grens...
Back
Top