Is it possible to assign the size and values of a common array in a subroutine, and then use it from other program subroutines?
The following program does not work, but I want to do something like this:
main.f
program main integer n integer, allocatable :: co(:) common n, co call assign print *, co(1), co(2) deallocate(co) stop end program main
assign.f
subroutine assign integer n integer, allocatable :: co(:) common n, co n = 2 allocate(co(n)) co(1) = 1 co(2) = 2 return end subroutine assign
No. You can put pointers in a generic, but not allocatables.
, , , - , , , . , , , .
( allocatables , , allocatable, - . , , ( ), allocatable. , , - , , , , - , , .)
Allocatables F90. , - , . , .
Source: https://habr.com/ru/post/1541354/More articles:Confused by dispatcher and asynchronous - multithreadingrpois generates NA with large funds (lambda) in R - lambdaHow to check for closing anonymous function in Chrome - javascriptСуществует ли различие в памяти между использованием общих блоков и модулей в Fortran 90 - moduleHow to connect a stream using pdfkit using node js - node.jsHow to enable grunt-contrib-connect to allow POST, PUT, DELETE methods for static files? - gruntjsHow to get "this" from a callback in Dart: js - dartPython command line flags - pythonSpring 4, Hibernate JPA JarInputStreamBasedArchiveDescriptor Error in Websphere 8.5.5 - springWhat is the standard HW test technique when there are cases where RTL and Goldenmodel can produce different but correct results? - verilogAll Articles