Hello,
This file has certainly never been compiled, you have the declaration of ALREADY and the data in the middle of executable commands... or is it that a compiler accepts this ?
Anyway another reason for memory leaks is your automatic arrays :
CN1(MESH%NPOIN) and ZF(MESH%NPOIN), these also trigger an allocation at every call and automatic arrays are not accepted in standard Fortran, the problem is that some compilers do it and don't manage it well, so again you can allocate them only once or give them a hardcoded size.
With best regards,
Jean-Michel Hervouet
Jean-Michel Hervouet