97b773c9f661e51341408df056b1fb4e2d7a247b
[unres4.git] / source / unres / data / energy_data.f90
1       module energy_data
2 !-----------------------------------------------------------------------------
3       use names
4 !-----------------------------------------------------------------------------
5 ! Max. number of energy intervals
6       integer,parameter :: max_ene=21 !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,wliptran,wshield,lipscale,wtube, &
68        wbond_nucl,wang_nucl,wcorr_nucl,wcorr3_nucl,welpp,wtor_nucl,&
69        wtor_d_nucl,welsb,wsbloc,wvdwsb,welpsb,wvdwpsb
70 #ifdef CLUSTER
71       real(kind=8) :: scalscp
72 #endif
73       real(kind=8),dimension(:),allocatable :: weights !(n_ene)
74       real(kind=8) :: temp0,scal14,cutoff_corr,delt_corr,r0_corr
75       integer :: ipot,ipot_nucl
76 !      common /potentials/
77       character(len=3),dimension(5) :: potname = &
78         (/'LJ ','LJK','BP ','GB ','GBV'/)
79 !-----------------------------------------------------------------------------
80 ! wlong,welec,wtor,wang,wscloc are the weight of the energy terms 
81 ! corresponding to side-chain, electrostatic, torsional, valence-angle,
82 ! and local side-chain terms.
83 !
84 ! IPOT determines which SC...SC interaction potential will be used:
85 ! 1 - LJ:  2n-n Lennard-Jones
86 ! 2 - LJK: 2n-n Kihara type (shifted Lennard-Jones) 
87 ! 3 - BP;  Berne-Pechukas (angular dependence)
88 ! 4 - GB;  Gay-Berne (angular dependence)
89 ! 5 - GBV; Gay-Berne-Vorobjev; angularly-dependent Kihara potential
90 !-----------------------------------------------------------------------------
91 ! common.interact
92 !      common /interact/
93       real(kind=8),dimension(:,:),allocatable :: aa_aq,bb_aq,augm,aa_lip,bb_lip !(ntyp,ntyp)
94       real(kind=8),dimension(:),allocatable :: sc_aa_tube_par,sc_bb_tube_par,&
95        acavtub,bcavtub,ccavtub,dcavtub,tubetranene
96       real(kind=8),dimension(:,:),allocatable :: aa_nucl,bb_nucl
97       real(kind=8) :: acavtubpep,bcavtubpep,ccavtubpep,dcavtubpep, &
98       tubetranenepep,pep_aa_tube,pep_bb_tube,tubeR0
99       real(kind=8),dimension(3) :: tubecenter
100       real(kind=8),dimension(:,:),allocatable :: aad,bad !(ntyp,2)
101       real(kind=8),dimension(2,2) :: app,bpp,ael6,ael3
102       real(kind=8),dimension(:),allocatable :: aad_nucl,bad_nucl !(ntyp,2)
103       real(kind=8),dimension(2,2) :: app_nucl,bpp_nucl
104       real(kind=8),dimension(:,:),allocatable :: ael6_nucl,&
105         ael3_nucl,ael32_nucl,ael63_nucl
106       integer :: expon,expon2, nnt,nct,itypro
107       integer,dimension(:,:),allocatable :: istart,iend !(maxres,maxint_gr)
108       integer,dimension(:),allocatable :: nint_gr,itel,&
109        ielstart,ielend,ielstart_vdw,ielend_vdw,nscp_gr !(maxres)
110       integer,dimension(:,:),allocatable :: istart_nucl,iend_nucl !(maxres,maxint_gr)
111       integer,dimension(:),allocatable :: nint_gr_nucl,itel_nucl,&
112        ielstart_nucl,ielend_nucl,ielstart_vdw_nucl,ielend_vdw_nucl,nscp_gr_nucl !(maxres)
113       integer,dimension(:,:),allocatable :: iscpstart_nucl,iscpend_nucl !(maxres,maxint_gr)
114
115       integer,dimension(:),allocatable :: istype,molnum
116       integer,dimension(:,:),allocatable :: itype ! now itype has more molecule types
117       integer,dimension(:,:),allocatable :: iscpstart,iscpend !(maxres,maxint_gr)
118       integer :: iatsc_s,iatsc_e,iatel_s,iatel_e,iatel_s_vdw,&
119        iatel_e_vdw,iatscp_s,iatscp_e,ispp,iscp
120       integer :: iatsc_s_nucl,iatsc_e_nucl,iatel_s_nucl,iatel_e_nucl,&
121        iatel_s_vdw_nucl,iatel_e_vdw_nucl,iatscp_s_nucl,iatscp_e_nucl,&
122        ispp_nucl,iscp_nucl
123
124 ! 12/1/95 Array EPS included in the COMMON block.
125 !      common /body/
126       real(kind=8),dimension(:,:),allocatable :: sigma !(0:ntyp1,0:ntyp1)
127       real(kind=8),dimension(:,:),allocatable :: eps,epslip,sigmaii,&
128        rs0,chi,r0,r0e   !(ntyp,ntyp) r0e !!! nie używane
129       real(kind=8),dimension(:),allocatable :: chip,alp,sigma0,&
130        sigii,rr0        !(ntyp)
131       real(kind=8),dimension(2,2) :: rpp,epp,elpp6,elpp3
132       real(kind=8),dimension(:,:),allocatable :: sigma_nucl !(0:ntyp1,0:ntyp1)
133       real(kind=8),dimension(:,:),allocatable :: eps_nucl,sigmaii_nucl,&
134        chi_nucl,r0_nucl, chip_nucl   !(ntyp,ntyp) r0e !!! nie używane
135       real(kind=8),dimension(:),allocatable :: alp_nucl,sigma0_nucl,&
136        sigii_nucl,rr0_nucl        !(ntyp)
137       real(kind=8),dimension(2,2) :: rpp_nucl,epp_nucl
138       real(kind=8),dimension(:,:),allocatable ::elpp6_nucl,&
139        elpp3_nucl,elpp32_nucl,elpp63_nucl
140       real(kind=8):: r0pp,epspp,AEES,BEES
141
142       real(kind=8),dimension(:,:),allocatable :: r0d,eps_scp,rscp !(ntyp,2)  r0d  !!! nie używane
143       real(kind=8),dimension(:),allocatable :: eps_scp_nucl,rscp_nucl!(ntyp,2)  r0d  !!! nie używane
144
145 ! 12/5/03 modified 09/18/03 Bond stretching parameters.
146 !      common /stretch/
147       real(kind=8) :: vbldp0,akp,distchainmax,vbldpDUM
148       real(kind=8),dimension(:,:),allocatable :: vbldsc0,aksc,abond0 !(maxbondterm,ntyp)
149       real(kind=8) :: vbldp0_nucl,akp_nucl
150       real(kind=8),dimension(:,:),allocatable :: vbldsc0_nucl,&
151        aksc_nucl,abond0_nucl !(maxbondterm,ntyp)
152
153       integer,dimension(:),allocatable :: nbondterm     !(ntyp)
154       integer,dimension(:),allocatable :: nbondterm_nucl     !(ntyp)
155
156 !-----------------------------------------------------------------------------
157 ! common.local
158 ! Parameters of ab initio-derived potential of virtual-bond-angle bending
159 !      common /theta_abinitio/
160       integer :: nthetyp,ntheterm,ntheterm2,ntheterm3,nsingle,&
161        ndouble,nntheterm
162       integer,dimension(:),allocatable :: ithetyp !(-ntyp1:ntyp1)
163       real(kind=8),dimension(:,:,:,:),allocatable :: aa0thet
164 !(-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
165       real(kind=8),dimension(:,:,:,:,:),allocatable :: aathet
166       real(kind=8),dimension(:,:,:,:,:,:),allocatable :: bbthet,&
167        ccthet,ddthet,eethet
168 !(maxsingle,maxtheterm2,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
169       real(kind=8),dimension(:,:,:,:,:,:,:),allocatable :: ffthet,ggthet
170
171 !-----------nucleic acid parameters--------------------------
172       integer :: nthetyp_nucl,ntheterm_nucl,ntheterm2_nucl,&
173       ntheterm3_nucl,nsingle_nucl,&
174        ndouble_nucl,nntheterm_nucl
175       integer,dimension(:),allocatable :: ithetyp_nucl !(-ntyp1:ntyp1)
176       real(kind=8),dimension(:,:,:),allocatable :: aa0thet_nucl
177 !(-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
178       real(kind=8),dimension(:,:,:,:),allocatable :: aathet_nucl
179       real(kind=8),dimension(:,:,:,:,:),allocatable :: bbthet_nucl,&
180        ccthet_nucl,ddthet_nucl,eethet_nucl
181 !(maxsingle,maxtheterm2,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
182       real(kind=8),dimension(:,:,:,:,:,:),allocatable :: ffthet_nucl,ggthet_nucl
183
184 !(maxdouble,maxdouble,maxtheterm3,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
185 ! Parameters of the virtual-bond-angle probability distribution
186 !      common /thetas/ 
187       real(kind=8),dimension(:),allocatable :: a0thet,theta0,&
188        sig0,sigc0       !(-ntyp:ntyp)
189       real(kind=8),dimension(:,:,:,:),allocatable :: athet,bthet !(2,-ntyp:ntyp,-1:1,-1:1)
190       real(kind=8),dimension(:,:),allocatable :: polthet        !(0:3,-ntyp:ntyp)
191       real(kind=8),dimension(:,:),allocatable :: gthet  !(3,-ntyp:ntyp)
192 ! Parameters of the side-chain probability distribution
193 !      common /sclocal/
194       real(kind=8),dimension(:),allocatable :: dsc,dsc_inv,dsc0 !(ntyp1)
195       real(kind=8),dimension(:,:),allocatable :: bsc !(maxlob,ntyp)
196       real(kind=8),dimension(:,:,:),allocatable :: censc !(3,maxlob,-ntyp:ntyp)
197       real(kind=8),dimension(:,:,:,:),allocatable :: gaussc !(3,3,maxlob,-ntyp:ntyp)
198       integer,dimension(:),allocatable :: nlob !(ntyp1)
199 ! Virtual-bond lenghts
200 !      common /peptbond/
201       real(kind=8) :: vbl,vblinv,vblinv2,vbl_cis,vbl0
202 !      common /indices/
203       integer :: loc_start,loc_end,ithet_start,ithet_end,iphi_start,&
204        iphi_end,iphid_start,iphid_end,ibond_start,ibond_end,&
205        ibondp_start,ibondp_end,ivec_start,ivec_end,iset_start,iset_end,&
206        iturn3_start,iturn3_end,iturn4_start,iturn4_end,iint_start,&
207        iint_end,iphi1_start,iphi1_end,itau_start,itau_end,&
208        ilip_start,ilip_end,itube_start,itube_end
209       integer :: ibond_nucl_start,ibond_nucl_end,iphi_nucl_start,&
210        iphi_nucl_end,iphid_nucl_start,iphid_nucl_end,& 
211        ibondp_nucl_start,ibondp_nucl_end,ithet_nucl_start,ithet_nucl_end,&
212         loc_start_nucl,loc_end_nucl
213       integer,dimension(:),allocatable :: ibond_displ,ibond_count,&
214        ithet_displ,ithet_count,iphi_displ,iphi_count,iphi1_displ,&
215        iphi1_count,ivec_displ,ivec_count,iset_displ,iset_count,&
216        iint_count,iint_displ    !(0:max_fg_procs-1)
217 !-----------------------------------------------------------------------------
218 ! common.MD
219 !      common /mdgrad/
220       real(kind=8),dimension(:,:),allocatable :: gcart,gxcart !(3,0:MAXRES)
221       real(kind=8),dimension(:,:),allocatable :: gradcag,gradxag !(3,MAXRES)  !!! nie używane
222 !      common /back_constr/
223       integer :: nfrag_back
224       real(kind=8) :: uconst_back
225       real(kind=8),dimension(:),allocatable :: utheta,ugamma,uscdiff !(maxfrag_back)
226       real(kind=8),dimension(:,:,:),allocatable :: wfrag_back !(3,maxfrag_back,maxprocs/20)
227       integer,dimension(:,:,:),allocatable :: ifrag_back !(3,maxfrag_back,maxprocs/20)
228 !      common /qmeas/ in module geometry
229 !-----------------------------------------------------------------------------
230 ! common.sbridge
231 !      common /sbridge/
232       real(kind=8) :: ss_depth,ebr,d0cm,akcm,akth,akct,v1ss,v2ss,v3ss
233       integer :: ns,nss,nfree
234       integer,dimension(:),allocatable :: iss   !(maxss)
235 !      common /links/
236       real(kind=8),dimension(:),allocatable :: dhpb,forcon,dhpb1,fordepth !(maxdim) !el dhpb1 !!! nie używane
237       integer :: nhpb
238       integer,dimension(:),allocatable :: ihpb,jhpb,ibecarb !(maxdim) !el ibecarb !!! nie używane
239 !      common /restraints/
240       real(kind=8) :: weidis
241 !      common /links_split/
242       integer :: link_start,link_end
243 !      common /dyn_ssbond/
244       real(kind=8) :: Ht,atriss,btriss,ctriss,dtriss
245       integer,dimension(:),allocatable :: idssb,jdssb !(maxdim)
246       logical :: dyn_ss
247       logical,dimension(:),allocatable :: dyn_ss_mask !(maxres)
248 !-----------------------------------------------------------------------------
249 ! common.sccor
250 ! Parameters of the SCCOR term
251 !      common/sccor/
252       real(kind=8),dimension(:,:,:,:),allocatable :: v1sccor,v2sccor !(maxterm_sccor,3,-ntyp:ntyp,-ntyp:ntyp)
253       real(kind=8),dimension(:,:,:),allocatable :: v0sccor !(maxterm_sccor,-ntyp:ntyp,-ntyp:ntyp)
254       integer :: nsccortyp
255       integer,dimension(:),allocatable :: isccortyp !(-ntyp:ntyp)
256       integer,dimension(:,:),allocatable :: nterm_sccor,nlor_sccor !(-ntyp:ntyp,-ntyp:ntyp)
257       real(kind=8),dimension(:,:,:),allocatable :: vlor1sccor,&
258        vlor2sccor,vlor3sccor    !(maxterm_sccor,20,20)
259       real(kind=8),dimension(:,:,:),allocatable :: gloc_sc !(3,0:maxres2,10)
260       real(kind=8),dimension(:,:,:,:),allocatable :: dtauangle !(3,3,3,maxres2)
261 !-----------------------------------------------------------------------------
262 ! common.scrot
263 ! Parameters of the SC rotamers (local) term
264 !      common/scrot/
265       real(kind=8),dimension(:,:),allocatable :: sc_parmin !(maxsccoef,ntyp)
266       real(kind=8),dimension(:,:),allocatable :: sc_parmin_nucl !(maxsccoef,ntyp)
267
268 !-----------------------------------------------------------------------------
269 ! common.torcnstr
270 !      common /torcnstr/
271       integer :: ndih_constr,ndih_nconstr,ntheta_constr
272       integer,dimension(:),allocatable :: idih_constr,idih_nconstr,itheta_constr !(maxdih_constr)
273       integer :: idihconstr_start,idihconstr_end, &
274        ithetaconstr_start,ithetaconstr_end
275       real(kind=8) :: ftors
276       real(kind=8),dimension(:),allocatable :: drange,theta_constr0,theta_drange !(maxdih_constr)
277       real(kind=8),dimension(:),allocatable :: phi0 !(maxdih_constr)
278       real(kind=8),dimension(:),allocatable :: for_thet_constr !(maxdih_constr)
279
280 !-----------------------------------------------------------------------------
281 ! common.torsion
282 ! Torsional constants of the rotation about virtual-bond dihedral angles
283 !      common/torsion/
284       real(kind=8),dimension(:,:,:),allocatable :: v0 !(-maxtor:maxtor,-maxtor:maxtor,2)
285 #ifdef CRYST_TOR
286       real(kind=8),dimension(:,:,:),allocatable :: v1,v2 !(maxterm,-maxtor:maxtor,-maxtor:maxtor)
287 #else
288       real(kind=8),dimension(:,:,:,:),allocatable :: v1,v2 !(maxterm,-maxtor:maxtor,-maxtor:maxtor,2)
289 #endif
290       real(kind=8),dimension(:,:,:),allocatable :: vlor1 !(maxlor,-maxtor:maxtor,-maxtor:maxtor)
291       real(kind=8),dimension(:,:,:),allocatable :: vlor2,vlor3 !(maxlor,maxtor,maxtor)
292       integer,dimension(:),allocatable :: itortyp !(-ntyp1:ntyp1)
293       integer,dimension(:,:,:),allocatable :: nterm,nlor !(-maxtor:maxtor,-maxtor:maxtor,2)
294       integer :: ntortyp,nterm_old
295 !------torsion nucleic
296       real(kind=8),dimension(:,:),allocatable :: v0_nucl !(-maxtor:maxtor,-maxtor:maxtor,2)
297       real(kind=8),dimension(:,:,:),allocatable :: v1_nucl,v2_nucl !(maxterm,-maxtor:maxtor,-maxtor:maxtor)
298       real(kind=8),dimension(:,:,:),allocatable :: vlor1_nucl !(maxlor,-maxtor:maxtor,-maxtor:maxtor)
299       real(kind=8),dimension(:,:,:),allocatable :: vlor2_nucl,vlor3_nucl !(maxlor,maxtor,maxtor)
300       integer,dimension(:),allocatable :: itortyp_nucl !(-ntyp1:ntyp1)
301       integer,dimension(:,:),allocatable :: nterm_nucl,nlor_nucl !(-maxtor:maxtor,-maxtor:maxtor,2)
302       integer :: ntortyp_nucl,nterm_old_nucl
303
304 ! 6/23/01 - constants for double torsionals
305 !      common /torsiond/ 
306       real(kind=8),dimension(:,:,:,:,:,:),allocatable :: v1c,v1s 
307         !(2,maxtermd_1,-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
308       real(kind=8),dimension(:,:,:,:,:,:),allocatable :: v2c,v2s
309         !(maxtermd_2,maxtermd_2,-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
310       integer,dimension(:,:,:,:),allocatable :: ntermd_1,ntermd_2
311         !(-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
312 ! 9/18/99 - added Fourier coeffficients of the expansion of local energy 
313 !           surfacecommon
314 !      common/fourier/
315       real(kind=8),dimension(:,:),allocatable :: b1,b2,&
316        b1tilde  !(2,-maxtor:maxtor),
317       real(kind=8),dimension(:,:,:),allocatable :: cc,dd,ee,&
318        ctilde,dtilde !(2,2,-maxtor:maxtor)
319       integer :: nloctyp
320 !      common/fourier/  z wham
321       real(kind=8),dimension(:,:),allocatable :: b !(13,0:maxtor)
322 !-----------------------------------------------------------------------------
323 ! 24 Apr 2017 
324 ! Varibles for cutoff on electorstatic
325       real(kind=8) sss_ele_cut,sss_ele_grad
326       integer xshift,yshift,zshift
327 !2 Jul 2017 lipidc parameters -----------------------------------------------------
328       real(kind=8),dimension(:), allocatable :: liptranene
329       real(kind=8) :: pepliptran
330
331 ! 4 Jul 2017 parameters for shieliding 
332       real(kind=8),dimension(:), allocatable :: long_r_sidechain, &
333         short_r_sidechain
334       real(kind=8) :: VSolvSphere,VSolvSphere_div,buff_shield
335 ! AFM
336        real(kind=8) :: distafminit,forceAFMconst,velAFMconst
337       integer :: afmend,afmbeg
338
339
340
341
342       end module energy_data