added v4.0 sources
[unres4.git] / source / unres / energy_data.f90
1       module energy_data
2 !-----------------------------------------------------------------------------
3       use names
4 !-----------------------------------------------------------------------------
5 ! Max. number of energy intervals
6       integer,parameter :: max_ene=10
7 !-----------------------------------------------------------------------------
8 ! Maximum number of terms in SC bond-stretching potential
9       integer,parameter :: maxbondterm=3
10 !-----------------------------------------------------------------------------
11 ! Max. number of derivatives of virtual-bond and side-chain vectors in theta
12 ! or phi.
13       integer :: maxdim
14 !-----------------------------------------------------------------------------
15 ! Max. number of contacts per residue
16       integer :: maxconts
17 !-----------------------------------------------------------------------------
18 ! Max. number of SC contacts
19       integer :: maxcont
20 !-----------------------------------------------------------------------------
21 ! commom.contacts
22 !      common /contacts/
23       integer :: ncont,ncont_ref
24       integer,dimension(:,:),allocatable :: icont,icont_ref !(2,maxcont)
25 #ifdef WHAM_RUN
26       integer,dimension(:),allocatable :: nsccont_frag_ref !(mmaxfrag) !wham
27       integer,dimension(:,:,:),allocatable :: isccont_frag_ref !(2,maxcont,mmaxfrag) !wham
28 #endif
29 ! 12/13/2008 (again Poland-Jaruzel war anniversary)
30 !   RE: Parallelization of 4th and higher order loc-el correlations
31 !      common /contdistrib/
32       integer,dimension(:),allocatable :: iat_sent !(maxres)
33 ! iat_sent - zainicjowane w initialize_p.F;
34       integer,dimension(:,:,:),allocatable :: iint_sent,iint_sent_local !(4,maxres,maxres)
35       integer,dimension(:,:),allocatable :: iturn3_sent,iturn4_sent,&
36        iturn3_sent_local,iturn4_sent_local      !(4,maxres),
37       integer,dimension(:),allocatable :: itask_cont_from,itask_cont_to !(0:max_fg_procs-1),
38       integer :: nat_sent,ntask_cont_from,ntask_cont_to
39 !-----------------------------------------------------------------------------
40 ! commom.deriv;
41 !      common /derivat/ 
42       real(kind=8),dimension(:,:),allocatable :: dcdv,dxdv !(6,maxdim)
43       real(kind=8),dimension(:,:),allocatable :: dxds !(6,maxres)
44       real(kind=8),dimension(:,:,:),allocatable :: gradx,gradc !(3,maxres,2)
45       real(kind=8),dimension(:,:),allocatable :: gvdwx !(3,maxres)
46       real(kind=8),dimension(:,:),allocatable :: gloc,gloc_x !(maxvar,2)   ,gloc_x  !!! nie używane
47       real(kind=8),dimension(:,:,:),allocatable :: dtheta       !(3,2,maxres)
48       real(kind=8),dimension(:,:,:),allocatable :: dphi,dalpha,domega !(3,3,maxres)
49       integer :: nfl,icg
50
51 !      common /derivat/   wham
52       logical :: calc_grad
53 !      common /mpgrad/
54       integer :: igrad_start,igrad_end
55       integer,dimension(:),allocatable :: jgrad_start,jgrad_end !(maxres)
56 !-----------------------------------------------------------------------------
57 ! The following COMMON block selects the type of the force field used in
58 ! calculations and defines weights of various energy terms.
59 ! 12/1/95 wcorr added
60 !-----------------------------------------------------------------------------
61 ! common.ffield
62 !      common /ffield/
63       integer :: n_ene_comp
64       integer :: rescale_mode
65       real(kind=8) :: wsc,wscp,welec,wbond,wstrain,wtor,wtor_d,wang,&
66        wscloc,wcorr,wcorr4,wcorr5,wcorr6,wsccor,wel_loc,wturn3,wturn4,&
67        wturn6,wvdwpp
68       real(kind=8),dimension(:),allocatable :: weights !(n_ene)
69       real(kind=8) :: temp0,scal14,cutoff_corr,delt_corr,r0_corr
70       integer :: ipot
71 !      common /potentials/
72       character(len=3),dimension(5) :: potname = &
73         (/'LJ ','LJK','BP ','GB ','GBV'/)
74 !-----------------------------------------------------------------------------
75 ! wlong,welec,wtor,wang,wscloc are the weight of the energy terms 
76 ! corresponding to side-chain, electrostatic, torsional, valence-angle,
77 ! and local side-chain terms.
78 !
79 ! IPOT determines which SC...SC interaction potential will be used:
80 ! 1 - LJ:  2n-n Lennard-Jones
81 ! 2 - LJK: 2n-n Kihara type (shifted Lennard-Jones) 
82 ! 3 - BP;  Berne-Pechukas (angular dependence)
83 ! 4 - GB;  Gay-Berne (angular dependence)
84 ! 5 - GBV; Gay-Berne-Vorobjev; angularly-dependent Kihara potential
85 !-----------------------------------------------------------------------------
86 ! common.interact
87 !      common /interact/
88       real(kind=8),dimension(:,:),allocatable :: aa,bb,augm !(ntyp,ntyp)
89       real(kind=8),dimension(:,:),allocatable :: aad,bad !(ntyp,2)
90       real(kind=8),dimension(2,2) :: app,bpp,ael6,ael3
91       integer :: expon,expon2, nnt,nct,itypro
92       integer,dimension(:,:),allocatable :: istart,iend !(maxres,maxint_gr)
93       integer,dimension(:),allocatable :: nint_gr,itype,itel,&
94        ielstart,ielend,ielstart_vdw,ielend_vdw,nscp_gr !(maxres)
95       integer,dimension(:,:),allocatable :: iscpstart,iscpend !(maxres,maxint_gr)
96       integer :: iatsc_s,iatsc_e,iatel_s,iatel_e,iatel_s_vdw,&
97        iatel_e_vdw,iatscp_s,iatscp_e,ispp,iscp
98 ! 12/1/95 Array EPS included in the COMMON block.
99 !      common /body/
100       real(kind=8),dimension(:,:),allocatable :: sigma !(0:ntyp1,0:ntyp1)
101       real(kind=8),dimension(:,:),allocatable :: eps,sigmaii,&
102        rs0,chi,r0,r0e   !(ntyp,ntyp) r0e !!! nie używane
103       real(kind=8),dimension(:),allocatable :: chip,alp,sigma0,&
104        sigii,rr0        !(ntyp)
105       real(kind=8),dimension(2,2) :: rpp,epp,elpp6,elpp3
106       real(kind=8),dimension(:,:),allocatable :: r0d,eps_scp,rscp !(ntyp,2)  r0d  !!! nie używane
107 ! 12/5/03 modified 09/18/03 Bond stretching parameters.
108 !      common /stretch/
109       real(kind=8) :: vbldp0,akp,distchainmax
110       real(kind=8),dimension(:,:),allocatable :: vbldsc0,aksc,abond0 !(maxbondterm,ntyp)
111       integer,dimension(:),allocatable :: nbondterm     !(ntyp)
112 !-----------------------------------------------------------------------------
113 ! common.local
114 ! Parameters of ab initio-derived potential of virtual-bond-angle bending
115 !      common /theta_abinitio/
116       integer :: nthetyp,ntheterm,ntheterm2,ntheterm3,nsingle,&
117        ndouble,nntheterm
118       integer,dimension(:),allocatable :: ithetyp !(-ntyp1:ntyp1)
119       real(kind=8),dimension(:,:,:,:),allocatable :: aa0thet
120 !(-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
121       real(kind=8),dimension(:,:,:,:,:),allocatable :: aathet
122       real(kind=8),dimension(:,:,:,:,:,:),allocatable :: bbthet,&
123        ccthet,ddthet,eethet
124 !(maxsingle,maxtheterm2,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
125       real(kind=8),dimension(:,:,:,:,:,:,:),allocatable :: ffthet,ggthet
126 !(maxdouble,maxdouble,maxtheterm3,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
127 ! Parameters of the virtual-bond-angle probability distribution
128 !      common /thetas/ 
129       real(kind=8),dimension(:),allocatable :: a0thet,theta0,&
130        sig0,sigc0       !(-ntyp:ntyp)
131       real(kind=8),dimension(:,:,:,:),allocatable :: athet,bthet !(2,-ntyp:ntyp,-1:1,-1:1)
132       real(kind=8),dimension(:,:),allocatable :: polthet        !(0:3,-ntyp:ntyp)
133       real(kind=8),dimension(:,:),allocatable :: gthet  !(3,-ntyp:ntyp)
134 ! Parameters of the side-chain probability distribution
135 !      common /sclocal/
136       real(kind=8),dimension(:),allocatable :: dsc,dsc_inv,dsc0 !(ntyp1)
137       real(kind=8),dimension(:,:),allocatable :: bsc !(maxlob,ntyp)
138       real(kind=8),dimension(:,:,:),allocatable :: censc !(3,maxlob,-ntyp:ntyp)
139       real(kind=8),dimension(:,:,:,:),allocatable :: gaussc !(3,3,maxlob,-ntyp:ntyp)
140       integer,dimension(:),allocatable :: nlob !(ntyp1)
141 ! Virtual-bond lenghts
142 !      common /peptbond/
143       real(kind=8) :: vbl,vblinv,vblinv2,vbl_cis,vbl0
144 !      common /indices/
145       integer :: loc_start,loc_end,ithet_start,ithet_end,iphi_start,&
146        iphi_end,iphid_start,iphid_end,ibond_start,ibond_end,&
147        ibondp_start,ibondp_end,ivec_start,ivec_end,iset_start,iset_end,&
148        iturn3_start,iturn3_end,iturn4_start,iturn4_end,iint_start,&
149        iint_end,iphi1_start,iphi1_end,itau_start,itau_end
150       integer,dimension(:),allocatable :: ibond_displ,ibond_count,&
151        ithet_displ,ithet_count,iphi_displ,iphi_count,iphi1_displ,&
152        iphi1_count,ivec_displ,ivec_count,iset_displ,iset_count,&
153        iint_count,iint_displ    !(0:max_fg_procs-1)
154 !-----------------------------------------------------------------------------
155 ! common.MD
156 !      common /mdgrad/
157       real(kind=8),dimension(:,:),allocatable :: gcart,gxcart !(3,0:MAXRES)
158       real(kind=8),dimension(:,:),allocatable :: gradcag,gradxag !(3,MAXRES)  !!! nie używane
159 !      common /back_constr/
160       integer :: nfrag_back
161       real(kind=8) :: uconst_back
162       real(kind=8),dimension(:),allocatable :: utheta,ugamma,uscdiff !(maxfrag_back)
163       real(kind=8),dimension(:,:,:),allocatable :: wfrag_back !(3,maxfrag_back,maxprocs/20)
164       integer,dimension(:,:,:),allocatable :: ifrag_back !(3,maxfrag_back,maxprocs/20)
165 !      common /qmeas/
166       real(kind=8),dimension(50) :: qfrag
167       real(kind=8),dimension(100) :: qpair
168       real(kind=8),dimension(:,:),allocatable :: qinfrag,wfrag !(50,maxprocs/20)
169       real(kind=8),dimension(:,:),allocatable :: qinpair,wpair !(100,maxprocs/20)
170       real(kind=8) :: eq_time,Uconst
171       integer :: iset,nset
172       integer,dimension(:),allocatable :: mset !(maxprocs/20)
173       integer,dimension(:,:,:),allocatable :: ifrag !(2,50,maxprocs/20)
174       integer,dimension(:,:,:),allocatable :: ipair !(2,100,maxprocs/20)
175       integer :: nfrag,npair
176       logical :: usampl
177 !-----------------------------------------------------------------------------
178 ! common.sbridge
179 !      common /sbridge/
180       real(kind=8) :: ss_depth,ebr,d0cm,akcm,akth,akct,v1ss,v2ss,v3ss
181       integer :: ns,nss,nfree
182       integer,dimension(:),allocatable :: iss   !(maxss)
183 !      common /links/
184       real(kind=8),dimension(:),allocatable :: dhpb,forcon,dhpb1 !(maxdim) !el dhpb1 !!! nie używane
185       integer :: nhpb
186       integer,dimension(:),allocatable :: ihpb,jhpb,ibecarb !(maxdim) !el ibecarb !!! nie używane
187 !      common /restraints/
188       real(kind=8) :: weidis
189 !      common /links_split/
190       integer :: link_start,link_end
191 !      common /dyn_ssbond/
192       real(kind=8) :: Ht
193       integer,dimension(:),allocatable :: idssb,jdssb !(maxdim)
194       logical :: dyn_ss
195       logical,dimension(:),allocatable :: dyn_ss_mask !(maxres)
196 !-----------------------------------------------------------------------------
197 ! common.sccor
198 ! Parameters of the SCCOR term
199 !      common/sccor/
200       real(kind=8),dimension(:,:,:,:),allocatable :: v1sccor,v2sccor !(maxterm_sccor,3,-ntyp:ntyp,-ntyp:ntyp)
201       real(kind=8),dimension(:,:,:),allocatable :: v0sccor !(maxterm_sccor,-ntyp:ntyp,-ntyp:ntyp)
202       integer :: nsccortyp
203       integer,dimension(:),allocatable :: isccortyp !(-ntyp:ntyp)
204       integer,dimension(:,:),allocatable :: nterm_sccor,nlor_sccor !(-ntyp:ntyp,-ntyp:ntyp)
205       real(kind=8),dimension(:,:,:),allocatable :: vlor1sccor,&
206        vlor2sccor,vlor3sccor    !(maxterm_sccor,20,20)
207       real(kind=8),dimension(:,:,:),allocatable :: gloc_sc !(3,0:maxres2,10)
208       real(kind=8),dimension(:,:,:,:),allocatable :: dtauangle !(3,3,3,maxres2)
209 !-----------------------------------------------------------------------------
210 ! common.scrot
211 ! Parameters of the SC rotamers (local) term
212 !      common/scrot/
213       real(kind=8),dimension(:,:),allocatable :: sc_parmin !(maxsccoef,ntyp)
214 !-----------------------------------------------------------------------------
215 ! common.torcnstr
216 !      common /torcnstr/
217       integer :: ndih_constr,ndih_nconstr
218       integer,dimension(:),allocatable :: idih_constr,idih_nconstr !(maxdih_constr)
219       integer :: idihconstr_start,idihconstr_end
220       real(kind=8) :: ftors
221       real(kind=8),dimension(:),allocatable :: drange !(maxdih_constr)
222       real(kind=8),dimension(:),allocatable :: phi0 !(maxdih_constr)
223 !-----------------------------------------------------------------------------
224 ! common.torsion
225 ! Torsional constants of the rotation about virtual-bond dihedral angles
226 !      common/torsion/
227       real(kind=8),dimension(:,:,:),allocatable :: v0 !(-maxtor:maxtor,-maxtor:maxtor,2)
228 #ifdef CRYST_TOR
229       real(kind=8),dimension(:,:,:),allocatable :: v1,v2 !(maxterm,-maxtor:maxtor,-maxtor:maxtor)
230 #else
231       real(kind=8),dimension(:,:,:,:),allocatable :: v1,v2 !(maxterm,-maxtor:maxtor,-maxtor:maxtor,2)
232 #endif
233       real(kind=8),dimension(:,:,:),allocatable :: vlor1 !(maxlor,-maxtor:maxtor,-maxtor:maxtor)
234       real(kind=8),dimension(:,:,:),allocatable :: vlor2,vlor3 !(maxlor,maxtor,maxtor)
235       integer,dimension(:),allocatable :: itortyp !(-ntyp1:ntyp1)
236       integer,dimension(:,:,:),allocatable :: nterm,nlor !(-maxtor:maxtor,-maxtor:maxtor,2)
237       integer :: ntortyp,nterm_old
238 ! 6/23/01 - constants for double torsionals
239 !      common /torsiond/ 
240       real(kind=8),dimension(:,:,:,:,:,:),allocatable :: v1c,v1s 
241         !(2,maxtermd_1,-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
242       real(kind=8),dimension(:,:,:,:,:,:),allocatable :: v2c,v2s
243         !(maxtermd_2,maxtermd_2,-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
244       integer,dimension(:,:,:,:),allocatable :: ntermd_1,ntermd_2
245         !(-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
246 ! 9/18/99 - added Fourier coeffficients of the expansion of local energy 
247 !           surfacecommon
248 !      common/fourier/
249       real(kind=8),dimension(:,:),allocatable :: b1,b2,&
250        b1tilde  !(2,-maxtor:maxtor),
251       real(kind=8),dimension(:,:,:),allocatable :: cc,dd,ee,&
252        ctilde,dtilde !(2,2,-maxtor:maxtor)
253       integer :: nloctyp
254 !      common/fourier/  z wham
255       real(kind=8),dimension(:,:),allocatable :: b !(13,0:maxtor)
256 !-----------------------------------------------------------------------------
257 ! common.var
258 ! Store the geometric variables in the following COMMON block.
259 !      common /var/ in module geometry_data
260 ! Store the angles and variables corresponding to old conformations (for use
261 ! in MCM).
262 !      common /oldgeo/
263 !el      real(kind=8),dimension(:,:),allocatable :: varsave !(maxvar,maxsave)
264 !      real(kind=8),dimension(:),allocatable :: esave !(maxsave)
265 !      integer,dimension(:),allocatable :: Origin !(maxsave)
266 !      integer :: nstore
267 ! freeze some variables
268 !      common /restr/
269       real(kind=8),dimension(:),allocatable :: varall !(maxvar)
270       integer,dimension(:),allocatable :: mask_theta,&
271        mask_phi,mask_side !(maxres)
272       logical :: mask_r
273 !-----------------------------------------------------------------------------
274 !-----------------------------------------------------------------------------
275       end module energy_data