add_variables_to_input Subroutine

public subroutine add_variables_to_input(me, variable, units, frame, center, rdata, error_cnt)

Arguments

Type IntentOptional AttributesName
type(json_value), , pointer:: me
character(len=*), intent(in) :: variable
character(len=*), intent(in) :: units
character(len=*), intent(in) :: frame
character(len=*), intent(in) :: center
real(kind=wp), intent(in), dimension(:):: rdata
integer, intent(inout) :: error_cnt

Calls

proc~~add_variables_to_input~~CallsGraph proc~add_variables_to_input add_variables_to_input interface~json_create_object json_create_object proc~add_variables_to_input->interface~json_create_object interface~json_add json_add proc~add_variables_to_input->interface~json_add proc~json_failed json_failed proc~add_variables_to_input->proc~json_failed proc~json_print_error_message json_print_error_message proc~add_variables_to_input->proc~json_print_error_message proc~json_value_create_object json_value_create_object interface~json_create_object->proc~json_value_create_object proc~json_value_add_logical json_value_add_logical interface~json_add->proc~json_value_add_logical proc~json_value_add_double json_value_add_double interface~json_add->proc~json_value_add_double proc~json_value_add_member json_value_add_member interface~json_add->proc~json_value_add_member proc~json_value_add_integer json_value_add_integer interface~json_add->proc~json_value_add_integer proc~json_value_add_double_vec json_value_add_double_vec interface~json_add->proc~json_value_add_double_vec proc~json_value_add_logical_vec json_value_add_logical_vec interface~json_add->proc~json_value_add_logical_vec proc~json_value_add_integer_vec json_value_add_integer_vec interface~json_add->proc~json_value_add_integer_vec proc~json_value_add_string_vec json_value_add_string_vec interface~json_add->proc~json_value_add_string_vec proc~json_value_add_string json_value_add_string interface~json_add->proc~json_value_add_string proc~json_check_for_errors json_check_for_errors proc~json_print_error_message->proc~json_check_for_errors proc~json_clear_exceptions json_clear_exceptions proc~json_print_error_message->proc~json_clear_exceptions proc~json_value_create json_value_create proc~json_value_create_object->proc~json_value_create proc~to_object to_object proc~json_value_create_object->proc~to_object proc~destroy_json_data destroy_json_data proc~to_object->proc~destroy_json_data proc~json_value_add_logical->interface~json_add proc~json_value_add_logical->proc~json_value_create proc~to_logical to_logical proc~json_value_add_logical->proc~to_logical proc~json_value_add_double->interface~json_add proc~json_value_add_double->proc~json_value_create proc~to_double to_double proc~json_value_add_double->proc~to_double proc~json_value_add_integer->interface~json_add proc~json_value_add_integer->proc~json_value_create proc~to_integer to_integer proc~json_value_add_integer->proc~to_integer proc~json_value_add_double_vec->interface~json_add proc~json_value_add_double_vec->proc~json_value_create proc~to_array to_array proc~json_value_add_double_vec->proc~to_array proc~json_value_add_logical_vec->interface~json_add proc~json_value_add_logical_vec->proc~json_value_create proc~json_value_add_logical_vec->proc~to_array proc~json_value_add_integer_vec->interface~json_add proc~json_value_add_integer_vec->proc~json_value_create proc~json_value_add_integer_vec->proc~to_array proc~json_value_add_string_vec->interface~json_add proc~json_value_add_string_vec->proc~json_value_create proc~json_value_add_string_vec->proc~to_array proc~json_value_add_string->interface~json_add proc~json_value_add_string->proc~json_value_create proc~escape_string escape_string proc~json_value_add_string->proc~escape_string proc~to_string to_string proc~json_value_add_string->proc~to_string proc~to_logical->proc~destroy_json_data proc~to_double->proc~destroy_json_data proc~to_integer->proc~destroy_json_data proc~to_array->proc~destroy_json_data proc~to_string->proc~destroy_json_data
Help

Called By

proc~~add_variables_to_input~~CalledByGraph proc~add_variables_to_input add_variables_to_input proc~test_2 test_2 proc~test_2->proc~add_variables_to_input program~jf_test_2 jf_test_2 program~jf_test_2->proc~test_2
Help

Variables

TypeVisibility AttributesNameInitial
type(json_value), public, pointer:: var

Source Code

    subroutine add_variables_to_input(me, variable, units, frame, center, rdata, error_cnt)
    !Used by test_2.

    implicit none

    type(json_value),pointer :: me
    character(len=*),intent(in) :: variable, units, frame, center
    real(wp),dimension(:),intent(in) :: rdata
    integer, intent(inout) :: error_cnt

    type(json_value),pointer :: var        !a variable in the trajectory:

    !initialize:
    nullify(var)

    !create the object before data can be added:
    call json_create_object(var,'')    !name does not matter
    if (json_failed()) then
        call json_print_error_message(error_unit)
        error_cnt = error_cnt + 1
    end if

    !variable info:
    call json_add(var, 'VARIABLE',trim(variable))
    if (json_failed()) then
        call json_print_error_message(error_unit)
        error_cnt = error_cnt + 1
    end if
    call json_add(var, 'UNITS', trim(units))
    if (json_failed()) then
        call json_print_error_message(error_unit)
        error_cnt = error_cnt + 1
    end if
    call json_add(var, 'FRAME', trim(frame))
    if (json_failed()) then
        call json_print_error_message(error_unit)
        error_cnt = error_cnt + 1
    end if
    call json_add(var, 'CENTER', trim(center))
    if (json_failed()) then
        call json_print_error_message(error_unit)
        error_cnt = error_cnt + 1
    end if

    !trajectory [vector of reals]:
    call json_add(var, 'DATA', rdata)
    if (json_failed()) then
        call json_print_error_message(error_unit)
        error_cnt = error_cnt + 1
    end if

    !add this variable to trajectory structure:
    call json_add(me, var)
    if (json_failed()) then
        call json_print_error_message(error_unit)
        error_cnt = error_cnt + 1
    end if

    !cleanup:
    nullify(var)

    end subroutine add_variables_to_input