(git:50ddb19)
Loading...
Searching...
No Matches
topology_psf.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Functionality to read in PSF topologies and convert it into local
10!> data structures
11!> \author ikuo
12!> tlaino 10.2006
13! **************************************************************************************************
30 USE input_constants, ONLY: do_conn_psf,&
36 USE kinds, ONLY: default_path_length,&
38 dp
42 USE string_table, ONLY: id2str,&
43 s2s,&
44 str2id
52 USE util, ONLY: sort
53#include "./base/base_uses.f90"
54
55 IMPLICIT NONE
56
57 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'topology_psf'
58
59 PRIVATE
60 PUBLIC :: read_topology_psf, &
64
65CONTAINS
66
67! **************************************************************************************************
68!> \brief Read PSF topology file
69!> Teodoro Laino - Introduced CHARMM31 EXT PSF standard format
70!> \param filename ...
71!> \param topology ...
72!> \param para_env ...
73!> \param subsys_section ...
74!> \param psf_type ...
75!> \par History
76!> 04-2007 Teodoro Laino - Zurich University [tlaino]
77!> This routine should contain only information read from the PSF format
78!> and all post_process should be performef in the psf_post_process
79! **************************************************************************************************
80 SUBROUTINE read_topology_psf(filename, topology, para_env, subsys_section, psf_type)
81 CHARACTER(LEN=*), INTENT(IN) :: filename
82 TYPE(topology_parameters_type), INTENT(INOUT) :: topology
83 TYPE(mp_para_env_type), POINTER :: para_env
84 TYPE(section_vals_type), POINTER :: subsys_section
85 INTEGER, INTENT(IN) :: psf_type
86
87 CHARACTER(len=*), PARAMETER :: routinen = 'read_topology_psf'
88
89 CHARACTER(LEN=2*default_string_length) :: psf_format
90 CHARACTER(LEN=3) :: c_int
91 CHARACTER(LEN=default_string_length) :: dummy_field, field, label, strtmp1, &
92 strtmp2, strtmp3
93 INTEGER :: handle, i, iatom, ibond, idum, index_now, iphi, itheta, iw, natom, natom_prev, &
94 nbond, nbond_prev, nphi, nphi_prev, ntheta, ntheta_prev, output_unit
95 LOGICAL :: found
96 TYPE(atom_info_type), POINTER :: atom_info
97 TYPE(connectivity_info_type), POINTER :: conn_info
98 TYPE(cp_logger_type), POINTER :: logger
99 TYPE(cp_parser_type) :: parser
100
101 NULLIFY (logger)
102 logger => cp_get_default_logger()
103 output_unit = cp_logger_get_default_io_unit(logger)
104 iw = cp_print_key_unit_nr(logger, subsys_section, "PRINT%TOPOLOGY_INFO/PSF_INFO", &
105 extension=".subsysLog")
106 CALL timeset(routinen, handle)
107 CALL parser_create(parser, filename, para_env=para_env)
108
109 atom_info => topology%atom_info
110 conn_info => topology%conn_info
111 natom_prev = 0
112 IF (ASSOCIATED(atom_info%id_molname)) natom_prev = SIZE(atom_info%id_molname)
113 c_int = 'I8'
114 label = 'PSF'
115 CALL parser_search_string(parser, label, .true., found, begin_line=.true.)
116 IF (.NOT. found) THEN
117 CALL cp_abort(__location__, &
118 "Missing PSF specification line in <"//trim(filename)//">")
119 END IF
120 DO WHILE (parser_test_next_token(parser) /= "EOL")
121 CALL parser_get_object(parser, field)
122 SELECT CASE (field(1:3))
123 CASE ("PSF")
124 IF (psf_type == do_conn_psf) THEN
125 ! X-PLOR PSF format "similar" to the plain CHARMM PSF format
126 psf_format = '(I8,1X,A4,I5,1X,A4,1X,A4,1X,A4,1X,2G14.6,I8)'
127 END IF
128 CASE ("EXT")
129 IF (psf_type == do_conn_psf) THEN
130 ! EXTEnded CHARMM31 format
131 psf_format = '(I10,T12,A7,T21,I8,T30,A7,T39,A6,T47,A6,T53,F10.6,T69,F8.3,T88,I1)'
132 c_int = 'I10'
133 ELSE
134 cpabort("PSF_INFO| "//field(1:3)//" :: not available for UPSF format!")
135 END IF
136 CASE DEFAULT
137 cpabort("PSF_INFO| "//field(1:3)//" :: Unimplemented keyword in CP2K PSF/UPSF format!")
138 END SELECT
139 END DO
140 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| Parsing the NATOM section'
141 !
142 ! ATOM section
143 !
144 label = '!NATOM'
145 CALL parser_search_string(parser, label, .true., found, begin_line=.true.)
146 IF (.NOT. found) THEN
147 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| No NATOM section '
148 natom = 0
149 ELSE
150 CALL parser_get_object(parser, natom)
151 IF (natom_prev + natom > topology%natoms) THEN
152 CALL cp_abort(__location__, &
153 "Number of atoms in connectivity control is larger than the "// &
154 "number of atoms in coordinate control. check coordinates and "// &
155 "connectivity. ")
156 END IF
157 IF (iw > 0) WRITE (iw, '(T2,A,'//trim(c_int)//')') 'PSF_INFO| NATOM = ', natom
158 !malloc the memory that we need
159 CALL reallocate(atom_info%id_molname, 1, natom_prev + natom)
160 CALL reallocate(atom_info%resid, 1, natom_prev + natom)
161 CALL reallocate(atom_info%id_resname, 1, natom_prev + natom)
162 CALL reallocate(atom_info%id_atmname, 1, natom_prev + natom)
163 CALL reallocate(atom_info%atm_charge, 1, natom_prev + natom)
164 CALL reallocate(atom_info%atm_mass, 1, natom_prev + natom)
165 !Read in the atom info
166 IF (psf_type == do_conn_psf_u) THEN
167 DO iatom = 1, natom
168 index_now = iatom + natom_prev
169 CALL parser_get_next_line(parser, 1)
170 READ (parser%input_line, fmt=*, err=9) i, &
171 strtmp1, &
172 atom_info%resid(index_now), &
173 strtmp2, &
174 dummy_field, &
175 strtmp3, &
176 atom_info%atm_charge(index_now), &
177 atom_info%atm_mass(index_now)
178 atom_info%id_molname(index_now) = str2id(s2s(strtmp1))
179 atom_info%id_resname(index_now) = str2id(s2s(strtmp2))
180 atom_info%id_atmname(index_now) = str2id(s2s(strtmp3))
181 END DO
182 ELSE
183 DO iatom = 1, natom
184 index_now = iatom + natom_prev
185 CALL parser_get_next_line(parser, 1)
186 READ (parser%input_line, fmt=psf_format) &
187 i, &
188 strtmp1, &
189 atom_info%resid(index_now), &
190 strtmp2, &
191 dummy_field, &
192 strtmp3, &
193 atom_info%atm_charge(index_now), &
194 atom_info%atm_mass(index_now), &
195 idum
196 atom_info%id_molname(index_now) = str2id(s2s(strtmp1))
197 atom_info%id_resname(index_now) = str2id(s2s(strtmp2))
198 atom_info%id_atmname(index_now) = str2id(s2s(adjustl(strtmp3)))
199 END DO
200 END IF
201 END IF
202
203 !
204 ! BOND section
205 !
206 nbond_prev = 0
207 IF (ASSOCIATED(conn_info%bond_a)) nbond_prev = SIZE(conn_info%bond_a)
208
209 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| Parsing the NBOND section'
210 IF (iw > 0) WRITE (iw, '(T2,A,I8)') 'PSF_INFO| Previous number of allocated BOND: ', nbond_prev
211 label = '!NBOND'
212 CALL parser_search_string(parser, label, .true., found, begin_line=.true.)
213 IF (.NOT. found) THEN
214 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| No NBOND section '
215 nbond = 0
216 ELSE
217 CALL parser_get_object(parser, nbond)
218 IF (iw > 0) WRITE (iw, '(T2,A,'//trim(c_int)//')') 'PSF_INFO| NBOND = ', nbond
219 !malloc the memory that we need
220 CALL reallocate(conn_info%bond_a, 1, nbond_prev + nbond)
221 CALL reallocate(conn_info%bond_b, 1, nbond_prev + nbond)
222 !Read in the bond info
223 IF (psf_type == do_conn_psf_u) THEN
224 DO ibond = 1, nbond, 4
225 CALL parser_get_next_line(parser, 1)
226 index_now = nbond_prev + ibond - 1
227 READ (parser%input_line, fmt=*, err=9) (conn_info%bond_a(index_now + i), &
228 conn_info%bond_b(index_now + i), &
229 i=1, min(4, (nbond - ibond + 1)))
230 END DO
231 ELSE
232 DO ibond = 1, nbond, 4
233 CALL parser_get_next_line(parser, 1)
234 index_now = nbond_prev + ibond - 1
235 READ (parser%input_line, fmt='(8'//trim(c_int)//')') &
236 (conn_info%bond_a(index_now + i), &
237 conn_info%bond_b(index_now + i), &
238 i=1, min(4, (nbond - ibond + 1)))
239 END DO
240 END IF
241 IF (any(conn_info%bond_a(nbond_prev + 1:) <= 0) .OR. &
242 any(conn_info%bond_a(nbond_prev + 1:) > natom) .OR. &
243 any(conn_info%bond_b(nbond_prev + 1:) <= 0) .OR. &
244 any(conn_info%bond_b(nbond_prev + 1:) > natom)) THEN
245 cpabort("topology_read, invalid bond")
246 END IF
247 conn_info%bond_a(nbond_prev + 1:) = conn_info%bond_a(nbond_prev + 1:) + natom_prev
248 conn_info%bond_b(nbond_prev + 1:) = conn_info%bond_b(nbond_prev + 1:) + natom_prev
249 END IF
250 !
251 ! THETA section
252 !
253 ntheta_prev = 0
254 IF (ASSOCIATED(conn_info%theta_a)) ntheta_prev = SIZE(conn_info%theta_a)
255
256 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| Parsing the NTHETA section'
257 IF (iw > 0) WRITE (iw, '(T2,A,I8)') 'PSF_INFO| Previous number of allocated THETA: ', ntheta_prev
258 label = '!NTHETA'
259 CALL parser_search_string(parser, label, .true., found, begin_line=.true.)
260 IF (.NOT. found) THEN
261 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| No NTHETA section '
262 ntheta = 0
263 ELSE
264 CALL parser_get_object(parser, ntheta)
265 IF (iw > 0) WRITE (iw, '(T2,A,'//trim(c_int)//')') 'PSF_INFO| NTHETA = ', ntheta
266 !malloc the memory that we need
267 CALL reallocate(conn_info%theta_a, 1, ntheta_prev + ntheta)
268 CALL reallocate(conn_info%theta_b, 1, ntheta_prev + ntheta)
269 CALL reallocate(conn_info%theta_c, 1, ntheta_prev + ntheta)
270 !Read in the bend info
271 IF (psf_type == do_conn_psf_u) THEN
272 DO itheta = 1, ntheta, 3
273 CALL parser_get_next_line(parser, 1)
274 index_now = ntheta_prev + itheta - 1
275 READ (parser%input_line, fmt=*, err=9) (conn_info%theta_a(index_now + i), &
276 conn_info%theta_b(index_now + i), &
277 conn_info%theta_c(index_now + i), &
278 i=1, min(3, (ntheta - itheta + 1)))
279 END DO
280 ELSE
281 DO itheta = 1, ntheta, 3
282 CALL parser_get_next_line(parser, 1)
283 index_now = ntheta_prev + itheta - 1
284 READ (parser%input_line, fmt='(9'//trim(c_int)//')') &
285 (conn_info%theta_a(index_now + i), &
286 conn_info%theta_b(index_now + i), &
287 conn_info%theta_c(index_now + i), &
288 i=1, min(3, (ntheta - itheta + 1)))
289 END DO
290 END IF
291 conn_info%theta_a(ntheta_prev + 1:) = conn_info%theta_a(ntheta_prev + 1:) + natom_prev
292 conn_info%theta_b(ntheta_prev + 1:) = conn_info%theta_b(ntheta_prev + 1:) + natom_prev
293 conn_info%theta_c(ntheta_prev + 1:) = conn_info%theta_c(ntheta_prev + 1:) + natom_prev
294 END IF
295 !
296 ! PHI section
297 !
298 nphi_prev = 0
299 IF (ASSOCIATED(conn_info%phi_a)) nphi_prev = SIZE(conn_info%phi_a)
300
301 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| Parsing the NPHI section'
302 IF (iw > 0) WRITE (iw, '(T2,A,I8)') 'PSF_INFO| Previous number of allocated PHI: ', nphi_prev
303 label = '!NPHI'
304 CALL parser_search_string(parser, label, .true., found, begin_line=.true.)
305 IF (.NOT. found) THEN
306 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| No NPHI section '
307 nphi = 0
308 ELSE
309 CALL parser_get_object(parser, nphi)
310 IF (iw > 0) WRITE (iw, '(T2,A,'//trim(c_int)//')') 'PSF_INFO| NPHI = ', nphi
311 !malloc the memory that we need
312 CALL reallocate(conn_info%phi_a, 1, nphi_prev + nphi)
313 CALL reallocate(conn_info%phi_b, 1, nphi_prev + nphi)
314 CALL reallocate(conn_info%phi_c, 1, nphi_prev + nphi)
315 CALL reallocate(conn_info%phi_d, 1, nphi_prev + nphi)
316 !Read in the torsion info
317 IF (psf_type == do_conn_psf_u) THEN
318 DO iphi = 1, nphi, 2
319 CALL parser_get_next_line(parser, 1)
320 index_now = nphi_prev + iphi - 1
321 READ (parser%input_line, fmt=*, err=9) (conn_info%phi_a(index_now + i), &
322 conn_info%phi_b(index_now + i), &
323 conn_info%phi_c(index_now + i), &
324 conn_info%phi_d(index_now + i), &
325 i=1, min(2, (nphi - iphi + 1)))
326 END DO
327 ELSE
328 DO iphi = 1, nphi, 2
329 CALL parser_get_next_line(parser, 1)
330 index_now = nphi_prev + iphi - 1
331 READ (parser%input_line, fmt='(8'//trim(c_int)//')') &
332 (conn_info%phi_a(index_now + i), &
333 conn_info%phi_b(index_now + i), &
334 conn_info%phi_c(index_now + i), &
335 conn_info%phi_d(index_now + i), &
336 i=1, min(2, (nphi - iphi + 1)))
337 END DO
338 END IF
339 conn_info%phi_a(nphi_prev + 1:) = conn_info%phi_a(nphi_prev + 1:) + natom_prev
340 conn_info%phi_b(nphi_prev + 1:) = conn_info%phi_b(nphi_prev + 1:) + natom_prev
341 conn_info%phi_c(nphi_prev + 1:) = conn_info%phi_c(nphi_prev + 1:) + natom_prev
342 conn_info%phi_d(nphi_prev + 1:) = conn_info%phi_d(nphi_prev + 1:) + natom_prev
343 END IF
344 !
345 ! IMPHI section
346 !
347 nphi_prev = 0
348 IF (ASSOCIATED(conn_info%impr_a)) nphi_prev = SIZE(conn_info%impr_a)
349
350 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| Parsing the NIMPHI section'
351 IF (iw > 0) WRITE (iw, '(T2,A,I8)') 'PSF_INFO| Previous number of allocated IMPHI: ', nphi_prev
352 label = '!NIMPHI'
353 CALL parser_search_string(parser, label, .true., found, begin_line=.true.)
354 IF (.NOT. found) THEN
355 IF (iw > 0) WRITE (iw, '(T2,A)') 'PSF_INFO| No NIMPHI section '
356 nphi = 0
357 ELSE
358 CALL parser_get_object(parser, nphi)
359 IF (iw > 0) WRITE (iw, '(T2,A,'//trim(c_int)//')') 'PSF_INFO| NIMPR = ', nphi
360 !malloc the memory that we need
361 CALL reallocate(conn_info%impr_a, 1, nphi_prev + nphi)
362 CALL reallocate(conn_info%impr_b, 1, nphi_prev + nphi)
363 CALL reallocate(conn_info%impr_c, 1, nphi_prev + nphi)
364 CALL reallocate(conn_info%impr_d, 1, nphi_prev + nphi)
365 !Read in the improper torsion info
366 IF (psf_type == do_conn_psf_u) THEN
367 DO iphi = 1, nphi, 2
368 CALL parser_get_next_line(parser, 1)
369 index_now = nphi_prev + iphi - 1
370 READ (parser%input_line, fmt=*, err=9) (conn_info%impr_a(index_now + i), &
371 conn_info%impr_b(index_now + i), &
372 conn_info%impr_c(index_now + i), &
373 conn_info%impr_d(index_now + i), &
374 i=1, min(2, (nphi - iphi + 1)))
375 END DO
376 ELSE
377 DO iphi = 1, nphi, 2
378 CALL parser_get_next_line(parser, 1)
379 index_now = nphi_prev + iphi - 1
380 READ (parser%input_line, fmt='(8'//trim(c_int)//')') &
381 (conn_info%impr_a(index_now + i), &
382 conn_info%impr_b(index_now + i), &
383 conn_info%impr_c(index_now + i), &
384 conn_info%impr_d(index_now + i), &
385 i=1, min(2, (nphi - iphi + 1)))
386 END DO
387 END IF
388 conn_info%impr_a(nphi_prev + 1:) = conn_info%impr_a(nphi_prev + 1:) + natom_prev
389 conn_info%impr_b(nphi_prev + 1:) = conn_info%impr_b(nphi_prev + 1:) + natom_prev
390 conn_info%impr_c(nphi_prev + 1:) = conn_info%impr_c(nphi_prev + 1:) + natom_prev
391 conn_info%impr_d(nphi_prev + 1:) = conn_info%impr_d(nphi_prev + 1:) + natom_prev
392 END IF
393
394 CALL parser_release(parser)
395 CALL timestop(handle)
396 CALL cp_print_key_finished_output(iw, logger, subsys_section, &
397 "PRINT%TOPOLOGY_INFO/PSF_INFO")
398 RETURN
3999 CONTINUE
400 ! Print error and exit
401 IF (output_unit > 0) THEN
402 WRITE (output_unit, '(T2,A)') &
403 "PSF_INFO| Error while reading PSF using the unformatted PSF reading option!", &
404 "PSF_INFO| Try using PSF instead of UPSF."
405 END IF
406
407 cpabort("Error while reading PSF data!")
408
409 END SUBROUTINE read_topology_psf
410
411! **************************************************************************************************
412!> \brief Post processing of PSF informations
413!> \param topology ...
414!> \param subsys_section ...
415! **************************************************************************************************
416 SUBROUTINE psf_post_process(topology, subsys_section)
417 TYPE(topology_parameters_type), INTENT(INOUT) :: topology
418 TYPE(section_vals_type), POINTER :: subsys_section
419
420 CHARACTER(len=*), PARAMETER :: routinen = 'psf_post_process'
421
422 INTEGER :: handle, i, iatom, ibond, ionfo, iw, &
423 jatom, n, natom, nbond, nonfo, nphi, &
424 ntheta
425 TYPE(array1_list_type), DIMENSION(:), POINTER :: ex_bend_list, ex_bond_list
426 TYPE(atom_info_type), POINTER :: atom_info
427 TYPE(connectivity_info_type), POINTER :: conn_info
428 TYPE(cp_logger_type), POINTER :: logger
429
430 NULLIFY (logger)
431 logger => cp_get_default_logger()
432 iw = cp_print_key_unit_nr(logger, subsys_section, "PRINT%TOPOLOGY_INFO/PSF_INFO", &
433 extension=".subsysLog")
434 CALL timeset(routinen, handle)
435 atom_info => topology%atom_info
436 conn_info => topology%conn_info
437 !
438 ! PARA_RES structure
439 !
440 natom = 0
441 nbond = 0
442 i = 0
443 IF (ASSOCIATED(atom_info%id_molname)) natom = SIZE(atom_info%id_molname)
444 IF (ASSOCIATED(conn_info%bond_a)) nbond = SIZE(conn_info%bond_a)
445 IF (ASSOCIATED(conn_info%c_bond_a)) i = SIZE(conn_info%c_bond_a)
446 DO ibond = 1, nbond
447 iatom = conn_info%bond_a(ibond)
448 jatom = conn_info%bond_b(ibond)
449 IF (topology%para_res) THEN
450 IF ((atom_info%id_molname(iatom) /= atom_info%id_molname(jatom)) .OR. &
451 (atom_info%resid(iatom) /= atom_info%resid(jatom)) .OR. &
452 (atom_info%id_resname(iatom) /= atom_info%id_resname(jatom))) THEN
453 IF (iw > 0) WRITE (iw, '(T2,A,2I6)') "PSF_INFO| PARA_RES, bond between molecules atom ", &
454 iatom, jatom
455 i = i + 1
456 CALL reallocate(conn_info%c_bond_a, 1, i)
457 CALL reallocate(conn_info%c_bond_b, 1, i)
458 conn_info%c_bond_a(i) = iatom
459 conn_info%c_bond_b(i) = jatom
460 END IF
461 ELSE
462 cpassert(atom_info%id_molname(iatom) == atom_info%id_molname(jatom))
463 END IF
464 END DO
465 !
466 ! UB structure
467 !
468 ntheta = 0
469 IF (ASSOCIATED(conn_info%theta_a)) ntheta = SIZE(conn_info%theta_a)
470 CALL reallocate(conn_info%ub_a, 1, ntheta)
471 CALL reallocate(conn_info%ub_b, 1, ntheta)
472 CALL reallocate(conn_info%ub_c, 1, ntheta)
473 conn_info%ub_a(:) = conn_info%theta_a(:)
474 conn_info%ub_b(:) = conn_info%theta_b(:)
475 conn_info%ub_c(:) = conn_info%theta_c(:)
476 !
477 ! ONFO structure
478 !
479 nphi = 0
480 nonfo = 0
481 IF (ASSOCIATED(conn_info%phi_a)) nphi = SIZE(conn_info%phi_a)
482 CALL reallocate(conn_info%onfo_a, 1, nphi)
483 CALL reallocate(conn_info%onfo_b, 1, nphi)
484 conn_info%onfo_a(1:) = conn_info%phi_a(1:)
485 conn_info%onfo_b(1:) = conn_info%phi_d(1:)
486 ! Reorder bonds
487 ALLOCATE (ex_bond_list(natom))
488 DO i = 1, natom
489 ALLOCATE (ex_bond_list(i)%array1(0))
490 END DO
491 n = 0
492 IF (ASSOCIATED(conn_info%bond_a)) n = SIZE(conn_info%bond_a)
493 CALL reorder_structure(ex_bond_list, conn_info%bond_a, conn_info%bond_b, n)
494 ! Reorder bends
495 ALLOCATE (ex_bend_list(natom))
496 DO i = 1, natom
497 ALLOCATE (ex_bend_list(i)%array1(0))
498 END DO
499 n = 0
500 IF (ASSOCIATED(conn_info%theta_a)) n = SIZE(conn_info%theta_a)
501 CALL reorder_structure(ex_bend_list, conn_info%theta_a, conn_info%theta_c, n)
502 DO ionfo = 1, nphi
503 ! Check if the torsion is not shared between angles or bonds
504 IF (any(ex_bond_list(conn_info%onfo_a(ionfo))%array1 == conn_info%onfo_b(ionfo)) .OR. &
505 any(ex_bend_list(conn_info%onfo_a(ionfo))%array1 == conn_info%onfo_b(ionfo))) cycle
506 nonfo = nonfo + 1
507 conn_info%onfo_a(nonfo) = conn_info%onfo_a(ionfo)
508 conn_info%onfo_b(nonfo) = conn_info%onfo_b(ionfo)
509 END DO
510 ! deallocate bends
511 DO i = 1, natom
512 DEALLOCATE (ex_bend_list(i)%array1)
513 END DO
514 DEALLOCATE (ex_bend_list)
515 ! deallocate bonds
516 DO i = 1, natom
517 DEALLOCATE (ex_bond_list(i)%array1)
518 END DO
519 DEALLOCATE (ex_bond_list)
520 ! Get unique onfo
521 ALLOCATE (ex_bond_list(natom))
522 DO i = 1, natom
523 ALLOCATE (ex_bond_list(i)%array1(0))
524 END DO
525 n = 0
526 IF (ASSOCIATED(conn_info%onfo_a)) n = nonfo
527 CALL reorder_structure(ex_bond_list, conn_info%onfo_a, conn_info%onfo_b, n)
528 nonfo = 0
529 DO i = 1, natom
530 DO ionfo = 1, SIZE(ex_bond_list(i)%array1)
531 IF (count(ex_bond_list(i)%array1 == ex_bond_list(i)%array1(ionfo)) /= 1) THEN
532 ex_bond_list(i)%array1(ionfo) = 0
533 ELSE
534 IF (ex_bond_list(i)%array1(ionfo) <= i) cycle
535 nonfo = nonfo + 1
536 conn_info%onfo_a(nonfo) = i
537 conn_info%onfo_b(nonfo) = ex_bond_list(i)%array1(ionfo)
538 END IF
539 END DO
540 END DO
541 DO i = 1, natom
542 DEALLOCATE (ex_bond_list(i)%array1)
543 END DO
544 DEALLOCATE (ex_bond_list)
545 CALL reallocate(conn_info%onfo_a, 1, nonfo)
546 CALL reallocate(conn_info%onfo_b, 1, nonfo)
547
548 CALL timestop(handle)
549 CALL cp_print_key_finished_output(iw, logger, subsys_section, &
550 "PRINT%TOPOLOGY_INFO/PSF_INFO")
551 END SUBROUTINE psf_post_process
552
553! **************************************************************************************************
554!> \brief Input driven modification (IDM) of PSF defined structures
555!> \param topology ...
556!> \param section ...
557!> \param subsys_section ...
558!> \author Teodoro Laino - Zurich University 04.2007
559! **************************************************************************************************
560 SUBROUTINE idm_psf(topology, section, subsys_section)
561 TYPE(topology_parameters_type), INTENT(INOUT) :: topology
562 TYPE(section_vals_type), POINTER :: section, subsys_section
563
564 CHARACTER(len=*), PARAMETER :: routinen = 'idm_psf'
565
566 INTEGER :: handle, i, iend, iend1, istart, istart1, &
567 item, iw, j, mol_id, n_rep, natom, &
568 nbond, nimpr, noe, nphi, ntheta
569 INTEGER, DIMENSION(:), POINTER :: tag_mols, tmp, wrk
570 LOGICAL :: explicit
571 TYPE(array1_list_type), DIMENSION(:), POINTER :: ex_bond_list
572 TYPE(atom_info_type), POINTER :: atom_info
573 TYPE(connectivity_info_type), POINTER :: conn_info
574 TYPE(cp_logger_type), POINTER :: logger
575 TYPE(section_vals_type), POINTER :: subsection
576
577 NULLIFY (logger)
578 logger => cp_get_default_logger()
579 iw = cp_print_key_unit_nr(logger, subsys_section, "PRINT%TOPOLOGY_INFO/PSF_INFO", &
580 extension=".subsysLog")
581 CALL timeset(routinen, handle)
582 CALL section_vals_get(section, explicit=explicit)
583 IF (explicit) THEN
584 atom_info => topology%atom_info
585 conn_info => topology%conn_info
586 natom = 0
587 IF (ASSOCIATED(atom_info%id_molname)) natom = SIZE(atom_info%id_molname)
588 nbond = 0
589 IF (ASSOCIATED(conn_info%bond_a)) nbond = SIZE(conn_info%bond_a)
590 ntheta = 0
591 IF (ASSOCIATED(conn_info%theta_a)) ntheta = SIZE(conn_info%theta_a)
592 nphi = 0
593 IF (ASSOCIATED(conn_info%phi_a)) nphi = SIZE(conn_info%phi_a)
594 nimpr = 0
595 IF (ASSOCIATED(conn_info%impr_a)) nimpr = SIZE(conn_info%impr_a)
596 ! Any new defined bond
597 subsection => section_vals_get_subs_vals(section, "BONDS")
598 CALL section_vals_get(subsection, explicit=explicit)
599 IF (explicit) THEN
600 CALL section_vals_val_get(subsection, "_DEFAULT_KEYWORD_", n_rep_val=n_rep)
601 CALL reallocate(conn_info%bond_a, 1, n_rep + nbond)
602 CALL reallocate(conn_info%bond_b, 1, n_rep + nbond)
603 DO i = 1, n_rep
604 CALL section_vals_val_get(subsection, "_DEFAULT_KEYWORD_", i_rep_val=i, i_vals=tmp)
605 conn_info%bond_a(nbond + i) = tmp(1)
606 conn_info%bond_b(nbond + i) = tmp(2)
607 END DO
608 ! And now modify the molecule name if two molecules have been bridged
609 ALLOCATE (ex_bond_list(natom))
610 ALLOCATE (tag_mols(natom))
611 ALLOCATE (wrk(natom))
612 DO j = 1, natom
613 ALLOCATE (ex_bond_list(j)%array1(0))
614 END DO
615 CALL reorder_structure(ex_bond_list, conn_info%bond_a, conn_info%bond_b, nbond + n_rep)
616 ! Loop over atoms to possiblyt change molecule name
617 tag_mols = -1
618 mol_id = 1
619 DO i = 1, natom
620 IF (tag_mols(i) /= -1) cycle
621 CALL tag_molecule(tag_mols, ex_bond_list, i, mol_id)
622 mol_id = mol_id + 1
623 END DO
624 mol_id = mol_id - 1
625 IF (iw > 0) WRITE (iw, '(T2,A,I8)') 'PSF_INFO| Number of molecules detected after merging: ', mol_id
626 ! Now simply check about the contiguousness of molecule definition
627 CALL sort(tag_mols, natom, wrk)
628 item = tag_mols(1)
629 istart = 1
630 DO i = 2, natom
631 IF (tag_mols(i) == item) cycle
632 iend = i - 1
633 noe = iend - istart + 1
634 istart1 = minval(wrk(istart:iend))
635 iend1 = maxval(wrk(istart:iend))
636 cpassert(iend1 - istart1 + 1 == noe)
637 atom_info%id_molname(istart1:iend1) = str2id(s2s("MOL"//cp_to_string(item)))
638 item = tag_mols(i)
639 istart = i
640 END DO
641 iend = i - 1
642 noe = iend - istart + 1
643 istart1 = minval(wrk(istart:iend))
644 iend1 = maxval(wrk(istart:iend))
645 cpassert(iend1 - istart1 + 1 == noe)
646 atom_info%id_molname(istart1:iend1) = str2id(s2s("MOL"//cp_to_string(item)))
647 ! Deallocate bonds
648 DO i = 1, natom
649 DEALLOCATE (ex_bond_list(i)%array1)
650 END DO
651 DEALLOCATE (ex_bond_list)
652 DEALLOCATE (tag_mols)
653 DEALLOCATE (wrk)
654 END IF
655 ! Any new defined angle
656 subsection => section_vals_get_subs_vals(section, "ANGLES")
657 CALL section_vals_get(subsection, explicit=explicit)
658 IF (explicit) THEN
659 CALL section_vals_val_get(subsection, "_DEFAULT_KEYWORD_", n_rep_val=n_rep)
660 CALL reallocate(conn_info%theta_a, 1, n_rep + ntheta)
661 CALL reallocate(conn_info%theta_b, 1, n_rep + ntheta)
662 CALL reallocate(conn_info%theta_c, 1, n_rep + ntheta)
663 DO i = 1, n_rep
664 CALL section_vals_val_get(subsection, "_DEFAULT_KEYWORD_", i_rep_val=i, i_vals=tmp)
665 conn_info%theta_a(ntheta + i) = tmp(1)
666 conn_info%theta_b(ntheta + i) = tmp(2)
667 conn_info%theta_c(ntheta + i) = tmp(3)
668 END DO
669 END IF
670 ! Any new defined torsion
671 subsection => section_vals_get_subs_vals(section, "TORSIONS")
672 CALL section_vals_get(subsection, explicit=explicit)
673 IF (explicit) THEN
674 CALL section_vals_val_get(subsection, "_DEFAULT_KEYWORD_", n_rep_val=n_rep)
675 CALL reallocate(conn_info%phi_a, 1, n_rep + nphi)
676 CALL reallocate(conn_info%phi_b, 1, n_rep + nphi)
677 CALL reallocate(conn_info%phi_c, 1, n_rep + nphi)
678 CALL reallocate(conn_info%phi_d, 1, n_rep + nphi)
679 DO i = 1, n_rep
680 CALL section_vals_val_get(subsection, "_DEFAULT_KEYWORD_", i_rep_val=i, i_vals=tmp)
681 conn_info%phi_a(nphi + i) = tmp(1)
682 conn_info%phi_b(nphi + i) = tmp(2)
683 conn_info%phi_c(nphi + i) = tmp(3)
684 conn_info%phi_d(nphi + i) = tmp(4)
685 END DO
686 END IF
687 ! Any new defined improper
688 subsection => section_vals_get_subs_vals(section, "IMPROPERS")
689 CALL section_vals_get(subsection, explicit=explicit)
690 IF (explicit) THEN
691 CALL section_vals_val_get(subsection, "_DEFAULT_KEYWORD_", n_rep_val=n_rep)
692 CALL reallocate(conn_info%impr_a, 1, n_rep + nimpr)
693 CALL reallocate(conn_info%impr_b, 1, n_rep + nimpr)
694 CALL reallocate(conn_info%impr_c, 1, n_rep + nimpr)
695 CALL reallocate(conn_info%impr_d, 1, n_rep + nimpr)
696 DO i = 1, n_rep
697 CALL section_vals_val_get(subsection, "_DEFAULT_KEYWORD_", i_rep_val=i, i_vals=tmp)
698 conn_info%impr_a(nimpr + i) = tmp(1)
699 conn_info%impr_b(nimpr + i) = tmp(2)
700 conn_info%impr_c(nimpr + i) = tmp(3)
701 conn_info%impr_d(nimpr + i) = tmp(4)
702 END DO
703 END IF
704 END IF
705 CALL timestop(handle)
706 CALL cp_print_key_finished_output(iw, logger, subsys_section, &
707 "PRINT%TOPOLOGY_INFO/PSF_INFO")
708
709 END SUBROUTINE idm_psf
710
711! **************************************************************************************************
712!> \brief Teodoro Laino - 01.2006
713!> Write PSF topology file in the CHARMM31 EXT standard format
714!> \param file_unit ...
715!> \param topology ...
716!> \param subsys_section ...
717!> \param force_env_section ...
718! **************************************************************************************************
719 SUBROUTINE write_topology_psf(file_unit, topology, subsys_section, force_env_section)
720 INTEGER, INTENT(IN) :: file_unit
721 TYPE(topology_parameters_type), INTENT(INOUT) :: topology
722 TYPE(section_vals_type), POINTER :: subsys_section, force_env_section
723
724 CHARACTER(len=*), PARAMETER :: routinen = 'write_topology_psf'
725
726 CHARACTER(LEN=2*default_string_length) :: psf_format
727 CHARACTER(LEN=default_path_length) :: record
728 CHARACTER(LEN=default_string_length) :: c_int, my_tag1, my_tag2, my_tag3
729 CHARACTER(LEN=default_string_length), &
730 DIMENSION(:), POINTER :: charge_atm
731 INTEGER :: handle, i, iw, j, my_index, nchg
732 LOGICAL :: explicit, ldum
733 REAL(kind=dp), DIMENSION(:), POINTER :: charge_inp, charges
734 TYPE(atom_info_type), POINTER :: atom_info
735 TYPE(connectivity_info_type), POINTER :: conn_info
736 TYPE(cp_logger_type), POINTER :: logger
737 TYPE(section_vals_type), POINTER :: print_key, tmp_section
738
739 NULLIFY (logger)
740 logger => cp_get_default_logger()
741 print_key => section_vals_get_subs_vals(subsys_section, "TOPOLOGY%DUMP_PSF")
742 iw = cp_print_key_unit_nr(logger, subsys_section, "PRINT%TOPOLOGY_INFO/PSF_INFO", &
743 extension=".subsysLog")
744 CALL timeset(routinen, handle)
745
746 atom_info => topology%atom_info
747 conn_info => topology%conn_info
748
749 ! Check for charges.. (need to dump them in the PSF..)
750 ALLOCATE (charges(topology%natoms))
751 charges = atom_info%atm_charge
752 ! Collect charges from Input file..
753 NULLIFY (tmp_section)
754 tmp_section => section_vals_get_subs_vals(force_env_section, "MM%FORCEFIELD%CHARGE")
755 CALL section_vals_get(tmp_section, explicit=explicit, n_repetition=nchg)
756 IF (explicit) THEN
757 ALLOCATE (charge_atm(nchg))
758 ALLOCATE (charge_inp(nchg))
759 CALL read_chrg_section(charge_atm, charge_inp, section=tmp_section, start=0)
760 DO j = 1, topology%natoms
761 record = id2str(atom_info%id_atmname(j))
762 ldum = qmmm_ff_precond_only_qm(record)
763 CALL uppercase(record)
764 DO i = 1, nchg
765 IF (record == charge_atm(i)) THEN
766 charges(j) = charge_inp(i)
767 EXIT
768 END IF
769 END DO
770 END DO
771 DEALLOCATE (charge_atm)
772 DEALLOCATE (charge_inp)
773 END IF
774 ! fixup for topology output
775 DO j = 1, topology%natoms
776 IF (charges(j) == -huge(0.0_dp)) charges(j) = -99.0_dp
777 END DO
778 record = cp_print_key_generate_filename(logger, print_key, &
779 extension=".psf", my_local=.false.)
780 ! build the EXT format
781 c_int = "I10"
782 psf_format = '(I10,T12,A,T21,I0,T30,A,T39,A,T47,A,T53,F10.6,T69,F8.3,T88,I1)'
783 IF (iw > 0) WRITE (iw, '(T2,A)') &
784 "PSF_WRITE| Writing out PSF file with CHARMM31 EXTErnal format: ", trim(record)
785
786 WRITE (file_unit, fmt='(A)') "PSF EXT"
787 WRITE (file_unit, fmt='(A)') ""
788 WRITE (file_unit, fmt='('//trim(c_int)//',A)') 1, " !NTITLE"
789 WRITE (file_unit, fmt='(A)') " CP2K generated DUMP of connectivity"
790 WRITE (file_unit, fmt='(A)') ""
791
792 WRITE (file_unit, fmt='('//trim(c_int)//',A)') topology%natoms, " !NATOM"
793 my_index = 1
794 i = 1
795 my_tag1 = id2str(atom_info%id_molname(i))
796 my_tag2 = id2str(atom_info%id_resname(i))
797 my_tag3 = id2str(atom_info%id_atmname(i))
798 ldum = qmmm_ff_precond_only_qm(my_tag1)
799 ldum = qmmm_ff_precond_only_qm(my_tag2)
800 ldum = qmmm_ff_precond_only_qm(my_tag3)
801 WRITE (file_unit, fmt=psf_format) &
802 i, &
803 trim(my_tag1), &
804 my_index, &
805 trim(my_tag2), &
806 trim(my_tag3), &
807 trim(my_tag3), &
808 charges(i), &
809 atom_info%atm_mass(i), &
810 0
811 DO i = 2, topology%natoms
812 IF ((atom_info%map_mol_num(i) /= atom_info%map_mol_num(i - 1)) .OR. &
813 (atom_info%map_mol_res(i) /= atom_info%map_mol_res(i - 1))) my_index = my_index + 1
814 my_tag1 = id2str(atom_info%id_molname(i))
815 my_tag2 = id2str(atom_info%id_resname(i))
816 my_tag3 = id2str(atom_info%id_atmname(i))
817 ldum = qmmm_ff_precond_only_qm(my_tag1)
818 ldum = qmmm_ff_precond_only_qm(my_tag2)
819 ldum = qmmm_ff_precond_only_qm(my_tag3)
820 WRITE (file_unit, fmt=psf_format) &
821 i, &
822 trim(my_tag1), &
823 my_index, &
824 trim(my_tag2), &
825 trim(my_tag3), &
826 trim(my_tag3), &
827 charges(i), &
828 atom_info%atm_mass(i), &
829 0
830 END DO
831 WRITE (file_unit, fmt='(/)')
832 DEALLOCATE (charges)
833
834 WRITE (file_unit, fmt='('//trim(c_int)//',A)') SIZE(conn_info%bond_a), " !NBOND"
835 DO i = 1, SIZE(conn_info%bond_a), 4
836 j = 0
837 DO WHILE ((j < 4) .AND. ((i + j) <= SIZE(conn_info%bond_a)))
838 WRITE (file_unit, fmt='(2('//trim(c_int)//'))', advance="NO") &
839 conn_info%bond_a(i + j), conn_info%bond_b(i + j)
840 j = j + 1
841 END DO
842 WRITE (file_unit, fmt='(/)', advance="NO")
843 END DO
844 WRITE (file_unit, fmt='(/)')
845
846 WRITE (file_unit, fmt='('//trim(c_int)//',A)') SIZE(conn_info%theta_a), " !NTHETA"
847 DO i = 1, SIZE(conn_info%theta_a), 3
848 j = 0
849 DO WHILE ((j < 3) .AND. ((i + j) <= SIZE(conn_info%theta_a)))
850 WRITE (file_unit, fmt='(3('//trim(c_int)//'))', advance="NO") &
851 conn_info%theta_a(i + j), conn_info%theta_b(i + j), &
852 conn_info%theta_c(i + j)
853 j = j + 1
854 END DO
855 WRITE (file_unit, fmt='(/)', advance="NO")
856 END DO
857 WRITE (file_unit, fmt='(/)')
858
859 WRITE (file_unit, fmt='('//trim(c_int)//',A)') SIZE(conn_info%phi_a), " !NPHI"
860 DO i = 1, SIZE(conn_info%phi_a), 2
861 j = 0
862 DO WHILE ((j < 2) .AND. ((i + j) <= SIZE(conn_info%phi_a)))
863 WRITE (file_unit, fmt='(4('//trim(c_int)//'))', advance="NO") &
864 conn_info%phi_a(i + j), conn_info%phi_b(i + j), &
865 conn_info%phi_c(i + j), conn_info%phi_d(i + j)
866 j = j + 1
867 END DO
868 WRITE (file_unit, fmt='(/)', advance="NO")
869 END DO
870 WRITE (file_unit, fmt='(/)')
871
872 WRITE (file_unit, fmt='('//trim(c_int)//',A)') SIZE(conn_info%impr_a), " !NIMPHI"
873 DO i = 1, SIZE(conn_info%impr_a), 2
874 j = 0
875 DO WHILE ((j < 2) .AND. ((i + j) <= SIZE(conn_info%impr_a)))
876 WRITE (file_unit, fmt='(4('//trim(c_int)//'))', advance="NO") &
877 conn_info%impr_a(i + j), conn_info%impr_b(i + j), &
878 conn_info%impr_c(i + j), conn_info%impr_d(i + j)
879 j = j + 1
880 END DO
881 WRITE (file_unit, fmt='(/)', advance="NO")
882 END DO
883 WRITE (file_unit, fmt='(/)')
884
885 WRITE (file_unit, fmt='('//trim(c_int)//',A)') 0, " !NDON"
886 WRITE (file_unit, fmt='(/)')
887 WRITE (file_unit, fmt='('//trim(c_int)//',A)') 0, " !NACC"
888 WRITE (file_unit, fmt='(/)')
889 WRITE (file_unit, fmt='('//trim(c_int)//',A)') 0, " !NNB"
890 WRITE (file_unit, fmt='(/)')
891
892 CALL cp_print_key_finished_output(iw, logger, subsys_section, &
893 "PRINT%TOPOLOGY_INFO/PSF_INFO")
894 CALL timestop(handle)
895
896 END SUBROUTINE write_topology_psf
897
898END MODULE topology_psf
899
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
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)
...
character(len=default_path_length) function, public cp_print_key_generate_filename(logger, print_key, middle_name, extension, my_local)
Utility function that returns a unit number to write the print key. Might open a file with a unique f...
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.
subroutine, public read_chrg_section(charge_atm, charge, section, start)
Reads the CHARGE section.
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_conn_psf_u
integer, parameter, public do_conn_psf
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
integer, parameter, public default_path_length
Definition kinds.F:58
Utility routines for the memory handling.
Interface to the message passing library MPI.
logical function, public qmmm_ff_precond_only_qm(id1, id2, id3, id4, is_link)
This function handles the atom names and modifies the "_QM_" prefix, in order to find the parameters ...
generates a unique id number for a string (str2id) that can be used two compare two strings....
character(len=default_string_length) function, public s2s(str)
converts a string in a string of default_string_length
integer function, public str2id(str)
returns a unique id for a given string, and stores the string for later retrieval using the id.
character(len=default_string_length) function, public id2str(id)
returns the string associated with a given id
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
Functionality to read in PSF topologies and convert it into local data structures.
subroutine, public read_topology_psf(filename, topology, para_env, subsys_section, psf_type)
Read PSF topology file Teodoro Laino - Introduced CHARMM31 EXT PSF standard format.
subroutine, public idm_psf(topology, section, subsys_section)
Input driven modification (IDM) of PSF defined structures.
subroutine, public write_topology_psf(file_unit, topology, subsys_section, force_env_section)
Teodoro Laino - 01.2006 Write PSF topology file in the CHARMM31 EXT standard format.
subroutine, public psf_post_process(topology, subsys_section)
Post processing of PSF informations.
Collection of subroutine needed for topology related things.
recursive subroutine, public tag_molecule(icheck, bond_list, i, my_mol)
gives back a mapping of molecules.. icheck needs to be initialized with -1
Control for reading in different topologies and coordinates.
Definition topology.F:13
All kind of helpful little routines.
Definition util.F:14
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment