fortran Questions
3
How can I print a list of all the files in a given directory using Fortran, limiting only to specific file types... For instance I only want to get the list of '.txt' files from a directory.
Files ...
Lawyer asked 28/11, 2012 at 9:37
2
Solved
Is there a way to set an array (vector, or matrix, or even a scalar) to zero yet in Fortran? 2003/2008 seem to be taking Fortran to a very modern level, and I have to wonder if they have included a...
Okun asked 16/4, 2017 at 2:5
3
I use a Fortran 90 model under Ubuntu 14.04. The gfortran 95 compiler (gfortran 4:4.8.2-1ubuntu6) and the gcc 4:4.8.2-1ubuntu6 are installed by Ubuntu Software Center. After I ran the model I get t...
Margueritamarguerite asked 17/2, 2015 at 8:51
2
I am asking user to give a value at run time to do some calculations.
I want to test if the user entered value is a real/integer number, and if not then give a warning that the program is expecti...
Carry asked 26/8, 2013 at 14:18
2
I am trying to configure a Fortran 2008 project to use CMake; the files in the project have the ".f08" extension. However, I cannot get CMake to work even with a "hello world" example. Here are the...
6
Solved
I have the following code:
program main
character (len=15) :: abc = "te st tex t"
print *, trim(abc)
end program main
Which outputs:
te st tex t
I excepted all the whitespace to be remo...
2
I am using GNU Fortran (GCC) 4.8.2
I want to read allocatable arrays from a namelist.
But I don't know in advance how many elements have to be read into the allocatable array, so I cannot allocate ...
Carline asked 2/12, 2016 at 14:56
2
Solved
Assume I have two Fortran modules called modA and modB. Is there a way to use one or the other in a program based on a conditional statement? Does this require some type of preprocessing? For examp...
Vasileior asked 13/5, 2016 at 21:19
6
Solved
What is the safest way to set a variable to +Infinity in Fortran? At the moment I am using:
program test
implicit none
print *,infinity()
contains
real function infinity()
implicit none
real...
1
The problem
I wish to solve a general system of linear equations A*x=b. The m-by-m matrix is sparse, real, square, somewhat poorly-conditioned, non-symmetric, but it is singular (rank(A)==m-1) bec...
Boelter asked 30/3, 2016 at 19:15
13
I am trying to install an R package from source, but getting an error:
* installing *source* package ‘mclust’ ...
** package ‘mclust’ successfully unpacked and MD5 sums checked
** libs
gfortran-4....
0
I was getting this error:
error while loading shared libraries: libgfortran.so.4: cannot open shared object file: No such file or directory
To resolve this, I searched "libgfortran.so.4"...
Sanctus asked 2/6, 2023 at 9:34
3
Solved
I am trying to define a array of arrays.
I have defined:
integer,dimension(2,2):: &
x=reshape(source= (/0,1,1,0/), shape=(/2,2/)), &
y=reshape(source= (/1,0,0,1/), shape=(/2,2/)), &...
4
Solved
My program is running though 3D array, labelling 'clusters' that it finds and then doing some checks to see if any neighbouring clusters have a label higher than the current cluster. There's a seco...
Windbound asked 5/12, 2011 at 11:11
10
Solved
I have a program in Fortran that saves the results to a file. At the moment I open the file using
OPEN (1, FILE = 'Output.TXT')
However, I now want to run a loop, and save the results of each i...
4
Solved
GCC version 4.6
The Problem: To find a way to feed in parameters to the executable, say a.out, from the command line - more specifically feed in an array of double precision numbers.
Attempt: Usi...
Pullet asked 12/12, 2012 at 16:6
1
Solved
First of all I have no experience coding with fortran. I am trying to run a fortran code with python ctypes. I used the command gfortran -shared -g -o test.so test.f90 to convert my test.f90 file (...
1
Solved
I am studying the possibility to interface Fortran code to be used in Python.
I know of f2py but, since I did not succeed in using it with external libraries (such as lapack), I reverted to use cty...
4
Solved
How does one write a (Intel) F90 function that converts a string into lowercase (or, alternatively, uppercase)? I want to pass a character array to the function and have it return a character array...
4
Solved
I would like to compute the cross product of two vectors in Fortran 90. For example, in words, the cross product of (1, 2, 3) and (4, 5, 6) turns out to be (-3, 6, -3) in Cartesian coordinates. I w...
Urgency asked 28/6, 2011 at 18:58
8
Solved
I find particularly difficult reading binary file with Python. Can you give me a hand?
I need to read this file, which in Fortran 90 is easily read by
int*4 n_particles, n_groups
real*4 group_id(n...
5
Solved
I am writing some simple output in fortran, but I want whitespace delimiters. If use the following statement, however:
format(A20,ES18.8,A12,ES18.8)
I get output like this:
p001t0000 3.49141273...
3
VSCode keeps showing the error notification,
Error launching fortls: Please check that all selected options are supported by your language server version. Source: FORTRAN IntelliSense (Extension)
...
Ugly asked 7/5, 2022 at 14:48
1
Is it legal/valid to access program global variables from an internal subroutine called from an OpenMP task?
ifort 2021.7.0 20220726 doesn't report an error, but appears to produce random results d...
Wavawave asked 30/9, 2022 at 22:13
2
Solved
I'm trying to compile a huge, world-renowned numerical weather prediction code - written mostly in Fortran 90 - that uses cpp extensively, and successfully, with PGI, Intel and gfortran. Now, I've ...
Tamas asked 26/12, 2016 at 19:15
1 Next >
© 2022 - 2024 — McMap. All rights reserved.