Compile error of cvm evaluation

Hi,

I am trying to evaluate the adjoint result using the cvm module in the adjoint 5.0 package. However, when I compile it, it reports the error:

xadv.o: In function xadv_': xadv.F:(.text+0x600): undefined reference to swap3d_complex_’
xadv.F:(.text+0x7f4): undefined reference to swap3d_complex_' yadv.o: In function yadv_‘:
yadv.F:(.text+0x6bd): undefined reference to swap3d_complex_' yadv.F:(.text+0x8a6): undefined reference to swap3d_complex_’
hdiff.o: In function hdiff_': hdiff.F:(.text+0x1a6e): undefined reference to swap4d_complex_’
hdiff.F:(.text+0x1cd9): undefined reference to swap4d_complex_' hdiff.F:(.text+0x1f3e): undefined reference to swap4d_complex_’
hdiff.F:(.text+0x219d): undefined reference to `swap4d_complex_’

I can not find any swap_complex from the package. Anyone can give me a .F file? Thanks in advance.

Best regards,

Jie

Hi Jie,

The two subroutines you mentioned are supposed to be in swap_sandia_routines.f. You can make your own by revising the subroutines swap3d and swap4d. Below are the necessary changes.


subroutine swap3d_complex(send,recv,n1,n2,n3,dim1,dim2,dir)

complex*8 send(*) ! 1st value to be sent

complex*8 recv(*) ! 1st value to be received

complex*8, allocatable :: rbuf(:),sbuf(:)

call MPI_Irecv(rbuf,ntotal,MPI_COMPLEX,recvproc,0,MPI_COMM_WORLD,

call MPI_Send(sbuf,ntotal,MPI_COMPLEX,sendproc,0,MPI_COMM_WORLD,

end subroutine swap3d_complex

subroutine swap4d_complex(send,recv,n1,n2,n3,n4,dim1,dim2,dim3,dir)

complex*8 send(*) ! 1st value to be sent

complex*8 recv(*) ! 1st value to be received

complex*8, allocatable :: rbuf(:),sbuf(:)

call MPI_Irecv(rbuf,ntotal,MPI_COMPLEX,recvproc,0,MPI_COMM_WORLD,

call MPI_Send(sbuf,ntotal,MPI_COMPLEX,sendproc,0,MPI_COMM_WORLD,

end subroutine swap4d_complex

Hope this would help.

Thanks,

Shunliu

Hi Shunliu,

Thanks for your prompt response. I have successfully compiled the model based on your suggestions. However, when I was running the model, it always stopped at the same location without any notifications. I have attached the log files for your reference and I am looking forward to any recommendations. Thank you very much and merry christmas.

log_2019100.txt (164.2 KB)