load_alignmask Subroutine

private subroutine load_alignmask(mask, conf, key, parent)

Arguments

Type IntentOptional Attributes Name
logical, intent(out) :: mask(3)

Time to be read from the Lua script

type(flu_State), intent(inout) :: conf

Handle to the Lua script.

character(len=*), intent(in) :: key

Name of the table containing the time definition. Default: 'time'.

integer, intent(in), optional :: parent

Handle to the parent table.


Calls

proc~~load_alignmask~~CallsGraph proc~load_alignmask load_alignmask proc~aot_table_open aot_table_open proc~load_alignmask->proc~aot_table_open proc~aot_table_close aot_table_close proc~load_alignmask->proc~aot_table_close proc~aot_get_val aot_get_val proc~load_alignmask->proc~aot_get_val

Called by

proc~~load_alignmask~~CalledByGraph proc~load_alignmask load_alignmask proc~tem_timecontrol_align_trigger tem_timeControl_align_trigger proc~tem_timecontrol_align_trigger->proc~load_alignmask proc~tem_load_restart tem_load_restart proc~tem_load_restart->proc~tem_timecontrol_align_trigger

Contents

Source Code


Source Code

  subroutine load_alignmask(mask, conf, key, parent)
    !> Time to be read from the Lua script
    logical, intent(out) :: mask(3)

    !> Handle to the Lua script.
    type(flu_state), intent(inout) :: conf

    !> Name of the table containing the time definition. Default: 'time'.
    character(len=*), intent(in) :: key

    !> Handle to the parent table.
    integer, intent(in), optional :: parent
    ! -------------------------------------------------------------------- !
    integer :: iErr
    integer :: thandle
    ! -------------------------------------------------------------------- !

    call aot_table_open(L       = conf,     &
      &                 parent  = parent,   &
      &                 thandle = thandle,  &
      &                 key     = trim(key) )

    if (thandle /= 0) then
      ! The mask is given as a table load its components accordingly.
      call aot_get_val(L       = conf,      &
        &              thandle = thandle,   &
        &              val     = mask(sim), &
        &              key     = 'sim',     &
        &              default = .false.,   &
        &              ErrCode = iErr       )

      call aot_get_val(L       = conf,       &
        &              thandle = thandle,    &
        &              val     = mask(iter), &
        &              key     = 'iter',     &
        &              default = .false.,    &
        &              ErrCode = iErr        )

      call aot_get_val(L       = conf,        &
        &              thandle = thandle,     &
        &              val     = mask(clock), &
        &              key     = 'clock',     &
        &              default = .false.,     &
        &              ErrCode = iErr         )
    else
      ! The mask is not given as a table, try to interpret it as a setting for
      ! the simtime.
      mask = .false.
      call aot_get_val(L       = conf,      &
        &              thandle = parent,    &
        &              key     = trim(key), &
        &              val     = mask(sim), &
        &              default = .false.,   &
        &              ErrCode = iErr       )
    end if

    call aot_table_close(conf, thandle)

  end subroutine load_alignmask