13,222 questions
0 votes
1 answer
95 views
Fortran90 doesn't compile with gfortran
I am attempting to compile and run a Fortran 90 program using command line (bash). In the past, when I've run gfortran /path/to/file, a file a.out and a file program_name are created, and I can run ...
2 votes
1 answer
101 views
Does the construct `workshare` work with `do-concurrent`?
I'm one of the developers of the Lumen code: https://www.lumen-code.org/. That is computational code for condensed matter physics simulations. We are replacing FORALL with DO CONCURRENT, since FORALL ...
Advice
0 votes
1 replies
61 views
BLAS speed much worse on one (supposedly heterogenous) compute node
We have a small local compute cluster consisting of 5 compute nodes (all supposedly having the same hardware and software) and a login/storage node. I'm running an in-house Fortran software that uses ...
Best practices
0 votes
4 replies
96 views
Best way to convert a array of char to an array of int8
Assume that I read an array of char from any source and I want to convert it into an array of int8. What is the best way to do it. Here I have two propositions, but may be there is another more suited ...
1 vote
1 answer
86 views
Type-bound procedure for parameterized derived type
Could you tell me how to write type-bound procedures for parameterized types? For example: module parameters type :: sinx (kind) integer, kind :: kind=4 real(kind) :: x contains procedure,...
0 votes
1 answer
77 views
normalization in FFTW3
I am trying to use FFTw3 in Visual Studio using the Intel Fortran compiler. I am confused about normalization. I have setup a r2r spectral to grid plan for sinx siny components. ...
0 votes
0 answers
81 views
Evaluating pre-trained random forest in Fortran
I have a trained random forest regressor from scikit-learn: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html I then want to make use of (but not train ...
0 votes
1 answer
108 views
Fortran: “Type mismatch in argument ‘iwk’; passed REAL(8) to INTEGER(4)” when compiling opkda1.f in pyradex/myradex
I’m trying to compile myradex (a Fortran-based molecular excitation code, part of the pyradex package) using gfortran on macOS. During compilation, I get this kind of error: opkda1.f:1309:72: 1309 | ...
1 vote
0 answers
83 views
Neovim LSP new syntax not working for fortls and texlab
I've been changing neovim LSP config notation from the old require('lspconfig').name.setup({}) (deprecated) to vim.lsp.config(name, {}). This has worked fine for pyright and clangd, but does not work ...
0 votes
0 answers
40 views
blocking display when called in function called in a display [duplicate]
I run the following code compiled with gfortran program blocking implicit none print *, disp_len("haha") contains function disp_len(x) character(*) :: x integer :: ...
0 votes
0 answers
89 views
library handle in fortran
I have a fortran dll/so which needs to know its own programhandle. On windows, I can obtain the handle from the DLLMain routine: integer(4) function DllMain(hInst, ul_reason_being_called, lpReserved) ...
3 votes
2 answers
162 views
OpenMP tasks not working in a Fortran code with asymmetric loads
I am optimising a code already parallelised but not very optimised because of the very different duration of operations among the threads, even though all threads have a similar task to do. So I ...
0 votes
0 answers
69 views
Segmentation fault in Fortran OpenMP+OpenACC hybrid parallelization
I'm working on porting the CAMB (Cosmological Boltzmann code) to run with hybrid CPU+GPU parallelization using OpenMP and OpenACC with NVIDIA HPC SDK compilers. The code works perfectly when compiled ...
1 vote
1 answer
124 views
Different result when passing an entry and the same entry which is inside a matrix in Fortran
The TLDR: I have a Fortran function, shiftxe_pos that acts on an element fe(i,j,:,:) with integer, parameter :: dp = kind(1.0d0) integer, parameter :: nx integer, parameter :: nv ...
3 votes
1 answer
131 views
Optional dummy argument of a subroutine: I need to pass to an object of the base type instead of any derived type from this base type
I have a toy project about designing a very simplified exception system in Fortran that imitates Python's exceptions. Until now, it appears to work, but I stumbled upon an inconvenience. I must say ...