tem_load_acoustic_pulse Subroutine

public subroutine tem_load_acoustic_pulse(conf, thandle, me)

Load the definition of an acoustic pulse from a configuration Lua script.

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: conf
integer, intent(in) :: thandle
type(tem_acoustic_pulse_type), intent(out) :: me

Calls

proc~~tem_load_acoustic_pulse~~CallsGraph proc~tem_load_acoustic_pulse tem_load_acoustic_pulse proc~aot_get_val~2 aot_get_val proc~tem_load_acoustic_pulse->proc~aot_get_val~2 proc~tem_abort tem_abort proc~tem_load_acoustic_pulse->proc~tem_abort mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~tem_load_acoustic_pulse~~CalledByGraph proc~tem_load_acoustic_pulse tem_load_acoustic_pulse proc~load_spacetime_predefined load_spacetime_predefined proc~load_spacetime_predefined->proc~tem_load_acoustic_pulse proc~tem_load_spacetime_single tem_load_spacetime_single proc~tem_load_spacetime_single->proc~load_spacetime_predefined proc~tem_load_spacetime_single->proc~tem_load_spacetime_single proc~tem_load_spacetime_table tem_load_spacetime_table proc~tem_load_spacetime_table->proc~tem_load_spacetime_single interface~tem_load_spacetime tem_load_spacetime interface~tem_load_spacetime->proc~tem_load_spacetime_single interface~tem_load_spacetime->proc~tem_load_spacetime_table proc~tem_variable_loadmapping_single tem_variable_loadMapping_single proc~tem_variable_loadmapping_single->interface~tem_load_spacetime proc~tem_variable_load_single tem_variable_load_single proc~tem_variable_load_single->interface~tem_load_spacetime

Contents


Source Code

  subroutine tem_load_acoustic_pulse(conf, thandle, me)
    type(flu_State) :: conf
    integer, intent(in) :: thandle
    type(tem_acoustic_pulse_type), intent(out) :: me
    ! -------------------------------------------------------------------- !
    integer :: iError, vError(3)
    ! -------------------------------------------------------------------- !

    write(logunit(1),*) 'Loading predefined function for acoustic pulse:'

    call aot_get_val( L       = conf,         &
      &               thandle = thandle,      &
      &               key     = 'amplitude',  &
      &               val     = me%amplitude, &
      &               ErrCode = iError        )

    if (iError /= 0) then
      write(logUnit(1),*) 'ERROR in tem_load_acoustic_pulse: not able '
      write(logUnit(1),*) 'to read amplitude from config file.'
      call tem_abort()
    end if

    write(logUnit(1),*) ' * amplitude =', me%amplitude

    call aot_get_val( L       = conf,         &
      &               thandle = thandle,      &
      &               key     = 'halfwidth',  &
      &               val     = me%halfwidth, &
      &               ErrCode = iError        )

    if (iError /= 0) then
      write(logUnit(1),*) 'ERROR in tem_load_acoustic_pulse: not able '
      write(logUnit(1),*) 'to read halfwidth from config file.'
      call tem_abort()
    end if

    write(logUnit(1),*) ' * halfwidth =', me%halfwidth

    call aot_get_val( L       = conf,              &
      &               thandle = thandle,           &
      &               key     = 'speed_of_sound',  &
      &               val     = me%speed_of_sound, &
      &               ErrCode = iError             )

    if (iError /= 0) then
      write(logUnit(1),*) 'ERROR in tem_load_acoustic_pulse: not able '
      write(logUnit(1),*) 'to read speed_of_sound from config file.'
      call tem_abort()
    end if

    write(logUnit(1),*) ' * speed_of_sound =', me%speed_of_sound

    call aot_get_val( L       = conf,                     &
      &               thandle = thandle,                  &
      &               key     = 'center',                 &
      &               val     = me%center,                &
                      default = [0.0_rk, 0.0_rk, 0.0_rk], &
      &               ErrCode = vError                    )

    if ( any(vError /= 0) ) then
      write(logUnit(1),*) 'ERROR in tem_load_acoustic_pulse: not able '
      write(logUnit(1),*) 'to read center from config file.'
      call tem_abort()
    end if

    write(logUnit(1),*) ' * center =', me%center

    call aot_get_val( L       = conf,          &
      &               thandle = thandle,       &
      &               key     = 'background',  &
      &               val     = me%background, &
                      default = 0.0_rk,        &
      &               ErrCode = iError         )

    if (iError /= 0) then
      write(logUnit(1),*) 'ERROR in tem_load_acoustic_pulse: not able '
      write(logUnit(1),*) 'to read background from config file.'
      call tem_abort()
    end if

    write(logUnit(1),*) ' * background =', me%background

  end subroutine tem_load_acoustic_pulse