The solution is to not use the same dummy argument name in both procedures. Automatic arrays, allocatable arrays, and pointers. Automatic arrays are automatically created on entry and deleted on exit from a procedure, and they are safest and easiest to use. Allocatable arrays require the user to manually create and delete them, and should only be used if automatic creation and deletion is not the desired behavior. Pointers are the most error prone and should only be used when allocatable arrays are not possible, e.g., when one desires an array to be a component of a derived type.
Many people think that the status of a pointer which has never been associated is .not.
This is false. When a pointer is declared its status is undefined, and cannot be safely queried with the associated intrinsic. A second variable is introduced to nullify the pointer on first entry so that its status can be safely tested. This is not a problem in Fortran 95 which allows one to nullify a pointer on declaration. We recommend that the save attribute should always be used when pointers and allocatable arrays are allocated in procedures.