dij=dist(i,j)
c write (iout,*) "dij(",i,j,") =",dij
do k=1,constr_homology
+ if(.not.l_homo(k,ii)) cycle
distance(k)=odl(k,ii)-dij
c write (iout,*) "distance(",k,") =",distance(k)
c
endif
enddo
- min_odl=minval(distancek)
+c min_odl=minval(distancek)
+ do kk=1,constr_homology
+ if(l_homo(kk,ii)) then
+ min_odl=distancek(kk)
+ exit
+ endif
+ enddo
+ do kk=1,constr_homology
+ if(l_homo(kk,ii) .and. distancek(kk).lt.min_odl)
+ & min_odl=distancek(kk)
+ enddo
c write (iout,* )"min_odl",min_odl
#ifdef DEBUG
write (iout,*) "ij dij",i,j,dij
c Nie wiem po co to liczycie jeszcze raz!
c odleg3=-waga_dist(iset)*((distance(i,j,k)**2)/
c & (2*(sigma_odl(i,j,k))**2))
+ if(.not.l_homo(k,ii)) cycle
if (waga_dist.ge.0.0d0) then
c
c For Gaussian-type Urestr
c & *waga_dist)+min_odl
c sgodl=-godl(k)*distance(k)*sigma_odl(k,ii)*waga_dist
c
+ if(.not.l_homo(k,ii)) cycle
if (waga_dist.ge.0.0d0) then
c For Gaussian-type Urestr
c
coskt(k)=dcos(k*theti2)
sinkt(k)=dsin(k*theti2)
enddo
- if (i.gt.3 .and. itype(i-3).ne.ntyp1) then
+ if (i.gt.3 .and. itype(max0(i-3,1)).ne.ntyp1) then
#ifdef OSF
phii=phi(i)
if (phii.ne.phii) phii=150.0