tem_load_miescatter Subroutine

private subroutine tem_load_miescatter(conf, thandle, me)

load gauss pulse variables to set initial condition

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

aotus parent handle

type(tem_miescatter_field_type), intent(out) :: me

Global gauss pulse data type


Calls

proc~~tem_load_miescatter~~CallsGraph proc~tem_load_miescatter tem_load_miescatter proc~aot_table_open aot_table_open proc~tem_load_miescatter->proc~aot_table_open proc~tem_init_data tem_init_data proc~tem_load_miescatter->proc~tem_init_data proc~aot_table_close aot_table_close proc~tem_load_miescatter->proc~aot_table_close proc~aot_get_val aot_get_val proc~tem_load_miescatter->proc~aot_get_val proc~tem_abort tem_abort proc~tem_load_miescatter->proc~tem_abort proc~hankel2_n_derivative hankel2_n_derivative proc~tem_init_data->proc~hankel2_n_derivative proc~tem_get_ncoeffs_miescat tem_get_ncoeffs_miescat proc~tem_init_data->proc~tem_get_ncoeffs_miescat proc~bessel_jn_derivative bessel_jn_derivative proc~tem_init_data->proc~bessel_jn_derivative proc~hankel2_n hankel2_n proc~tem_init_data->proc~hankel2_n mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~hankel2_n_derivative->proc~hankel2_n proc~tem_get_ncoeffs_miescat->proc~aot_get_val proc~tem_get_ncoeffs_miescat->proc~tem_abort

Called by

proc~~tem_load_miescatter~~CalledByGraph proc~tem_load_miescatter tem_load_miescatter interface~tem_load_miescatter_displacementfieldz tem_load_miescatter_displacementfieldz interface~tem_load_miescatter_displacementfieldz->proc~tem_load_miescatter interface~tem_load_miescatter_magneticfieldy tem_load_miescatter_magneticfieldy interface~tem_load_miescatter_magneticfieldy->proc~tem_load_miescatter interface~tem_load_miescatter_magneticfieldx tem_load_miescatter_magneticfieldx interface~tem_load_miescatter_magneticfieldx->proc~tem_load_miescatter proc~load_spatial_predefined load_spatial_predefined proc~load_spatial_predefined->interface~tem_load_miescatter_displacementfieldz proc~load_spatial_predefined->interface~tem_load_miescatter_magneticfieldy proc~load_spatial_predefined->interface~tem_load_miescatter_magneticfieldx proc~load_spacetime_predefined load_spacetime_predefined proc~load_spacetime_predefined->interface~tem_load_miescatter_displacementfieldz proc~load_spacetime_predefined->interface~tem_load_miescatter_magneticfieldy proc~load_spacetime_predefined->interface~tem_load_miescatter_magneticfieldx proc~tem_load_spatial tem_load_spatial proc~load_spacetime_predefined->proc~tem_load_spatial proc~tem_load_spatial->proc~load_spatial_predefined 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_ic tem_load_ic proc~tem_load_ic->proc~tem_load_spatial 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

Contents

Source Code


