Octopus
parser.F90
Go to the documentation of this file.
1!! Copyright (C) 2003-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21module parser_oct_m
22 use global_oct_m
23 use iso_c_binding
24 use loct_oct_m
25 use mpi_oct_m
27 use unit_oct_m
28 use string_oct_m
30
31 implicit none
32
33 private
34 public :: &
35 block_t, &
37 parser_end, &
38 parse_init, &
39 parse_end, &
56
57 type :: block_t
58 private
59 integer, pointer :: p
60 end type block_t
61
63 character(len=27), parameter, public :: parser_varname_excluded_characters = '|!''"#$%&/\‍()=?{}+-*^.,;:<> '
64
65 interface parse_init
66 integer function oct_parse_init(file_out, mpiv_node) bind(c)
67 use iso_c_binding
68 implicit none
69 character(kind=c_char), intent(in) :: file_out(*)
70 integer, intent(in) :: mpiv_node
71 end function oct_parse_init
72 end interface parse_init
73
74 interface parse_input_file
75 integer function oct_parse_input(file_in, set_used) bind(c)
76 use iso_c_binding
77 implicit none
78 character(kind=c_char), intent(in) :: file_in(*)
79 integer, intent(in) :: set_used
80 end function oct_parse_input
81 end interface parse_input_file
82
83 interface parse_environment
84 subroutine oct_parse_environment(prefix) bind(c)
85 use iso_c_binding
86 implicit none
87 character(kind=c_char), intent(in) :: prefix(*)
88 end subroutine oct_parse_environment
89 end interface parse_environment
90
91 interface parse_end
92 subroutine oct_parse_end()
93 implicit none
94 end subroutine oct_parse_end
95 end interface parse_end
96
97 interface sym_output_table
98 subroutine oct_sym_output_table(only_unused, mpiv_node)
99 implicit none
100 integer, intent(in) :: only_unused
101 integer, intent(in) :: mpiv_node
102 end subroutine oct_sym_output_table
103 end interface sym_output_table
104
105 interface parse_isdef
106 integer pure function oct_parse_isdef(name) bind(c)
107 use iso_c_binding
108 implicit none
109 character(kind=c_char), intent(in) :: name(*)
110 end function oct_parse_isdef
111 end interface parse_isdef
112
113 interface
114 subroutine oct_parse_int(name, def, res) bind(c)
115 use iso_c_binding
116 use, intrinsic :: iso_fortran_env
117 implicit none
118 character(kind=c_char), intent(in) :: name(*)
119 integer(int64), intent(in) :: def
120 integer(int64), intent(out) :: res
121 end subroutine oct_parse_int
122
123 subroutine oct_parse_double(name, def, res) bind(c)
124 use iso_c_binding
125 use, intrinsic :: iso_fortran_env
126 implicit none
127 character(kind=c_char), intent(in) :: name(*)
128 real(real64), intent(in) :: def
129 real(real64), intent(out) :: res
130 end subroutine oct_parse_double
131
132 subroutine oct_parse_complex(name, def, res) bind(c)
133 use iso_c_binding
134 use, intrinsic :: iso_fortran_env
135 implicit none
136 character(kind=c_char), intent(in) :: name(*)
137 complex(real64), intent(in) :: def
138 complex(real64), intent(out) :: res
139 end subroutine oct_parse_complex
140
141 subroutine oct_parse_string(name, def, res, res_len) bind(c)
142 use iso_c_binding
143 implicit none
144 character(kind=c_char), intent(in) :: name(*), def(*)
145 character(kind=c_char), intent(inout) :: res(*)
146 integer(kind=c_size_t), intent(in) :: res_len ! Length of res
147 end subroutine oct_parse_string
148
149 integer function oct_parse_block(name, blk)
150 use iso_c_binding
151 import block_t
152 implicit none
153 character(kind=c_char), intent(in) :: name(*)
154 type(block_t), intent(out) :: blk
155 end function oct_parse_block
156 end interface
157
159 module procedure parse_integer
160 module procedure parse_integer8
161 module procedure parse_integer48
162 module procedure parse_integer84
163 module procedure parse_logical
164 module procedure parse_string
165 module procedure parse_cmplx
166 module procedure oct_parse_double_unit
167 end interface parse_variable
168
171 module procedure oct_parse_expression_vec1
172 end interface parse_expression
173
174 interface parse_block_end
175 subroutine oct_parse_block_end(blk)
176 import block_t
177 implicit none
178 type(block_t), intent(inout) :: blk
179 end subroutine oct_parse_block_end
180 end interface parse_block_end
181
182 interface parse_block_n
183 integer function oct_parse_block_n(blk)
184 import block_t
185 implicit none
186 type(block_t), intent(in) :: blk
187 end function oct_parse_block_n
188 end interface parse_block_n
189
190 interface parse_block_cols
191 integer function oct_parse_block_cols(blk, line)
192 import block_t
193 implicit none
194 type(block_t), intent(in) :: blk
195 integer, intent(in) :: line
196 end function oct_parse_block_cols
197 end interface parse_block_cols
198
199 interface parse_block_integer
200 subroutine oct_parse_block_int(blk, l, c, res)
201 import block_t
202 implicit none
203 type(block_t), intent(in) :: blk
204 integer, intent(in) :: l, c
205 integer, intent(out) :: res
206 end subroutine oct_parse_block_int
207
208 subroutine oct_parse_block_int8(blk, l, c, res)
209 use, intrinsic :: iso_fortran_env
210 import block_t
211 implicit none
212 type(block_t), intent(in) :: blk
213 integer, intent(in) :: l, c
214 integer(int64), intent(out) :: res
215 end subroutine oct_parse_block_int8
216 end interface parse_block_integer
217
219 subroutine oct_parse_block_double(blk, l, c, res)
220 use, intrinsic :: iso_fortran_env
221 import block_t
222 implicit none
223 type(block_t), intent(in) :: blk
224 integer, intent(in) :: l, c
225 real(real64), intent(out) :: res
226 end subroutine oct_parse_block_double
228 module procedure oct_parse_block_double_unit
229 end interface parse_block_float
230
231 interface parse_block_cmplx
232 subroutine oct_parse_block_complex(blk, l, c, res)
233 use, intrinsic :: iso_fortran_env
234 import block_t
235 implicit none
236 type(block_t), intent(in) :: blk
237 integer, intent(in) :: l, c
238 complex(real64), intent(out) :: res
239 end subroutine oct_parse_block_complex
240 end interface parse_block_cmplx
241
242contains
243
254 subroutine parser_initialize_symbol_table(log_file)
255 character(len=*), optional, intent(in) :: log_file
256
257 integer :: ierr
258 logical :: file_exists
259 character(len=:), allocatable :: log_file_
260 character(len=MAX_PATH_LEN) :: variables
261
262 if (present(log_file)) then
263 log_file_ = trim(log_file)
264 else
265 log_file_ = 'exec/parser.log'
266 end if
267
268 variables = trim(conf%share)//'/variables'
269 file_exists = .false.
270 inquire(file=variables, exist=file_exists)
271 if (.not. file_exists) then
272 write(stderr,'(a)') '*** Fatal Error (description follows)'
273 write(stderr,'(a)') 'Error initializing parser'
274 write(stderr,'(a)') 'Cannot open variables file: '//trim(conf%share)//'/variables'
275 call parse_fatal()
276 end if
278 ! If using default log file, make the directory
279 if (.not. present(log_file)) then
280 if (mpi_world%is_root()) call loct_mkdir('exec')
281 endif
282
283 ! Initialize the symbol table, and the log file
284 ! Note, it would make sense to expose `sym_init_table` as its own call
285 ierr = parse_init(string_f_to_c(log_file_), mpi_world%rank)
286 if (ierr /= 0) then
287 write(stderr,'(a)') '*** Fatal Error (description follows)'
288 write(stderr,'(a)') 'Error initializing parser: cannot write to ' // log_file_
289 write(stderr,'(a)') 'Do you have write permissions in this directory?'
290 call parse_fatal()
291 end if
292
293 ! Parse option definitions, and use them to populate the symbol table keys
294 ierr = parse_input_file(string_f_to_c(variables), set_used = 1)
295 if (ierr /= 0) then
296 write(stderr,'(a)') '*** Fatal Error (description follows)'
297 write(stderr,'(a)') 'Error initializing parser'
298 write(stderr,'(a)') 'Cannot open variables file: '//trim(conf%share)//'/variables'
299 call parse_fatal()
300 end if
301
302 end subroutine parser_initialize_symbol_table
304
306 subroutine parser_init()
307
308 integer :: ierr
309 logical :: file_exists
310
312
313 file_exists = .false.
314 inquire(file='inp', exist=file_exists)
315 if (.not. file_exists) then
316 write(stderr,'(a)') '*** Fatal Error (description follows)'
317 write(stderr,'(a)') 'Error initializing parser'
318 write(stderr,'(a)') 'Cannot open input file!'
319 write(stderr,'(a)') 'Please provide an input file with name inp in the current workdir'
320 call parse_fatal()
321 end if
322
323 ierr = parse_input_file(string_f_to_c('inp'), set_used = 0)
324 if (ierr /= 0) then
325 write(stderr,'(a)') '*** Fatal Error (description follows)'
326 write(stderr,'(a)') 'Error initializing parser'
327 write(stderr,'(a)') 'Cannot open input file!'
328 write(stderr,'(a)') 'Please provide an input file with name inp in the current workdir'
329 call parse_fatal()
330 end if
331
332 ! parse OCT_ prefixed variables from environment
333 call parse_environment(string_f_to_c("OCT_"))
334
335 end subroutine parser_init
336
338 subroutine parser_end()
339 integer :: parser_log
340
341 ! Output the symbol table
342 call sym_output_table(only_unused = 1, mpiv_node = mpi_world%rank)
343 ! Free the symbol table and close global C file handle.
344 call parse_end()
345
346 ! Write the octopus version and git_commit hash to the parser.log.
347 ! This is done after parse_end(), to avoid conflicting with the existing open file handle
348 if(mpi_world%is_root()) then
349 open(newunit=parser_log, file='exec/parser.log', status='old', action='write', position='append')
350 write(parser_log, '(a)') '# Octopus version: '//trim(conf%version)
351 write(parser_log, '(a)') '# Octopus git_commit: '//trim(conf%git_commit)
352 close(parser_log)
353 end if
354
355 end subroutine parser_end
356
357 ! ---------------------------------------------------------
358
359 logical function parse_is_defined(namespace, name) result(isdef)
360 type(namespace_t), intent(in) :: namespace
361 character(len=*), intent(in) :: name
362
363 character(len=MAX_PATH_LEN) :: full_name
364
365 full_name = parse_get_full_name(namespace, name)
366 isdef = parse_isdef(string_f_to_c(full_name)) /= 0
367
368 end function parse_is_defined
369
370 ! ---------------------------------------------------------
371
372 integer function parse_input_string(file_contents, set_used)
373 character(len=*), intent(in) :: file_contents
374 integer, intent(in) :: set_used
375
376 interface
377 integer function oct_parse_input_string(file_contents, set_used) bind(c)
378 use iso_c_binding
379 implicit none
380 character(kind=c_char), intent(in) :: file_contents(*)
381 integer, intent(in) :: set_used
382 end function oct_parse_input_string
383 end interface
384
385 parse_input_string = oct_parse_input_string(string_f_to_c(file_contents), set_used)
386 end function parse_input_string
387
388 ! ---------------------------------------------------------
389
390 subroutine parse_integer(namespace, name, def, res)
391 type(namespace_t), intent(in) :: namespace
392 character(len=*), intent(in) :: name
393 integer, intent(in) :: def
394 integer, intent(out) :: res
395
396 integer(int64) :: res8
397 character(len=MAX_PATH_LEN) :: full_name
398
399 call parse_check_varinfo(name)
400
401 full_name = parse_get_full_name(namespace, name)
402 call oct_parse_int(string_f_to_c(full_name), int(def, int64), res8)
403
404 res = int(res8)
405
406 end subroutine parse_integer
407
408 ! ---------------------------------------------------------
409
410 subroutine parse_integer8(namespace, name, def, res)
411 type(namespace_t), intent(in) :: namespace
412 character(len=*), intent(in) :: name
413 integer(int64), intent(in) :: def
414 integer(int64), intent(out) :: res
415
416 call parse_check_varinfo(name)
417 call oct_parse_int(string_f_to_c(parse_get_full_name(namespace, name)), def, res)
418
419 end subroutine parse_integer8
420
421 ! ---------------------------------------------------------
422
423 subroutine parse_integer48(namespace, name, def, res)
424 type(namespace_t), intent(in) :: namespace
425 character(len=*), intent(in) :: name
426 integer, intent(in) :: def
427 integer(int64), intent(out) :: res
428
429 character(len=MAX_PATH_LEN) :: full_name
430
431
432 call parse_check_varinfo(name)
434 full_name = parse_get_full_name(namespace, name)
435 call oct_parse_int(string_f_to_c(full_name), int(def, int64), res)
436
437 end subroutine parse_integer48
438
439 ! ---------------------------------------------------------
440
441 subroutine parse_integer84(namespace, name, def, res)
442 type(namespace_t), intent(in) :: namespace
443 character(len=*), intent(in) :: name
444 integer(int64), intent(in) :: def
445 integer, intent(out) :: res
446
447 integer(int64) :: res8
448 character(len=MAX_PATH_LEN) :: full_name
449
450 call parse_check_varinfo(name)
451
452 full_name = parse_get_full_name(namespace, name)
453 call oct_parse_int(string_f_to_c(full_name), def, res8)
455 res = int(res8)
456
457 end subroutine parse_integer84
458
459 ! ---------------------------------------------------------
460
461 subroutine parse_string(namespace, name, def, res)
462 type(namespace_t), intent(in) :: namespace
463 character(len=*), intent(in) :: name
464 character(len=*), intent(in) :: def
465 character(len=*), intent(inout) :: res
466
467 integer(kind=c_size_t) :: res_len
468 character(len=MAX_PATH_LEN) :: full_name
469 character(kind=c_char) :: c_res(len(res)+1)
470
471 call parse_check_varinfo(name)
472
473 c_res = c_null_char
474 res_len = len(res)+1
475
476 full_name = parse_get_full_name(namespace, name)
477 call oct_parse_string(string_f_to_c(full_name), string_f_to_c(def), c_res, res_len)
478 call string_c_to_f(c_res, res)
479
480 end subroutine parse_string
481
482
483 subroutine parse_logical(namespace, name, def, res)
484 type(namespace_t), intent(in) :: namespace
485 character(len=*), intent(in) :: name
486 logical, intent(in) :: def
487 logical, intent(out) :: res
488
489 integer(int64) :: idef, ires
490 character(len=MAX_PATH_LEN) :: full_name
491
492 call parse_check_varinfo(name)
493
494 ! logical is a FORTRAN type, so we emulate the routine with integers
495 idef = 0
496 if (def) idef = 1
497
498 full_name = parse_get_full_name(namespace, name)
499 call oct_parse_int(string_f_to_c(full_name), idef, ires)
500 res = (ires /= 0)
501
502 end subroutine parse_logical
503
504 ! ---------------------------------------------------------
506 subroutine parse_cmplx(namespace, name, def, res)
507 type(namespace_t), intent(in) :: namespace
508 character(len=*), intent(in) :: name
509 complex(real64), intent(in) :: def
510 complex(real64), intent(out) :: res
511
512 call parse_check_varinfo(name)
513 call oct_parse_complex(string_f_to_c(parse_get_full_name(namespace, name)), def, res)
514
515 end subroutine parse_cmplx
516
517 ! ---------------------------------------------------------
519 integer function parse_block(namespace, name, blk, check_varinfo_)
520 type(namespace_t), intent(in) :: namespace
521 character(len=*), intent(in) :: name
522 type(block_t), intent(out) :: blk
523 logical, optional, intent(in) :: check_varinfo_
524
525 logical :: check_varinfo
526 character(len=MAX_PATH_LEN) :: full_name
527
528 check_varinfo = .true.
529 if (present(check_varinfo_)) check_varinfo = check_varinfo_
530
531 if (check_varinfo) then
532 call parse_check_varinfo(name)
533 end if
534
535 full_name = parse_get_full_name(namespace, name)
537 parse_block = oct_parse_block(string_f_to_c(full_name), blk)
538
539 end function parse_block
540
541 ! ---------------------------------------------------------
542
543 subroutine parse_block_logical(blk, l, c, res)
544 type(block_t), intent(in) :: blk
545 integer, intent(in) :: l, c
546 logical, intent(out) :: res
547
548 integer :: ires
549
550 call oct_parse_block_int(blk, l, c, ires)
551 res = (ires /= 0)
552
553 end subroutine parse_block_logical
554
555 ! ---------------------------------------------------------
557 subroutine oct_parse_double_unit(namespace, name, def, res, unit)
558 type(namespace_t), intent(in) :: namespace
559 character(len=*), intent(in) :: name
560 real(real64), intent(in) :: def
561 real(real64), intent(out) :: res
562 type(unit_t), optional, intent(in) :: unit
563
564 character(len=MAX_PATH_LEN) :: full_name
565
566 call parse_check_varinfo(name)
567
568 full_name = parse_get_full_name(namespace, name)
569
570 if (present(unit)) then
571 call oct_parse_double(string_f_to_c(full_name), units_from_atomic(unit, def), res)
572 res = units_to_atomic(unit, res)
573 else
574 call oct_parse_double(string_f_to_c(full_name), def, res)
575 end if
576
577 end subroutine oct_parse_double_unit
579 ! ---------------------------------------------------------
580
581 subroutine oct_parse_block_double_unit(blk, l, c, res, unit)
582 type(block_t), intent(in) :: blk
583 integer, intent(in) :: l, c
584 real(real64), intent(out) :: res
585 type(unit_t), intent(in) :: unit
586
587 call oct_parse_block_double(blk, l, c, res)
588 res = units_to_atomic(unit, res)
589
590 end subroutine oct_parse_block_double_unit
591
592 ! ---------------------------------------------------------
593 subroutine oct_parse_expression_vec0(re, im, ndim, x, r, t, pot)
594 real(real64), intent(out) :: re, im
595 integer, intent(in) :: ndim
596 real(real64), intent(in) :: x(:), r, t
597 character(len=*), intent(in) :: pot
598
599 call oct_parse_expression(re, im, ndim, x(1), r, t, pot)
600
602
603
604 ! ----------------------------------------------------------------------
609 subroutine parse_array(inp_string, x, arraychar)
610 character(len=*), intent(inout) :: inp_string
611 real(real64), intent(in) :: x(:, :)
612 character(len=1), intent(in) :: arraychar
613
614 integer :: i, m, n_atom, coord, string_length
615 character (LEN=100) :: v_string
616
617 string_length = len(inp_string)
618 do i = 1, string_length - 1
619 if (inp_string(i:i+1) == arraychar//"[") then
620 m = 0
621 if (inp_string(i+3:i+3) == ",") m = 1
622 if (inp_string(i+4:i+4) == ",") m = 2
623 if (m == 0) then
624 write(stderr, '(a)') "*** Fatal Error (description follows)"
625 write(stderr, '(a)') "Attempting to parse a string with array elements larger than 99"
626 call parse_fatal()
627 end if
628 read(inp_string(i+2:i+1+m),*) n_atom
629 read(inp_string(i+3+m:i+3+m),*) coord
630 write(v_string,*) x(n_atom, coord)
631 inp_string = inp_string(:i-1) // "(" // trim(v_string) // ")" // inp_string(i+5+m:)
632 end if
633 end do
634
635 end subroutine parse_array
636
637 ! ----------------------------------------------------------------------
639 subroutine parse_check_varinfo(varname)
640 character(len=*), intent(in) :: varname
641
642 if (.not. varinfo_exists(varname)) then
643 write(stderr,'(a)') "*** Fatal Internal Error (description follows)"
644 write(stderr,'(a)') 'Attempting to parse undocumented variable '//trim(varname)//'.'
645 call parse_fatal()
646 end if
647
648 end subroutine parse_check_varinfo
649
650 ! ----------------------------------------------------------------------
677 function parse_get_full_name(namespace, varname) result(name)
678 type(namespace_t), target, intent(in) :: namespace
679 character(len=*), intent(in) :: varname
680 character(len=:), allocatable :: name
681
682 logical :: found
683 integer :: is
684 type(namespace_t), pointer :: ancestor
685 character(len=MAX_NAMESPACE_LEN) :: ancestor_name, tmp
686
687 found = .false.
689 ! Loop over all ancestors, starting from the right-most
690 ancestor => namespace
691 do while (associated(ancestor) .and. .not. found)
692
693 ! Loop over all paths to this ancestor, starting from the most complete path
694 ancestor_name = ancestor%get()
695 is = -1
696 do while (len_trim(ancestor_name) > 0 .and. is /= 0 .and. .not. found)
697 ! Check if the current path is found in the input file
698 name = trim(ancestor_name) // "." // trim(varname)
699 found = parse_isdef(string_f_to_c(trim(name))) /= 0
700
701 ! Remove the left-most namespace ("is" will be zero if there is only one namespace left)
702 is = index(ancestor_name, ".")
703 tmp = ancestor_name(is+1:)
704 ancestor_name = tmp
705 end do
706 ancestor => ancestor%parent
707 end do
708
709 ! If no suitable namespace found, just return the variable name
710 if (.not. found) name = varname
711
712 end function parse_get_full_name
713
714 subroutine parse_block_string(blk, l, c, res, convert_to_c)
715 type(block_t), intent(in) :: blk
716 integer, intent(in) :: l, c
717 character(len=*), intent(inout) :: res
718 logical, optional,intent(in) :: convert_to_c
719
720 character(kind=c_char) :: c_res(len(res)+1)
721
722 interface oct_parse_block_string
723 subroutine oct_parse_block_string(blk, l, c, res)
724 use iso_c_binding
725 import block_t
726 implicit none
727 type(block_t), intent(in) :: blk
728 integer, intent(in) :: l, c
729 character(kind=c_char), intent(out) :: res(*)
730 end subroutine oct_parse_block_string
731 end interface oct_parse_block_string
732
733 c_res = c_null_char
734 call oct_parse_block_string(blk, l, c, c_res)
735 call string_c_to_f(c_res, res)
736
737 if(optional_default(convert_to_c, .false.)) then
738 call conv_to_c_string(res)
739 end if
740 end subroutine parse_block_string
741
742
743 ! ---------------------------------------------------------
754 ! ---------------------------------------------------------
755
756 subroutine oct_parse_expression(re, im, ndim, x, r, t, pot)
757 real(real64), intent(in) :: x, r, t
758 integer, intent(in) :: ndim
759 real(real64), intent(out) :: re, im
760 character(len=*), intent(in) :: pot
761
762 interface oct_parse_expression_low
763 subroutine oct_parse_expression_low(re, im, ndim, x, r, t, pot) bind(c, name='oct_parse_expression')
764 use iso_c_binding
765 use, intrinsic :: iso_fortran_env
766 implicit none
767 real(real64), intent(in) :: x, r, t
768 integer, intent(in) :: ndim
769 real(real64), intent(out) :: re, im
770 character(kind=c_char), intent(in) :: pot(*)
771 end subroutine oct_parse_expression_low
772 end interface oct_parse_expression_low
773
774 call oct_parse_expression_low(re, im, ndim, x, r, t, string_f_to_c(pot))
775 end subroutine oct_parse_expression
776
777 subroutine oct_parse_expression_vec1(re, im, c, x, string)
778 real(real64), intent(out) :: re, im
779 character(len=*), intent(in) :: c
780 real(real64), intent(in) :: x
781 character(len=*), intent(in) :: string
782
783 interface oct_parse_expression1
784 subroutine oct_parse_expression1(re, im, c, x, string) bind(c)
785 use iso_c_binding
786 use, intrinsic :: iso_fortran_env
787 implicit none
788 real(real64), intent(out) :: re, im
789 character(kind=c_char), intent(in) :: c(*)
790 real(real64), intent(in) :: x
791 character(kind=c_char), intent(in) :: string(*)
792 end subroutine oct_parse_expression1
793 end interface oct_parse_expression1
794
795 call oct_parse_expression1(re, im, string_f_to_c(c), x, string_f_to_c(string))
796
797 end subroutine oct_parse_expression_vec1
798
799
800
801 ! ----------------------------------------------------------------------
802 subroutine parse_fatal()
803
804 call mpi_world%abort()
805
806 end subroutine parse_fatal
807
808end module parser_oct_m
810!! Local Variables:
811!! mode: f90
812!! coding: utf-8
813!! End:
character(len=:) function, allocatable, public parse_get_full_name(namespace, varname)
Given a namespace and a variable name, this function will iterate over all namespace ancestors contai...
Definition: parser.F90:773
logical function, public parse_is_defined(namespace, name)
Definition: parser.F90:455
subroutine parse_logical(namespace, name, def, res)
Definition: parser.F90:579
subroutine parse_integer(namespace, name, def, res)
Definition: parser.F90:486
subroutine, public parse_block_string(blk, l, c, res, convert_to_c)
Definition: parser.F90:810
subroutine parse_fatal()
Definition: parser.F90:898
subroutine parse_integer48(namespace, name, def, res)
Definition: parser.F90:519
subroutine, public parser_init()
Initialise the Octopus parser.
Definition: parser.F90:402
subroutine, public parse_block_logical(blk, l, c, res)
Definition: parser.F90:639
subroutine oct_parse_expression(re, im, ndim, x, r, t, pot)
The public subroutine parse_expression accepts two possible interfaces, one which assumes that the va...
Definition: parser.F90:852
subroutine, public parser_end()
End the Octopus parser.
Definition: parser.F90:434
subroutine oct_parse_block_double_unit(blk, l, c, res, unit)
Definition: parser.F90:677
subroutine parse_integer84(namespace, name, def, res)
Definition: parser.F90:537
subroutine, public parse_array(inp_string, x, arraychar)
A very primitive way to "preprocess" a string that contains reference to the elements of a two-dimens...
Definition: parser.F90:705
integer function, public parse_input_string(file_contents, set_used)
Definition: parser.F90:468
subroutine parse_integer8(namespace, name, def, res)
Definition: parser.F90:506
subroutine oct_parse_double_unit(namespace, name, def, res, unit)
Definition: parser.F90:653
subroutine oct_parse_expression_vec1(re, im, c, x, string)
Definition: parser.F90:873
subroutine oct_parse_expression_vec0(re, im, ndim, x, r, t, pot)
Definition: parser.F90:689
subroutine parse_string(namespace, name, def, res)
Definition: parser.F90:557
subroutine parse_check_varinfo(varname)
Definition: parser.F90:735
subroutine parse_cmplx(namespace, name, def, res)
Definition: parser.F90:602
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:615
subroutine, public parser_initialize_symbol_table(log_file)
Initialise the Octopus parser symbol table from file of keys.
Definition: parser.F90:350
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:134
int true(void)