I have tried this, but it has no effect. The problem occurs at the same line in the code. Furthermore this could be no solution, because if the variables are correctly implemented in a serial version of the code, there should be no changes in the OpenMP code version. If I have to check all the variables, parallelization would be very difficult, becuase the code has more than 50.000 lines and more than 500 variables.
If it is helpful, I could submit the complete code.
The -openmp option should make local arrays dynamic, even if they were not already automatic (in the standard Fortran sense) by definition, so the lack of change is to be expected. The problem usually cited with Fortran automatic arrays is the lack of error diagnosis. Supposing the allocation fails, which might happen simply because the stack size limit is reached at this point, you don't have a satisfactory way to catch it. Hence the usual recommendation for ALLOCATABLE arrays with STAT= checking. This would apply equally to the serial version, but the OpenMP version will consume more stack.