Merge branch 'devel' into AFM
[unres.git] / source / wham / src-NEWSC-NEWCORR / promienie.f
diff --git a/source/wham/src-NEWSC-NEWCORR/promienie.f b/source/wham/src-NEWSC-NEWCORR/promienie.f
new file mode 100644 (file)
index 0000000..12a2e80
--- /dev/null
@@ -0,0 +1,46 @@
+      subroutine promienie(*)
+      implicit none
+      include 'DIMENSIONS'
+      include 'COMMON.CONTROL'
+      include 'COMMON.INTERACT'
+      include 'COMMON.IOUNITS'
+      include 'COMMON.CONTPAR'
+      include 'COMMON.LOCAL'
+      integer i,j
+      real*8 facont /1.569D0/  ! facont = (2/(1-sqrt(1-1/4)))**(1/6)
+      character*8 contfunc
+      character*8 contfuncid(5)/'GB','DIST','CEN','ODC','SIG'/
+      character*8 ucase
+      call getenv("CONTFUNC",contfunc)
+      contfunc=ucase(contfunc)
+      do icomparfunc=1,5
+        if (contfunc.eq.contfuncid(icomparfunc)) goto 10
+      enddo     
+   10 continue
+      write (iout,*) "Sidechain contact function is ",contfunc,
+     &  "icomparfunc",icomparfunc 
+      do i=1,ntyp
+        do j=1,ntyp
+          if (icomparfunc.lt.3) then
+            read(isidep1,*) chi_comp(i,j),chip_comp(i,j),sig_comp(i,j),
+     &       sc_cutoff(i,j)
+          else if (icomparfunc.lt.5) then
+            read(isidep1,*) sc_cutoff(i,j)
+          else if (icomparfunc.eq.5) then
+            sc_cutoff(i,j)=dsqrt(sigma0(i)**2+sigma0(j)**2)*facont
+          else
+            write (iout,*) "Error - Unknown contact function"
+            return1
+          endif
+        enddo
+      enddo
+      close (isidep1)
+      do i=1,ntyp1
+        if (i.eq.10 .or. i.eq.21) then
+          dsc_inv(i)=0.0d0
+        else
+          dsc_inv(i)=1.0d0/dsc(i)
+        endif
+      enddo
+      return
+      end