********> update.9 Authors: Vinicius Wilian D. Cruzeiro Date: May 21, 2018 Programs: sander Description: Adds an error message when users run REMD and the box sizes are not the same across all replicas. -------------------------------------------------------------------------------- AmberTools/src/sander/mdread2.F90 | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git AmberTools/src/sander/mdread2.F90 AmberTools/src/sander/mdread2.F90 index 97df3f5..cceaa97 100644 --- AmberTools/src/sander/mdread2.F90 +++ AmberTools/src/sander/mdread2.F90 @@ -105,6 +105,8 @@ integer ist(MPI_STATUS_SIZE), partner, nbonh_c, num_noshake_c integer nquant_c, noshake_overlap_c integer crggp( natom ) + _REAL_ val + _REAL_, allocatable :: repvals(:) # ifdef CRAY_PVP # define MPI_DOUBLE_PRECISION MPI_REAL8 # endif @@ -687,6 +689,44 @@ 9006 format (5x,'Cutoff=',f9.3,3x,'Tol =',e9.3) 9007 format (5x,'Ewald Coefficient =',f9.5) end if + +#ifdef MPI + ! Prints an error if REMD is to be performed with different cell sizes across + ! the different replicas + if (rem .ne. 0 .and. ntp .eq. 0) then + allocate(repvals(numgroup), stat=ierr) + REQUIRE(ierr == 0) + do i = 1, 6 + repvals(:) = 0.d0 + if (i .eq. 1) then + val = a + else if (i .eq. 2) then + val = b + else if (i .eq. 3) then + val = c + else if (i .eq. 4) then + val = alpha + else if (i .eq. 5) then + val = beta + else if (i .eq. 6) then + val = gamma + end if + call mpi_allgather(val, 1, mpi_double_precision, & + repvals, 1, mpi_double_precision, & + commmaster, ierr) + do j = 2, numgroup + if (abs(repvals(j)-repvals(1)) .gt. 1.0d-5) then + write(6,'(a,a,a)') error_hdr, "The box sizes do not match for all REMD replicas." + write(6,'(11x,a)') "This can happen, for example, if you are using different input coordinate files" + write(6,'(11x,a)') "for the different replicas and these structures come from a NPT run." + write(6,'(11x,a)') "Make sure the box lengths and angles are the same for all replicas in all input" + write(6,'(11x,a)') "coordinate files." + FATAL_ERROR + end if + end do + end do + end if +#endif !---- QMMM Options ----