Fortran Definition and 858 Threads
-
DEC runtime library for Fortran in Visual studio 2022
trying to revive some stuff from 40 years ago. Found I could download and install Intel Fortran which seems to be a descendant from an old DEC VMS friend. Even managed to get it 'integrated' into Visual Studio 2022 (somewhat; haven't got a decent help or debug facility running yet... and no idea...- BvU
- Thread
- Fortran Runtime
- Replies: 11
- Forum: Computing and Technology
-
M
Fortran Passing variables in FORTRAN
I need to pass the value of a variable from one FORTRAN program to another. The main program carries out calculations with some numerical inputs a,b , I want to enter numerical values of variables in another program like [FONT=arial]real*8 a, b common/variables/a,b a = 1. b = 2. How should I...- Milleniumeye
- Thread
- Fortran
- Replies: 25
- Forum: Programming and Computer Science
-
C
Former subscriber to "Computers in Physics"
Just looking for Fortran compilers. I wrote, compiled and used EM software - a long time ago. Now I'm trying to re-learn Fortran that was so simple, 40+ years ago.- ccsmith
- Thread
- Fortran
- Replies: 4
- Forum: New Member Introductions
-
P
Fortran Errors in Fortran code for solving Laplace's equation in 3D
hey everyone. I wrote a code in Fortran to calculate potential values or solve the Laplace equation inside a cube according to the boundary conditions mentioned in the code. this is my code: program laplace_cubic implicit none REAL*8 :: LX, LY, LZ, DELTA, MAX_ERR, ERR INTEGER :: NX, NY...- physicsuser2023
- Thread
- Computational physics Fortran Fortran95 Physics Programming
- Replies: 4
- Forum: Programming and Computer Science
-
M
Python Can Fortran 77 Code Be Used to Debug Python Code for Solving ODEs Using Radau5?
Hi, I have a piece of Fortran code but I'm not Fortran literate. I'm trying to translate it into Python. I have already made it, but I need someone who can run the Fortran code to compare the values of the variables.- member 657093
- Thread
- Code Debugging Fortran Python Translation
- Replies: 64
- Forum: Programming and Computer Science
-
How to read a column of data into Fortran without arrays? (Fortran 77)
TL;DR Summary: I am beginning research as an undergrad in Physics and have an example file I must analyze for the mean of each column. I cannot use arrays. I need to take the sum of a column of data. Hi all, I am new to fortran and programming in general, but I'm having issues with creating a...- gjleigh10
- Thread
- Arrays Column Data Fortran
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
Fortran Does Fortran have a built-in function to calculate the determinant?
program main ! use ! some library that defines the function to calculate the determinant of a given matrix implicit none real,dimension(2,2)::A real::det_val A(1,1)=1 A(2,2)=1 A(2,1)=0 A(1,2)=0 ! det_val=det(A) print *,det_val ! Should print 1. end program main- Eclair_de_XII
- Thread
- Determinant Fortran Function
- Replies: 5
- Forum: Programming and Computer Science
-
P
Comp Sci Can‘t call a subroutine name in a subroutine in Fortran90
Here is the code for example: PROGRAM main CALL B() CALL CaoB(B) contains subroutine B() IMPLICIT NONE write (*,*) 'fk' end subroutine B subroutine CaoB(fcn) implicit none INTERFACE SUBROUTINE fcn() IMPLICIT NONE END SUBROUTINE fcn END INTERFACE write...- pilipili2021
- Thread
- Fortran Fortran90 Subroutine
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
Fortran Dimension of arrays (RESHAPE) in Fortran 90
program testmatek implicit none integer :: Nc=1000 ,k integer,parameter :: N=2 REAL :: kx ,a0=1.0 ,t0=0.25 DOUBLE PRECISION :: pi=4*ATAN(1.) COMPLEX , PARAMETER :: i=(0,1) complex :: ek1 ,ek2 complex :: MATRIX_ek(N,N) open(1,file='matek.txt') MATRIX_ek(N,N)=(0,0) DO k=-Nc,+Nc...- MahdiI84
- Thread
- Arrays Dimension Fortran
- Replies: 4
- Forum: Programming and Computer Science
-
Fortran Fortran jump command for fortran 95
Even after writing the label , it is showing that label is not defined, please help! my program reads...…... ……... 99 z = b + 2*c*(d - 0.0792079*(e + log((( sqrt(x) + 1.52569)**5.64616)/(((sqrt(x) - 1.26704)**5.93863)*((sqrt(x) - 0.258652)**50.2075)))) - 2 log(x)) zs = g + 2*i*(d - 0.0792079*(e...- buddhanath
- Thread
- Fortran Jump
- Replies: 12
- Forum: Programming and Computer Science
-
J
Fortran FORTRAN 90 - Insert Matrices into Other Matrices
Hi, I haven't made a code for it yet, however I will be making a Gauss-Seidel algroithm in Fortran 90, for solving very large matrices (actually to initiate the multi-gird method but that's irrelevant for this). As part of this, I wish to insert matrices into other matrices. in MATLAB this...- JP12321
- Thread
- Fortran Matrices
- Replies: 2
- Forum: Programming and Computer Science
-
Fortran Spring Pendulum system in FORTRAN
I have checked the program several times the program is running but the graphs I am getting is not what I was accepting soon one of the variables approaches zero I don't know why is it happening. The program I have made is below and it's in the FORTRAN language. If anyone knows Fortran can they...- Abhisheko07
- Thread
- Fortran Pendulum Spring System
- Replies: 8
- Forum: Programming and Computer Science
-
N
Fortran Having trouble when reading file using Fortran 90
implicit none!do not use an undetermined constant character(len=18)::fname character(len=22)::fname_2 character(len=19)::fname_3 character(len=7)::yyyymmd character(len=1)::dash character(len=1)::d character(len=1)::f1 character(len=1)::f2 character(len=1)::f3 character(len=1)::f4...- Novia Lusiana
- Thread
- File Fortran Reading
- Replies: 12
- Forum: Programming and Computer Science
-
Fortran Parallel DO loop with OpenMP (fortran)
Hey guys, I've started to read some OpenMP programming and now I'm trying to parallelize small part of a fortran code. The first thing I would like to do is to parallelize the innermost DO loop. It loops through the number of particles (na) and calculates the distance between some point in 3D...- davidfur
- Thread
- Fortran Loop Parallel
- Replies: 8
- Forum: Programming and Computer Science
-
Fortran Extract values from ASCII file in GIS by Fortran code
I want to read values from the ASCII file of GIS by Fortran code. In GIS, an area has meshed. Each mesh has an individual value (e.g. velocity of water). Here is the website that shows how the ASCII file is working in GIS. https://en.wikipedia.org/wiki/Esri_grid I want to know if anybody has...- Pooyannikeghbali
- Thread
- Code File Fortran
- Replies: 2
- Forum: Programming and Computer Science
-
Problems with Landau Wang algorithm in fortran
I have been struggling for over a month now with a problem I cannot fix. I would really appreciate any comment or guidance. Thank you! I am considering an Ising-like model with N agents that han hold one of the following 3 states, represented by vectors: state + : vector (1 0) state 0 : vector...- IreneFerri
- Thread
- Algorithm Fortran Ising model Landau Monte carlo
- Replies: 8
- Forum: Atomic and Condensed Matter
-
J
Fortran Why Is My OpenMP FORTRAN Program Slower in Parallel Than in Single Thread?
I am trying to understand OpenMP, but my experiments are not paying off. I made a simple FORTRAN program to show me parallel time results. it turns out that parallel times are greater than single thread. What am I doing wrong? results: (changing number of threads) No OpenMP seconds=...- jelanier
- Thread
- Beginner Fortran
- Replies: 37
- Forum: Programming and Computer Science
-
Fortran Help with these Fortran Compiler Errors please
What is the reason for error while compilation- Chaitanya_90
- Thread
- Compiler Errors Fortran
- Replies: 16
- Forum: Programming and Computer Science
-
P
Fortran Are these bugs for the GNU Fortran, g++, and clang compilers?
I tried to calculate the smallest number in my machine with gfortran, g++ and clang. I did it by looping as: a = a / 1.73 In gfortran after 1358 loops, I found that a = 4.9406564584124654E-324, and the value of a never changes from loop 1358 till the end 1500 loop. It is questionable for me...- Phyty
- Thread
- Fortran Gfortran
- Replies: 3
- Forum: Programming and Computer Science
-
Comp Sci How Does This Fortran Code Generate and Output Its Array Values?
integer n, ar(12) ar(1) = 1 ar(2) = 2 do n=1, 10 ar(n+2) = ar(n+1) + ar(n) end do do n=0,3 print*, ar(12-3*n) end do print*, ar(ar(ar(4))-1) end- suezxc6
- Thread
- Fortran tracing
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
Comp Sci Need help with Fortran homework -- Error: Invalid form of PROGRAM statement
program Lab5A implicit none ! This program introduces Fortran string handling capabilities character*26 upper, lower, name, cap character str*2, one*1 integer from, to, i, m lower = "abcdefghijklmnopqrstuvwxyz" upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"...- suezxc6
- Thread
- Error Form Fortran Homework Program
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
Old timers reminiscing about Fortran
<Moderator's note: This thread is a spinoff from https://www.physicsforums.com/threads/need-help-with-fortran-compiler-errors.985749/> There's a lot of Fortran dummies on PF and they know who they are! :-)- jedishrfu
- Thread
- Fortran
- Replies: 19
- Forum: General Discussion
-
Need Help with Fortran compiler errors
Summary:: so I am trying to compile this program and i keep on getting "Unterminated character constant beginning at (1)" and "invalid character in name" at the months section. what do i have to change to fix it? thanks program Lab6 implicit none character*9 month integer monthNum, pos...- suezxc6
- Thread
- Compiler Errors Fortran
- Replies: 12
- Forum: Engineering and Comp Sci Homework Help
-
J
Fortran Fortran subroutine solving for the velocity and displacement of a spring
I have a simple Fortran code for solving velocity and displacement of spring, the code works fine when writing all together without using a subroutine. but as I am learning Fortran I tried to do it using subroutine, but I keep getting errors appreciate any help in advance. program msd implicit...- joseph2015
- Thread
- Displacement Fortran Spring Subroutine Velocity
- Replies: 8
- Forum: Programming and Computer Science
-
U
Fortran Fixing Fortran Runtime Error for Beginner
Hi, I am a beginner of Fortran. Recently I try to use a fortran code for my simulation. But it always shows me the following error when execute the program: At line 18 of the file sous.f (unit =11, file = 'fluid'), fortran runtime error, End of file, Error termination. Backtrace: could not print...- USTCkong
- Thread
- Error Fortran Gfortran Runtime
- Replies: 17
- Forum: Programming and Computer Science
-
B
Python Second programming language to get under the belt: python vs C
Hello everybody, I am a master student in Theoretical Chemistry and I am working in the DFT realm. Both TDDFT and DFT applied to extended systems (eg. using QUANTUM ESPRESSO). Of course I work with these softwares from a end-user point of view, not as a developer. But anyway, even if some of...- Barbradipo
- Thread
- Belt C++ Choice Dft Fortran Language Programming Python
- Replies: 9
- Forum: Programming and Computer Science
-
Fortran Fortran Tutorials: Learn FORTRAN Easily
Does anyone know any FORTRAN didactic tutorial?- Purahei
- Thread
- Fortran Tutorials
- Replies: 4
- Forum: Programming and Computer Science
-
Fortran Discrete Element Method in FORTRAN 90 for collisions of particles
Does anyone know a simple implementation in FORTRAN 90 of collisions of particles?- Purahei
- Thread
- Collisions Discrete Element Fortran Method Particles
- Replies: 13
- Forum: Programming and Computer Science
-
Comp Sci Multiplication of two 2x2 matrices in Fortran
I have tried to do this using arrays and do loops: program matrixmul implicit none real A(2, 2), B (2, 2), C (2, 2) integer i, j, k write (*, *) 'Input: First matrix' do i = 1, 2 do j = 1, 2 read (*, *) A (i, j) enddo enddo write (*, *) 'Input: Second...- Parzeevahl
- Thread
- Fortran Matrices Matrix Multiplication
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
K
I'm getting garbage values while reading matrices from a file
Hi All, While trying to read a matrix from data file using fortran90 code ,I get garbage values and a backtrace error. Error termination. Backtrace: #0 0x7f4a4de3631a #1 0x7f4a4de36ec5 #2 0x7f4a4de3768d #3 0x7f4a4dfa4d42 #4 0x7f4a4dfa6ad5 #5 0x7f4a4dfa80f9 #6 0x56040bbeae57 #7...- kranthi4689
- Thread
- File Fortran Fortran90 Matrices Reading
- Replies: 12
- Forum: Programming and Computer Science
-
S
Fortran Generate a circle in FORTRAN having polar coordinates
Say "I have grid in polar coordinates (r, theta). How do I plot it in tecplot. Tecplot plots it in cartesian coordinates."- sharmaN
- Thread
- Circle Coordinates Fortran Polar Polar coordinates
- Replies: 6
- Forum: Programming and Computer Science
-
K
Fortran Runtime error while reading file in fortran90
I'm new to fortran coding and trying to read a file called "data.dat" with data like a triangular matrix 0.1 0.1 0.2 0.1 0.2 0.3 0.1 0.2 0.3 0.4 0.1 0.2 0.3 0.4 0.5 using the code PROGRAM matrix IMPLICIT NONE REAL, DIMENSION(5,5) :: a INTEGER :: row,col,max_rows,max_cols max_rows=5...- kranthi4689
- Thread
- Error File Fortran Fortran90 Reading Runtime
- Replies: 5
- Forum: Programming and Computer Science
-
Fortran Help with fortran numerical precision
Hello. I need help to understand why my code is not giving me double numerical precision. In this piece of code, I create a function that is analytically normalized, but when I calculate the numerical normalization factor, it seems to be with single precision. Here it is: program dyna...- Cayo
- Thread
- Fortran Numerical Precision
- Replies: 4
- Forum: Programming and Computer Science
-
R
Fortran Reading a specific column from .csv into fortran
Hi, I am using fortran to read specific columns from a .csv file. the rows in each columns are different, so I wish to read columns wise with a do loop. say, I wish to read from A1 to D20 initially(4 columns of 20 rows), then later f1 to h35 (3 columns, 35 rows). how do I read particular columns...- rajith
- Thread
- Column Csv Fortran Reading Specific
- Replies: 2
- Forum: Programming and Computer Science
-
K
Fortran How do I find an exact line from a large file in fortran90
I'm new to prorgramming . I have been working with Fortran90 for my physics project and I have to read data from a file. I need to find a specific matrix and then print the said matrix onto a different file and diagonalize it. How do I read the matrix that follows a specific line from a file ...- kranthi4689
- Thread
- File Fortran Fortran90 Line Strings
- Replies: 16
- Forum: Programming and Computer Science
-
Fortran Calling a subroutine in Fortran 77
I am calling a fortran 77 subroutine in a fortran 90 code and the results i am getting are wrong as confirmed from matlab. Can anybody please let me know where is the problem? do isss=1,5 do ig=1,10 dat0=dat(:,ig,isss) do iss=1,5 if...- vjvaibhu
- Thread
- Fortran Subroutine
- Replies: 3
- Forum: Programming and Computer Science
-
Fortran Need to do a multitask program in Fortran 95
Hi everyone, I am new programming in Fortran and Inhave done about three or four programs that solves different problems in trigonometry, one is the basic one it gives you hypotenuse upon two sides, the other finds the theta angle by giving hypotenuse and opposite side, other find hypotenuse by...- Ottodomus
- Thread
- Fortran Fortran95 Program Programming
- Replies: 16
- Forum: Programming and Computer Science
-
Fortran Fortran: Array Syntax Explained
Well, I'm trying to move a bit into modern Fortran, and I am more used to Fortran77 syntax. So, for example, when I wanted to make an array whose two of its components equal another array of another dimension, I used to do something like this: do k=1,N do j=1,N do i=1,N...- Telemachus
- Thread
- Array Fortran
- Replies: 20
- Forum: Programming and Computer Science
-
J
Comp Sci Help with solving first order ODE using a simple Fortran code, please
I am trying to solve the following first order ODE using a simple Fortran code : $$ ds/dt=k_i * \sqrt{v}$$ where both (ki) and (v) are variables depending on (h) as follows $$ k_i=\sqrt{χ/h^2}$$ $$v= \mu h$$ where (μ) and (χ) are constants. (the arbitrary values of each of them can be seen...- joseph2015
- Thread
- Code First order Fortran Ode
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
B
Comp Sci Dynamic Link Library, Compaq Visual Fortran 6.6 & Module
Dear Forum Members, I need to create and use dynamic-link library (DLL) for Fortran application using Compaq Visual Fortran 6.6. The following code works just fine: ########################################### PROGRAM AMAIN1 IMPLICIT NONE REAL(8):: A,B,S A = 1D0 B = 2D0 CALL SUBRO1(A,B,S)...- Bakhbergen
- Thread
- Dynamic Fortran Link module Visual
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
I
Comp Sci Solving Fortran 77 Assignments with XYZ: Reading & Calculating Values
Hey guys, new here and was hoping for some help. Basically I have to use Fortran 77 to complete some questions for an assignment The first thing to do is, read a bunch of numbers in a list format and then use these numbers to be entered within an equation. The values I have are listed in a 1...- Ihatefortran
- Thread
- Engineering Fortran Fortran77 Nuclear Physics Reading
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
P
Fortran How to Retrieve the Value of MPI_TAG_UB in openmpi/2.1.1 Using Fortran?
Hello, I am trying to get the parameter MPI_TAG_UB for openmpi (I am using version 2.1.1). I know I need to use the routine MPI_COMM_GET_ATTR, but I have no idea how to do that, I never used fortran in my life. Following this link...- pachomba
- Thread
- Fortran
- Replies: 5
- Forum: Programming and Computer Science
-
Fortran How Do You Read and Manipulate Complex Number Data in Fortran?
Hello, I need to read a fortran data with complex numbers and real numbers, the first column is the real numbers, the second and third complex numbers (real, imaginary). I need to read the first 64 lines and then the next 64 lines in separate ways and save in a variable. for example read from...- Raziel13
- Thread
- Complex Complex number Fortran
- Replies: 8
- Forum: Programming and Computer Science
-
S
Fortran FORTRAN 77 IO Error: Troubleshooting with FORCE 2.0
I have a FORTRAN code that is producing no error upon compilation but when I run it, the run aborts with following message "open: illegal unit number apparent state: unit 72 <unnamed> last format: list io lately writing direct formatted external IO This application has requested the Runtime to...- Sujash Bhattacharya
- Thread
- Error Fortran
- Replies: 2
- Forum: Programming and Computer Science
-
Fortran 1D Shallow Water Wave in FORTRAN using LAX WENDROFF Method
Hey everyone, I’m trying to simulate a 1D Shallow Water wave in FORTRAN using the Lax Wendroff Method. The case is fairly simple. I have a wave generator on one end of a water pool and a wall boundary on another. The waves start traveling towards the wall and are ‘reflected off’ the wall. The...- Aun Muhammad
- Thread
- 1d Fortran Method Water Wave
- Replies: 3
- Forum: Programming and Computer Science
-
Fortran Successive Over Relaxation Method in FORTRAN
Hey everyone. I've attached a code I have written in FORTRAN implementing the SOR Method for a 2 D Laplace Equation. Subroutines have been created, grid has been created and initial and BC's applied appropriately. While computing the error of each iteration, I am unable to achieve the desired...- Aun Muhammad
- Thread
- Fortran Method
- Replies: 9
- Forum: Programming and Computer Science
-
Programs Best Way for a Physics Major to Learn Fortran?
A physics major I'm mentoring has been invited to join a theory group that makes heavy use of FORTRAN in their calculations. The student already knows Python and is adept at using it including integrating diff eqs and solving various challenging 1st year physics type problems. This theory...- Dr. Courtney
- Thread
- Fortran Major Physics Physics major
- Replies: 5
- Forum: STEM Academic Advising
-
M
If statement for Monte Carlo integration
Hello, I am writing a program on Fortran to calculate the integral of sin^4(x) between x = 0 and x = π/2. I believe I know how to write the correct code, but I am unsure what the if statement should be for whether or not a point is inside the desired area. Any thoughts? Thanks.- mayankbhargava101
- Thread
- Fortran If statement Integration Monte carlo
- Replies: 1
- Forum: Programming and Computer Science
-
S
C/C++ How to use C++ in studying calculus
How to use C++ in studying calculus I'm having a hard time.- sherlin
- Thread
- C++ Calculus Fortran
- Replies: 7
- Forum: Programming and Computer Science
-
J
Testing my Discrete Fourier Transform program
Homework Statement I've written a program that calculates the discrete Fourier transform of a set of data in FORTRAN 90. To test it, I need to "generate a perfect sine wave of given period, calculate the DFT and write both data and DFT out to file. Plot the result- does it look like what you...- john kly
- Thread
- Discrete Discrete fourier transform Fortran Fourier Fourier transform Gfortran Program Testing Transform
- Replies: 12
- Forum: Advanced Physics Homework Help