Fortran90 Definition and 51 Threads
-
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
-
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
-
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
-
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 Interface between a Fortran77 program and a Fortran90 program
Hi all, I'm new to Fortran programming, so I might probably ask some really trivial questions - please forgive me. I have two source codes of big programs. One is coded in Fortran77 and the other one in Fortran90. Now, I need to build an interface so that the Fortran90 program can call some...- davidfur
- Thread
- Fortran77 Fortran90 Interface Program
- Replies: 14
- Forum: Programming and Computer Science
-
G
Fortran Best 3D Animation Software for Numerical Simulation Data
hello everyone, I`m trying to make 3d animation from numerical simulation data. Can someone recommend good software for me Thanks in advance- grecko94
- Thread
- 3d Animation Fortran90 Program
- Replies: 1
- Forum: Programming and Computer Science
-
Y
Fortran How to use Real Array Index in Matrix dimension?
I am developing a FORTRAN code (.f90) which "ll calculate some matrix in some time interval (dt1=0.001) and these matrices have to be integrated in some time steps (dt=0.1). Though I am experience in FORTRAN 77, new to FORTRAN 90. I am unable to make dimension of matrix real (I think that is the...- yuvan
- Thread
- Array Dimension Fortran90 Gfortran Index Matrix Ubuntu
- Replies: 21
- Forum: Programming and Computer Science
-
A
New member and enthusiast to share my experience and learn
hello all i am a new member on Physics Forum i am a last year master student in fundamental physics ( again ) and also have done a master in condense mater and nano-science i worked on noble solid /amorphous interface in my first master internship ( DFT and ab initio molecular dynamic using...- aymalmknn
- Thread
- Condensed matter Density functional theory Fortran90 Python
- Replies: 1
- Forum: New Member Introductions
-
Comp Sci Read specific lines from a file using fortran90
Homework Statement I want to read only specific lines from a file using fortran code. Homework Equations Fortran code The Attempt at a Solution I have a dummy.txt file wrote 7 5 6 4 5 6 9 10 14 19 I want read only values between lines 5 to lines10. But when I use print statement, the value...- shyvir3108
- Thread
- File Fortran90 Lines Specific
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
Y
FORTRAN 90 How to plot the Poincaré section?
Hi all, I'm writing a fortran 90 program to simulate the Duffing oscillator. I have it working and have produced a cos wave which I expected for D (the driving force) being set to 0. Here's the code: program rungekutta implicit none integer, parameter :: dp = selected_real_kind(15,300)...- youngfreedman
- Thread
- Fortran Fortran90 Gfortran Plot Poincare Section
- Replies: 1
- Forum: Advanced Physics Homework Help
-
G
Fortran Simulating Contact Force in a Moving Dashpot System Using FORTRAN
Hi there I am really new into programiing thing, and I am trying to make program of this problem usin FORTRAN I want the output to be Time,poisiton,velocity and contact force and i already know = amplitude U = velocity of the car d = rail distance and so far this is my program...- grecko94
- Thread
- Damped Fortran90 Simulation Spring
- Replies: 26
- Forum: Programming and Computer Science
-
Y
Fortran Program that reads data from a file and calculates the mean?
Hi everyone. I'm trying to write a program that reads data from 2 files and then calculates the mean, standard deviation and standard error of both files (separate values for each). I'm struggling to get my head around simple I/O, so excuse the poor attempt, but this is what I have so far: (I'm...- youngfreedman
- Thread
- Data File Fortran Fortran90 Gfortran Mean Program
- Replies: 5
- Forum: Programming and Computer Science
-
Fortran How to Read Specific Data from a Fortran Table File?
Hello I am very new to programming and fortran. I have a text file formatted the following way: Name Peter John Sally Joseph Luke Vader etc... age XXXX XXXX XXXX XXXX XXXX XXXX XXXX height XXXX XXXX XXXX XXXX XXXX XXXX XXXX weigh...- Arez
- Thread
- Data File Fortran Fortran90 Reading Table
- Replies: 2
- Forum: Programming and Computer Science
-
J
Fortran Problems when averaging a value
Hi, I am running a fortran 90 program and I have some problems when getting an average. It happens that at some point the value of suma2 is not updated, even when the value of the term s(fixed2(j))/real(nfixed) is not zero. Below is the output of fort.32. The problem dissapears when suma2 is...- jbenet
- Thread
- Fortran90 Programming Value
- Replies: 4
- Forum: Programming and Computer Science
-
I
MATLAB Transforming part of matlab code to Fortran90
Here are my Fortran codes: program test implicitnone integer*4 nxProjPad, cf, numViews, cc, index, indRad, iv, i, INDEX1, d, n real*4 v4, v5, RSS, S1, F1, gMDL real*4, dimension(:), allocatable :: array, sum, cumsum, transpose, log, SS1, SSs nxProjPad=185 numViews=180...- i_a_n
- Thread
- Array Code Fortran90 Functions Matlab Matlab code Variable
- Replies: 8
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
H
Comp Sci Fortran90 SIGSEGV: Segmentation fault
Hi, I have a project for a class in numerics, where I have to write a program with FORTRAN 90 that calculates the determinant of a matrix using Laplace. The program itself works now, but I have added a function that finds the row/column with most zeroes and reorganizes the matrix, so that they...- Ha1234
- Thread
- Fault Fortran Fortran90
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
Fortran How to Handle Floating Point Errors in Fortran90 Real Number Calculations
Hello guys I am trying to write a code which is below; But my results seems to be fairly wrong. I noticed some of my real numbers are not what I assigned them. For example Ks shows on the watch window as 9.9999999E-5. How can I fix such situation? program hw1 REAL:: G,DVIS,Ks...- abdulsulo
- Thread
- Fortran90 Numbers Real numbers
- Replies: 9
- Forum: Programming and Computer Science
-
Fortran Why Does My Fortran Code Give an Unclassifiable Statement Error?
Hey so I'm getting the error message: Euler_Method.f90:43.1: fun=(c)(1-c)/(d+2) 1 Error: Unclassifiable statement at (1) And here is my code: PROGRAM Euler_Method !------------------------------------------------------------------- ! The purpose of this program is to read in endpoints...- gabforse
- Thread
- Desperate Error Figure Fortran Fortran90
- Replies: 3
- Forum: Programming and Computer Science
-
G
Fortran Solving Function Problem in Code Exchange
Hello I am trying to exchange following code into two functions which I will need to use in further programs. The code is as follows: do i=0,k do j=0,k if (i/=j) then lj(i)=lj(i)*((xx-x(i))/(x(j)-x(i))) end if enddo l(i)=l(i)+y(i)*lj(i) write(2,*) x(i),y(i),l(i) enddo I would...- Galizius
- Thread
- Fortran Fortran90 Function Gcc
- Replies: 8
- Forum: Programming and Computer Science
-
G
Fortran [Fortran] How to loss different random number
Hello I am wondering how can I make sure that every number which I am losing will be different? I am using the following code: program lottery implicit none real(kind=4) :: x real(kind=8) :: y integer :: i, seed= 64256 call srand(seed) do i=1,6 x=rand() ! to make the lossing interval...- Galizius
- Thread
- Fortran Fortran90 Gcc Loss Random Random number
- Replies: 2
- Forum: Programming and Computer Science
-
G
Fortran [Fortran] Filon's method Fourier Transform
I was told to do a Fourier transform of function by using a Filon's method. I have found the code but I don't know how to include any function to the subroutine. I would be grateful for any example of how to use this code. SUBROUTINE FILONC ( DT, DOM, NMAX, C, CHAT ) C...- Galizius
- Thread
- Fortran Fortran77 Fortran90 Fourier Fourier transform Gcc Gfortran Method Transform
- Replies: 6
- Forum: Programming and Computer Science
-
G
Fortran Why Isn't My Fortran Bisection Code Finding the Root?
Hello, I was told to find the root of an integrand with using the bisection method. I am kind of new to such a stuff so I am kind of confused why I am not getting the expected result. Here is my bisection code: tl=3.0 tup=4.0 tempred=0.0 s=-0.234726128709272990292 do while (abs(total_calka)...- Galizius
- Thread
- Formula Fortran Fortran90 Gcc
- Replies: 6
- Forum: Programming and Computer Science
-
Fortran Fortran 90 Program Factorial: Fixing Incorrect Output
program factorial implicit none integer::fact,i,n print*,'enter the value of n' read*,n fact=1 do i=1,n fact=fact*i end do print*,'factorial is ',fact end program when input n largest number then answer is incorrect. how to solve- Md. Abde Mannaf
- Thread
- Factorial Factorials Fortran Fortran90 Programming
- Replies: 5
- Forum: Programming and Computer Science
-
Fortran Combination is not working correctly -- fortran 90
!subprogram for combination !Author:: mannaf function fact(n) implicit none integer ::fact,n,i fact=1 do i=1,n fact=fact*i end do return end program comb implicit none integer ::fact,n,r,combination print*,'enter the value of nCr' read*,n,r...- Md. Abde Mannaf
- Thread
- Combination Fortran Fortran90
- Replies: 6
- Forum: Programming and Computer Science
-
L
Fortran Can complex numbers be used in Fortran array constructors?
Hi, so I need to write a fortran code with 2, 2x2 matrices. These matrices are in the form of B=(1 exp(i)(theta) 0 0) and D=(0 0 exp(i)(theta) 1) where i is sqrt of -1 and theta is an angle between 0 and 2pi. I've expanded the exponential so it reads cos(theta)+isin(theta) and let theta=pi/2...- Lukejambo
- Thread
- Complex Complex exponential Exponential Fortran Fortran90 Fortran95
- Replies: 5
- Forum: Programming and Computer Science
-
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
-
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
-
I
Fortran Fortran90 issue: nonzero out of bounds array elements
Hi to all. I am programing a new code for some calculation and i have detected a strange issue. I have my all arrays strictly defined for example real, dimension(-2:2,-3:2) A, B complex, dimension(-2:2,1:2) C In my time dependend calculations i expect the matrix element C(-2,1) to...- ilvreth
- Thread
- Array Bounds Elements Fortran90
- Replies: 3
- Forum: Programming and Computer Science
-
2
Comp Sci [fortran90] cartesian to polar coordinate
Write a short FORTRAN90 subroutine to convert Cartesian coordinates (x, y, z) to spherical polar coordinates (r, q, f) using • Write a FORTRAN90 program which uses this subroutine to convert the following (x, y, z) coordinates which are read from a text file and stored within a single vector...- 2000yak
- Thread
- Cartesian Coordinate Fortran90 Polar
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
S
Fortran [fortran90] arrange value in row into column
I have a data file, let's say test.dat which is contain [1 2 3 4 5 6 7...3000]. the question is how can I re-arrange this data from a row into a column so that I will have a set of data like this 1 2 3 4 5 6 7 . . . 3000 in fortran90 or MATLAB also will be okay. thank you- s_hy
- Thread
- Column Fortran90 Row Value
- Replies: 2
- Forum: Programming and Computer Science
-
S
Fortran [Fortran90] how to write increment in dimension
hi all, i am new with fortran 90. i have here codes for 2d fdtd polar coordinates. but i have problem handling with increment in dimension in real number (as higlighted below). I have googled how to write the increment in do loops, but do loops only applicable for integer. can anyone help me...- s_hy
- Thread
- Dimension Fortran90
- Replies: 4
- Forum: Programming and Computer Science
-
S
Fortran [Fortran90] fdtd in polar coordinates, got infinity output
hi all, attached here is my code for 2d fdtd in polar coordinates, from 'numerical electromagnetic: the fdtd method (umran s inan, pg 94-96) written in fortran90. I have try a few approach I could think about to troubleshoot this code but the output is still infinity. Anybody here can give me...- s_hy
- Thread
- Coordinates Fdtd Fortran90 Infinity Output Polar Polar coordinates
- Replies: 3
- Forum: Programming and Computer Science
-
S
Fortran [fortran90] having problem to call back the value from previous loop
hi all, I wrote programming code for fdtd 2d tfsf in fortran 90 as below: !simulation for tmz mode incident plane in 2d subroutine tfsf2d implicit none double precision :: f0,miu,eps,delta,S,c,lambda,E0,N0 double precision :: deltat integer...- s_hy
- Thread
- Fortran90 Loop Value
- Replies: 5
- Forum: Programming and Computer Science
-
Fortran Fortran90 problem, runtime error
Hello, I've been playing around with some code (as shown below) and for some reason everytime i run this code I am told: At line 11 of file tester.f90 Fortran runtime error: End of file I'm not really sure what's causing it, is it the position of my Open file? Any help would be much...- Saxby
- Thread
- Error Fortran90 Runtime
- Replies: 1
- Forum: Programming and Computer Science
-
S
Fortran [fortran90] have problem in real array index
hi all...i have problem in understanding in array index. my codes are as below subroutine tmz2d implicit none double precision :: phi double precision :: cosphi,sinphi double precision :: d,dp,dpp,d1,d2 integer...- s_hy
- Thread
- Array Fortran90 Index
- Replies: 3
- Forum: Programming and Computer Science
-
J
Fortran Newton Raphson Method on Fortran90
Here's what I need to do: "Compare the effectiveness of the bisection method and Newton’s method for the equation x^3−2x−2 = 0 which has a single root between x=−4 and x = 2."So far I've done ok. this is working but of course I need to do iteration which I don't know how. Can someone teach me...- jhosamelly
- Thread
- Fortran90 Method Newton
- Replies: 3
- Forum: Programming and Computer Science
-
G
Fortran How can I change the starting index of an array in Fortran?
I'm try to read some files in subdirectories and create some other files in my present location: program multiread ! implicit none !variables integer :: n, k, i integer :: j, m2 real(8) :: pratio, crap, rmsttv character(len=42) :: filein(98) character(len=10) :: fileout(14)...- Giammy85
- Thread
- Fault Fortran90
- Replies: 4
- Forum: Programming and Computer Science
-
S
Fortran [Fortran90] how to write several output into one file
hi all, Currently I am doing 2d fdtd (TMz mode) modeling. I expect to have output for Ez, Hx and Hy in one file, which is mean that the output will be in 3 column. But I don't have any idea how format it. Anyone can help me? Below is the code !problem 3.9, Taflove chapter 3 !to model 2d...- s_hy
- Thread
- File Fortran90 Output
- Replies: 3
- Forum: Programming and Computer Science
-
A
Fortran Fortran90: Subroutine DSYEV and associating eigenvalues and eigenvectors.
Greetings. I am using the LAPACK (Linear Algebra Package) software package to find the eigenvalues and eigenvectors of a large symmetrical real matrix. Specifically, I calculate a scalar from each eigenvector, and I want to graph it against its associated eigenvalue. I am using the subroutine...- Animastryfe
- Thread
- Eigenvalues Eigenvectors Fortran90 Subroutine
- Replies: 3
- Forum: Programming and Computer Science
-
V
Fortran Need help for error in Fortran90
Hi everyone, I'm a student and I'm new in this language but I have to run a fortran90 code for my advisor. However, there is some error as provide below (I got the completed code to run for the results, which means that it doesn't suppose to have any error - but it's quite old. I run it on...- VSan
- Thread
- Error Fortran90
- Replies: 6
- Forum: Programming and Computer Science
-
Fortran How does the Fortran90 function floor not have a main type?
I'm running Fortran 90 with the ifort compiler. As far as I can tell, floor is a function introduced in Fortran 90- Simfish
- Thread
- Fortran90 Function Type
- Replies: 6
- Forum: Programming and Computer Science
-
N
Fortran Help with Fortran90: Reading a File
Hi All I have a problem in the work with Fortran90. I have a file that don't have any idea for read it. It consiste of number and character.For example it includes as below 1 15193r 8 9r 4 6 74r,... I want to write these numbers in 2 columns. For example 1 15193 8 9 4 0 6 74 terms...- ne_237
- Thread
- Fortran90
- Replies: 7
- Forum: Programming and Computer Science
-
R
Fortran Fortran90 reading in a formatted input file
Hi All, Let me preface by saying this is my first post, but I'm very glad to have found and joined what looks like a great community here. Also I have no Fortran experience, so please bear with my greenness: I'm trying to resurrect and use a code written by another engineer in our...- Rowdy5000
- Thread
- File Fortran90 Input Reading
- Replies: 11
- Forum: Programming and Computer Science
-
T
Fortran Fortran90: Reading Mixed-Type Input File
Hi everyone, I am kind of new in fortran90 and I am struggling with writing this basic programme: I have an input file with a fixed format . It looks like this: c 23.345 45.342 34.345 c 12.345 56.235 67.234 c 45.567 44.345 78.345 c 56.567 78.563 97.342 where the first column...- typeon
- Thread
- File Fortran90
- Replies: 5
- Forum: Programming and Computer Science
-
S
Fortran90 How to take the power of elements of an array to, say, 5?
Hi all, as title, how to take the power of elements of an array to, say, 5? I know how to do it using loops, but would it be very troublesome if I have to do it a thousand times? Any ready made function in fortran90? I hope there is... I have googled it quite a bit, but seems nothing useful.- stevenphy2
- Thread
- Array Elements Fortran90 Power
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
S
Fortran Improving Performance with MPI in Fortran90
I'm just starting to use MPI in Fortran90 and have some questions on improving performance. At the start of a calculation, I run a stage to distribute all required data to the slave nodes. This is a one-off step, but seems to be taking a long time. The code running on the master node...- SFA10
- Thread
- Fortran90 performance
- Replies: 2
- Forum: Programming and Computer Science
-
A
Fortran How Can Fortran 90 Ensure External Executable Completion Before Proceeding?
Hello! I’m programming in Fortran 90 using Force, version 3.0.0. beta2 compiler. The program calls an executable external file with the instruction call system (‘name of file’). This executable file calculates the estimation variance of a set of data and automatically generates an output txt...- andredoc
- Thread
- Fortran90
- Replies: 5
- Forum: Programming and Computer Science
-
C
Fortran What Fortran90 Compiler Should I Use for Linux?
Hi folks, I'm using Mandriva 2008 for some time and I now have to compile a program using fortran compiler. I've installed gcc f95 compiler and Intel FC but the compiling gives error when I use ifort myfile.f and g95 myfile.f In the manual of the program that I'll compile with fortran...- carbon9
- Thread
- Compiler Fortran90 Linux
- Replies: 1
- Forum: Programming and Computer Science
-
M
C/C++ Fortran90 vs C vs C++: not a troll
Fortran90 vs C vs C++: not a troll! Ahhh, yes, the perennial debate that leads inevitably to broken bottles and fisticuffs. I'm being quite sincere here, though, although I'm sure the end of the thread may be ignoble. What I'm wondering is this: --->> What are the ADVANTAGES of Fortran90/95...- mrentropy
- Thread
- Fortran90
- Replies: 2
- Forum: Programming and Computer Science
-
D
Fortran Interactive file naming for naming multiple files in fortran90
I am looking for a way to create the files with names name according to value of variable in a loop. For example (not actual code): do i=1,11 open(10,file=name 'i'//".txt") ... ... enddo where 11 files with names: name1.txt, name2.txt...name11.txt will be created with the content. Do you...- dealove
- Thread
- File files Fortran90 Multiple
- Replies: 2
- Forum: Programming and Computer Science