: SZ: Add parts for catching aotus errors
Type | Intent | Optional | 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 |
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