Fortran Definition and 858 Threads
-
B
Comp Sci Output format of a matrix in Fortran 90
Hello, I'm new here and I'm also new in programming. I never did it before and now I have a problem with one of the programs in fortran 90 and I can't figure out how to solve it. Maybe some of you can help me. Many thanks in advance. 1. Homework Statement I need to plot the results of a...- Boltzmann
- Thread
- Format Fortran Fortran90 Fourier series Matrix Output Plot
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
J
Normal distribution starting with a uniformed distribution
Hi comunity! I need to make a code o a normal distribution of velocities, starting whit a random secuence uniformly distributed between [0,1]. I am using FNT95, with Plato. I want to obtain a ''for'' bucle with I=1,N for the velocities. It is importan for the distribution to have sigma defined...- Jamil
- Thread
- Code Distribution Fortran Gaussian distribution Initial conditions Initial state Normal Normal distribution
- Replies: 2
- Forum: Programming and Computer Science
-
S
Fortran Useful and Extensive MPI tutorial/notes in FORTRAN
Hello Everyone, I am a new user of MPI in fortran ( i have used fortran for an adequate time ) and I want to make myself familiar with the subject. Has anyone you stumbled upon a useful tutorial in MPI for fortran but simultaneously extensive ? Or maybe someone has used a textbook that...- sketos
- Thread
- Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
L
Fortran Using Integer Expressions in an If Statement: Help Needed!
Hi, so I'm trying to use the following if statement: if (sum(i,j) <=1.0 ) then sidash=(si)*(Death) else if (1 <= sum(i,j) <= 2) then sidash=(si)*((sqrt(2.0)+1.0)*(2.0-sum(i,j))*(Death)+(sum(i,j)-1.0)*(Survive)) else if (sum(i,j)<=3 .and. sum(i,j)=>2) then...- Lukejambo
- Thread
- Expressions Fortran Fortran95 If statement Integer
- Replies: 3
- Forum: Programming and Computer Science
-
J
Fortran Problem with initial state in FORTRAN
I have created an initial state code with perodic boundary conditions and normal distribution of velocities. I not know where is the problem, when I compile the computer detect the 112 error. Could anyone help me please? Thanks! the code is...- Jamil
- Thread
- Fortran Fortran95 Initial Initial state Physics problems State
- Replies: 12
- Forum: Programming and Computer Science
-
Fortran {FORTRAN}How can i read blank steps without using iostat
hello, I have a tricky question with arrays involved. I am trying to made a code who can read precipitation, so i have 3 kinds of strings: 1.numbers, 2.0 ,3. blank steps. I need to change the blanks into the smallest number who can read fortran. I was reading and the other options is using...- camila
- Thread
- Array Fortran
- Replies: 6
- Forum: Programming and Computer Science
-
Fortran [FORTRAN] Code misassigning values
Hi guys, I can't figure this one out. Here I am working with a piece of code which should read in a grid of 2 arrays, a radius array and an electron fraction array. The code looks like this: subroutine varelec_init(varelecfrac,elecprofile,effilename,elecfracname) integer ...- Matterwave
- Thread
- Code Fortran
- Replies: 16
- Forum: Programming and Computer Science
-
Fortran Fortran Write Path - Change File Paths
Hello, I have write a fortran code to write several file, like this CHARACTER(len=12) :: FNAME INTEGER::ST DO 100 ST=1,12 DO KC=1,4 !number of layer IF(ST.EQ.1) WRITE (FNAME,10)KC IF(ST.EQ.2) WRITE (FNAME,11)KC IF(ST.EQ.3) WRITE (FNAME,12)KC...- shade rahmawati
- Thread
- Fortran Path
- Replies: 2
- Forum: Programming and Computer Science
-
L
Fortran Can Fortran be used to create a video of changing arrays?
Hi, using Fortran that writes a large amount of arrays to a text/dat file. Is there some kind of software where I can create a video of these arrays changing from beginning to end? I've tried using VMD, but cannot get dat/text files working on it. Any input will be appreciated.- Lukejambo
- Thread
- Fortran Fortran95 Video
- Replies: 5
- Forum: Programming and Computer Science
-
Comp Sci Fortran error *** glibc detected ***
Homework Statement I'm doing aproximation of derivative called five-point stencil. For every value of x, in interval [a,b], in step of 0.1 i need to calculate derivative.Homework Equations [/B] The equation is like this: Five-point stencil: (-f(x + 2h) + 8f(x + h) - 8f(x - h) + f(x -...- Antonija
- Thread
- Error Fortran
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
L
Fortran Fortran 90/95: Array Help with IF Statement
Hi, For fortran 90/95, I've written a 10x10 array of numbers. 2 do loops (n,m) from 1 to 10 indicate the subscript of the elements in this array. I've applied a generic rule to the array elements where they become 0 if they are above a certain number. Using an if statement to change the...- Lukejambo
- Thread
- Array Fortran Fortran95
- Replies: 2
- Forum: Programming and Computer Science
-
L
Fortran [Fortran] Rounding up Random Numbers
Hi, So I'm writing a programme in Fortran95 atm and I want to produce an array of 1s and 0s. I've used a random number and random seed generator to produce 10 numbers between 0 and 1 and I want to use a NINT statement to round these random numbers to 0 or 1. However when I try this the...- Lukejambo
- Thread
- Fortran Fortran95 Numbers Random
- Replies: 12
- Forum: Programming and Computer Science
-
M
Can FORTRAN be Used for Quantum Computing in Physics?
Hi, folks! I am Maisalatison. I currently teach physics at a Nigerian university. My earlier experience includes many years in government service on educational planning and curriculum development for technical & vocational education. I look forward to sharing ideas on especially use of...- Maisalatison
- Thread
- fortran mathematical physics quantum computing
- Replies: 2
- Forum: New Member Introductions
-
Comp Sci How to Evaluate a Function in Fortran at a Given Point of x?
Homework Statement How can I evaluate function in some point of x? So, user inputs function in a character string, and he inputs the value of x. The program then needs to evaluate f(x). I have read something like this:http://faculty.cs.niu.edu/~hutchins/csci230/arith.htm But, I'd like to see...- Antonija
- Thread
- Fortran Function
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
Comp Sci Allocatable character array in Fortran
Homework Statement I have character array in fortran which is defined as allocatable. When program runs, user inputs something like: [1,2,3,4...], and then program reads it and counts the particles, and then allocate array with dimension it just read. Thats' how I understood it. This program...- Antonija
- Thread
- Array Fortran
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
Comp Sci Derivative of a function in FORTRAN
[Note from mentor: This thread was originally posted in a non-homework forum, therefore it does not follow the standard homework template.] ------------------------------------------------ Hello. I have some homework to do. I need to make program that finds minimum/maximum of a function od 2...- Antonija
- Thread
- Derivative Fortran Function
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
M
Fortran What is meaning of (5,*), (6,*)and (*,*) in Fortran ?
Dear Members, Why The characters "(5,*)" should appear after every READ and the characters "(6,*)" after every WRITE ? What is the use of "(*,*)" that can appear with either the READ or WRITE statements. Best Regards- masyousaf1
- Thread
- Fortran
- Replies: 5
- Forum: Programming and Computer Science
-
Help with Adams-Bashforth program
Hi - trying to write a Fortran95 program to solve a trivial 1st order DE (dy/dx=-xy), the idea being that once it works it can be used for different forms of f(x,y). I use Euler to get the starting point, then A-B's 2 step formula for the next 2 starting points. It is when I apply the A-B...- ognik
- Thread
- Fortran Fortran95 Numerical methods Program
- Replies: 5
- Forum: Programming and Computer Science
-
S
Fortran Fortran 90 command to write only specific lines
Hi all. I did search in internet but couldn't find the specific answer for my specific problem.I need to run a program with a datafile in 3000 time step and the output will 1.dat to 3000.dat, which is every single data output size 200Mb. To safe the storage, I would like to write only every...- s_hy
- Thread
- Fortran Lines Specific
- Replies: 3
- Forum: Programming and Computer Science
-
A
Fortran Fortran 77 variable declaration issue
Hi I've been struggling with a fortran 77 code that I need for my astrophysics thesis... Since it's quite old, I'm trying to rewrite some features in order to make it more readable, and I'm trying to make it more rigorous by declaring all variables (I'm declaring "implicit none" everywhere)...- AmenoParallax
- Thread
- Fortran Variable
- Replies: 3
- Forum: Programming and Computer Science
-
Comp Sci Counting Numbers in Curly Braces in Fortran?
< Mentor Note -- thread moved to HH from the technical forums, so no HH Template is shown >[/color] I have a file Aggregation.dat ######################################################################################## 6.999e+04 4.50000e+01 2.22222e+00 4.94813e+00 2.50000e+01 1.00000e+00...- Karlisson
- Thread
- Count Counting Fortran
- Replies: 12
- Forum: Engineering and Comp Sci Homework Help
-
Fortran Clear a variable in fortran subroutine
Hello, I am trying to figure out how to clear a variable inside a subroutine from a calling function. The variable in the subroutine acts as a persistent(MATLAB) or static(C), but once in so many calls I want it to be reset to empty as if the subroutine is being called for the first time. I...- Somefantastik
- Thread
- Fortran Subroutine Variable
- Replies: 10
- Forum: Programming and Computer Science
-
Comp Sci Fortran - equation of motion, astronomical units
Homework Statement Euler method : Plot the trajectory of a body moving under the influence of the suns gravity from initial conditions x=1, y=0, vx=0, vy=1. My trouble is figuring out my function. Homework Equations d2r / dt2 = -r/r3 The Attempt at a Solution What I have been doing...- SalfordPhysics
- Thread
- Equation of motion Fortran Motion Newtonian mechanics Trajectory Units
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
M
Fortran Can You Implement a Column-Major Matrix Storage Data Structure in C?
See attached image. I have never heard that before. Why wouldn't one be able to implement a data structure that stores a matrix by its columns using C? Is that true?- mafagafo
- Thread
- Columns Data Fortran Matrix Storage Structures Textbook
- Replies: 35
- Forum: Programming and Computer Science
-
Comp Sci Efficient Fortran Method for Trajectory Plotting with 4d Vector-First Order ODE
Homework Statement I have a code that successfully plots the trajectory of a ball moving under gravity and air resistance, but my method is rather long-winded and I want to use a 4d vector-first order ODE instead - but I don't know how to do it. I've tried writing some simple skeletons but...- SalfordPhysics
- Thread
- Array Arrays Euler formula Fortran Multidimensional
- Replies: 18
- Forum: Engineering and Comp Sci Homework Help
-
Comp Sci Fortran90: DO loop for sequence of numbers
Homework Statement A program finds the area under the Gaussian Distribution Curve between ±σ using Simpsons Rule. Modify the program to investigate the effect of the number of strips. Do this by using a DO loop in the main program for the following sequence of number of strips (n); n-2, n-4...- SalfordPhysics
- Thread
- Area Fortran Fortran90 Integration Loop Numbers Numerical methods Programming Sequence
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
FORTRN90: Euler Midpoint Method for SHO
Homework Statement Write a program to simulate motion of simple harmonic oscillator. Initial conditions: Let ω = 1, x(t=0) = 1, v(t=0) = 0. Integrate over 30 seconds in intervals of 0.05s. Homework Equations δ2x / δt2 = -ω2x As set of 2 coupled ODE's; x' = v, v' = -w2x The...- SalfordPhysics
- Thread
- Euler Fortran Integral Method Sho Simple harmonic motion
- Replies: 25
- Forum: Engineering and Comp Sci Homework Help
-
A
Comp Sci Eigenvalues and eigenvectors of a real symmetric matrix in Fortran
Homework Statement I try to run this program, but there are still some errors, please help me to solve this problems Homework EquationsThe Attempt at a Solution Program Main !==================================================================== ! eigenvalues and eigenvectors of a real...- alui
- Thread
- Eigenvalues Eigenvectors Fortran Matrix Symmetric Symmetric matrix
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
I
Fortran Program in FORTRAN which calculate the detection efficiency
Hi everyone, I want to write a program in FORTRAN which calculate the detection efficiency for a punctual source and a disc source at a distance from the detector .The disc detector is assumed to be perfect: ie photon absorbing everything that falls on it. So here I am working in 3D and I use...- inesnoussa
- Thread
- Detection Efficiency Fortran Program
- Replies: 4
- Forum: Programming and Computer Science
-
S
Fortran Error 6404 when running fortran code in visual studio
I am trying to compile several libraries of FORTRAN code and getting the error message as can be seen in the screen shot. As I do not have any experience with FORTRAN I am not sure what is wrong in the line highlighted line. Any help would be greatly appreciated! Thanks a lot! :-)- snow.ball
- Thread
- Code Error Fortran Running Visual
- Replies: 7
- Forum: Programming and Computer Science
-
Fortran A specification statement cannot appear in the executable section (fortran)
I'm working on a code to compute the Kahan summation of two arrays. I'm a bit new to fortran so my error is probably obvious, but I have no idea why. It seems as if I have declared the subroutine according to standard that I have read on the internet. The code is still a work in progress so I...- Hercuflea
- Thread
- Fortran Section
- Replies: 11
- Forum: Programming and Computer Science
-
S
Fortran [Fortran] How to open .hdf5 file extension
Hello, i am relatively new linux user so please be as thoroughly descriptive as you can. i am starting a project and i have a file "file.hdf5" which contains velocity data i need to process in my fortran program. What do i have to do in order to use the data inside this file? i normally use...- sketos
- Thread
- Extension File Fortran
- Replies: 1
- Forum: Programming and Computer Science
-
Fortran Why am I getting a Fortran runtime error when trying to print more values?
Hi guys, I've been tinkering with this code for a while now, as you probably have seen from my other threads. Right now I am working on changing the code around so that it actually writes out the correct output instead of the old output. I am getting this runtime error: At line 2057 of file...- Matterwave
- Thread
- Error Fortran Runtime
- Replies: 12
- Forum: Programming and Computer Science
-
Fortran [FORTRAN] Assigning bad values in arrays
Hi, I just realized that I have been making bad array assignments in my code. Specifically, I think I have been assigning to slots that the array does not have. For example, I might declare an array: int,parameter :: nflavor=3 int,parameter :: nflavor2=nflavor*2 real,dimension(nflavor)::x...- Matterwave
- Thread
- Arrays Fortran
- Replies: 13
- Forum: Programming and Computer Science
-
D
Fortran FORTRAN moving from OpenVMS to AIX
Good day, I am not familiar with older FORTRAN. We are shutting down an old OpenVMS server and moving to AIX. I am trying to tweak old FORTRAN code that is working fine on OpenVMS to now run on AIX. I have one error left in this code that I can't seem to fix. It is the line that reads 6...- debbieanne
- Thread
- Fortran
- Replies: 14
- Forum: Programming and Computer Science
-
Fortran [Fortran] something very peculiar
Hello guys, As, you probably know by now, I've been trying to run this piece of code for a while now. I finally got it to run and then I realized something very weird is happening! So in my code, which simulates neutrino evolution, I have made 3 conditional statements in the evolution stage of...- Matterwave
- Thread
- Fortran
- Replies: 23
- Forum: Programming and Computer Science
-
Fortran [Fortran] A piece of code that confuses me
Hello all, There is a subroutine in the code I'm working on that looks like this: subroutine onestep(iter,iegy,icos,jcos,iphi,rinit,rfin, & & v2,v2bar,hel,helbar,drdis, & & psib,psie,psibarb,psibare,err) use params use helectron use angles use neutrinodist use parallel...- Matterwave
- Thread
- Code Fortran
- Replies: 21
- Forum: Programming and Computer Science
-
Fortran [Fortran] Functions and naming conventions
Hi guys, In the code I'm working on there are a few functions that will be used to find a Hamiltonian, which I will then use in later parts of the code to find the time evolution of my system. Right now I have it set up so that the function names are actually the names I want to give the...- Matterwave
- Thread
- Fortran Functions
- Replies: 6
- Forum: Programming and Computer Science
-
1
Fortran Writing strings/arrays to files in FORTRAN 77
Hey guys i am a little confused in how to write arrays to a output file in FORTRAN 77. Here is the piece of code: Please assume that rri and eei arrays have been defined correctly above open (16,file='output.out') write (16,6100) rri eei format (5e16.8) However in the output file...- 1994Bhaskar
- Thread
- files Fortran Writing
- Replies: 3
- Forum: Programming and Computer Science
-
Fortran Fortran 90 installation assistance
Like so many before, I have a unit over the next year using Fortran 90 as part of my Physics B.Sc. In advance, I'd like to get it up an running on my MacBook Pro, but having read various threads over the internet I'm not so sure on what to do. I don't want to pay a penny, but if it is the...- SalfordPhysics
- Thread
- Assistance Fortran installation
- Replies: 3
- Forum: Programming and Computer Science
-
T
Fortran FORTRAN 77 input absolute values
How to input absolute values in FORTRAN77? This was the code I used READ *,H PRINT *,H The input I gave was 0.01 But the output I got was 0.00999999978.- tyogav
- Thread
- Absolute Absolute values Fortran Input
- Replies: 4
- Forum: Programming and Computer Science
-
1
Fortran Help with Debugging Fortran Code | Plato Compiler
Hey everybody, I am a mechanical engineer and new to Fortran(I have decent experience in programming in C, Matlab and understand languages similar to them). However the Fortran programming structure is new to me. Hence I am facing problems debugging a Fortran code. Here is the link of the code...- 1994Bhaskar
- Thread
- Code Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
Fortran [FORTRAN] Help figuring out zheev
Hello guys, I am in need of a subroutine that diagonalizes a nxn Hermitian matrix (really I'm just looking for the eigenvalues and eigenvectors of course). Looking online I found that LAPACK has a zheev subroutine that presumably does just this. I am a little confused on how to use this...- Matterwave
- Thread
- Berkeley Fortran
- Replies: 18
- Forum: Programming and Computer Science
-
1
Fortran Fortran Code Help for Mechanical Engineers | Solving Debugging Issues
Hey everybody, I am a mechanical engineer and new to Fortran(I have decent experience in programming in C, Matlab and understand languages similar to them). However the Fortran programming structure is new to me. Hence I am facing problems debugging a Fortran code. Here is the link of the code...- 1994Bhaskar
- Thread
- Code Fortran
- Replies: 17
- Forum: Programming and Computer Science
-
Fortran Can equations be used in Fortran array declarations with parameters?
Hi, I'm just wondering real quick, are equations allowed in array declarations? For example: int :: y=2 int, dimension(2*y):: x ?- Matterwave
- Thread
- Array Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
I
Fortran Run Fortran Code - Tips from Ilango
Dear all, Let me introduce myself first. I am Ilango from India. I am new to Fortran, mostly working on Matlab, Modelica & Dymola. Working in an automobile company I was required to go through some battery models and hence landed at this page. http://www.cchem.berkeley.edu/jsngrp/fortran.html...- Ilango
- Thread
- Code Fortran Running
- Replies: 4
- Forum: Programming and Computer Science
-
S
Fortran Why Am I Getting a Fortran Memory Allocation Error?
I am getting the following error when i try to run my program: Operating system error: Cannot allocate memory Allocation would exceed memory limit Any thoughts about that this is and maybe any suggestions about how to resolve the issue??- sketos
- Thread
- Error Fortran System
- Replies: 2
- Forum: Programming and Computer Science
-
S
Fortran How to Change Directory in Fortran for Gnuplot Execution?
I am using the following subroutine: subroutine plot_2pCF_2D(A_0,index_0,Point_color,Title) implicit none integer ret real A_0,index_0 character(len=*) :: Point_color,Title OPEN(10,ACCESS='SEQUENTIAL',FILE='gp.txt') write(10,*)'set terminal postscript eps color enhanced size 5,7'...- sketos
- Thread
- Change Fortran
- Replies: 5
- Forum: Programming and Computer Science
-
S
Fortran Can I use a Fortran module for subroutines?
Hello, I want to create one file test.f95 where i can keep all my subroutines and use them whenever i create a new program new.f95. Is the modules the right way to do it?? because when i create a file let's say test.f95 with the module and one other with my main program (new.f95) when i...- sketos
- Thread
- Fortran module
- Replies: 16
- Forum: Programming and Computer Science
-
B
Fortran FORTRAN adding trailing zeros 0s
Aloha all, I am reading in real data values in a FORTRAN program that are something like 23.134. The problem is that the program adds extra numbers on the end to make it 8bit, so I end up with 23.13451. This is throwing everything off. Is there a way to make the values have trailing 0s...- byrdman1982
- Thread
- Fortran
- Replies: 4
- Forum: Programming and Computer Science