Fortran Definition and 858 Threads
-
G
Fortran Definition of a complex variable in Fortran 77
Hello, I'm making now a simple program (in Fortran 77) to find the roots of the quadratic function. When the discriminant is negative, imaginary numbers are to be used and the solution of the function is a complex number. I'd like to define a complex variable so that: complex x...- gelbehahn
- Thread
- Complex Definition Fortran Variable
- Replies: 2
- Forum: Programming and Computer Science
-
L
Python Fortran Routine calling a Python Function
I have been trying to merge some python with fortran, to build a nice interface but still be fast. I spent the last two days learning how to use f2py, buy everything would be so much easier if I could call a Python function from Fortran instead of doing the other way around. Anyone know how...- LucasCampos
- Thread
- Fortran Function Python
- Replies: 2
- Forum: Programming and Computer Science
-
Why do astronomers stick with old languages like IDL and FORTRAN?
I've heard that there's some movement towards newer languages like Python. But is there some resistance to this movement? Is there a similar problem with physics departments? Do astronomers prefer their grad students to be fluent with FORTRAN or with Python? I know one professor who doesn't...- Simfish
- Thread
- Fortran
- Replies: 5
- Forum: Astronomy and Astrophysics
-
Fortran Free Fortran g90 compilers for windows xp
I know there are tons of them out there, but I am looking for a recommendation on one. I know absolutely nothing about Fortran and very little about programming in general. I do know that I will be inheriting a bunch of code that was written in a g90 environment (if that is even the correct...- Saladsamurai
- Thread
- Fortran Windows
- Replies: 2
- Forum: Programming and Computer Science
-
Fortran Parallel FORTRAN output varies with addition of arbitrary WRITE statement
Hi there, I've been puzzling over the following code (which works in serial). It produces radically different answers if the (blank) WRITE(*,*) is included or not. Any help greatly appreciated! eps = 0.0 !$omp parallel do default(none) private(i, j, current_angle, current_energy) &...- Hemmer
- Thread
- Addition Fortran Output Parallel
- Replies: 1
- Forum: Programming and Computer Science
-
M
Fortran How can I fix my Fortran makefile to properly calculate travel times on nodes?
I have made and compiled a programme,but the calculations are not good,because it has somehow problems with findfiff2d.o file(calulates travel-times on nodes).May be the problem is that findiff2d calls 6 other subroutines.So main=>findiff2d=>expand,sort,pass,stensilcs2d,fnod e,fside.So how to...- Milentije
- Thread
- Fortran
- Replies: 1
- Forum: Programming and Computer Science
-
R
Fortran Compiling Fortran 77 for Windows
Can someone suggest a way to easily compile fortran 77 code so it will run on a Windows machine. For my research I need to use a computer code that was written by former students at my school several years ago in fortran. I have very little experience with this sort of thing but I really only...- RandomGuy88
- Thread
- Fortran Windows
- Replies: 2
- Forum: Programming and Computer Science
-
M
Fortran Fortran (better suited to programming section)
The following question pertains to programming, but I have posted it here because I want the views of mathematicians (also of physicists and engineers), not those of computer scientists (which i already know) and I do not know how many of the former category care to look into programming...- mechprog
- Thread
- Fortran Programming Section
- Replies: 8
- Forum: Programming and Computer Science
-
F
Romberg integration fortran code
how to code it?...sequence? logic?.. -
N
Fortran Solving Fortran Input File Problem - B
Hey guys, I am wondering if anyone could help me with a simple problem. I want to remove key parameters from the "type declaration/parameter" portion of my code and into an external input file for easy access. The problem is, many of my variables (such as arrays) can't be defined until...- Nrets
- Thread
- File Fortran Input
- Replies: 1
- Forum: Programming and Computer Science
-
S
Fortran Help with Fortran IV to Fortran77 Conversion Errors
I have a program written in Fortran IV and tryed to run it with fortran77(g77). Nevertheless it could be not problem in fortran IV it make some errors in fortran77. I am not programmer but trying to learn some. Here is the errors that compiler fortran77 is wrote: found.f: In program...- stefan_ss
- Thread
- Errors Fortran Fortran77
- Replies: 27
- Forum: Programming and Computer Science
-
A
Fortran Fortran reading scientific form
Hi, I have been struggling with the Fortran IO for a while. Here is the question, any comments will be much appreciated. I output some double precision numbers with the format: write (file_id,'(6(ES17.10E3,2X))'), a,b,c,d,e,f ! say the filename is 'data.dat' It works fine. But...- Axios
- Thread
- Form Fortran Reading Scientific
- Replies: 5
- Forum: Programming and Computer Science
-
H
Fortran What is the issue with this Fortran recursion problem?
Hi everybody. I am learning Fortran on my own, and I started doing simple examples like factorials, iterations, and stuff like that. The problem comes in recursion, I'm trying to run this simple factorial program using recursion, but the outcome is completely wrong. I asked to an expert in...- hassamu
- Thread
- Fortran Recursion
- Replies: 8
- Forum: Programming and Computer Science
-
P
Fortran Code for Solving Linear System w/ Least Square Method
Dear all: For a standard linear system, y(n*1)=A(n*n)x(n*1) If y is exact and A is well-conditioned, it is easy to calculate x. However, if y has some disturbances or some errors, at the same time, A matrix is ill-conditioned. It is difficult to accurately obtain vector x...- passionfly
- Thread
- Code Fortran Linear Linear system Method Square System
- Replies: 1
- Forum: Linear and Abstract Algebra
-
A
Fortran Input .txt file into Fortran program
I am trying to input a txt file into my fortran program. My txt file is a 9x2 table of integers, all I want is to display the values in the same format in my program. I tried using, program name implicit none integer :: input(9,2), I, J open (unit=20, file="values.txt") DO I =...- ae62589
- Thread
- File Fortran Input Program
- Replies: 9
- Forum: Programming and Computer Science
-
P
Fortran Debugging Strange Fortran Code: A Simple Delta Function
Hi guys, I just wrote a simple code for delta function and print it out. Here it is. program main implicit none integer i real*8 del real*8,parameter:: ep=1D-2 real*8,parameter:: pi=3.1415926 do i=-10,10,1 write(*,*)...- phynewb
- Thread
- Code Fortran Strange
- Replies: 5
- Forum: Programming and Computer Science
-
E
Fortran How can I generate a random number between 1-10 in Fortran 90?
I'm trying to contruct a program that will generate a different random number between 1-10. I am not sure how to make it only 1-10. PROGRAM guess USE const IMPLICIT NONE INTEGER::i REAL(kind=dp)::x call random_number(x) WRITE(*,*) 'x=',x END DO END PROGRAM...- epratt
- Thread
- Fortran Random Random number
- Replies: 2
- Forum: Programming and Computer Science
-
V
Fortran Memory storage of multidimensional arrays in fortran 90
Hello, I think i heard somewhere that a multidimensional array in fortran 90 may be stored non-contiguously in memory. Is this true? Even if it the size was known at compile time? If your answer is it depends on a compiler, what about ifort and gfortran?- vacuum
- Thread
- Arrays Fortran Memory Multidimensional Storage
- Replies: 1
- Forum: Programming and Computer Science
-
M
Fortran How to Create an Executable in Intel Fortran Using Visual Studio?
Hello all, I am new to programming and fortran, I have Intel Fortran 9.1 and using this via Microsoft Visual Studio 2005. To start with I have found a simple exmaple from the a Intel Fortran 90 book. I seem to be able to run a debug, but can't seem to create an executable? Its my first time...- MechEng2010
- Thread
- Fortran Programming
- Replies: 2
- Forum: Programming and Computer Science
-
S
Fortran Fortran 95 & complex numbers question
Hi, I'm trying to compile a code (.f95, compiling using gfortran) in which I'm using a 'do' loop to set the values in a complex array; the following little piece is giving me trouble: double precision, dimension(n) :: x complex, dimension(n) :: y do i=1, n x(i) = ... end do do...- Sdakouls
- Thread
- Complex Complex numbers Fortran Numbers
- Replies: 6
- Forum: Programming and Computer Science
-
T
Fortran Comparing Fortran and Pascal: Advantages & Uses
Hi, I heard that fortran is quite a useful language for some scientific computations, so I looked it up to see what is looks like and I was surprised that the syntax is very similar to Pascal. I know that syntax doesn't mean anything, but it seems to me that when languages have a similar syntax...- Tom83B
- Thread
- Fortran Pascal
- Replies: 11
- Forum: Programming and Computer Science
-
A
Fortran Read start: end of file error in fortran
Hi all, do i = 1, 79 open(2,file=afiln(i),status='old') do k = 1,11 read(2,'(51a)')astr1 enddo do j=12,2000 read(2,22,end=23,err=23)iyr,imn,id,ih,imt,flx write(7,*)i,j obstim =...- agalya
- Thread
- Error File Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
J
Fortran Fortran Code for Calculating Second-Order Derivative | Get Help Now!
I'm looking for a fortran code to calculate second-order derivative from a dataset. Please help me!- jimmytung
- Thread
- Code Fortran
- Replies: 2
- Forum: Programming and Computer Science
-
N
Fortran Can I Install Fortran 95 on Windows 7 for My Computer Science Class?
I am a student who is currently enrolled in a computer science class, and the program we are using is Fortran 95. I was wondering how I could get this program/compiler onto my own computer? I have almost no experience with programming and Fortran so I really want toget this on my own system...- nlsherrill
- Thread
- Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
S
Fortran How to Fix Overflow Error in FORTRAN Matrix Program?
hi i have over flow error in FORTRAN for a program that do some function and summation on matrix elements , then multiply them and at last find its determinant, the dimension is SET by input when it is more than 7 i have this error what should i do?- shasa
- Thread
- Error Flow Fortran
- Replies: 1
- Forum: Programming and Computer Science
-
Fortran Which FORTRAN Compilers are Compatible with Windows 7 32-bit?
Hello all, Although I am currently working on implementing FORTRAN on my Mac, I would also like to find a compiler that works well with Windows 7 32-bit. I initially had Win7 64-bit installed on my computer, but when I went to use my (really old) DIGITAL Visual Fortran install disk, it said it...- Saladsamurai
- Thread
- Bit Fortran Windows windows 7
- Replies: 4
- Forum: Programming and Computer Science
-
Fortran Anyone using Snow Leopard & FORTRAN?
If so, how did you install it? I have been looking at http://gcc.gnu.org/wiki/GFortran" and apparently you have to be a rocket scientist to install the compiler. I'm a little desperate here. I really know nothing about compilers. Most compilers I have dealt with simply require me to run a...- Saladsamurai
- Thread
- Fortran
- Replies: 14
- Forum: Programming and Computer Science
-
N
Fortran Using Fortran Subarrays in f90: Passing Single Columns/Rows into a Subroutine
Dear all, I am using f90 and trying to pass only one column/row of an array into a subroutine. So I want something like... call test(x(1,:),...) If "test" defines the first entry as a vector, will this work? Natski- natski
- Thread
- Fortran
- Replies: 1
- Forum: Programming and Computer Science
-
L
Fortran How can I properly name and open multiple files in Fortran based on user input?
Hello there. I've doing a program that I do not know how many files will be needed, because it'll depend on user's choice. So, how to name them? I tought that a command like, where n is a user-input number Do While (i .LE. n) Open (Unit=i, File=i'.dat') i=i+1 EndDo Would be enough, but I...- LucasCampos
- Thread
- Fortran
- Replies: 7
- Forum: Programming and Computer Science
-
B
Fortran Fortran 95: WRITE to screen changes output to WRITE to file
I have a short code that calculates the running median for three columns of data in an input file and writes the running medians out to three columns of data in an output file. I use Numerical Recipe subroutines and functions to compute the running median. If I include a WRITE(*,*) directly...- benacquista
- Thread
- File Fortran Output Screen
- Replies: 13
- Forum: Programming and Computer Science
-
A
Fortran Fortran: creating array containing characters
Hello. I'd like to create an array containing characters (basically a word stored as a 1xn array). I have no idea how to do this, however. I thought that the most obvious way to do it (yes, it would've been highly impractical for long words) was to write character, dimension(3) :: A...- _Andreas
- Thread
- Array Fortran
- Replies: 1
- Forum: Programming and Computer Science
-
M
Fortran Fortran Formatting Computational Chemistry
Hi, I require specific formatting for a quantum chemistry calculation. But for some reason I can't seem to write using formatting. I have checked tutorials, but to no avail. Here is my toy program: program test_format implicit none real :: m write(*,*) 'Enter a number' read(*,*)...- Morberticus
- Thread
- Chemistry Computational Computational chemistry Fortran
- Replies: 2
- Forum: Programming and Computer Science
-
D
Fortran How to Fix 'Undefined Symbol: G77_date_and_time_0' Error in Fortran Subroutine?
27 Jul 10 2:35 Hello, I have an error when I try to execute my python program which uses a fortran subroutine (which call date_and_time function) : "undefined symbol: G77_date_and_time_0" Do you know how can I fix this issue? Thank you very much!- Dreyliciouss
- Thread
- Fortran Symbol
- Replies: 1
- Forum: Programming and Computer Science
-
M
Comp Sci Fortran program to calculate texas hold em odds
The instructions are to calculate the odds of winning if you are dealt King and 9 of clubs, what are the odds of winning? I am finding myself spending more time trying to figure out texas hold em (never played before) than writing the program. So far I found a list on wiki that breaks down the...- mike81
- Thread
- Em Fortran Program
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
L
Fortran How to Handle Line Truncation in Fortran?
I've made a program that uses more than 72 characters per line. When I try to compile it on gfortran, using -ffixed-line-length-n, it returns several errors, all of them derived from a line truncated at the very beggining. How can I compile it or untruncate the line? The code is as follows...- LucasCampos
- Thread
- Fortran Line
- Replies: 1
- Forum: Programming and Computer Science
-
M
Fortran How Can I Correctly Print Imaginary Numbers in My Fortran Quadratic Program?
I am trying to write this program, it runs fine but I can't get the imaginary numbers to print correctly. I have been trying this for a few hours now and can't figure it out. Here is the code, I am running Force 2.0. Thanks in advance for the help. Program Quad Implicit None...- mike81
- Thread
- Fortran Program Quadratic
- Replies: 10
- Forum: Programming and Computer Science
-
M
Fortran Fortran 77 - Troubleshoot Char Function Error
I am using one progran,have problem with char function. rfile(3:4)=char(id1+48)//char(id2+48) write(6,*)rfile open(28, file=rfile, form='unformatted', status='old') I have entered write line.This is what I get: fd01.picks open: No such file or directory apparent state: unit...- Milentije
- Thread
- Fortran
- Replies: 7
- Forum: Programming and Computer Science
-
S
Fortran Problem with fortran 90 Present() function
Hi all, When I use Present(x) to check for the presence of an optional variable, I am getting TRUE even when the subroutine call clearly does NOT contain the optional variable. See here the call to test_present(a,b): program options implicit none real*8 a,b real*8 c a =...- sghan
- Thread
- Fortran Function
- Replies: 2
- Forum: Programming and Computer Science
-
BinariesWhat are some free Fortran compilers for Mac OSX?
I was just wondering if anyone can recommend any free Fortran compilers for OSX on Mac? I am going to be starting some work that requires the use of Fortran and though I have a Windows machine, I would like to use my Mac since it is faster. I have Googled around, but I am really not sure...- Saladsamurai
- Thread
- Fortran
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
J
Fortran Programming in FORTRAN - Begginer
I've to do a program which read "N" pairs of points and print the points which are contained in a two dimensions quadrilateral domain with vertices on (2,2), (2,5), (7,5) and (5,2), Can anyone help me? Thanks for the atention and patience.- JesusCristo
- Thread
- Fortran Programming
- Replies: 2
- Forum: Programming and Computer Science
-
S
Fortran Fortran 2008: The Final Steps of Standardization for Scientific Computing
http://www.nag.co.uk/sc22wg5/ It looks like Fortran 2008 is going through its final steps of standardization. What does this mean for scientific computing? Since people still use Fortran 90 despite new revisions up to 2003, will this go under the radar, or will this be a new and useful...- spb
- Thread
- Computing Final Fortran Scientific Scientific computing standardization
- Replies: 1
- Forum: Programming and Computer Science
-
O
Fortran How to declare real constants in Fortran? Please help
How do I declare constants beginning with "zero" in Fortran to get the output beginning with zero ? If I declare : I get the output: Thanks in advance- onlybarca6
- Thread
- Constants Fortran
- Replies: 1
- Forum: Programming and Computer Science
-
O
Fortran How to Implement a Do-Loop for Incremental Calculations in Fortran?
I can't figure out how to make a do-loop in Fortran to do the following: I have 2 variables. Let's say: and I need 10 fields printed out. The first field will have the value: level + step <then the value of the one above + step> <then the value of the one above + step> <then the...- onlybarca6
- Thread
- Fortran
- Replies: 2
- Forum: Programming and Computer Science
-
D
Fortran Question about printing with FORTRAN
Hey guys, I tried looking around on the web and came back without much luck.. Is it possible to print FORTRAN output using FORTRAN code? When I say "print," I mean to a local printer such as a laserjet.. not just printing to the terminal screen.. I've searched pretty intensely on the...- DoktorD
- Thread
- Fortran Printing
- Replies: 1
- Forum: Programming and Computer Science
-
D
Fortran Help with reading file into FORTRAN
Hey all, I'm in the process of writing a Suggested Reorder Program for my father's small business.. His current computer program exports its item data in the form of .CSV files. I'm trying to read the file into FORTRAN to manipulate. However, I run into the following problem: Even...- DoktorD
- Thread
- File Fortran Reading
- Replies: 1
- Forum: Programming and Computer Science
-
G
MATLAB MATLAB To FORTRAN Troubles (eig.m equivalent?)
Hello all, first time I post here. I'm doing a PhD in Plasma Physics at the moment and have always been using MATLAB. It seems the research industry however does not look kindly on MATLAB and develops solely on FORTRAN (!).. Anyway, I don't need to go into a lot of detail. I have a big 10x10...- Gib007
- Thread
- Equivalent Fortran Matlab
- Replies: 5
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
M
Fortran Turn off writing to screen in Fortran 90
Hi, Is there a command available that makes the compiler ignore all write(*,*) statements?! The thing is, I'm working on a code which will eventually run for several hours (perhaps days) to complete a single run. At the moment I'm testing so I write a lot of data to the screen in order to...- MichielM
- Thread
- Fortran Screen Writing
- Replies: 2
- Forum: Programming and Computer Science
-
P
Is there any command in Fortran that is similar to eval in MATLAB?
Hello, I am trying to write a Fortran subroutine to solve non-linear equations (given by external function fnxname) using Newton's method, where the derivative is given by finite difference calculation. How may I use the function in the program. Suppose the desired function name is given...- phanlada
- Thread
- Fortran Matlab
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
V
Comp Sci Comparing array of data is fortran
Hi FORTRAN experts, I have two arrays of data, called data1.dat and data2.dat. each contains 60 data. What I want to do is to compare the data in each file and write the counting into bins. It goes like this. First, take the first data in data1.dat file and compare with the 60 data in...- vjramana
- Thread
- Array Data Fortran
- Replies: 12
- Forum: Engineering and Comp Sci Homework Help
-
J
Fortran Salford fortran library compiler error?
Salford fortran library compiler error?? Dear all, I have install the NAG fortran library, firstly, I compile the fortran program by using the Salford Fortran compiler with NAG static Lib. Command Prompt by typing ftn95 -c ProgramName.f95 It got a few warning, not error. But I...- jcang
- Thread
- Compiler Error Fortran
- Replies: 1
- Forum: Programming and Computer Science