Fortran Definition and 858 Threads
-
R
Fortran How Can I Improve My Fortran Program for Calculating Different Types of Means?
Trying to write a single Fortran program that calculates the arithmetic mean, rms (root-mean-square) average, geometric mean, and harmonic mean for a set of numbers (for example - 4 4 4 4 4). I don't know if I am doing the write way. Please guide me. PROGRAM ComputingMeans IMPLICIT...- rk2ray
- Thread
- Code Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
Fortran Fortran - Having to add integer command
Hello everyone. Today I learned how to write a program which calculates and prints integer squares roots from 1 to 1000. Here is what I wrote: program example real::i do i=1,1000 if(sqrt(i)**2==i) then print*,i end if end do end program example After compling this, 25, 49 etcs can't...- Nugso
- Thread
- Fortran Integer
- Replies: 5
- Forum: Programming and Computer Science
-
T
Fortran How to handle empty txt files when reading data in Fortran 90?
Hi I have a problem with reading data in fortran 90. my programs try to read a txt file that only contains one number in it but if the txt file is empty it stops. i want to make it continue what should i do?- toni_2374
- Thread
- Data Fortran
- Replies: 2
- Forum: Programming and Computer Science
-
N
Fortran How to Modify a FORTRAN Program to Exclude Multiples of 5?
How would I modify the program so it doesn't generate an output for integers that are multiples of 5? (e.g. if range was 1-20, then no lines would be printed for 5, 10, 15, 20.) program squares implicit none integer*2 start, finish, i ...- Nicolaus
- Thread
- Fortran
- Replies: 1
- Forum: Programming and Computer Science
-
F
Fortran Why Am I Getting a Parenthesis Error in FORTRAN Code Compilation?
Hello, I received some very old cold, and I don't even know for which FORTRAN standard it was originally written, only that it has existed since at least 1993. I'm trying to compile it in gfortran, and I get the following error: 'Error: Expected a right parenthesis in expression at (1)'...- FatLynn
- Thread
- Code Fortran
- Replies: 6
- Forum: Programming and Computer Science
-
X
Fortran Why is My Fortran Program Only Showing Output Data After Completion?
Hi all, I encounted a write file problem for Fortran 90. I appreciate it a lot if you can help me. I open a file at the beginning of the program. Then everytime I rewind the unit number and write one new line to the first line of the file (the previous data on the first line is replaced)...- xxh418
- Thread
- Delay File Fortran
- Replies: 3
- Forum: Programming and Computer Science
-
S
Fortran Creating a distribution with specific mean and variance in FORTRAN 90
Hi, I'm trying to create a normal distribution with mean 0.5 and variance 0.05. I tried it initially with MATLAB, for which I used newdist=0.5+(randn(1,1000)*sqrt(0.05)); Could you please help me in doing this in FORTRAN 90? Would generating a sequence using RANDOM_NUMBER and using the...- sue132
- Thread
- Distribution Fortran Mean Specific Variance
- Replies: 3
- Forum: Programming and Computer Science
-
O
Fortran Fortran, File Read Error( Tried to read past )
Fortran, File Read Error[Resolved itself, fixed] Basically I'm writing a simple fortran program to read in a data file formatted as shown below and then calculate the line of best fit for the given data points. N x1 y2 x2 y2 . . . . . . xn yn Where N is the...- Ordain
- Thread
- Error File Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
D
Fortran Reading Universal File Type 58b in Fortran
Hi there, I am trying to read a universal file (*.unv) in fortran. The file is type 58b (mixed ascii and binary format). I can read the ascii part fine but am having trouble reading the binary part. Does anyone know of anywhere I can access some source code to read this correctly. I suspect...- DaveGil12
- Thread
- File Fortran Reading Type Universal
- Replies: 2
- Forum: Programming and Computer Science
-
N
Fortran How to Prompt User for Desired Payment in Loan Payment Program?
Can someone give him a head start re: the following Q: We can make the program test itself by having it plug in the found root and evaluate the LHS (it should be zero). Complete the program by having it evaluate the LHS at x = root1. ! This program finds the roots of equations of the 2nd...- Nicolaus
- Thread
- Beginner Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
Y
Fortran Can Fortran read input data from Excel?
I have prepared the coordinate of a pipe layout in excel. Now I have to input them into a FORTRAN code. Although I know it is possible to generate these coordinates inside FORTRAN, but working with Excel is much easier for me. Making these coordinate data inside FORTRAN is a very hard work and...- yabi
- Thread
- Data Excel Fortran Input
- Replies: 5
- Forum: Programming and Computer Science
-
M
Fortran How can I fix a Fortran compiling error?
I Just finished installing gcc and SciTE . when i try to run a basic code ..the following error is returned(refer attached file) many thanks PS:I have saved fortarn.properties file in the installation folder of scyntilla- mechb05
- Thread
- Error Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
M
Fortran Error 112 /undef when running fortran code
Hi, I am a new Fortran User. I have a problem when I run my code (not errors during building), in fact the code is stopped in the last line and this message appears "Error 112, Reference to undefined variable, array elements or function result" ... write(number,100)k1 open...- Marco87
- Thread
- Code Error Fortran Running
- Replies: 5
- Forum: Programming and Computer Science
-
D
Comp Sci Implementing Simpson's Rule in Fortran for Accurate Numerical Integration
I am trying to program Simpson's Rule in Fortran I=(1/3)*h*(y0 + 4*y1 + 2*y2 + 4*y3 + 2*y4 + ... 2*yn-2 + 4*yn-1 + yn) n=100 (number of strips) I have generated the y values but I don't know how to get Fortran to follow the pattern in the brackets after h to add up the y values. Any...- Daniel1992
- Thread
- Fortran
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
D
Comp Sci Help with FORTRAN error message
Homework Statement I get the follwing error message in the FORTRAN program I am trying to code. P(i)=(1/(sigma*sqrt(2*Pi)))*e^(-(x-xbar)^2/(2*sigma^2)) ----------------------------1 Error: Invalid character in name at (1) I assume this means there is something it doesn't like about...- Daniel1992
- Thread
- Error Fortran
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
Y
Fortran Looking for a Lamczos program in fortran
Anyone can help me getting a source deck of Lanczos in f77 for large sparse Hermitian matrices? I need one that is user friendly. There is one written by Jane Cullum and Ralph Willowghbi that I find too difficult to use. Or is there some library that has it and can be linked? Thanks in advance- yshai avishai
- Thread
- Fortran Program
- Replies: 4
- Forum: Programming and Computer Science
-
J
Fortran Running FORTRAN executable from Linux SHELL
I have noticed an issue I must resolve before writing a GUI for my FORTRAN program in Linux. If I move into the directory (cmd line) and type ./myprogram it works fine. It reads the input file from that directory and creates an output file. If I run it from the file manager it gives me 2...- jelanier
- Thread
- Fortran Linux Running Shell
- Replies: 1
- Forum: Programming and Computer Science
-
G
MATLAB Is fortran 90 or matlab better for simulating non-linear dynamics (Chaos)?
I am going to be simulating damped driven oscillators for my project and I was wondering if someone could give me a definitive answer on the matter. I know MATLAB is more of a 'tool' than a language so I'm thinking the maths behind damped driven oscillators might be easier to implement into...- great_sushi
- Thread
- Chaos Dynamics Fortran Matlab Non-linear
- Replies: 3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
J
Fortran FORTRAN in linuxread file problems
I wrote a simple FORTRAN program to show my read problem. This works fine in windows. On the Linux machine I always get this eof error when I open a file and read. This means that every program I have written doesn't work :) The error is line 12 EOF. What is the problem? (I am using GFORTRAN in...- jelanier
- Thread
- File Fortran
- Replies: 13
- Forum: Programming and Computer Science
-
Y
Fortran A FORTRAN code for solving Sudoku puzzle
For few days I am thinking to write a code in FORTRAN to solve the sudoku puzzle. At first it seams simple but I have no luck writing this code. I am wondering if there is any written code to solve this puzzle. I hope Sudoku puzzle is known for members here. en.wikipedia.org/wiki/Sudoku- yabi
- Thread
- Code Fortran Puzzle Sudoku
- Replies: 8
- Forum: Programming and Computer Science
-
Y
Fortran What is the meaning of COE & COK in Fortran?
In an old (1974) FORTRAN program, I have following two lines IF(FX.GT.COE(KOP,1)) GOTO 1 F=X*COK(KOP,1) I can't understand the meaning of COE and COK commands. Are they standard FORTRAN commands? PS) If you could kindly guide me to a site whee I can find list of fortran commands, I...- yabi
- Thread
- Fortran
- Replies: 16
- Forum: Programming and Computer Science
-
A
Fortran Using FORTRAN to Read & Output Text Data in Column & Row Format
Hey I have a text file with 2 blocks of Data Example Numbers 1: 1,2,3,4,5,6 7,8,9,10,11 ... Numbers 2: 92,93,94,95,96 97,98,99,100,101 ... How would i use FORTRAN to read the text file and output in a column and row format.. Example 1 92 2...- abhi1117
- Thread
- Column Data Format Fortran Output Row Text
- Replies: 1
- Forum: Programming and Computer Science
-
L
Fortran Fortran tutorial for someone with no prior programming experience?
Hi there, As the title suggests, I am looking to start learning my first programming language. I am a mature student (24) who has recently returned to school to pursue physics. A friend of mine who does physics suggested that I learn Fortran (90/95) as my first language. I am looking online...- Light Bearer
- Thread
- Experience Fortran Programming Tutorial
- Replies: 7
- Forum: Programming and Computer Science
-
H
Fortran Array reading error when opening multiple files in Fortran
Guys. I really need help. I have been working in this little problem for hours. I had a problem in array reading when I opened more than 1 files, it seems like an array with different names mixed each other. Here is my code integer, parameter::size=11 real, dimension(101) :: cldata...- heliosplane
- Thread
- Array Error files Fortran Multiple Reading
- Replies: 5
- Forum: Programming and Computer Science
-
M
Fortran Integration of functions in Fortran
I've recently stated using Fortran (I downloaded 'Silverfrost') and am hitting a block. I've learned the basics, but I can't find any more tutorials. My professor (who I plan on doing research for) suggests that I get familiar with Fortran, especially integration of functions. I do not have...- MPKU
- Thread
- Fortran Functions Integration
- Replies: 4
- Forum: Programming and Computer Science
-
M
Fortran Fortran 90, changing 8 bit stream into a 10 bit one
Hello, I'm having a bit of trouble converting an 8 bit stream into a 10 bit one. First i create intvalbin8, a Nx8 zero/one array where N is the byte length of the input data: (6198 is the header offset factor) j=1 do while (intvalout(i).gt.0)...- mediocre
- Thread
- Bit Fortran Stream
- Replies: 7
- Forum: Programming and Computer Science
-
M
Comp Sci How can I calculate pi in Fortran without using intrinsic functions?
Homework Statement I have a project about pi. We are wanted to calculate pi in Fortran 90/95,without use intrinsic functions. For example, we must think like a computer. Homework Equations We must use formula of sin(x) and cos(x) for find 'pi'. When Sin(x)=cos(x) (and error is 10**-4)...- mrous27
- Thread
- Fortran Pi
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
Fortran Will FORTRAN always be the premier programming language for science?
Fortran has been around since the 1950s and obviously there is a large amount of Fortran code lying around. However, I'm curious if C or another programming language will someday supplant Fortran. Perhaps scientists will gravitate towards high-level math packages like Matlab and Maple, and...- Aaronvan
- Thread
- Fortran Language Programming Science
- Replies: 24
- Forum: Programming and Computer Science
-
J
Fortran What Should Be the Values of Ax and Ay in This Fortran 90 Code?
I have the code. program star implicit none real (kind=8) :: x integer :: i dt=0.001 pi=4*(atan1.0) do i=1, Nsteps t = n*dt !calculate acceleration ax= ay=... !calculate values at next step vy=vy+ay*dt vx=vx+ax*dt x=x+vx*dt y=y+vy*dt end do...- jhosamelly
- Thread
- Fortran Machine
- Replies: 2
- Forum: Programming and Computer Science
-
R
Fortran I can not read character 0A in a bmp file with Compaq Visual Fortran 6.6C
I can not read character "0A" in a bmp file with "Compaq Visual Fortran 6.6C" Hi, How to read character "0A" in a bmp file with "Compaq Visual Fortran 6.6C" Here's an excerpt from bmp file: 42 4D 16 02 00 00 00 00 00 00 36 00 00 00 28 00 00 00 10 00 00 00 0A 00 00 00 01 00 18 00 00 00...- roy437
- Thread
- File Fortran Visual
- Replies: 11
- Forum: Programming and Computer Science
-
J
Fortran What's Wrong with My Fortran 90 Bisection Method Code?
Bisection method for the equation x3−2x−2 = 0 which has a single root between x=−4 and x = 2. here's the code I have program bisection2 implicit none real :: fxa, xnew, xu, xl, fxb, fnew xu=4 xl=2 1 xnew=(xu+xl)/2 fxa=(xnew**3-(2*xnew)-2) fxb=(xl**3-(2*xl)-2)...- jhosamelly
- Thread
- Bisection method Fortran Method
- Replies: 17
- Forum: Programming and Computer Science
-
C
Comp Sci FORTRAN: second-order ODE with Euler Method
Homework Statement Dear all, please help. I have tried this question and came up with strange numbers, my fortran is definitely not correct. Please help! When the effect of the air resistance is taken into account, the equation of motion for a particle of mass m falling vertically in a...- Cecily
- Thread
- Euler Euler method Fortran Method Ode
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
S
Fortran Fortran Call Troubleshooting: Passing Integers & Strings
ok, Been programing for awhile, come from a visual basic background. We have a new server with newer compilers. Compiling with -f77 switch. Seems the old software allowed passing of integers, and strings in a call statement. New compilers seems to be inconsistent in passing the...- stupify
- Thread
- Fortran
- Replies: 11
- Forum: Programming and Computer Science
-
J
Comp Sci Computational Physics Programming using fortran g95
Homework Statement Create a program that computes for the value of sine function. Then compute for its integral from 0 to pi with N intervals, where N=4,8,16,256 and 1024 and compare the result for the trapezoid and simpson method. Homework Equations Trapezoid rule of Integration...- jhosamelly
- Thread
- Computational Computational physics Fortran Physics Programming
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
R
Large-scale eigen solver package for Fortran?
Dear All, I would like to know what type of solver packages can be used for solving the Large scale eigen problems, implemented in the Fortran language. Especially the simultaneous, subspace, ritz vectors, Lanczos etc.. methods is a must in the package. Does any of you aware of such...- Ronankeating
- Thread
- Fortran
- Replies: 1
- Forum: General Math
-
A
Fortran Read problem in fortran for matrices
Have data that is coming from Matlab and want to read it into Fortran. Simple example of what I have: PROGRAM file_read IMPLICIT NONE REAL, ALLOCATABLE :: read_matrix(:,:) INTEGER :: i,j OPEN(1,FILE = 'data_wanted.prn', ACTION = 'READ', STATUS = 'OLD') do i = 1,50 do j = 1,25 READ(1,*)...- autobot.d
- Thread
- Fortran Matrices
- Replies: 10
- Forum: Programming and Computer Science
-
S
Fortran What Is the Meaning of This Fortran Error Message?
Hi; I am trying to run a program which includes; call AB write(6,*) 'finished AB' c--------- call ABp(Vup,gup) call ABp(Vdn,gdn) write(6,*) 'finished ABp'...- selmayda
- Thread
- Fortran Program
- Replies: 3
- Forum: Programming and Computer Science
-
C
Fortran Wanted: Ancient Fortran FFT source code
Hi. I'm new here and wasn't sure which forum to post this request on, but this one seemed a good start. I am developing a talk/seminar on dealing with legacy code. In the late 1990s I was working for a large corporation in a software capacity and one day idly wondered what the source code...- cdenzler
- Thread
- Code Fft Fortran Source
- Replies: 2
- Forum: Programming and Computer Science
-
T
Fortran Can Fortran 90 Arrays Be Dynamically Allocated Based on a Variable?
Hello forum, I was wondering if there is a way to declare/define arrays depending on some previously defined variable. example: if a=2, then declare/define 2 arrays if a=3, then declare/define 3 arrays If doable, how does one assign names to these arrays?- truparel
- Thread
- Array Fortran
- Replies: 1
- Forum: Programming and Computer Science
-
M
Desperate Student - Fortran G77 Compiler Help
I recently asked my professor if he had any research opportunities in the following semesters and he told me that I should download and play around with 'Fortran G77 Compiler' and get back to him. So, I've looked into it but didn't make much progress.First off, I'm confused with which program...- MPKU
- Thread
- Compiler Desperate Fortran Student
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
A
Fortran Dealing with IMPLICIT Definitions and Variable Type Errors in FORTRAN Code?
So I have been trying to write a code which calls from REFPROP subroutines to get thermodynamic properties and then uses these to do some other calculations. I am facing two issues: 1) The REFPROP subroutines require IMPLICIT definitions so I can't say IMPLICIT none at the top, and this may...- Aerospark
- Thread
- Error Fortran
- Replies: 2
- Forum: Programming and Computer Science
-
A
Fortran Why Am I Getting an 'Out of Range in G Table' Error in FORTRAN?
Ok so basically I am trying to write code that can call from a fluid properties subroutine similar to refprop but it is called FLUID. I need to call the subroutine with temperature and pressure, and have it come back with density, compressibility, and etc. It should be able to do this, however...- Aerospark
- Thread
- Fortran
- Replies: 1
- Forum: Programming and Computer Science
-
G
Fortran Does Fortran Use Arithmetic If Statements?
Fortran has this type of "If"? Hi, I was reading a code from a thesis, obviously the quality of the scan was not good and I reached to this point in the image below, that the programmer uses "If" statements: http://i48.tinypic.com/x5z7n.jpg I am not sure if he uses a "=" sign or a"-"...- gholamghar
- Thread
- Fortran Type
- Replies: 2
- Forum: Programming and Computer Science
-
M
Comp Sci How Do I Start Programming in Fortran 95 for a Math Problem?
Please help in the work of this program : http://www.picpanda.com/ thanks- memo2
- Thread
- Fortran Program Work
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
Z
Fortran [FORTRAN] Division by zero allowed?
Hi, I have an issue where I am squaring a very small complex number 1e-20 (FALFA2) which seems to make the value zero (both the real and imag part) and then dividing by it, the problem line is (all the numbers are complex): GALFA = ( FBETA * FAA / FALFA2 ) - ( FAB / FALFA )...- zstratto
- Thread
- Division Division by zero Fortran Zero
- Replies: 10
- Forum: Programming and Computer Science
-
Q
Fortran Fortran code for geometry of fcc
Hi friends . is there anybody here who can give me a fortran code for describing fcc lattice and give us the neighbours of each site and also which pay attention to periodic condition ? thank you for your help my friends.- quin
- Thread
- Code Fcc Fortran Geometry
- Replies: 3
- Forum: Programming and Computer Science
-
D
Comp Sci Fortran: How to work out if 3 variables make a right angled triangle
Homework Statement I have a program which will sort out three inputted variables into order from lowest to highest. I now must get the program to work out if these 3 values could be the sides of a right angled triangle. Homework Equations I am going to use a^2+b^2=c^2 to solve...- Daniel1992
- Thread
- Fortran Triangle Variables Work
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
Z
Fortran [FORTRAN] Strange Characters in output
Hi, I am trying to compile a code that should work fine, but I am getting errors and also some odd characters are printing on the screen. This is the output: ENTER INPUT FILE NAME (INCLUDE EXTENSION NAME) blisw.inp YOUR INPUT FILE IS blisw.inp...- zstratto
- Thread
- Fortran Output Strange
- Replies: 3
- Forum: Programming and Computer Science
-
S
Fortran [Fortran] Bad Programming Practices
I'm updating some particle physics code from Pang's An Introduction to Computational Physics. It looks like he updated F77 code to F90, but kept a lot of iffy practices in like putting all of his functions, subroutines, and modules into one file without the use of a contains. What I'm aiming...- swartzism
- Thread
- Fortran Programming
- Replies: 25
- Forum: Programming and Computer Science
-
D
Fortran Divide an Array into a Scalar in FORTRAN: Get Help Here!
How can i divide elements of an array into a scalar. I mean, i have read my data file into a matrix in FORTRAN which this matrix is 1*3414. Then, I want that each elements of this matrix is divided to (24480*2). I will be so grateful if you guide me the appropriate function. Thanks a lot- Davoodk
- Thread
- Array Fortran Scalar
- Replies: 2
- Forum: Programming and Computer Science