fortran Questions
4
I am trying to track the memory usage and cpu time of a subroutine in a Fortran 90 program. To track the track the cpu time, I use the following:
call cpu_time(tic)
call subroutine(args)
call cpu_...
5
Solved
Is it about performance, clean source code, compilers, ...? I know that many compilers allow longer single-line codes. But, if this extension is possible without any compromise, then why does Fortr...
Singapore asked 8/7, 2017 at 19:39
5
Is there a way to control the case of symbols emitted by GNU Fortran 4.8?
Older versions (such as 3.4) had -fcase-lower, -fcase-preserve and -fcase-upper to force lower case, the case used in the ...
2
I want to send 2d chunks of data using MPI_GATHER. For example: I have 2x3 arrays on each node and I want 8x3 array on root, if I have 4 nodes. For 1d arrays, MPI_GATHER sorts data according to MPI...
4
I'm just starting out on Fortran and am confused with the usage of double vs single quotation marks.
Deitz asked 23/6, 2015 at 8:41
7
Solved
In fortran, we can define default arguments. However, if an optional argument is not present, it can also not be set. When using arguments as keyword arguments with default values, this leads to aw...
Mortie asked 9/6, 2016 at 10:55
3
system:
mac osx catalina (10.15.5)
gfortran 9.3.0 (from homebrew)
gdb 9.2 (from homebrew)
went through and followed these instructions:
https://sourceware.org/gdb/wiki/PermissionsDarwin
trying ...
Repartee asked 19/6, 2020 at 16:4
2
Solved
I'm trying to learn Fortran2018 using gfortran.
When playing around with pointers I noticed that there doesn't seem to be a facility to test for nullpointers. So I have two questions:
Is there rea...
Shillong asked 6/5, 2022 at 10:44
4
Solved
Is it possible to set a parameter variable with NaN? and have that in a particular module. I want to use it for initialization of some other variables. Therefore, I'll be faced with a run-time erro...
Jaynajayne asked 12/8, 2015 at 17:32
3
Solved
My problem is the following:
I want to use the idb intel debugger with eclipse to be able to go step by step through my code, much like idb -gui does. I already tried to implement a solution i fou...
Nevanevada asked 30/11, 2010 at 14:52
4
One of the most troublesome issues with Fortran 90 is the lack of namespacing. In this previous question "How do you use Fortran 90 module data" from Pete, it has been discussed the main issue of U...
Ionian asked 6/10, 2010 at 16:10
12
I'm using the OS X devel version of R
R Under development (unstable) (2014-05-27 r65787)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
with GNU Fortran (GCC) 4.2.3 (from Simon's site) and versio...
6
I would like to be able to use a simple configuration file to pass parameters to my program. This configuration file would consist of a list of arguments with values that can be of different ...
Dahlia asked 24/2, 2011 at 3:52
4
Solved
The following code compiles in both GNU gfortran and Intel ifort. But only the gfortran compiled version will run successfully.
program fort_tst
use iso_c_binding
INTEGER, POINTER :: a(:)
TYP...
Burgoyne asked 31/1, 2022 at 8:14
1
Solved
I can't seem to get output from the lfortran jupyter kernel.
I installed via conda install for:
- lfortran
- jupyter
I can run jupyter and select the lfortran kernel. However:
I see no hello wo...
Vachel asked 23/1, 2022 at 19:3
9
Solved
I am getting a strange error when trying to compile a simple fortran-90 file using gfortran. I am working on a macOS mojave system. I have gfortran 8.2.0 installed and I checked to be sure of this ...
4
Solved
I am wanting to mask a Fortran array. Here's the way I am currently doing it...
where (my_array <=15.0)
mask_array = 1
elsewhere
mask_array = 0
end where
So then I get my masked array with:...
1
I have 3 allocatable 1D arrays in a Fortran routine, VX(:), VY(:), VZ(:), all with the same size.
I need to aggregate them in a 2D array named VARXYZ and send it to a routine that modifies the 'mat...
Engraving asked 1/1, 2022 at 9:54
2
Solved
I am trying to compile a big solver using a makefile. When typing make, the following command gets executed:
mpif90 -O2 -fpp -I/somePath/ -c precision.F90
I get the following error:
gfortran: e...
Luckless asked 1/9, 2015 at 15:30
3
In Fortran, is there a way to determine the type of a variable?
A possible use case where the type of a variable would be needed is the following. We pass a variable's type as an argument to a fu...
2
Solved
I would like to produce the same random number sequence in both a program written in C and Fortran. I am using gcc version 10.3.0 within Windows Subsystem for Linux (Win10) running Ubuntu 20.04 LTS...
2
Solved
What argument type should I use in C when calling a Fortran function that takes logical arguments, specifically with gfortran? Where is this documented for gfortran?
Here's an example program that ...
7
I have seen /* block comment */ for block commenting in C++. I know I can do line commenting by using ! or c, but is there any option for block commenting in Fortran?
1
Solved
A Fortran code I am working on has several lines similar to
WRITE(filename, '(A16,"_",I4,".dat")') filename, indx
This code has been successfully compiled and run literally hun...
Claudette asked 28/10, 2021 at 20:12
2
Solved
In Fortran, is it possible to define a function which returns multiple values like below?
[a, b] = myfunc(x, y)
© 2022 - 2025 — McMap. All rights reserved.