48 #include "./base/base_uses.f90"
52 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'force_fields_ext'
70 TYPE(force_field_type),
INTENT(INOUT) :: ff_type
71 TYPE(mp_para_env_type),
POINTER :: para_env
72 TYPE(section_vals_type),
POINTER :: mm_section
74 CHARACTER(len=*),
PARAMETER :: routinen =
'read_force_field_gromos'
75 REAL(kind=
dp),
PARAMETER :: ekt = 2.5_dp
77 CHARACTER(LEN=default_string_length) :: label
78 CHARACTER(LEN=default_string_length), &
79 DIMENSION(21) :: avail_section
80 CHARACTER(LEN=default_string_length),
POINTER :: namearray(:)
81 INTEGER :: handle, iatom, icon, itemp, itype, iw, &
82 jatom, ncon, ntype, offset
84 REAL(kind=
dp) :: cosphi0, cost2, csq, sdet
85 TYPE(cp_logger_type),
POINTER :: logger
86 TYPE(cp_parser_type) :: parser
87 TYPE(gromos_info_type),
POINTER :: gro_info
89 CALL timeset(routinen, handle)
95 avail_section(1) =
"TITLE"
96 avail_section(2) =
"TOPPHYSCON"
97 avail_section(3) =
"TOPVERSION"
98 avail_section(4) =
"ATOMTYPENAME"
99 avail_section(5) =
"RESNAME"
100 avail_section(6) =
"SOLUTEATOM"
101 avail_section(7) =
"BONDTYPE"
102 avail_section(8) =
"BONDH"
103 avail_section(9) =
"BOND"
104 avail_section(10) =
"BONDANGLETYPE"
105 avail_section(11) =
"BONDANGLEH"
106 avail_section(12) =
"BONDANGLE"
107 avail_section(13) =
"IMPDIHEDRALTYPE"
108 avail_section(14) =
"IMPDIHEDRALH"
109 avail_section(15) =
"IMPDIHEDRAL"
110 avail_section(16) =
"DIHEDRALTYPE"
111 avail_section(17) =
"DIHEDRALH"
112 avail_section(18) =
"DIHEDRAL"
113 avail_section(19) =
"LJPARAMETERS"
114 avail_section(20) =
"SOLVENTATOM"
115 avail_section(21) =
"SOLVENTCONSTR"
117 gro_info => ff_type%gro_info
118 gro_info%ff_gromos_type = ff_type%ff_type
121 IF (iw > 0)
WRITE (iw,
'(T2,A)')
'GTOP_INFO| Parsing the ATOMTYPENAME section'
122 CALL parser_create(parser, ff_type%ff_file_name, para_env=para_env)
123 label = trim(avail_section(4))
127 CALL parser_get_object(parser, ntype)
128 CALL reallocate(namearray, 1, ntype)
131 CALL parser_get_object(parser, namearray(itype), lower_to_upper=.true.)
132 IF (iw > 0)
WRITE (iw, *)
"GTOP_INFO| ", trim(namearray(itype))
138 IF (iw > 0)
WRITE (iw,
'(T2,A)')
'GROMOS_FF| Parsing the SOLVENTATOM section'
139 CALL parser_create(parser, ff_type%ff_file_name, para_env=para_env)
141 label = trim(avail_section(21))
145 CALL parser_get_object(parser, ncon)
146 CALL reallocate(gro_info%solvent_k, 1, ncon)
147 CALL reallocate(gro_info%solvent_r0, 1, ncon)
150 CALL parser_get_object(parser, itemp)
151 CALL parser_get_object(parser, itemp)
152 CALL parser_get_object(parser, gro_info%solvent_r0(icon))
153 gro_info%solvent_k(icon) = 0.0_dp
158 CALL parser_create(parser, ff_type%ff_file_name, para_env=para_env)
160 IF (iw > 0)
WRITE (iw,
'(T2,A)')
'GROMOS_FF| Parsing the BONDTYPE section'
161 label = trim(avail_section(7))
165 CALL parser_get_object(parser, ntype)
166 CALL reallocate(gro_info%bond_k, 1, ntype)
167 CALL reallocate(gro_info%bond_r0, 1, ntype)
170 CALL parser_get_object(parser, gro_info%bond_k(itype))
171 CALL parser_get_object(parser, gro_info%bond_r0(itype))
173 gro_info%bond_k(itype) =
cp_unit_to_cp2k(gro_info%bond_k(itype),
"kjmol*nm^-4")
175 gro_info%bond_k(itype) = (2.0_dp)*gro_info%bond_k(itype)*gro_info%bond_r0(itype)**2
176 gro_info%bond_k(itype) =
cp_unit_to_cp2k(gro_info%bond_k(itype),
"kjmol*nm^-2")
178 gro_info%bond_r0(itype) =
cp_unit_to_cp2k(gro_info%bond_r0(itype),
"nm")
179 IF (iw > 0)
WRITE (iw, *)
"GROMOS_FF| PUT BONDTYPE INFO HERE!!!!"
184 IF (iw > 0)
WRITE (iw,
'(T2,A)')
'GROMOS_FF| Parsing the BONDANGLETYPE section'
185 label = trim(avail_section(10))
189 CALL parser_get_object(parser, ntype)
190 CALL reallocate(gro_info%bend_k, 1, ntype)
191 CALL reallocate(gro_info%bend_theta0, 1, ntype)
194 CALL parser_get_object(parser, gro_info%bend_k(itype))
195 CALL parser_get_object(parser, gro_info%bend_theta0(itype))
196 gro_info%bend_theta0(itype) =
cp_unit_to_cp2k(gro_info%bend_theta0(itype),
"deg")
198 gro_info%bend_theta0(itype) = cos(gro_info%bend_theta0(itype))
200 cost2 = cos(gro_info%bend_theta0(itype))*cos(gro_info%bend_theta0(itype))
201 sdet = cost2*cost2 - (2.0_dp*cost2 - 1.0_dp)*(1.0_dp - ekt/gro_info%bend_k(itype))
202 csq = (cost2 - sqrt(sdet))/(2.0_dp*cost2 - 1.0_dp)
203 gro_info%bend_k(itype) = ekt/acos(csq)**2
205 gro_info%bend_k(itype) =
cp_unit_to_cp2k(gro_info%bend_k(itype),
"kjmol")
206 IF (iw > 0)
WRITE (iw, *)
"GROMOS_FF| PUT BONDANGLETYPE INFO HERE!!!!"
211 IF (iw > 0)
WRITE (iw,
'(T2,A)')
'GROMOS_FF| Parsing the IMPDIHEDRALTYPE section'
212 label = trim(avail_section(13))
216 CALL parser_get_object(parser, ntype)
217 CALL reallocate(gro_info%impr_k, 1, ntype)
218 CALL reallocate(gro_info%impr_phi0, 1, ntype)
221 CALL parser_get_object(parser, gro_info%impr_k(itype))
222 CALL parser_get_object(parser, gro_info%impr_phi0(itype))
223 gro_info%impr_phi0(itype) =
cp_unit_to_cp2k(gro_info%impr_phi0(itype),
"deg")
224 gro_info%impr_k(itype) =
cp_unit_to_cp2k(gro_info%impr_k(itype),
"kjmol*deg^-2")
225 IF (iw > 0)
WRITE (iw, *)
"GROMOS_FF| PUT IMPDIHEDRALTYPE INFO HERE!!!!"
230 IF (iw > 0)
WRITE (iw,
'(T2,A)')
'GROMOS_FF| Parsing the DIHEDRALTYPE section'
231 label = trim(avail_section(16))
235 CALL parser_get_object(parser, ntype)
236 CALL reallocate(gro_info%torsion_k, 1, ntype)
237 CALL reallocate(gro_info%torsion_m, 1, ntype)
238 CALL reallocate(gro_info%torsion_phi0, 1, ntype)
241 CALL parser_get_object(parser, gro_info%torsion_k(itype))
242 CALL parser_get_object(parser, cosphi0)
243 CALL parser_get_object(parser, gro_info%torsion_m(itype))
244 gro_info%torsion_phi0(itype) = acos(cosphi0)
245 gro_info%torsion_k(itype) =
cp_unit_to_cp2k(gro_info%torsion_k(itype),
"kjmol")
246 IF (iw > 0)
WRITE (iw, *)
"GROMOS_FF| PUT DIHEDRALTYPE INFO HERE!!!!"
253 IF (iw > 0)
WRITE (iw,
'(T2,A)')
'GROMOS_FF| Parsing the LJPARAMETERS section'
254 CALL parser_create(parser, ff_type%ff_file_name, para_env=para_env)
255 label = trim(avail_section(19))
259 CALL parser_get_object(parser, ntype)
261 IF (
ASSOCIATED(gro_info%nonbond_a)) offset =
SIZE(gro_info%nonbond_a)
262 ntype =
SIZE(namearray)
263 CALL reallocate(gro_info%nonbond_a, 1, ntype)
264 CALL reallocate(gro_info%nonbond_a_14, 1, ntype)
265 CALL reallocate(gro_info%nonbond_c6, 1, ntype, 1, ntype)
266 CALL reallocate(gro_info%nonbond_c12, 1, ntype, 1, ntype)
267 CALL reallocate(gro_info%nonbond_c6_14, 1, ntype, 1, ntype)
268 CALL reallocate(gro_info%nonbond_c12_14, 1, ntype, 1, ntype)
270 gro_info%nonbond_c12 = 0._dp
271 gro_info%nonbond_c6 = 0._dp
272 gro_info%nonbond_c12_14 = 0._dp
273 gro_info%nonbond_c6_14 = 0._dp
275 DO itype = 1, ntype*(ntype + 1)/2
277 CALL parser_get_object(parser, iatom)
278 CALL parser_get_object(parser, jatom)
279 IF (iatom == jatom)
THEN
280 gro_info%nonbond_a(iatom) = namearray(iatom)
281 gro_info%nonbond_a_14(iatom) = namearray(iatom)
283 CALL parser_get_object(parser, gro_info%nonbond_c12(iatom, jatom))
284 CALL parser_get_object(parser, gro_info%nonbond_c6(iatom, jatom))
285 CALL parser_get_object(parser, gro_info%nonbond_c12_14(iatom, jatom))
286 CALL parser_get_object(parser, gro_info%nonbond_c6_14(iatom, jatom))
287 gro_info%nonbond_c6(iatom, jatom) =
cp_unit_to_cp2k(gro_info%nonbond_c6(iatom, jatom),
"kjmol*nm^6")
288 gro_info%nonbond_c12(iatom, jatom) =
cp_unit_to_cp2k(gro_info%nonbond_c12(iatom, jatom),
"kjmol*nm^12")
289 gro_info%nonbond_c6_14(iatom, jatom) =
cp_unit_to_cp2k(gro_info%nonbond_c6_14(iatom, jatom),
"kjmol*nm^6")
290 gro_info%nonbond_c12_14(iatom, jatom) =
cp_unit_to_cp2k(gro_info%nonbond_c12_14(iatom, jatom),
"kjmol*nm^12")
292 gro_info%nonbond_c6_14(jatom, iatom) = gro_info%nonbond_c6_14(iatom, jatom)
293 gro_info%nonbond_c12_14(jatom, iatom) = gro_info%nonbond_c12_14(iatom, jatom)
294 gro_info%nonbond_c6(jatom, iatom) = gro_info%nonbond_c6(iatom, jatom)
295 gro_info%nonbond_c12(jatom, iatom) = gro_info%nonbond_c12(iatom, jatom)
296 IF (iw > 0)
WRITE (iw, *)
"GROMOS_FF| PUT LJPARAMETERS INFO HERE!!!!"
303 CALL timestop(handle)
305 DEALLOCATE (namearray)
317 TYPE(force_field_type),
INTENT(INOUT) :: ff_type
318 TYPE(mp_para_env_type),
POINTER :: para_env
319 TYPE(section_vals_type),
POINTER :: mm_section
321 CHARACTER(len=*),
PARAMETER :: routinen =
'read_force_field_charmm'
323 CHARACTER(LEN=default_string_length) :: label, string, string2, string3, string4
324 CHARACTER(LEN=default_string_length),
DIMENSION(1) :: bond_section
325 CHARACTER(LEN=default_string_length),
DIMENSION(2) :: angl_section, impr_section, &
326 nbon_section, thet_section
327 CHARACTER(LEN=default_string_length), &
328 DIMENSION(20) :: avail_section
329 INTEGER :: dummy, handle, ilab, iw, nbend, nbond, &
330 nimpr, nnonbond, nonfo, ntorsion, nub
332 TYPE(charmm_info_type),
POINTER :: chm_info
333 TYPE(cp_logger_type),
POINTER :: logger
334 TYPE(cp_parser_type) :: parser
336 CALL timeset(routinen, handle)
342 avail_section(1) =
"BOND"; bond_section(1) = avail_section(1)
343 avail_section(11) =
"BONDS"
344 avail_section(2) =
"ANGL"; angl_section(1) = avail_section(2)
345 avail_section(3) =
"THETA"; angl_section(2) = avail_section(3)
346 avail_section(12) =
"THETAS"
347 avail_section(13) =
"ANGLE"
348 avail_section(14) =
"ANGLES"
349 avail_section(4) =
"DIHEDRAL"; thet_section(1) = avail_section(4)
350 avail_section(15) =
"DIHEDRALS"
351 avail_section(5) =
"PHI"; thet_section(2) = avail_section(5)
352 avail_section(6) =
"IMPROPER"; impr_section(1) = avail_section(6)
353 avail_section(20) =
"IMPROPERS"
354 avail_section(7) =
"IMPH"; impr_section(2) = avail_section(7)
355 avail_section(16) =
"IMPHI"
356 avail_section(8) =
"NONBONDED"; nbon_section(1) = avail_section(8)
357 avail_section(9) =
"NBOND"; nbon_section(2) = avail_section(9)
358 avail_section(10) =
"HBOND"
359 avail_section(17) =
"NBFIX"
360 avail_section(18) =
"CMAP"
361 avail_section(19) =
"END"
363 chm_info => ff_type%chm_info
371 DO ilab = 1,
SIZE(bond_section)
372 CALL parser_create(parser, ff_type%ff_file_name, para_env=para_env)
373 label = trim(bond_section(ilab))
377 CALL parser_get_object(parser, string)
378 IF (index(string, trim(label)) /= 1) cycle
379 CALL charmm_get_next_line(parser, 1)
381 CALL parser_get_object(parser, string)
383 IF (any(string == avail_section))
EXIT
384 CALL parser_get_object(parser, string2)
387 CALL reallocate(chm_info%bond_a, 1, nbond)
388 CALL reallocate(chm_info%bond_b, 1, nbond)
389 CALL reallocate(chm_info%bond_k, 1, nbond)
390 CALL reallocate(chm_info%bond_r0, 1, nbond)
391 chm_info%bond_a(nbond) = string
392 chm_info%bond_b(nbond) = string2
393 CALL parser_get_object(parser, chm_info%bond_k(nbond))
394 CALL parser_get_object(parser, chm_info%bond_r0(nbond))
395 IF (iw > 0)
WRITE (iw, *)
" CHM BOND ", nbond, &
396 trim(chm_info%bond_a(nbond)),
" ", &
397 trim(chm_info%bond_b(nbond)),
" ", &
398 chm_info%bond_k(nbond), &
399 chm_info%bond_r0(nbond)
401 chm_info%bond_r0(nbond) =
cp_unit_to_cp2k(chm_info%bond_r0(nbond),
"angstrom")
402 chm_info%bond_k(nbond) =
cp_unit_to_cp2k(chm_info%bond_k(nbond),
"kcalmol*angstrom^-2")
403 CALL charmm_get_next_line(parser, 1)
422 DO ilab = 1,
SIZE(angl_section)
423 CALL parser_create(parser, ff_type%ff_file_name, para_env=para_env)
424 label = trim(angl_section(ilab))
428 CALL parser_get_object(parser, string)
429 IF (index(string, trim(label)) /= 1) cycle
430 CALL charmm_get_next_line(parser, 1)
432 CALL parser_get_object(parser, string)
434 IF (any(string == avail_section))
EXIT
435 CALL parser_get_object(parser, string2)
436 CALL parser_get_object(parser, string3)
440 CALL reallocate(chm_info%bend_a, 1, nbend)
441 CALL reallocate(chm_info%bend_b, 1, nbend)
442 CALL reallocate(chm_info%bend_c, 1, nbend)
443 CALL reallocate(chm_info%bend_k, 1, nbend)
444 CALL reallocate(chm_info%bend_theta0, 1, nbend)
445 chm_info%bend_a(nbend) = string
446 chm_info%bend_b(nbend) = string2
447 chm_info%bend_c(nbend) = string3
448 CALL parser_get_object(parser, chm_info%bend_k(nbend))
449 CALL parser_get_object(parser, chm_info%bend_theta0(nbend))
450 IF (iw > 0)
WRITE (iw, *)
" CHM BEND ", nbend, &
451 trim(chm_info%bend_a(nbend)),
" ", &
452 trim(chm_info%bend_b(nbend)),
" ", &
453 trim(chm_info%bend_c(nbend)),
" ", &
454 chm_info%bend_k(nbend), &
455 chm_info%bend_theta0(nbend)
457 chm_info%bend_theta0(nbend) =
cp_unit_to_cp2k(chm_info%bend_theta0(nbend),
"deg")
458 chm_info%bend_k(nbend) =
cp_unit_to_cp2k(chm_info%bend_k(nbend),
"kcalmol*rad^-2")
461 CALL reallocate(chm_info%ub_a, 1, nub)
462 CALL reallocate(chm_info%ub_b, 1, nub)
463 CALL reallocate(chm_info%ub_c, 1, nub)
464 CALL reallocate(chm_info%ub_k, 1, nub)
465 CALL reallocate(chm_info%ub_r0, 1, nub)
466 chm_info%ub_a(nub) = string
467 chm_info%ub_b(nub) = string2
468 chm_info%ub_c(nub) = string3
469 CALL parser_get_object(parser, chm_info%ub_k(nub))
470 CALL parser_get_object(parser, chm_info%ub_r0(nub))
471 IF (iw > 0)
WRITE (iw, *)
" CHM UB ", nub, &
472 trim(chm_info%ub_a(nub)),
" ", &
473 trim(chm_info%ub_b(nub)),
" ", &
474 trim(chm_info%ub_c(nub)),
" ", &
475 chm_info%ub_k(nub), &
479 chm_info%ub_k(nub) =
cp_unit_to_cp2k(chm_info%ub_k(nub),
"kcalmol*angstrom^-2")
481 CALL charmm_get_next_line(parser, 1)
496 DO ilab = 1,
SIZE(thet_section)
497 CALL parser_create(parser, ff_type%ff_file_name, para_env=para_env)
498 label = trim(thet_section(ilab))
502 CALL parser_get_object(parser, string)
503 IF (index(string, trim(label)) /= 1) cycle
504 CALL charmm_get_next_line(parser, 1)
506 CALL parser_get_object(parser, string)
508 IF (any(string == avail_section))
EXIT
509 CALL parser_get_object(parser, string2)
510 CALL parser_get_object(parser, string3)
511 CALL parser_get_object(parser, string4)
515 ntorsion = ntorsion + 1
516 CALL reallocate(chm_info%torsion_a, 1, ntorsion)
517 CALL reallocate(chm_info%torsion_b, 1, ntorsion)
518 CALL reallocate(chm_info%torsion_c, 1, ntorsion)
519 CALL reallocate(chm_info%torsion_d, 1, ntorsion)
520 CALL reallocate(chm_info%torsion_k, 1, ntorsion)
521 CALL reallocate(chm_info%torsion_m, 1, ntorsion)
522 CALL reallocate(chm_info%torsion_phi0, 1, ntorsion)
523 chm_info%torsion_a(ntorsion) = string
524 chm_info%torsion_b(ntorsion) = string2
525 chm_info%torsion_c(ntorsion) = string3
526 chm_info%torsion_d(ntorsion) = string4
527 CALL parser_get_object(parser, chm_info%torsion_k(ntorsion))
528 CALL parser_get_object(parser, chm_info%torsion_m(ntorsion))
529 CALL parser_get_object(parser, chm_info%torsion_phi0(ntorsion))
530 IF (iw > 0)
WRITE (iw, *)
" CHM TORSION ", ntorsion, &
531 trim(chm_info%torsion_a(ntorsion)),
" ", &
532 trim(chm_info%torsion_b(ntorsion)),
" ", &
533 trim(chm_info%torsion_c(ntorsion)),
" ", &
534 trim(chm_info%torsion_d(ntorsion)),
" ", &
535 chm_info%torsion_k(ntorsion), &
536 chm_info%torsion_m(ntorsion), &
537 chm_info%torsion_phi0(ntorsion)
539 chm_info%torsion_phi0(ntorsion) =
cp_unit_to_cp2k(chm_info%torsion_phi0(ntorsion), &
541 chm_info%torsion_k(ntorsion) =
cp_unit_to_cp2k(chm_info%torsion_k(ntorsion),
"kcalmol")
542 CALL charmm_get_next_line(parser, 1)
557 DO ilab = 1,
SIZE(impr_section)
558 CALL parser_create(parser, ff_type%ff_file_name, para_env=para_env)
559 label = trim(impr_section(ilab))
563 CALL parser_get_object(parser, string)
564 IF (index(string, trim(label)) /= 1) cycle
565 CALL charmm_get_next_line(parser, 1)
567 CALL parser_get_object(parser, string)
569 IF (any(string == avail_section))
EXIT
570 CALL parser_get_object(parser, string2)
571 CALL parser_get_object(parser, string3)
572 CALL parser_get_object(parser, string4)
577 CALL reallocate(chm_info%impr_a, 1, nimpr)
578 CALL reallocate(chm_info%impr_b, 1, nimpr)
579 CALL reallocate(chm_info%impr_c, 1, nimpr)
580 CALL reallocate(chm_info%impr_d, 1, nimpr)
581 CALL reallocate(chm_info%impr_k, 1, nimpr)
582 CALL reallocate(chm_info%impr_phi0, 1, nimpr)
583 chm_info%impr_a(nimpr) = string
584 chm_info%impr_b(nimpr) = string2
585 chm_info%impr_c(nimpr) = string3
586 chm_info%impr_d(nimpr) = string4
587 CALL parser_get_object(parser, chm_info%impr_k(nimpr))
588 CALL parser_get_object(parser, dummy)
589 CALL parser_get_object(parser, chm_info%impr_phi0(nimpr))
590 IF (iw > 0)
WRITE (iw, *)
" CHM IMPROPERS ", nimpr, &
591 trim(chm_info%impr_a(nimpr)),
" ", &
592 trim(chm_info%impr_b(nimpr)),
" ", &
593 trim(chm_info%impr_c(nimpr)),
" ", &
594 trim(chm_info%impr_d(nimpr)),
" ", &
595 chm_info%impr_k(nimpr), &
596 chm_info%impr_phi0(nimpr)
598 chm_info%impr_phi0(nimpr) =
cp_unit_to_cp2k(chm_info%impr_phi0(nimpr),
"deg")
599 chm_info%impr_k(nimpr) =
cp_unit_to_cp2k(chm_info%impr_k(nimpr),
"kcalmol")
600 CALL charmm_get_next_line(parser, 1)
614 DO ilab = 1,
SIZE(nbon_section)
615 CALL parser_create(parser, ff_type%ff_file_name, para_env=para_env)
616 label = trim(nbon_section(ilab))
620 CALL parser_get_object(parser, string)
621 IF (index(string, trim(label)) /= 1) cycle
622 CALL charmm_get_next_line(parser, 1)
624 CALL parser_get_object(parser, string)
626 IF (any(string == avail_section))
EXIT
627 nnonbond = nnonbond + 1
628 CALL reallocate(chm_info%nonbond_a, 1, nnonbond)
629 CALL reallocate(chm_info%nonbond_eps, 1, nnonbond)
630 CALL reallocate(chm_info%nonbond_rmin2, 1, nnonbond)
631 chm_info%nonbond_a(nnonbond) = string
632 CALL parser_get_object(parser, chm_info%nonbond_eps(nnonbond))
633 CALL parser_get_object(parser, chm_info%nonbond_eps(nnonbond))
634 CALL parser_get_object(parser, chm_info%nonbond_rmin2(nnonbond))
635 IF (iw > 0)
WRITE (iw, *)
" CHM NONBOND ", nnonbond, &
636 trim(chm_info%nonbond_a(nnonbond)),
" ", &
637 chm_info%nonbond_eps(nnonbond), &
638 chm_info%nonbond_rmin2(nnonbond)
639 chm_info%nonbond_rmin2(nnonbond) =
cp_unit_to_cp2k(chm_info%nonbond_rmin2(nnonbond), &
641 chm_info%nonbond_eps(nnonbond) =
cp_unit_to_cp2k(chm_info%nonbond_eps(nnonbond), &
645 CALL reallocate(chm_info%nonbond_a_14, 1, nonfo)
646 CALL reallocate(chm_info%nonbond_eps_14, 1, nonfo)
647 CALL reallocate(chm_info%nonbond_rmin2_14, 1, nonfo)
648 chm_info%nonbond_a_14(nonfo) = chm_info%nonbond_a(nnonbond)
649 CALL parser_get_object(parser, chm_info%nonbond_eps_14(nonfo))
650 CALL parser_get_object(parser, chm_info%nonbond_eps_14(nonfo))
651 CALL parser_get_object(parser, chm_info%nonbond_rmin2_14(nonfo))
652 IF (iw > 0)
WRITE (iw, *)
" CHM ONFO ", nonfo, &
653 trim(chm_info%nonbond_a_14(nonfo)),
" ", &
654 chm_info%nonbond_eps_14(nonfo), &
655 chm_info%nonbond_rmin2_14(nonfo)
656 chm_info%nonbond_rmin2_14(nonfo) =
cp_unit_to_cp2k(chm_info%nonbond_rmin2_14(nonfo), &
658 chm_info%nonbond_eps_14(nonfo) =
cp_unit_to_cp2k(chm_info%nonbond_eps_14(nonfo), &
661 CALL charmm_get_next_line(parser, 1)
671 CALL timestop(handle)
685 TYPE(force_field_type),
INTENT(INOUT) :: ff_type
686 TYPE(mp_para_env_type),
POINTER :: para_env
687 TYPE(section_vals_type),
POINTER :: mm_section
688 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
690 CHARACTER(len=*),
PARAMETER :: routinen =
'read_force_field_amber'
692 INTEGER :: handle, i, iw
693 TYPE(amber_info_type),
POINTER :: amb_info
694 TYPE(cp_logger_type),
POINTER :: logger
696 CALL timeset(routinen, handle)
702 amb_info => ff_type%amb_info
705 CALL rdparm_amber_8(ff_type%ff_file_name, iw, para_env, do_connectivity=.false., &
706 do_forcefield=.true., particle_set=particle_set, amb_info=amb_info)
713 DO i = 1,
SIZE(amb_info%bond_a)
714 IF (iw > 0)
WRITE (iw, *)
" AMB BOND ", i, &
715 trim(amb_info%bond_a(i)),
" ", &
716 trim(amb_info%bond_b(i)),
" ", &
717 amb_info%bond_k(i), &
722 amb_info%bond_k(i) =
cp_unit_to_cp2k(amb_info%bond_k(i),
"kcalmol*angstrom^-2")
733 DO i = 1,
SIZE(amb_info%bend_a)
734 IF (iw > 0)
WRITE (iw, *)
" AMB BEND ", i, &
735 trim(amb_info%bend_a(i)),
" ", &
736 trim(amb_info%bend_b(i)),
" ", &
737 trim(amb_info%bend_c(i)),
" ", &
738 amb_info%bend_k(i), &
739 amb_info%bend_theta0(i)
742 amb_info%bend_theta0(i) =
cp_unit_to_cp2k(amb_info%bend_theta0(i),
"rad")
743 amb_info%bend_k(i) =
cp_unit_to_cp2k(amb_info%bend_k(i),
"kcalmol*rad^-2")
751 DO i = 1,
SIZE(amb_info%torsion_a)
752 IF (iw > 0)
WRITE (iw, *)
" AMB TORSION ", i, &
753 trim(amb_info%torsion_a(i)),
" ", &
754 trim(amb_info%torsion_b(i)),
" ", &
755 trim(amb_info%torsion_c(i)),
" ", &
756 trim(amb_info%torsion_d(i)),
" ", &
757 amb_info%torsion_k(i), &
758 amb_info%torsion_m(i), &
759 amb_info%torsion_phi0(i)
762 amb_info%torsion_phi0(i) =
cp_unit_to_cp2k(amb_info%torsion_phi0(i),
"rad")
763 amb_info%torsion_k(i) =
cp_unit_to_cp2k(amb_info%torsion_k(i),
"kcalmol")
767 IF (
ASSOCIATED(amb_info%raw_torsion_phi0))
THEN
768 DO i = 1,
SIZE(amb_info%raw_torsion_k)
769 amb_info%raw_torsion_phi0(i) =
cp_unit_to_cp2k(amb_info%raw_torsion_phi0(i),
"rad")
770 amb_info%raw_torsion_k(i) =
cp_unit_to_cp2k(amb_info%raw_torsion_k(i),
"kcalmol")
777 DO i = 1,
SIZE(amb_info%nonbond_eps)
778 IF (iw > 0)
WRITE (iw, *)
" AMB NONBOND ", i, &
779 trim(amb_info%nonbond_a(i)),
" ", &
780 amb_info%nonbond_eps(i), &
781 amb_info%nonbond_rmin2(i)
784 amb_info%nonbond_rmin2(i) =
cp_unit_to_cp2k(amb_info%nonbond_rmin2(i),
"angstrom")
785 amb_info%nonbond_eps(i) =
cp_unit_to_cp2k(amb_info%nonbond_eps(i),
"kcalmol")
788 CALL timestop(handle)
801 SUBROUTINE charmm_get_next_line(parser, nline)
802 TYPE(cp_parser_type),
INTENT(INOUT) :: parser
803 INTEGER,
INTENT(IN) :: nline
805 CHARACTER(LEN=1),
PARAMETER :: continuation_char =
"-"
807 INTEGER :: i, len_line
810 len_line = len_trim(parser%input_line)
811 DO WHILE (parser%input_line(len_line:len_line) == continuation_char)
813 len_line = len_trim(parser%input_line)
818 END SUBROUTINE charmm_get_next_line
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_get_next_line(parser, nline, at_end)
Read the next input line and broadcast the input information. Skip (nline-1) lines and skip also all ...
character(len=3) function, public parser_test_next_token(parser, string_length)
Test next input object.
subroutine, public parser_search_string(parser, string, ignore_case, found, line, begin_line, search_from_begin_of_file)
Search a string pattern in a file defined by its logical unit number "unit". A case sensitive search ...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Define all structure types related to force field kinds.
integer, parameter, public do_ff_g96
Define all structures types related to force_fields.
subroutine, public read_force_field_gromos(ff_type, para_env, mm_section)
Reads the GROMOS force_field.
subroutine, public read_force_field_charmm(ff_type, para_env, mm_section)
Reads the charmm force_field.
subroutine, public read_force_field_amber(ff_type, para_env, mm_section, particle_set)
Reads the AMBER force_field.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Utility routines for the memory handling.
Interface to the message passing library MPI.
Define the data structure for the particle information.
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
Handles all functions used to read and interpret AMBER coordinates and topology files.
subroutine, public rdparm_amber_8(filename, output_unit, para_env, do_connectivity, do_forcefield, atom_info, conn_info, amb_info, particle_set)
Access information form the AMBER topology file Notes on file structure: