MONC
optionsdatabase.F90
Go to the documentation of this file.
1 
13  use logging_mod, only: log_error, log_log
14  implicit none
15 
16 #ifndef TEST_MODE
17  private
18 #endif
19  integer, parameter :: logical_type=0,& !< Type of logical value data
20  integer_type=1,&
21  real_type=2,&
22  string_type=3
23 
24  ! Extra key size for a specific array element, the lookup key is allocated with the length of the key plus this
25  integer, parameter :: array_append_size = 10
26 
28  interface options_add
30  end interface options_add
31 
36 
37  contains
38 
42  integer function options_size(options_database)
43  type(hashmap_type), intent(inout) :: options_database
44 
45  options_size = c_size(options_database)
46  end function options_size
47 
52  character(len=STRING_LENGTH) function options_key_at(options_database, i)
53  type(hashmap_type), intent(inout) :: options_database
54  integer, intent(in) :: i
55 
56  options_key_at = c_key_at(options_database, i)
57  end function options_key_at
58 
63  function options_value_at(options_database, i)
64  type(hashmap_type), intent(inout) :: options_database
65  integer, intent(in) :: i
66  class(*), pointer :: options_value_at
67 
68  options_value_at=>c_generic_at(options_database, i)
69  end function options_value_at
70 
75  logical function options_has_key(options_database, key)
76  type(hashmap_type), intent(inout) :: options_database
77  character(len=*), intent(in) :: key
78 
79  options_has_key = c_contains(options_database, trim(key))
80  if (.not. options_has_key) then
81  options_has_key = c_contains(options_database, trim(key)//"a_size")
82  end if
83  end function options_has_key
84 
90  real(kind=default_precision) function options_get_real(options_database, key, index)
91  type(hashmap_type), intent(inout) :: options_database
92  character(len=*), intent(in) :: key
93  integer, intent(in), optional :: index
94 
95  character(len=len(key)+ARRAY_APPEND_SIZE) :: lookup_key
96 
97  if (present(index)) then
98  lookup_key=get_options_array_key(key, index)
99  else
100  lookup_key=key
101  end if
102  call check_options_key_exists(options_database, lookup_key)
103  options_get_real=c_get_real(options_database, lookup_key)
104  end function options_get_real
105 
112  subroutine options_get_real_array(options_database, key, array_data, from, to)
113  type(hashmap_type), intent(inout) :: options_database
114  character(len=*), intent(in) :: key
115  real(kind=default_precision), dimension(:), intent(inout) :: array_data
116  integer, intent(in), optional :: from, to
117 
118  integer :: num_elements, i, start, end
119 
120  num_elements=options_get_array_size(options_database, key)
121  if (num_elements .gt. 0 .and. options_has_key(options_database, trim(key)//"a_size")) then
122  if (present(from)) then
123  start=from
124  else
125  start=1
126  end if
127  if (present(to)) then
128  end=to
129  else
130  end=num_elements
131  end if
132  do i=start, num_elements
133  array_data((i-start)+1)=options_get_real(options_database, key, i)
134  end do
135  else
136  if (options_has_key(options_database, key)) then
137  if (present(from)) then
138  if (from .gt. 1) return
139  end if
140  if (present(to)) then
141  if (to .lt. 1) return
142  end if
143  array_data(1)=options_get_real(options_database, key)
144  end if
145  end if
146  end subroutine options_get_real_array
147 
153  logical function options_get_logical(options_database, key, index)
154  type(hashmap_type), intent(inout) :: options_database
155  character(len=*), intent(in) :: key
156  integer, intent(in), optional :: index
157 
158  character(len=len(key)+ARRAY_APPEND_SIZE) :: lookup_key
159 
160  if (present(index)) then
161  lookup_key=get_options_array_key(key, index)
162  else
163  lookup_key=key
164  end if
165  call check_options_key_exists(options_database, lookup_key)
166  options_get_logical=c_get_logical(options_database, lookup_key)
167  end function options_get_logical
168 
175  subroutine options_get_logical_array(options_database, key, array_data, from, to)
176  type(hashmap_type), intent(inout) :: options_database
177  character(len=*), intent(in) :: key
178  logical, dimension(:), intent(inout) :: array_data
179  integer, intent(in), optional :: from, to
180 
181  integer :: num_elements, i, start, end
182 
183  num_elements=options_get_array_size(options_database, key)
184  if (num_elements .gt. 0 .and. options_has_key(options_database, trim(key)//"a_size")) then
185  if (present(from)) then
186  start=from
187  else
188  start=1
189  end if
190  if (present(to)) then
191  end=to
192  else
193  end=num_elements
194  end if
195  do i=start, num_elements
196  array_data((i-start)+1)=options_get_logical(options_database, key, i)
197  end do
198  else
199  if (options_has_key(options_database, key)) then
200  if (present(from)) then
201  if (from .gt. 1) return
202  end if
203  if (present(to)) then
204  if (to .lt. 1) return
205  end if
206  array_data(1)=options_get_logical(options_database, key)
207  end if
208  end if
209  end subroutine options_get_logical_array
210 
216  integer function options_get_integer(options_database, key, index)
217  type(hashmap_type), intent(inout) :: options_database
218  character(len=*), intent(in) :: key
219  integer, intent(in), optional :: index
220 
221  character(len=len(key)+ARRAY_APPEND_SIZE) :: lookup_key
222 
223  if (present(index)) then
224  lookup_key=get_options_array_key(key, index)
225  else
226  lookup_key=key
227  end if
228  call check_options_key_exists(options_database, lookup_key)
229  options_get_integer=c_get_integer(options_database, lookup_key)
230  end function options_get_integer
231 
238  subroutine options_get_integer_array(options_database, key, array_data, from, to)
239  type(hashmap_type), intent(inout) :: options_database
240  character(len=*), intent(in) :: key
241  integer, dimension(:), intent(inout) :: array_data
242  integer, intent(in), optional :: from, to
243 
244  integer :: num_elements, i, start, end
245 
246  num_elements=options_get_array_size(options_database, key)
247  if (num_elements .gt. 0 .and. options_has_key(options_database, trim(key)//"a_size")) then
248  if (present(from)) then
249  start=from
250  else
251  start=1
252  end if
253  if (present(to)) then
254  end=to
255  else
256  end=num_elements
257  end if
258  do i=start, num_elements
259  array_data((i-start)+1)=options_get_integer(options_database, key, i)
260  end do
261  else
262  if (options_has_key(options_database, key)) then
263  if (present(from)) then
264  if (from .gt. 1) return
265  end if
266  if (present(to)) then
267  if (to .lt. 1) return
268  end if
269  array_data(1)=options_get_integer(options_database, key)
270  end if
271  end if
272  end subroutine options_get_integer_array
273 
279  character(len=STRING_LENGTH) function options_get_string(options_database, key, index)
280  type(hashmap_type), intent(inout) :: options_database
281  character(len=*), intent(in) :: key
282  integer, intent(in), optional :: index
283 
284  character(len=len(key)+ARRAY_APPEND_SIZE) :: lookup_key
285 
286  if (present(index)) then
287  lookup_key=get_options_array_key(key, index)
288  else
289  lookup_key=key
290  end if
291  call check_options_key_exists(options_database, lookup_key)
292  options_get_string=c_get_string(options_database, lookup_key)
293  end function options_get_string
294 
301  subroutine options_get_string_array(options_database, key, array_data, from, to)
302  type(hashmap_type), intent(inout) :: options_database
303  character(len=*), intent(in) :: key
304  character(len=STRING_LENGTH), dimension(:), intent(inout) :: array_data
305  integer, intent(in), optional :: from, to
306 
307  integer :: num_elements, i, start, end
308 
309  num_elements=options_get_array_size(options_database, key)
310  if (num_elements .gt. 0 .and. options_has_key(options_database, trim(key)//"a_size")) then
311  if (present(from)) then
312  start=from
313  else
314  start=1
315  end if
316  if (present(to)) then
317  end=to
318  else
319  end=num_elements
320  end if
321  do i=start, num_elements
322  array_data((i-start)+1)=options_get_string(options_database, key, i)
323  end do
324  else
325  if (options_has_key(options_database, key)) then
326  if (present(from)) then
327  if (from .gt. 1) return
328  end if
329  if (present(to)) then
330  if (to .lt. 1) return
331  end if
332  array_data(1)=options_get_string(options_database, key)
333  end if
334  end if
335  end subroutine options_get_string_array
336 
341  integer function options_get_array_size(options_database, key)
342  type(hashmap_type), intent(inout) :: options_database
343  character(len=*), intent(in) :: key
344 
345  if (options_has_key(options_database, trim(key)//"a_size")) then
346  options_get_array_size=options_get_integer(options_database, trim(key)//"a_size")
347  else if (options_has_key(options_database, trim(key))) then
349  else
351  end if
352  end function options_get_array_size
353 
356  subroutine load_command_line_into_options_database(options_database)
357  type(hashmap_type), intent(inout) :: options_database
358 
359  integer :: i, arguments, equals_posn, type_of_config
360  character(len=LONG_STRING_LENGTH) :: specific_arg
361 
362  arguments = command_argument_count()
363 
364  do i=1,arguments
365  call get_command_argument(i, value = specific_arg)
366  specific_arg = trim(specific_arg)
367  equals_posn=index(specific_arg, "=") ! Get the position of the equals character
368  if (index(specific_arg, "--") .eq. 1) then
369  if (equals_posn .gt. 0) then
370  type_of_config = get_argument_value_type(specific_arg(equals_posn+1 : len(specific_arg)))
371  else
372  ! If no equals then it is a logical switch (to true)
373  type_of_config = logical_type
374  end if
375  call add_specific_option_key_value_pair(type_of_config, options_database, specific_arg)
376  end if
377  end do
379 
383  subroutine options_remove_key(options_database, key)
384  type(hashmap_type), intent(inout) :: options_database
385  character(len=*), intent(in) :: key
386 
387  integer :: array_size, i
388 
389  if (options_has_key(options_database, key)) then
390  array_size=options_get_array_size(options_database, key)
391  if (array_size .gt. 0) then
392  do i=1,array_size
393  if (options_has_key(options_database, get_options_array_key(key, i))) then
394  call c_remove(options_database, get_options_array_key(key, i))
395  end if
396  end do
397  call c_remove(options_database, trim(key)//"a_size")
398  end if
399  else
400  call c_remove(options_database, key)
401  end if
402  end subroutine options_remove_key
403 
404  !--------------------------------------------------------------------------
405  ! Private procedures acting as helpers to the functionality of the registry
406  !--------------------------------------------------------------------------
407 
412  subroutine check_options_key_exists(options_database, key)
413  type(hashmap_type), intent(inout) :: options_database
414  character(len=*), intent(in) :: key
415 
416  if (.not. options_has_key(options_database, key)) then
417  call log_log(log_error, "No configuration option with key "//trim(key)//" present")
418  end if
419  end subroutine check_options_key_exists
420 
427  subroutine options_add_real(options_database, key, real_value, do_not_replace, array_index)
428  type(hashmap_type), intent(inout) :: options_database
429  character(len=*), intent(in) :: key
430  real(kind=default_precision), intent(in) :: real_value
431  integer, intent(in), optional :: array_index
432  logical, intent(in), optional :: do_not_replace
433 
434  integer :: temp_size
435  character(len=len(key)+ARRAY_APPEND_SIZE) :: lookup_key
436 
437  if (present(do_not_replace)) then
438  if (do_not_replace) then
439  if (present(array_index)) then
440  if (options_has_key(options_database, trim(key)//"a_"//conv_to_string(array_index))) return
441  else
442  if (options_has_key(options_database, key)) return
443  end if
444  end if
445  end if
446 
447  if (present(array_index)) then
448  if (options_has_key(options_database, trim(key)//"a_size")) then
449  temp_size=options_get_integer(options_database, trim(key)//"a_size")
450  if (temp_size .lt. array_index) temp_size=temp_size+1
451  else
452  temp_size=1
453  end if
454  call options_add(options_database, trim(key)//"a_size", temp_size)
455  lookup_key=get_options_array_key(key, array_index)
456  else
457  lookup_key=key
458  end if
459  call c_put_real(options_database, lookup_key, real_value)
460  end subroutine options_add_real
461 
468  subroutine options_add_logical(options_database, key, logical_value, do_not_replace, array_index)
469  type(hashmap_type), intent(inout) :: options_database
470  character(len=*), intent(in) :: key
471  logical, intent(in) :: logical_value
472  integer, intent(in), optional :: array_index
473  logical, intent(in), optional :: do_not_replace
474 
475  integer :: temp_size
476  character(len=len(key)+ARRAY_APPEND_SIZE) :: lookup_key
477 
478  if (present(do_not_replace)) then
479  if (do_not_replace) then
480  if (present(array_index)) then
481  if (options_has_key(options_database, trim(key)//"a_"//conv_to_string(array_index))) return
482  else
483  if (options_has_key(options_database, key)) return
484  end if
485  end if
486  end if
487 
488  if (present(array_index)) then
489  if (options_has_key(options_database, trim(key)//"a_size")) then
490  temp_size=options_get_integer(options_database, trim(key)//"a_size")
491  if (temp_size .lt. array_index) temp_size=temp_size+1
492  else
493  temp_size=1
494  end if
495  call options_add(options_database, trim(key)//"a_size", temp_size)
496  lookup_key=get_options_array_key(key, array_index)
497  else
498  lookup_key=key
499  end if
500  call c_put_logical(options_database, lookup_key, logical_value)
501  end subroutine options_add_logical
502 
509  subroutine options_add_string(options_database, key, string_value, do_not_replace, array_index)
510  type(hashmap_type), intent(inout) :: options_database
511  character(len=*), intent(in) :: key, string_value
512  integer, intent(in), optional :: array_index
513  logical, intent(in), optional :: do_not_replace
514 
515  character(len=STRING_LENGTH) :: value_to_store
516  integer :: temp_size
517  character(len=len(key)+ARRAY_APPEND_SIZE) :: lookup_key
518 
519  if (present(do_not_replace)) then
520  if (do_not_replace) then
521  if (present(array_index)) then
522  if (options_has_key(options_database, trim(key)//"a_"//conv_to_string(array_index))) return
523  else
524  if (options_has_key(options_database, key)) return
525  end if
526  end if
527  end if
528 
529  value_to_store=string_value
530 
531  if (present(array_index)) then
532  if (options_has_key(options_database, trim(key)//"a_size")) then
533  temp_size=options_get_integer(options_database, trim(key)//"a_size")
534  if (temp_size .lt. array_index) temp_size=temp_size+1
535  else
536  temp_size=1
537  end if
538  call options_add(options_database, trim(key)//"a_size", temp_size)
539  lookup_key=get_options_array_key(key, array_index)
540  else
541  lookup_key=key
542  end if
543  call c_put_string(options_database, lookup_key, value_to_store)
544  end subroutine options_add_string
545 
552  recursive subroutine options_add_integer(options_database, key, int_value, do_not_replace, array_index)
553  type(hashmap_type), intent(inout) :: options_database
554  character(len=*), intent(in) :: key
555  integer, intent(in) :: int_value
556  integer, intent(in), optional :: array_index
557  logical, intent(in), optional :: do_not_replace
558 
559  integer :: temp_size
560  character(len=len(key)+ARRAY_APPEND_SIZE) :: lookup_key
561 
562  if (present(do_not_replace)) then
563  if (do_not_replace) then
564  if (present(array_index)) then
565  if (options_has_key(options_database, trim(key)//"a_"//conv_to_string(array_index))) return
566  else
567  if (options_has_key(options_database, key)) return
568  end if
569  end if
570  end if
571 
572  if (present(array_index)) then
573  if (options_has_key(options_database, trim(key)//"a_size")) then
574  temp_size=options_get_integer(options_database, trim(key)//"a_size")
575  if (temp_size .lt. array_index) temp_size=temp_size+1
576  else
577  temp_size=1
578  end if
579  call options_add(options_database, trim(key)//"a_size", temp_size)
580  lookup_key=get_options_array_key(key, array_index)
581  else
582  lookup_key=key
583  end if
584  call c_put_integer(options_database, lookup_key, int_value)
585  end subroutine options_add_integer
586 
591  character(len=STRING_LENGTH) function get_options_array_key(key, index)
592  character(len=*), intent(in) :: key
593  integer, intent(in) :: index
594 
595  get_options_array_key=trim(key)//"a_"//trim(conv_to_string(index))
596  end function get_options_array_key
597 
605  integer function get_argument_value_type(specific_value)
606  character(len=*), intent(in) :: specific_value
607  integer :: dot_posn, exponent_posn
608 
609  if (conv_is_logical(specific_value)) then
611  return
612  else
613  end if
614 
615  dot_posn = index(specific_value,".")
616  exponent_posn = index(specific_value,"e")
617  if (dot_posn .eq. 0 .and. exponent_posn .eq. 0) then
618  ! No dot, therefore an integer or string
619  if (conv_is_integer(specific_value)) then
621  return
622  end if
623  else
624  ! A dot is present, therefore a real or string
625  if (conv_is_real(specific_value)) then
627  return
628  end if
629  end if
630  get_argument_value_type = string_type ! Default string type
631  end function get_argument_value_type
632 
640  subroutine add_specific_option_key_value_pair(type_of_config, parse_options, specific_arg)
641  integer, intent(in) :: type_of_config
642  character(len=*), intent(in) :: specific_arg
643  type(hashmap_type), intent(inout) :: parse_options
644 
645  integer :: equals_posn
646  equals_posn=index(specific_arg, "=") ! Get the position of the equals character
647 
648  if (type_of_config == logical_type) then
649  if (equals_posn .gt. 0) then
650  call set_options_logical_value(parse_options, specific_arg(3:equals_posn-1), &
651  conv_to_logical(specific_arg(equals_posn+1:len(specific_arg))))
652  else
653  ! Handle the case where there is just a key (no value)
654  call set_options_logical_value(parse_options, specific_arg(3:len(specific_arg)), .true.)
655  end if
656  else if (type_of_config == integer_type) then
657  call set_options_integer_value(parse_options, specific_arg(3:equals_posn-1), &
658  conv_to_integer(specific_arg(equals_posn+1:len(specific_arg))))
659  else if (type_of_config == real_type) then
660  call set_options_real_value(parse_options, specific_arg(3:equals_posn-1), &
661  conv_single_real_to_double(conv_to_real(specific_arg(equals_posn+1:len(specific_arg)))))
662  else if (type_of_config == string_type) then
663  call set_options_string_value(parse_options, specific_arg(3:equals_posn-1), specific_arg(equals_posn+1:len(specific_arg)))
664  end if
666 
668  subroutine set_options_logical_value(optionhashmap_type, key, logical_value)
669  type(hashmap_type), intent(inout) :: optionhashmap_type
670  character(len=*), intent(in) :: key
671  logical, intent(in) :: logical_value
672 
673  call c_put_logical(optionhashmap_type, key, logical_value)
674  end subroutine set_options_logical_value
675 
677  subroutine set_options_real_value(optionhashmap_type, key, real_value)
678  type(hashmap_type), intent(inout) :: optionhashmap_type
679  character(len=*), intent(in) :: key
680  real(kind=default_precision), intent(in) :: real_value
681 
682  call c_put_real(optionhashmap_type, key, real_value)
683  end subroutine set_options_real_value
684 
686  subroutine set_options_integer_value(optionhashmap_type, key, int_value)
687  type(hashmap_type), intent(inout) :: optionhashmap_type
688  character(len=*), intent(in) :: key
689  integer, intent(in) :: int_value
690 
691  call c_put_integer(optionhashmap_type, key, int_value)
692  end subroutine set_options_integer_value
693 
695  subroutine set_options_string_value(optionhashmap_type, key, str_value)
696  type(hashmap_type), intent(inout) :: optionhashmap_type
697  character(len=*), intent(in) :: key
698  character(len=*), intent(in) :: str_value
699 
700  character(len=STRING_LENGTH) :: write_value
701 
702  ! We do an assignment here to force the value to be default size, otherwise might underflow
703  write_value = str_value
704  call c_put_string(optionhashmap_type, key, write_value)
705  end subroutine set_options_string_value
706 end module optionsdatabase_mod
logging_mod::log_error
integer, parameter, public log_error
Only log ERROR messages.
Definition: logging.F90:11
conversions_mod
Conversion between common inbuilt FORTRAN data types.
Definition: conversions.F90:5
conversions_mod::conv_is_logical
Determines whether a data item can be represented as a logical or not.
Definition: conversions.F90:100
optionsdatabase_mod::options_key_at
character(len=string_length) function, public options_key_at(options_database, i)
Returns the ith key in the options database.
Definition: optionsdatabase.F90:53
collections_mod::c_key_at
Retrieves the key currently being held at a specific index in the map or "" if the index > map elemen...
Definition: collections.F90:457
optionsdatabase_mod::set_options_string_value
subroutine set_options_string_value(optionhashmap_type, key, str_value)
A helper procedure to set a specific string value.
Definition: optionsdatabase.F90:696
optionsdatabase_mod::options_get_array_size
integer function, public options_get_array_size(options_database, key)
Gets the size of the array held in the options database corresponding to a specific key.
Definition: optionsdatabase.F90:342
conversions_mod::conv_to_integer
Converts data types to integers.
Definition: conversions.F90:49
optionsdatabase_mod::options_get_integer_array
subroutine, public options_get_integer_array(options_database, key, array_data, from, to)
Retrieves an entire (or subset) integer array.
Definition: optionsdatabase.F90:239
collections_mod
Collection data structures.
Definition: collections.F90:7
optionsdatabase_mod::integer_type
integer, parameter integer_type
Type of integer value data.
Definition: optionsdatabase.F90:19
collections_mod::c_get_string
Gets a specific string element out of the list, stack, queue or map with the corresponding key.
Definition: collections.F90:388
optionsdatabase_mod::options_get_integer
integer function, public options_get_integer(options_database, key, index)
Retrieves an integer value from the database that matches the provided key.
Definition: optionsdatabase.F90:217
optionsdatabase_mod::options_add_string
subroutine options_add_string(options_database, key, string_value, do_not_replace, array_index)
Adds a string value to the options database with a specific key.
Definition: optionsdatabase.F90:510
collections_mod::hashmap_type
A hashmap structure, the same as a map but uses hashing for greatly improved performance when storing...
Definition: collections.F90:94
collections_mod::c_size
Returns the number of elements in the collection.
Definition: collections.F90:428
conversions_mod::conv_to_logical
Converts data types to logical.
Definition: conversions.F90:71
logging_mod::log_log
subroutine, public log_log(level, message, str)
Logs a message at the specified level. If the level is above the current level then the message is ig...
Definition: logging.F90:75
datadefn_mod::long_string_length
integer, parameter, public long_string_length
Length of longer strings.
Definition: datadefn.F90:11
optionsdatabase_mod::options_get_logical_array
subroutine, public options_get_logical_array(options_database, key, array_data, from, to)
Retrieves an entire (or subset) logical array.
Definition: optionsdatabase.F90:176
optionsdatabase_mod::array_append_size
integer, parameter array_append_size
Definition: optionsdatabase.F90:25
optionsdatabase_mod::options_add_real
subroutine options_add_real(options_database, key, real_value, do_not_replace, array_index)
Adds a real value to the options database with a specific key.
Definition: optionsdatabase.F90:428
optionsdatabase_mod::options_add
Generic add interface for adding different types of data to the databases.
Definition: optionsdatabase.F90:28
optionsdatabase_mod::set_options_integer_value
subroutine set_options_integer_value(optionhashmap_type, key, int_value)
A helper procedure to set a specific integer value.
Definition: optionsdatabase.F90:687
optionsdatabase_mod::options_add_logical
subroutine options_add_logical(options_database, key, logical_value, do_not_replace, array_index)
Adds a logical value to the options database with a specific key.
Definition: optionsdatabase.F90:469
optionsdatabase_mod::get_argument_value_type
integer function get_argument_value_type(specific_value)
Given a specific value this will determine the type of data.
Definition: optionsdatabase.F90:606
collections_mod::c_generic_at
Retrieves the generic value held at the specific map index or null if index > map elements.
Definition: collections.F90:467
optionsdatabase_mod::options_get_string
character(len=string_length) function, public options_get_string(options_database, key, index)
Retrieves a string value from the database that matches the provided key.
Definition: optionsdatabase.F90:280
collections_mod::c_contains
Determines whether or not a map contains a specific key.
Definition: collections.F90:447
optionsdatabase_mod::check_options_key_exists
subroutine check_options_key_exists(options_database, key)
Determines whether a specific options key exists in the database or not, if it doesn't then this resu...
Definition: optionsdatabase.F90:413
optionsdatabase_mod::options_has_key
logical function, public options_has_key(options_database, key)
Determines whether a specific key is in the database.
Definition: optionsdatabase.F90:76
optionsdatabase_mod::real_type
integer, parameter real_type
Type of real value data.
Definition: optionsdatabase.F90:19
collections_mod::c_get_logical
Gets a specific logical element out of the list, stack, queue or map with the corresponding key.
Definition: collections.F90:409
optionsdatabase_mod::options_size
integer function, public options_size(options_database)
Returns the number of entries in the options database.
Definition: optionsdatabase.F90:43
conversions_mod::conv_to_string
Converts data types to strings.
Definition: conversions.F90:38
optionsdatabase_mod::load_command_line_into_options_database
subroutine, public load_command_line_into_options_database(options_database)
Loads in the command line arguments and stores them in the options database.
Definition: optionsdatabase.F90:357
optionsdatabase_mod::logical_type
integer, parameter logical_type
Type of logical value data.
Definition: optionsdatabase.F90:19
conversions_mod::conv_is_real
Determines whether a data item can be represented as a real or not.
Definition: conversions.F90:91
collections_mod::c_get_real
Gets a specific double precision real element out of the list, stack, queue or map with the correspon...
Definition: collections.F90:399
conversions_mod::conv_is_integer
Determines whether a data item can be represented as an integer or not.
Definition: conversions.F90:81
collections_mod::c_put_integer
Puts an integer key-value pair into the map.
Definition: collections.F90:318
collections_mod::c_put_string
Puts a string key-value pair into the map.
Definition: collections.F90:331
optionsdatabase_mod::set_options_logical_value
subroutine set_options_logical_value(optionhashmap_type, key, logical_value)
A helper procedure to set a specific logical value.
Definition: optionsdatabase.F90:669
optionsdatabase_mod::options_get_logical
logical function, public options_get_logical(options_database, key, index)
Retrieves a logical value from the database that matches the provided key.
Definition: optionsdatabase.F90:154
optionsdatabase_mod::options_add_integer
recursive subroutine options_add_integer(options_database, key, int_value, do_not_replace, array_index)
Adds an integer value to the options database with a specific key.
Definition: optionsdatabase.F90:553
optionsdatabase_mod::string_type
integer, parameter string_type
Type of string value data.
Definition: optionsdatabase.F90:19
collections_mod::c_put_real
Puts a double precision real key-value pair into the map.
Definition: collections.F90:344
logging_mod
Logging utility.
Definition: logging.F90:2
datadefn_mod
Contains common definitions for the data and datatypes used by MONC.
Definition: datadefn.F90:2
optionsdatabase_mod::get_options_array_key
character(len=string_length) function get_options_array_key(key, index)
Gets a key corresponding to the correct options key and index combination.
Definition: optionsdatabase.F90:592
datadefn_mod::string_length
integer, parameter, public string_length
Default length of strings.
Definition: datadefn.F90:10
optionsdatabase_mod::add_specific_option_key_value_pair
subroutine add_specific_option_key_value_pair(type_of_config, parse_options, specific_arg)
This will add a specific option key value pair to the options hashmap_type.
Definition: optionsdatabase.F90:641
collections_mod::list_type
List data structure which implements a doubly linked list. This list will preserve its order.
Definition: collections.F90:60
optionsdatabase_mod::options_value_at
class(*) function, pointer, public options_value_at(options_database, i)
Returns the value at index in the database.
Definition: optionsdatabase.F90:64
collections_mod::c_remove
Removes a specific element from the list or map.
Definition: collections.F90:419
optionsdatabase_mod::options_get_string_array
subroutine, public options_get_string_array(options_database, key, array_data, from, to)
Retrieves an entire (or subset) string array.
Definition: optionsdatabase.F90:302
conversions_mod::conv_to_real
Converts data types to real.
Definition: conversions.F90:60
collections_mod::c_get_integer
Gets a specific integer element out of the list, stack, queue or map with the corresponding key.
Definition: collections.F90:378
optionsdatabase_mod
Manages the options database. Contains administration functions and deduce runtime options from the c...
Definition: optionsdatabase.F90:7
optionsdatabase_mod::options_get_real_array
subroutine, public options_get_real_array(options_database, key, array_data, from, to)
Retrieves an entire (or subset) real array.
Definition: optionsdatabase.F90:113
optionsdatabase_mod::options_remove_key
subroutine, public options_remove_key(options_database, key)
Removes a specific key from the options database, if it is an array then the entire array is removed.
Definition: optionsdatabase.F90:384
collections_mod::c_put_logical
Puts a logical key-value pair into the map.
Definition: collections.F90:357
optionsdatabase_mod::set_options_real_value
subroutine set_options_real_value(optionhashmap_type, key, real_value)
A helper procedure to set a specific real value.
Definition: optionsdatabase.F90:678
optionsdatabase_mod::options_get_real
real(kind=default_precision) function, public options_get_real(options_database, key, index)
Retrieves a real value from the database that matches the provided key.
Definition: optionsdatabase.F90:91
datadefn_mod::default_precision
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
Definition: datadefn.F90:17
conversions_mod::conv_single_real_to_double
real(kind=double_precision) function, public conv_single_real_to_double(input_real)
Converts from a single to double precision real. This applies some rounding to a certain number of de...
Definition: conversions.F90:114