How can I introduce an allocatable array which allocate in subroutine?

If I declared “allocatable”, the compiler shows error that: C is a dummy argument so can not be allocatable

In another post you wrote,

I write my code in PLATO as a fortran95.

I think that is the Salford compiler. A feature of Fortran 2003 that was implemented in some but not all Fortran 95 compilers was that dummy arguments can be ALLOCATABLE. In strict Fortran 95 you can get similar functionality by declaring the dummy argument as a POINTER. But it would be better for you to “graduate” to a more modern compiler such as gfortran or Intel Fortran, which are both free. The version of gfortran I use is from equation.com I think most people here are using compilers that support at least the Fortran 2003 standard, if not F2008 or F2018.

1 Like