Comments (4)
@RobertPincus The NAG compiler is exactly following the Fortran standard. You can change meanwhile some other compilers to behave similar (comply with the standard).
However, we do need a solution for the given problem: What about assumed shape/size arrays as arguments? If one defines those as pointer and uses nullify and associated, you could mimic the optional/'present' - the array bounds can be set as local variables at the beginning of the executable statements section via the size intrinsic or ubound.
Another option would be a BIND(C) container type containing the respective arrays. Just some unspecific thinking.
from rte-rrtmgp.
Apparently optional arguments are C++ compatible under Fortran 2018, but I guess you need Fortran 2008 compatibility?
from rte-rrtmgp.
@m214089 Agreed that the NAG behavior is the Fortran standard.
@peterukk We could consider to update the standard although 2018 might not yet be supported by many compilers.
The tension, it seems, is between Fortran performance, C compatibility, and flexibility. Fortran performance is best with explicit arrays (assumed-size?); C bindings (important for interoperability of kernels and front-ends) mean no optional arguments and assumed-size arrays (not assumed size, @m214089). I tried having different kernels e.g. for broadband and spectrally-detailed fluxes but a) this leads to lots of repeated code, and b) there are multiple permutations (e.g. Jacobians x broadband/spectral).
Keep the ideas coming.
from rte-rrtmgp.
In commit 3b5d157 on the main
branch we resolved this issue by allocating space for all output argument, even if they are not used. This lets the code conform to the Fortran standard for assumed-size array arguments, as noted by @m214089. It means that the memory footprint can't be reduced - but at least memory traffic can be made smaller.
from rte-rrtmgp.
Related Issues (20)
- gpt_Jac optional arguement code may be incorrect for OpenMP offload HOT 2
- Units in cloud optics extension? HOT 3
- RFMIP clear sky test failing with forcing index != 1 HOT 1
- A flexible benchmarking program HOT 4
- Small bug in mo_gas_optics_rrtmgp.F90 HOT 1
- Potential indexing error rte/kernels-openacc/mo_rte_solver_kernels.F90 HOT 2
- Optimized compiler flags for PGI incorrect HOT 3
- RRTMGP and Single Precision HOT 11
- Generic names in C bindings HOT 1
- Intel Compiler Optimization Problem on AMD EPYC ( Milan ) HOT 10
- Request for data files names to use ISO dates HOT 2
- Memory layout in gas optics kernels HOT 2
- Macro name in build system HOT 2
- Testing OpenMP GPU offload with Intel OneAPI compilers HOT 3
- Data external to code repo? HOT 15
- Inconsistent RRTMGP results on CPU with different code paths HOT 23
- Removing dtc/ccpp branch HOT 6
- Bug in rrtmgp/kernels/mo_gas_optics_kernels.F90 HOT 5
- RTE shortwave kernel not vectorizing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rte-rrtmgp.