MCSclimate / MCT

Model Coupling Tookit
Other
43 stars 18 forks source link

Need to always define Recv and Send bufs in rearrange_ #49

Closed rljacob closed 4 years ago

rljacob commented 7 years ago

While testing changes from PR #38 within ACME, intel and debugging complained as follows:

forrtl: severe (408): fort: (8): Attempt to fetch from allocatable variable RSENDBUF when it is not allocated

Image              PC                Routine            Line        Source     
acme.exe           0000000007EA8186  Unknown               Unknown  Unknown
acme.exe           0000000007CFD2C9  m_rearranger_mp_r        1165  m_Rearranger.F90

The send, recv buffers had to be allocated even in nprocs to send/recv with is 0. Solution is to remove the " if(SendRout%nprocs > 0) then" around the allocate/deallocate statements. This will allow allocation of 0-sized arrays but algorithm can already handle it.

rljacob commented 4 years ago

Issue #51 was a duplicate of this and #52 fixed the problem.