Fortran ccall variables persisting in the background

There is no separate “Fortran runtime session”. The Fortran code is running in the same process as Julia. It is no different than if you were calling your Fortran code multiple times from other Fortran code. (It is not like launching a separate program.)

The same way as if you were calling your Fortran functions multiple times from Fortran. (It’s hard to say more without seeing the Fortran code that is allocating the cross cvariable that it is complaining about. But presumably you want the deallocate statement in Fortran?)

2 Likes