Source Code

  subroutine tem_load_miescatter(conf, thandle, me)
    ! ---------------------------------------------------------------------------
    !> lua state type
    type(flu_State) :: conf
    !> aotus parent handle
    integer, intent(in) :: thandle
    !> Global gauss pulse data type
    type(tem_miescatter_field_type), intent(out) :: me
    ! ---------------------------------------------------------------------------
    integer :: iError, iPos, cent_handle, back_handle, circ_handle
    real(kind=rk) :: frequency
    ! ---------------------------------------------------------------------------

    ! Read center cooridnates
    call aot_table_open( L       = conf,                                       &
      &                  parent  = thandle,                                    &
      &                  thandle = cent_handle,                                &
      &                  key     = 'center' )
    if ( cent_handle.eq.0 ) then
      write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
      write(logUnit(1),*)'Not able to read center-table for Mie-Scatter '//    &
        &                'solution from lua, stopping ...'
      call tem_abort()
    end if
    do iPos = 1, 2
      call aot_get_val( L       = conf,                                        &
        &               thandle = cent_handle,                                 &
        &               pos     = iPos,                                        &
        &               val     = me%miescatter%center(iPos),                  &
        &               ErrCode = iError )
      if ( iError.ne.0 ) then
        write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
        write(logUnit(1),*)'Not able to read center for Mie-Scatter '//        &
          &                'solution from lua, stopping ...'
        call tem_abort()
      end if
    end do
    call aot_table_close(conf, cent_handle)


    ! Read radius of the cylinder
    call aot_get_val( L       = conf,                                          &
      &               thandle = thandle,                                       &
      &               key     = 'radius',                                      &
      &               val     = me%miescatter%radius,                          &
      &               ErrCode = iError )
    if ( iError.ne.0 ) then
      write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
      write(logUnit(1),*)'Not able to read radius for Mie-Scatter '//          &
         &                'solution from lua, stopping ...'
      call tem_abort()
    end if


    ! Read background permeability and permitivity
    call aot_table_open( L       = conf,                                       &
      &                  parent  = thandle,                                    &
      &                  thandle = back_handle,                                &
      &                  key     = 'permeaPermit_background' )
    if ( back_handle.eq.0 ) then
      write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
      write(logUnit(1),*) 'Not able to open permeaPermit_background-table for '&
                    & // 'Mie-Scatter solution from lua, stopping ...'
      call tem_abort()
    end if
    call aot_get_val( L       = conf,                                          &
      &               thandle = back_handle,                                   &
      &               pos     = 1,                                             &
      &               val     = me%miescatter%permeability_background,         &
      &               ErrCode = iError )
    if ( iError.ne.0 ) then
      write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
      write(logUnit(1),*) 'Not able to read background permeability for ' //   &
                    & 'Mie-Scatter solution from lua, stopping ...'
      call tem_abort()
    end if
    call aot_get_val( L       = conf,                                          &
      &               thandle = back_handle,                                   &
      &               pos     = 2,                                             &
      &               val     = me%miescatter%permitivity_background,          &
      &               ErrCode = iError )
    if ( iError.ne.0 ) then
      write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
      write(logUnit(1),*) 'Not able to read background permitivity for ' //    &
                    & 'Mie-Scatter solution from lua, stopping ...'
      call tem_abort()
    end if
    call aot_table_close(conf, back_handle)


    ! Read background permeability and permitivity
    call aot_table_open( L       = conf,                                       &
      &                  parent  = thandle,                                    &
      &                  thandle = circ_handle,                                &
      &                  key     = 'permeaPermit_cylinder' )
    if ( back_handle.eq.0 ) then
      write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
      write(logUnit(1),*) 'Not able to open permeaPermit_cylinder-table for '//&
                    & 'Mie-Scatter solution from lua, stopping ...'
      call tem_abort()
    end if
    call aot_get_val( L       = conf,                                          &
      &               thandle = circ_handle,                                   &
      &               pos     = 1,                                             &
      &               val     = me%miescatter%permeability_cylinder,           &
      &               ErrCode = iError )
    if ( iError.ne.0 ) then
      write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
      write(logUnit(1),*) 'Not able to read cylinder permeability for ' // &
                    & 'Mie-Scatter solution from lua, stopping ...'
      call tem_abort()
    end if
    call aot_get_val( L       = conf,                                          &
      &               thandle = circ_handle,                                   &
      &               pos     = 2,                                             &
      &               val     = me%miescatter%permitivity_cylinder,            &
      &               ErrCode = iError )
    if ( iError.ne.0 ) then
      write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
      write(logUnit(1),*) 'Not able to read cylinder permitivity for ' // &
                    & 'Mie-Scatter solution from lua, stopping ...'
      call tem_abort()
    end if
    call aot_table_close(conf, circ_handle)


    ! Read the frequency
    call aot_get_val( L       = conf,                                          &
      &               thandle = thandle,                                       &
      &               key     = 'frequency',                                   &
      &               val     = frequency,                                     &
      &               ErrCode = iError )
    if ( iError.ne.0 ) then
      write(logUnit(1),*)'ERROR in tem_load_miescatter_displacementfieldz: '
      write(logUnit(1),*)'Not able to read frequency for Mie-Scatter '//       &
        &                'solution from lua, stopping ...'
      call tem_abort()
    end if
    me%miescatter%omega = 2.0_rk * PI * frequency

    ! Calculate the wave numbers inside and outside of the cylinder
    me%miescatter%wavenumber_cylinder = me%miescatter%omega &
    & * sqrt(me%miescatter%permeability_cylinder *          &
    &        me%miescatter%permitivity_cylinder             )
    me%miescatter%wavenumber_background = me%miescatter%omega &
    & * sqrt(me%miescatter%permeability_background *          &
    &        me%miescatter%permitivity_background             )

    ! Setup the parameters for the solution inside and outside the
    ! dielectric cylinder...
    call tem_init_data( conf, thandle, me%miescatter, me%mieexpansion )

  end subroutine tem_load_miescatter