Debian Codegraph @

contrib/iapbs/modules/Amber/patches/amber9_sander.patch

raw
1 diff -ur sander.orig/depend sander/depend
2 --- sander.orig/depend 2006-04-03 16:35:54.000000000 -0700
3 +++ sander/depend 2007-09-25 11:54:11.000000000 -0700
4 @@ -187,6 +187,13 @@
5 amopen.o: \
6 copyright.h
7
8 +apbs.o: \
9 + dprec.h\
10 + files.h
11 +
12 +apbs_vars.o: \
13 + dprec.h
14 +
15 assert.o: \
16 copyright.h\
17 assert.h
18 @@ -1104,6 +1111,7 @@
19 egb.o\
20 pb_force.o\
21 np_force.o\
22 + apbs.o\
23 trace.o\
24 stack.o\
25 qmmm_module.o\
26 @@ -1149,6 +1157,7 @@
27 egb.LES.o\
28 pb_force.o\
29 np_force.o\
30 + apbs.o\
31 trace.o\
32 stack.o\
33 qmmm_module.o\
34 @@ -1193,6 +1202,7 @@
35 egb.o\
36 pb_force.o\
37 np_force.o\
38 + apbs.o\
39 trace.o\
40 stack.o\
41 qmmm_module.o\
42 @@ -1238,6 +1248,7 @@
43 egb.PIMD.o\
44 pb_force.o\
45 np_force.o\
46 + apbs.o\
47 trace.o\
48 stack.o\
49 qmmm_module.PIMD.o\
50 @@ -1393,6 +1404,7 @@
51 pimd_vars.o\
52 stack.o\
53 nmr.o\
54 + apbs.o\
55 box.h\
56 def_time.h\
57 ew_cntrl.h\
58 @@ -1431,6 +1443,7 @@
59 pimd_vars.o\
60 stack.o\
61 nmr.LES.o\
62 + apbs.o\
63 box.h\
64 def_time.h\
65 ew_cntrl.h\
66 @@ -1473,6 +1486,7 @@
67 pimd_vars.o\
68 stack.o\
69 nmr.o\
70 + apbs.o\
71 box.h\
72 def_time.h\
73 ew_cntrl.h\
74 @@ -1515,6 +1529,7 @@
75 pimd_vars.PIMD.o\
76 stack.o\
77 nmr.LES.o\
78 + apbs.o\
79 box.h\
80 def_time.h\
81 ew_cntrl.h\
82 @@ -2970,6 +2985,7 @@
83 amoeba_runmd.o\
84 amoeba_mdin.o\
85 amoeba_interface.o\
86 + apbs.o\
87 pimd_vars.o\
88 files.h\
89 memory.h\
90 @@ -3009,6 +3025,7 @@
91 amoeba_runmd.o\
92 amoeba_mdin.o\
93 amoeba_interface.o\
94 + apbs.o\
95 pimd_vars.o\
96 files.h\
97 memory.h\
98 @@ -3052,6 +3069,7 @@
99 amoeba_runmd.o\
100 amoeba_mdin.o\
101 amoeba_interface.o\
102 + apbs.o\
103 spatial_dcmp.o\
104 pimd_vars.o\
105 files.h\
106 @@ -3096,6 +3114,7 @@
107 amoeba_runmd.o\
108 amoeba_mdin.o\
109 amoeba_interface.o\
110 + apbs.o\
111 pimd_vars.PIMD.o\
112 files.h\
113 memory.h\
114 diff -ur sander.orig/dynlib.f sander/dynlib.f
115 --- sander.orig/dynlib.f 2006-04-03 16:35:54.000000000 -0700
116 +++ sander/dynlib.f 2007-09-25 12:06:53.000000000 -0700
117 @@ -340,6 +340,10 @@
118 write(6,9058) eel,ehbond,econst
119 else if ( igb == 10 ) then
120 write(6,9060) eel,ehbond,econst
121 +#ifdef APBS
122 + else if (igb == 6 .and. mdin_apbs ) then
123 + write(6,9060) eel,ehbond,econst
124 +#endif /* APBS */
125 else
126 write(6,9059) eel,ehbond,econst
127 end if
128 @@ -374,6 +378,9 @@
129 end if
130 if (gbsa > 0) write(6,9077) esurf
131 if (igb == 10) write(6,9074) esurf,edisp
132 +#ifdef APBS
133 + if (igb == 6 .and. mdin_apbs ) write(6,9087) esurf
134 +#endif /* APBS */
135 if (econst /= 0.0) write(6,9076) epot-econst
136 if ( dvdl /= 0.d0) write(6,9089) dvdl
137 #ifdef PIMD
138 @@ -430,6 +437,10 @@
139 write(7,9058) eel,ehbond,econst
140 else if ( igb == 10 ) then
141 write(7,9060) eel,ehbond,econst
142 +#ifdef APBS
143 + else if (igb == 6 .and. mdin_apbs ) then
144 + write(7,9060) eel,ehbond,econst
145 +#endif /* APBS */
146 else
147 write(7,9059) eel,ehbond,econst
148 end if
149 @@ -464,6 +475,9 @@
150 end if
151 if (gbsa > 0) write(7,9077) esurf
152 if (igb == 10) write(7,9074) esurf,edisp
153 +#ifdef APBS
154 + if (igb == 6 .and. mdin_apbs ) write(7,9087) esurf
155 +#endif /* APBS */
156 if (econst /= 0.0) write(7,9076) epot-econst
157 if ( dvdl /= 0.d0) write(7,9089) dvdl
158 #ifndef LES
159 @@ -523,7 +537,7 @@
160 9084 format (1x,'PDDGMNDO-ESCF= ',f11.4)
161 9085 format (1x,'PM3CARB1-ESCF= ',f11.4)
162 9086 format (1x,'DFTBESCF= ',f13.4)
163 -
164 + 9087 format (1x,'ENPOLAR= ',f14.4)
165 #ifdef LES
166 ! LES and non-LES temperatures (no solvent/solute)
167 9068 format (1x,'T_non-LES =',f10.4,2x, 'T_LES = ',f10.4)
168 diff -ur sander.orig/files.h sander/files.h
169 --- sander.orig/files.h 2006-04-03 16:35:55.000000000 -0700
170 +++ sander/files.h 2007-09-12 12:50:23.000000000 -0700
171 @@ -45,7 +45,12 @@
172
173 logical mdin_ewald,mdin_pb,mdin_amoeba
174
175 +#ifdef APBS
176 +logical mdin_apbs, sp_apbs
177 +common/mdin_flags/mdin_ewald,mdin_pb,mdin_amoeba,mdin_apbs,sp_apbs
178 +#else
179 common/mdin_flags/mdin_ewald,mdin_pb,mdin_amoeba
180 +#endif /* APBS */
181
182 integer BC_HULP ! size in integers of common HULP
183 parameter ( BC_HULP = 9 )
184 diff -ur sander.orig/force.f sander/force.f
185 --- sander.orig/force.f 2006-04-03 16:35:55.000000000 -0700
186 +++ sander/force.f 2007-09-25 10:36:12.000000000 -0700
187 @@ -11,6 +11,9 @@
188 use genborn
189 use poisson_boltzmann, only : pb_force
190 use dispersion_cavity, only : npopt, np_force
191 +#ifdef APBS
192 + use apbs
193 +#endif /* APBS */
194 use trace
195 use stack
196 use qmmm_module, only : qmmm_nml,qmmm_struct, qm2_struct, &
197 @@ -114,7 +117,7 @@
198 save ene
199
200 integer i,m,nttyp,i3
201 - _REAL_ virvsene,eelt,epol,esurf,edisp
202 + _REAL_ virvsene,eelt,epol,esurf,edisp,enpol
203 _REAL_ epolar,aveper,aveind,avetot,emtot,dipiter,dipole_temp
204 integer l_r2x,l_rjx,l_tmp1,l_tmp2,l_tmp3,l_tmp4,l_tmp5
205 integer l_tmp6,l_tmp7,l_tmp8,l_jj,l_skipv, l_kvls,l_jvls,l_psi
206 @@ -802,6 +805,33 @@
207
208 end if ! ( igb == 10 )
209
210 +#ifdef APBS
211 +! APBS forces
212 + if( mdin_apbs ) then
213 + if (igb /= 6) then
214 + write(6,*) '&apbs keyword requires igb=6.'
215 + call mexit(6,1)
216 + end if
217 +
218 + call timer_start(TIME_PBFORCE)
219 +
220 +! in: coords, radii, charges
221 +! out: updated forces (via apbs_params) and solvation energy (pol + apolar)
222 +
223 + if (sp_apbs) then
224 + call apbs_spenergy(natom, x, f, eelt, enpol)
225 + else
226 + call apbs_force(natom, x, f, ene(2), eelt, enpol)
227 + end if
228 +! ene(2) =
229 +! ene(3) =
230 + ene(4) = eelt
231 + ene(23) = enpol
232 + call timer_stop(TIME_PBFORCE)
233 +
234 + end if ! ( mdin_apbs )
235 +#endif /* APBS */
236 +
237 #ifdef MPI
238 end if
239 #endif
240 diff -ur sander.orig/Makefile sander/Makefile
241 --- sander.orig/Makefile 2006-04-03 16:35:54.000000000 -0700
242 +++ sander/Makefile 2007-09-12 12:50:23.000000000 -0700
243 @@ -42,6 +42,9 @@
244 amoeba_direct.o amoeba_mdin.o amoeba_adjust.o amoeba_self.o\
245 amoeba_vdw.o amoeba_induced.o amoeba_runmd.o
246
247 +APBSOBJ= \
248 + apbs_vars.o apbs.o
249 +
250 QMOBJ= \
251 qm_mm.o qm_link_atoms.o qm_nb_list.o qm_extract_coords.o \
252 qm_ewald.o qm_gb.o qm_zero_charges.o qm_print_info.o \
253 @@ -211,6 +214,19 @@
254 ../lib/nxtsec.o ../lib/sys.a $(NETCDFLIB) $(LOADLIB)
255
256 #---------------------------------------------------------------------------
257 +sander.APBS$(SFX): $(NETCDF) $(APBSOBJ) $(MMOBJ) $(QMOBJ) $(QM2OBJ) \
258 + $(QMMMOBJ_DFTB) \
259 + qm_div.o force.o syslib \
260 + nxtsec lapack blas lmod divcon checkserconf
261 + $(LOAD) -o sander.APBS$(SFX) $(APBSOBJ) $(MMOBJ) $(QMOBJ) $(QM2OBJ) \
262 + $(QMMMOBJ_DFTB) \
263 + qm_div.o force.o \
264 + -L$(APBS_LIB) -liapbs -lapbsmainroutines -lapbs -lmaloc \
265 + ../lmod/lmod.a ../dcqtp/src/qmmm/libdivcon.a $(LOADLIB) \
266 + ../lapack/lapack.a ../blas/blas.a \
267 + ../lib/nxtsec.o ../lib/sys.a $(NETCDFLIB)
268 +
269 +#---------------------------------------------------------------------------
270 psander$(SFX): $(NETCDF) $(PSOBJ) $(QMOBJ) $(QM2OBJ) $(QMMMOBJ_DFTB) \
271 qm_div.o force.PS.o syslib \
272 syslib nxtsec lapack blas lmod
273 diff -ur sander.orig/mdread.f sander/mdread.f
274 --- sander.orig/mdread.f 2006-04-03 16:35:55.000000000 -0700
275 +++ sander/mdread.f 2007-09-25 12:11:49.000000000 -0700
276 @@ -15,6 +15,9 @@
277 #endif
278 use stack, only: lastist,lastrst
279 use nmr, only: echoin
280 +#ifdef APBS
281 + use apbs
282 +#endif /* APBS */
283 implicit none
284 # include "box.h"
285 # include "def_time.h"
286 @@ -281,6 +284,9 @@
287 mdin_cntrl=.false.
288 mdin_ewald=.false.
289 mdin_pb=.false.
290 +#ifdef APBS
291 + mdin_apbs = .false.
292 +#endif /* APBS */
293 mdin_lmod=.false.
294 mdin_amoeba=.false.
295 iamoeba = 0
296 @@ -294,6 +300,11 @@
297 call nmlsrc('pb',5,ifind)
298 if (ifind /= 0) mdin_pb=.true.
299
300 +#ifdef APBS
301 + call nmlsrc('apbs',5,ifind)
302 + if (ifind /= 0) mdin_apbs=.true.
303 +#endif /* APBS */
304 +
305 call nmlsrc('lmod',5,ifind)
306 if (ifind /= 0) mdin_lmod=.true.
307
308 @@ -425,6 +436,12 @@
309 call pb_read
310 end if
311
312 +#ifdef APBS
313 + if ( mdin_apbs ) then
314 + call apbs_read
315 + end if
316 +#endif /* APBS */
317 +
318 if( iamoeba == 1 ) then
319 if( mdin_amoeba ) then
320 call AMOEBA_read_mdin(5)
321 @@ -728,7 +745,7 @@
322 ', iesp =',iesp
323 write(6,'(5x,3(a,f10.5))') 'dielc =',dielc, &
324 ', cut =',cut,', intdiel =',intdiel
325 -
326 +
327 if( igb /= 0 .and. igb /= 10) then
328 write(6,'(5x,3(a,f10.5))') 'saltcon =',saltcon, &
329 ', offset =',offset,', gbalpha= ',gbalpha
330 @@ -996,7 +1013,11 @@
331 write(0,*) 'GBSA=2 only works for single point energy calc'
332 call mexit( 6,1 )
333 end if
334 +#ifdef APBS
335 + if( igb /= 0 .and. igb /= 10 .and. .not.mdin_apbs ) then
336 +#else
337 if( igb /= 0 .and. igb /= 10) then
338 +#endif /* APBS */
339 #ifdef LES
340 write(6,*) 'igb=1,5,7 are working with LES, no SA term included'
341 #endif
342 @@ -1289,7 +1310,7 @@
343 call pb_init(ifcap,natom,nres,ntypes,nbonh,nbona,ix(i02),ix(i04),ix(i06),ix(i08),ix(i10),&
344 ix(iibh),ix(ijbh),ix(iiba),ix(ijba),ih(m02),ih(m04),ih(m06),x(l15),x(l97))
345 end if ! ( igb == 10 )
346 -
347 +
348 if (icnstph /= 0) then
349 ! Read charge data and alter current charges accordingly
350 call cnstphread(ix(icpstinf),ix(icpresst),ix(icpptcnt), &
351 @@ -1639,7 +1660,12 @@
352 write(6,'(/,a)') ' igb>0 is only compatible with ntb=0'
353 inerr = 1
354 end if
355 +#ifdef APBS
356 + if ( ntb == 0 .and. sqrt(cut) < 8.05 .and. igb /= 10 .and. &
357 + .not.mdin_apbs ) then
358 +#else
359 if ( ntb == 0 .and. sqrt(cut) < 8.05 .and. igb /= 10 ) then
360 +#endif /* APBS */
361 write(6,'(/,a,f8.2)') ' unreasonably small cut for non-periodic run: ', &
362 sqrt(cut)
363 inerr = 1
364 @@ -2083,7 +2109,7 @@
365 ih(m06),ix,x,ix(i08),ix(i10),fmn, &
366 nspm,ix(i70),x(l75),tmass,tmassinv,x(lmass),x(lwinv),req)
367 endif
368 -
369 +
370 ! DEBUG input; force checking
371 call load_debug(5)
372
373 diff -ur sander.orig/printe.f sander/printe.f
374 --- sander.orig/printe.f 2006-04-03 16:35:55.000000000 -0700
375 +++ sander/printe.f 2007-09-23 21:53:02.000000000 -0700
376 @@ -172,6 +172,9 @@
377 # include "ew_mpole.h"
378 # include "ew_cntrl.h"
379 # include "tgtmd.h"
380 +#ifdef APBS
381 +# include "files.h"
382 +#endif /* APBS */
383
384 _REAL_ epot,enonb,enele,ehbond,ebond,eangle,edihed,enb14,eel14
385 _REAL_ econst,epolar,aveper,aveind,avetot,esurf,edisp,diprms,dipiter
386 @@ -209,6 +212,10 @@
387 write(6,9048) enonb,enele,ehbond
388 else if ( igb == 10 ) then
389 write(6,9050) enonb,enele,ehbond
390 +#ifdef APBS
391 + else if ( igb == 6 .and. mdin_apbs ) then
392 + write(6,9050) enonb,enele,ehbond
393 +#endif /* APBS */
394 else
395 write(6,9049) enonb,enele,ehbond
396 end if
397 @@ -235,6 +242,9 @@
398 end if
399 if( gbsa > 0 ) write(6,9077) esurf
400 if (igb == 10) write(6,9074) esurf,edisp
401 +#ifdef APBS
402 + if (igb == 6 .and. mdin_apbs ) write(6,9069) esurf
403 +#endif /* APBS */
404 if (epolar /= 0.0) write(6,9068) epolar
405 if (econst /= 0.0) write(6,9078) epot-econst
406 if ( dvdl /= 0.d0) write(6,9089) dvdl
407 @@ -259,6 +269,10 @@
408 write(7,9048) enonb,enele,ehbond
409 else if ( igb == 10 ) then
410 write(7,9050) enonb,enele,ehbond
411 +#ifdef APBS
412 + else if ( igb == 6 .and. mdin_apbs ) then
413 + write(7,9050) enonb,enele,ehbond
414 +#endif /* APBS */
415 else
416 write(7,9049) enonb,enele,ehbond
417 end if
418 @@ -285,6 +299,9 @@
419 end if
420 if( gbsa > 0 ) write(7,9077) esurf
421 if ( igb == 10 ) write(7,9074) esurf,edisp
422 +#ifdef APBS
423 + if (igb == 6 .and. mdin_apbs ) write(7,9069) esurf
424 +#endif /* APBS */
425 if (epolar /= 0.0) write(7,9068) epolar
426 if (econst /= 0.0) write(7,9078) epot-econst
427 if ( dvdl /= 0.d0) write(7,9089) dvdl
428 @@ -307,6 +324,9 @@
429 9058 format (1x,'1-4 VDW = ',f13.4,2x,'1-4 EEL = ',f13.4,2x, &
430 'RESTRAINT = ',f13.4)
431 9068 format (1x,'EPOLAR = ',f13.4)
432 +#ifdef APBS
433 + 9069 format (1x,'ENPOLAR = ',f13.4)
434 +#endif /* APBS */
435 9074 format (1x,'ECAVITY = ',f13.4,2x,'EDISPER = ',f13.4)
436 9077 format (1x,'ESURF = ',f13.4)
437 9078 format (1x,'EAMBER = ',f13.4)
438 diff -ur sander.orig/sander.f sander/sander.f
439 --- sander.orig/sander.f 2006-04-03 16:35:55.000000000 -0700
440 +++ sander/sander.f 2007-09-25 11:01:07.000000000 -0700
441 @@ -34,6 +34,11 @@
442 use amoeba_mdin, only : beeman_integrator
443 use amoeba_interface, only: &
444 AMOEBA_deallocate,AMOEBA_readparm
445 +
446 +#ifdef APBS
447 + use apbs
448 +#endif /* APBS */
449 +
450 #ifdef PSANDER
451 use spatial, only:deallocate_psander
452 #endif
453 @@ -335,6 +340,16 @@
454
455 if( igb == 0 .and. induced == 1 ) call get_dips(x,nr)
456
457 +#ifdef APBS
458 +! APBS initialization
459 + if ( mdin_apbs ) then
460 +! in: natom, coords, charge and radii (from prmtop)
461 +! out: pb charges and pb radii (via apbs_vars module)
462 + call apbs_init(natom, x(lcrd), x(l15), x(l97))
463 + end if
464 +#endif /* APBS */
465 +
466 +
467 ! ----- SET THE INITIAL VELOCITIES -----
468
469 if (ntx <= 3) then