Merge branch 'UCGM' of mmka.chem.univ.gda.pl:unres4 into UCGM
[unres4.git] / source / unres / geometry.F90
index c89442f..af8df27 100644 (file)
          enddo
       endif 
 !  Settind dE/ddnres-1       
-#define DEBUG
-#ifdef DEBUG
-          j=1
-              write(iout,*)"in int to carta",nres-1,gcart(j,nres-1),gloc(nres-3,icg),dphi(j,3,nres), &
-        gloc(2*nres-5,icg),dtheta(j,2,nres)
+!#define DEBUG
+!#ifdef DEBUG
+!          j=1
+!              write(iout,*)"in int to carta",nres-1,gcart(j,nres-1),gloc(nres-3,icg),dphi(j,3,nres), &
+!        gloc(2*nres-5,icg),dtheta(j,2,nres)
 
-#endif
+!#endif
 !#undef DEBUG
 
        do j=1,3
         gcart(j,nres-1)=gcart(j,nres-1)+gloc(nres-3,icg)*dphi(j,3,nres)+ &
        gloc(2*nres-5,icg)*dtheta(j,2,nres)
 !#define DEBUG
-#ifdef DEBUG
-              write(iout,*)"in int to cartb",nres-1,gcart(j,nres-1),gloc(nres-3,icg),dphi(j,3,nres), &
-        gloc(2*nres-5,icg),dtheta(j,2,nres)
-
-#endif
+!#ifdef DEBUG
+!              write(iout,*)"in int to cartb",nres-1,gcart(j,nres-1),gloc(nres-3,icg),dphi(j,3,nres), &
+!        gloc(2*nres-5,icg),dtheta(j,2,nres)
+!
+!#endif
 !#undef DEBUG
         if((itype(nres-1,1).ne.10).and.(molnum(nres-1).ne.5)) then
           gcart(j,nres-1)=gcart(j,nres-1)+gloc(ialph(nres-1,1),icg)* &
          dalpha(j,2,nres-1)+gloc(ialph(nres-1,1)+nside,icg)* &
           domega(j,2,nres-1)
 !#define DEBUG
-#ifdef DEBUG
-              write(iout,*)"in int to cart2",i,gcart(j,nres-1),gloc(ialph(nres-1,1),icg)* &
-          dalpha(j,2,nres-1),gloc(ialph(nres-1,1)+nside,icg), &
-          domega(j,2,nres-1)
+!#ifdef DEBUG
+!              write(iout,*)"in int to cart2",i,gcart(j,nres-1),gloc(ialph(nres-1,1),icg)* &
+!          dalpha(j,2,nres-1),gloc(ialph(nres-1,1)+nside,icg), &
+!          domega(j,2,nres-1)
 
-#endif
+!#endif
 !#undef DEBUG
 
         endif
               gxcart(j,i)=gxcart(j,i)+gloc(ialph(i,1),icg)*dalpha(j,3,i) &
               +gloc(ialph(i,1)+nside,icg)*domega(j,3,i)
 !#define DEBUG
-#ifdef DEBUG
-              write(iout,*)"in int to cart",i, gxcart(j,i),gloc(ialph(i,1),icg),dalpha(j,3,i), &
-              gloc(ialph(i,1)+nside,icg),domega(j,3,i)
-#endif
-#undef DEBUG
+!#ifdef DEBUG
+!              write(iout,*)"in int to cart",i, gxcart(j,i),gloc(ialph(i,1),icg),dalpha(j,3,i), &
+!              gloc(ialph(i,1)+nside,icg),domega(j,3,i)
+!#endif
+!#undef DEBUG
             enddo
          endif     
        enddo                                                                                                                                                   
 !      common /refstruct/
       if(.not.allocated(cref)) allocate(cref(3,nres2+2,maxperm)) !(3,maxres2+2,maxperm)
 !elwrite(iout,*) "jestem w alloc geo 2"
-      allocate(crefjlee(3,nres2+2)) !(3,maxres2+2)
+!      allocate(crefjlee(3,nres2+2)) !(3,maxres2+2)
+        if (.not.allocated(crefjlee)) allocate (crefjlee(3,nres2+2))
       if(.not.allocated(chain_rep)) allocate(chain_rep(3,nres2+2,maxsym)) !(3,maxres2+2,maxsym)
       if(.not.allocated(tabperm)) allocate(tabperm(maxperm,maxsym)) !(maxperm,maxsym)
 !      common /from_zscore/ in module.compare