36  use json_module, 
only : json_file, json_value, json_core
 
   73    type(json_file), 
intent(inout) :: json
 
   74    character(len=*), 
intent(in) :: name
 
   75    real(kind=
sp), 
intent(out) :: 
value 
   77    if (.not. json%valid_path(name)) 
then 
   78       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
   81    call json%get(name, 
value)
 
 
   89    type(json_file), 
intent(inout) :: json
 
   90    character(len=*), 
intent(in) :: name
 
   91    real(kind=
dp), 
intent(out) :: 
value 
   93    if (.not. json%valid_path(name)) 
then 
   94       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
   97    call json%get(name, 
value)
 
 
  105    type(json_file), 
intent(inout) :: json
 
  106    character(len=*), 
intent(in) :: name
 
  107    integer, 
intent(out) :: value
 
  109    if (.not. json%valid_path(name)) 
then 
  110       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
  113    call json%get(name, 
value)
 
 
  121    type(json_file), 
intent(inout) :: json
 
  122    character(len=*), 
intent(in) :: name
 
  123    logical, 
intent(out) :: value
 
  125    if (.not. json%valid_path(name)) 
then 
  126       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
  129    call json%get(name, 
value)
 
 
  137    type(json_file), 
intent(inout) :: json
 
  138    character(len=*), 
intent(in) :: name
 
  139    character(len=:), 
allocatable, 
intent(out) :: value
 
  141    if (.not. json%valid_path(name)) 
then 
  142       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
  145    call json%get(name, 
value)
 
 
  153    type(json_file), 
intent(inout) :: json
 
  154    character(len=*), 
intent(in) :: name
 
  155    real(kind=
sp), 
allocatable, 
intent(out) :: value(:)
 
  157    if (.not. json%valid_path(name)) 
then 
  158       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
  161    call json%get(name, 
value)
 
 
  169    type(json_file), 
intent(inout) :: json
 
  170    character(len=*), 
intent(in) :: name
 
  171    real(kind=
dp), 
allocatable, 
intent(out) :: value(:)
 
  173    if (.not. json%valid_path(name)) 
then 
  174       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
  177    call json%get(name, 
value)
 
 
  185    type(json_file), 
intent(inout) :: json
 
  186    character(len=*), 
intent(in) :: name
 
  187    integer, 
allocatable, 
intent(out) :: 
value(:)
 
  189    if (.not. json%valid_path(name)) 
then 
  190       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
  193    call json%get(name, 
value)
 
 
  201    type(json_file), 
intent(inout) :: json
 
  202    character(len=*), 
intent(in) :: name
 
  203    logical, 
allocatable, 
intent(out) :: 
value(:)
 
  205    if (.not. json%valid_path(name)) 
then 
  206       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
  209    call json%get(name, 
value)
 
 
  218    type(json_file), 
intent(inout) :: json
 
  219    character(len=*), 
intent(in) :: name
 
  220    character(len=*), 
allocatable, 
intent(out) :: 
value(:)
 
  221    character(len=*), 
optional, 
intent(in) :: filler
 
  223    type(json_value), 
pointer :: json_val, val_ptr
 
  224    type(json_core) :: core
 
  225    character(len=:), 
allocatable :: string_value
 
  226    integer :: i, n_children
 
  228    if (.not. json%valid_path(name)) 
then 
  229       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
  231    call json%info(name, n_children = n_children)
 
  233    if (.not. 
allocated(
value)) 
then 
  234       allocate(value(n_children))
 
  235    else if (len(
value) .lt. n_children) 
then 
  237       allocate(value(n_children))
 
  240    call json%get(name, json_val, found)
 
  241    call json%get_core(core)
 
  244       call core%get_child(json_val, i, val_ptr, found)
 
  245       call core%get(val_ptr, string_value)
 
  247       if (len(string_value) .gt. 0) 
then 
  248          value(i) = string_value
 
  249       else if (
present(filler)) 
then 
 
  258    type(json_file), 
intent(inout) :: json
 
  259    character(len=*), 
intent(in) :: key
 
  260    type(json_file), 
intent(inout) :: output
 
  262    type(json_value), 
pointer :: ptr
 
  263    type(json_core) :: core
 
  265    character(len=:), 
allocatable :: buffer
 
  267    call json%get_core(core)
 
  268    call json%get(key, ptr, found)
 
  270    if (.not. found) 
then 
  272            trim(key) // 
" missing from the case file")
 
  275    call core%print_to_string(ptr, 
buffer)
 
 
  286    type(json_file), 
intent(inout) :: json
 
  287    character(len=*), 
intent(in) :: name
 
  288    real(kind=
sp), 
intent(out) :: 
value 
  289    real(kind=
sp), 
intent(in) :: default
 
  292    call json%get(name, 
value, found)
 
  296       call json%add(name, 
value)
 
  297    else if (.not. found) 
then 
  298       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
 
  308    type(json_file), 
intent(inout) :: json
 
  309    character(len=*), 
