Fortran Definition and 858 Threads

  1. 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...
  2. 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...
  3. Simfish

    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...
  4. Saladsamurai

    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...
  5. Hemmer

    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) &...
  6. 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...
  7. 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...
  8. 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...
  9. F

    Romberg integration fortran code

    how to code it?...sequence? logic?..
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. 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...
  15. 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 =...
  16. 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(*,*)...
  17. 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...
  18. 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?
  19. 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...
  20. 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...
  21. 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...
  22. 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 =...
  23. 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!
  24. 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...
  25. 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?
  26. Saladsamurai

    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...
  27. Saladsamurai

    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...
  28. 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
  29. 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...
  30. 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...
  31. 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...
  32. 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(*,*)...
  33. 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!
  34. 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...
  35. 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...
  36. 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...
  37. 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...
  38. 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 =...
  39. Saladsamurai

    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...
  40. 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.
  41. 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...
  42. 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
  43. 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...
  44. 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...
  45. 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...
  46. 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...
  47. 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...
  48. 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...
  49. 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...
  50. 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...
Back
Top