(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...
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.
...
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...
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...
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...
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
!##################################################################...
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...
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...
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>...
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 =...
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)))*...
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...
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...
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...
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...
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...
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 ...
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
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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)...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...