tem_load_surfData Subroutine

public subroutine tem_load_surfData(me, conf, sd_handle)

Todo

SZ: Add parts for catching aotus errors

Arguments

Type IntentOptional Attributes Name
type(tem_surfData_type), intent(inout) :: me

datatype to store the surface information

type(flu_State) :: conf

handle of the lua config file

integer :: sd_handle

handle for the surfaceData table


Calls

proc~~tem_load_surfdata~~CallsGraph proc~tem_load_surfdata tem_load_surfData aot_get_val aot_get_val proc~tem_load_surfdata->aot_get_val aot_table_close aot_table_close proc~tem_load_surfdata->aot_table_close aot_table_length aot_table_length proc~tem_load_surfdata->aot_table_length aot_table_open aot_table_open proc~tem_load_surfdata->aot_table_open proc~tem_timecontrol_dump tem_timeControl_dump proc~tem_load_surfdata->proc~tem_timecontrol_dump proc~tem_timecontrol_load tem_timeControl_load proc~tem_load_surfdata->proc~tem_timecontrol_load proc~tem_time_dump tem_time_dump proc~tem_timecontrol_dump->proc~tem_time_dump proc~tem_timecontrol_load->aot_get_val proc~tem_timecontrol_load->aot_table_close proc~tem_timecontrol_load->aot_table_open proc~tem_time_default_zero tem_time_default_zero proc~tem_timecontrol_load->proc~tem_time_default_zero proc~tem_time_load tem_time_load proc~tem_timecontrol_load->proc~tem_time_load proc~tem_time_needs_reduce tem_time_needs_reduce proc~tem_timecontrol_load->proc~tem_time_needs_reduce proc~tem_time_never tem_time_never proc~tem_timecontrol_load->proc~tem_time_never proc~tem_time_load->aot_get_val proc~tem_time_load->aot_table_close proc~tem_time_load->aot_table_open mpi_wtime mpi_wtime proc~tem_time_load->mpi_wtime

Source Code

  subroutine tem_load_surfData( me, conf, sd_handle )
    ! ---------------------------------------------------------------------------
    !> datatype to store the surface information
    type( tem_surfData_type ), intent(inout) :: me
    !> handle of the lua config file
    type( flu_state ) :: conf
    !> handle for the surfaceData table
    integer :: sd_handle
    ! ---------------------------------------------------------------------------
    integer :: iError
    integer :: stlFile_handle
    integer :: stlDump_handle
    integer :: nSTLFiles
    integer :: iSTLFile
    ! ---------------------------------------------------------------------------

    ! try to open the filename identifier as a table
    call aot_table_open( L       = conf,                                       &
      &                  parent  = sd_handle,                                  &
      &                  thandle = stlFile_handle,                             &
      &                  key     = 'stlfiles')

    ! if there is no table named filename ...
    if( stlFile_handle == 0 ) then
      ! ... close the table again
      call aot_table_close( L       = conf,                                    &
        &                   thandle = stlFile_handle )
      ! allocate the stlHead with 1
      allocate( me%stlHead( 1 ))
      ! ... and read the filename directly
      call aot_get_val( L       = conf,                                        &
        &               thandle = sd_handle,                                   &
        &               val     = me%stlHead(1)%filename,                      &
        &               ErrCode = iError,                                      &
        &               key     = 'stlfiles' )

    else ! there is a table
      ! ... get the table length
      nSTLFiles = aot_table_length( L       = conf,                            &
        &                           thandle = stlFile_handle )
      ! ... allocate the list of stlHeads
      allocate( me%stlHead( nSTLFiles ))
      ! ... and read them one by one
      do iSTLFile = 1, nSTLFiles
        call aot_get_val( L       = conf,                                      &
          &               thandle = stlFile_handle,                            &
          &               val     = me%stlHead(iSTLFile)%filename,             &
          &               ErrCode = iError,                                    &
          &               pos     = iSTLFile )
      end do
      ! ... and close the table in the end
      call aot_table_close( L       = conf,                                    &
        &                   thandle = stlFile_handle)
    end if


    ! open the stl dump table
    call aot_table_open( L       = conf,                                       &
      &                  parent  = sd_handle,                                  &
      &                  thandle = stlDump_handle,                             &
      &                  key     = 'dump_stl')

    ! if the table exists ...
    if( stlFile_handle /= 0 ) then

      ! read the output path
      call aot_get_val( L       = conf,                                        &
        &               thandle = stlDump_handle,                              &
        &               val     = me%outprefix,                                &
        &               ErrCode = iError,                                      &
        &               key     = 'outprefix',                                 &
        &               default = '' )

      ! whether to dump the force values or not
      call aot_get_val( L       = conf,                                        &
        &               thandle = stlDump_handle,                              &
        &               val     = me%dumpForce,                                &
        &               ErrCode = iError,                                      &
        &               key     = 'dumpForce',                                 &
        &               default = .false. )

      ! read the time control information for dumping the stls
      ! load time control to output tracking
      call tem_timeControl_load( conf           = conf,                        &
        &                        parent         = stlDump_handle,              &
        &                        me             = me%timeControl )
      write(logUnit(2),*) 'Writing stls using the prefix: '// trim(me%outprefix)
      write(logUnit(2),*) 'at the following timings: '
      call tem_timeControl_dump(me%timeControl, logUnit(2))
    end if

    call aot_table_close( L       = conf,                                      &
      &                   thandle = stlDump_handle )

  end subroutine tem_load_surfData