aot_out_val_logical Subroutine

private subroutine aot_out_val_logical(put_conf, val, vname, advance_previous)

Put logical variables into the Lua script.

The value is passed in with val, optionally you can assign a name to it with the vname argument. If it should be put on the same line as the previous entry, you have to set advance_previous=.false.

Arguments

Type IntentOptional Attributes Name
type(aot_out_type), intent(inout) :: put_conf
logical, intent(in) :: val
character(len=*), intent(in), optional :: vname
logical, intent(in), optional :: advance_previous

Calls

proc~~aot_out_val_logical~~CallsGraph proc~aot_out_val_logical aot_out_val_logical proc~aot_out_breakline aot_out_breakline proc~aot_out_val_logical->proc~aot_out_breakline

Called by

proc~~aot_out_val_logical~~CalledByGraph proc~aot_out_val_logical aot_out_val_logical interface~aot_out_val aot_out_val interface~aot_out_val->proc~aot_out_val_logical

Source Code

  subroutine aot_out_val_logical(put_conf, val, vname, advance_previous)
    !------------------------------------------------------------------------
    type(aot_out_type), intent(inout)  :: put_conf
    character(len=*), optional, intent(in) :: vname
    logical, intent(in) :: val
    logical, optional, intent(in) :: advance_previous
    !------------------------------------------------------------------------
    character(len=3) :: adv_string
    character(len=5) :: valstring
    !------------------------------------------------------------------------

    if (put_conf%level > 0) then
      ! Leave the advancing to the next entry in the table.
      adv_string = 'no'
    else
      ! Not within a table, finalize the global definition with a newline.
      adv_string = 'yes'
    end if

    call aot_out_breakline(put_conf, advance_previous)

    if (val) then
      valstring = 'true'
    else
      valstring = 'false'
    end if

    if (present(vname)) then
      write(put_conf%outunit, fmt="(a)", advance=adv_string) &
        &   trim(vname)//" = "//trim(valstring)
    else
      write(put_conf%outunit, fmt="(a)", advance=adv_string) trim(valstring)
    end if

  end subroutine aot_out_val_logical