In subroutines like PAIRPOTTAB, the part for determine which pair potential to use is like this:
DO K = 1, NOPPS
IF ((ATELE(I) .EQ. PPELE1(K) .AND. ATELE(J) .EQ. PPELE2(K)) &
.OR. (ATELE(J) .EQ. PPELE1(K) .AND. &
ATELE(I) .EQ. PPELE2(K))) THEN
PPSEL = K
R1 = POTCOEF(9,PPSEL)
RCUT = POTCOEF(10,PPSEL)
RCUT2 = RCUT*RCUT
ENDIF
ENDDO
If the pair potential is not defined for a pair of atom, it will use the pair potential function of last loop to compute the pair potential. Maybe it will be better to use zero for these non-existing parameters? It seems set RCUT2=ZERO for those pairs will make it work. (the code just put is wrong, just corrected it)
RCUT2=0
DO K = 1, NOPPS
IF ((ATELE(I) .EQ. PPELE1(K) .AND. ATELE(J) .EQ. PPELE2(K)) &
.OR. (ATELE(J) .EQ. PPELE1(K) .AND. &
ATELE(I) .EQ. PPELE2(K))) THEN
PPSEL = K
R1 = POTCOEF(9,PPSEL)
RCUT = POTCOEF(10,PPSEL)
RCUT2 = RCUT*RCUT
ENDIF
ENDDO