intent(in) :: name
 
  310    real(kind=
dp), 
intent(out) :: 
value 
  311    real(kind=
dp), 
intent(in) :: default
 
  314    call json%get(name, 
value, found)
 
  318       call json%add(name, 
value)
 
  319    else if (.not. found) 
then 
  320       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
 
  330    type(json_file), 
intent(inout) :: json
 
  331    character(len=*), 
intent(in) :: name
 
  332    integer, 
intent(out) :: value
 
  333    integer, 
intent(in) :: default
 
  336    call json%get(name, 
value, found)
 
  340       call json%add(name, 
value)
 
  341    else if (.not. found) 
then 
  342       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
 
  352    type(json_file), 
intent(inout) :: json
 
  353    character(len=*), 
intent(in) :: name
 
  354    logical, 
intent(out) :: value
 
  355    logical, 
intent(in) :: default
 
  358    call json%get(name, 
value, found)
 
  362       call json%add(name, 
value)
 
  363    else if (.not. found) 
then 
  364       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
 
  374    type(json_file), 
intent(inout) :: json
 
  375    character(len=*), 
intent(in) :: name
 
  376    character(len=:), 
allocatable, 
intent(out) :: value
 
  377    character(len=*), 
intent(in) :: default
 
  380    call json%get(name, 
value, found)
 
  384       call json%add(name, 
value)
 
  385    else if (.not. found) 
then 
  386       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
 
  396    type(json_core), 
intent(inout) :: core
 
  397    type(json_value), 
pointer, 
intent(in) :: array
 
  398    integer, 
intent(in) :: i
 
  399    type(json_file), 
intent(inout) :: item
 
  400    type(json_value), 
pointer :: ptr
 
  402    character(len=:), 
allocatable :: buffer
 
  404    call core%get_child(array, i, ptr, found)
 
  405    call core%print_to_string(ptr, 
buffer)
 
  406    call item%load_from_string(
buffer)
 
 
  416    type(json_file), 
intent(inout) :: json
 
  417    character(len=*), 
intent(in) :: name
 
  418    integer, 
intent(in) :: i
 
  419    type(json_file), 
intent(out) :: item
 
  421    type(json_core) :: core
 
  422    type(json_value), 
pointer :: array
 
  423    type(json_value), 
pointer :: ptr
 
  425    character(len=:), 
allocatable :: buffer
 
  427    call json%get_core(core)
 
  428    call json%get(name, array, found)
 
  430    if (.not. found) 
then 
  431       call neko_error(
"Parameter " // name // 
" missing from the case file")
 
  434    call core%get_child(array, i, ptr, found)
 
  435    call core%print_to_string(ptr, 
buffer)
 
  436    call item%load_from_string(
buffer)
 
 
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
 
Retrieves a parameter by name or throws an error.
 
Generic buffer that is extended with buffers of varying rank.
 
Utilities for retrieving parameters from the case files.
 
subroutine json_extract_item_from_name(json, name, i, item)
Extract ith item from a JSON array as a separate JSON object.
 
subroutine json_get_logical(json, name, value)
Retrieves a logical parameter by name or throws an error.
 
subroutine json_get_or_default_string(json, name, value, default)
Retrieves a string parameter by name or assigns a provided default value. In the latter case also add...
 
subroutine json_get_real_array(json, name, value)
Retrieves a real array parameter by name or throws an error.
 
subroutine json_get_subdict(json, key, output)
Extract a sub-object from a json object.
 
subroutine json_extract_item_from_array(core, array, i, item)
Extract ith item from a JSON array as a separate JSON object.
 
subroutine json_get_string(json, name, value)
Retrieves a string parameter by name or throws an error.
 
subroutine json_get_or_default_real(json, name, value, default)
Retrieves a real parameter by name or assigns a provided default value. In the latter case also adds ...
 
subroutine json_get_or_default_double(json, name, value, default)
Retrieves a real parameter by name or assigns a provided default value. In the latter case also adds ...
 
subroutine json_get_or_default_logical(json, name, value, default)
Retrieves a logical parameter by name or assigns a provided default value. In the latter case also ad...
 
subroutine json_get_double_array(json, name, value)
Retrieves a real array parameter by name or throws an error.
 
subroutine json_get_or_default_integer(json, name, value, default)
Retrieves an integer parameter by name or assigns a provided default value. In the latter case also a...
 
subroutine json_get_double(json, name, value)
Retrieves a double precision real parameter by name or throws an error.
 
subroutine json_get_string_array(json, name, value, filler)
Retrieves a string array parameter by name or throws an error.
 
subroutine json_get_logical_array(json, name, value)
Retrieves a logical array parameter by name or throws an error.
 
subroutine json_get_real(json, name, value)
Retrieves a real parameter by name or throws an error.
 
logical, public json_no_defaults
If true, the json_get_or_default routines will not add missing parameters.
 
subroutine json_get_integer(json, name, value)
Retrieves an integer parameter by name or throws an error.
 
subroutine json_get_integer_array(json, name, value)
Retrieves a integer array parameter by name or throws an error.
 
integer, parameter, public dp
 
integer, parameter, public sp
 
integer, parameter, public rp
Global precision used in computations.