Dear All
I am debugging my code and I saw a weird message which is shown below.
forrtl: severe (408): fort: (8): Attempt to fetch from allocatable variable G_COARSWRK when it is not allocated
The problem is that I already checked the code and noticed that the variable was allocated as you can see below
output of code :
[0] MPI startup(): Multi-threaded optimized library
[2] MPI startup(): shm data transfer mode
[0] MPI startup(): shm data transfer mode
[1] MPI startup(): shm data transfer mode
[3] MPI startup(): shm data transfer mode
[0] MPI startup(): Rank Pid Node name Pin cpu
[0] MPI startup(): 0 58392 ceft01.grid.fe.up.pt {0,1,2,3,4,5,6,7,32,33,34,35,36,37,38,39}
[0] MPI startup(): 1 58393 ceft01.grid.fe.up.pt {8,9,10,11,12,13,14,15,40,41,42,43,44,45,46,47}
[0] MPI startup(): 2 58394 ceft01.grid.fe.up.pt {16,17,18,19,20,21,22,23,48,49,50,51,52,53,54,55}
[0] MPI startup(): 3 58395 ceft01.grid.fe.up.pt {24,25,26,27,28,29,30,31,56,57,58,59,60,61,62,63}
[0] MPI startup(): I_MPI_DEBUG=5
[0] MPI startup(): I_MPI_INFO_NUMA_NODE_NUM=2
[0] MPI startup(): I_MPI_PIN_MAPPING=4:0 0,1 8,2 16,3 24
L_CoarsWrk is allocated
G_CoarsWrk is allocated
--------------------------------------------------------------------------------------
but I do not know why I get this message. The funny thing is when I use mpirun (more than 1 processor to run) it happens and It does not show any error while running the code with one cpu.
I used following commands.
REAL(prec), ALLOCATABLE, DIMENSION(:,:,:), SAVE :: &
L_CoarsWrk, G_CoarsWrk
! Working arrays for temporal spectra
ALLOCATE(L_CoarsWrk(coars_j,coars_k,nL1))
IF(master) print*,'L_CoarsWrk is allocated'
IF(master)THEN
ALLOCATE(G_CoarsWrk(coars_j,coars_k,nG1))
print*,'G_CoarsWrk is allocated'
ENDIF
IF(master.AND.DEBGON)THEN
WRITE(logfl,'(/,"DBG: m_stats_setup OK")')
FLUSH(logfl)
ENDIF
I used -assume realloc_lhs flag as some colleagues recommended but still get nowhere.
Best regards