Subroutine to read the 'EXEC_MUSST' section
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(in) | :: | iunit | |||
character(len=15), | intent(in) | :: | dir | output directory |
subroutine read_data(iunit, dir)
implicit none
integer(kind=I4), intent(in) :: iunit
character(len=15), intent(in) :: dir !! *output directory*
integer(kind=I4) :: err_read
character(len=064) :: word
res_dir = dir
compare_solution_file = 0
data_f%h_0 = -1._R8
data_f%h_g = -1._R8
data_f%V_x = 0._R8
data_f%V_y = 0._R8
data_f%pb_type = 0
data_f%fl%fluid_type = -1
data_f%fl%p_0 = -1.e10_R8
data_f%fl%rho_0 = -1.e10_R8
data_f%fl%mu_0 = -1.e10_R8
data_f%fl%rg = 287._R8
data_f%fl%lambda = 1.e-5_R8
data_f%fl%T_0 = 273._R8
surface_file = "no_file"
compare_solution_file = 0
pressure_solution_file = "no_file"
lx = -1._R8
ly = -1._R8
nx = -1
ny = -1
n_mac = -1
bc(1:4) = [1.e5_R8, 1.e5_R8, 1.e5_R8, 1.e5_R8]
num_pts = NUM_PAR(0._R8, 1.e10_R8, 0, 0)
num_pbs = NUM_PAR(0._R8, 1.e10_R8, 0, 0)
sq = 0._R8
s_vtk = 0
ms_vtk = "no_file"
prof_ts = "no_file"
prof_bs = "no_file"
res_file = "no_file"
do
word = repeat(' ', len(word))
read(iunit, *, iostat = err_read) word
if ( index(word, '[END_MUSST]') /= 0 ) exit
if ( index(word, '[PROBLEM_TYPE]') /= 0 ) then
read(iunit, *) test_num
cycle
endif
if ( index(word, '[GAP]') /= 0 ) then
read(iunit,*) data_f%h_0, data_f%h_g
cycle
endif
if ( index(word, '[SPEED]') /= 0 ) then
read(iunit,*) data_f%V_x, data_f%V_y
cycle
endif
if ( index(word, '[ELASTICITY]') /= 0 ) then
read(iunit,*) data_f%pb_type
cycle
endif
if ( index(word, '[FLUID_TYPE]') /= 0 ) then
read(iunit,*) data_f%fl%fluid_type
cycle
endif
if ( index(word, '[AMBIENT_PRESSURE]') /= 0 ) then
read(iunit,*) data_f%fl%p_0
cycle
endif
if ( index(word, '[DENSITY]') /= 0 ) then
read(iunit,*) data_f%fl%rho_0
cycle
endif
if ( index(word, '[VISCOSITY]') /= 0 ) then
read(iunit,*) data_f%fl%mu_0
cycle
endif
if ( index(word, '[GAZ_CONSTANT]') /= 0 ) then
read(iunit,*) data_f%fl%rg
cycle
endif
if ( index(word, '[MIXTURE_TRANSITION]') /= 0 ) then
read(iunit,*) data_f%fl%lambda
cycle
endif
if ( index(word, '[AMBIENT_TEMPERATURE]') /= 0 ) then
read(iunit,*) data_f%fl%T_0
cycle
endif
if ( index(word, '[ROUGH_SURFACE]') /= 0 ) then
read(iunit,*) surface_file
cycle
endif
if ( index(word, '[ROUGH_SURFACE_SOLUTION]') /= 0 ) then
read(iunit,*) compare_solution_file
read(iunit,*) pressure_solution_file
cycle
endif
if ( index(word, '[LENGTH]') /= 0 ) then
read(iunit,*) lx, ly
cycle
endif
if ( index(word, '[NUMBER_NODES]') /= 0 ) then
read(iunit,*) nx, ny
cycle
endif
if ( index(word, '[NUMBER_MACRO_ELEMENTS]') /= 0 ) then
read(iunit,*) n_mac
cycle
endif
if ( index(word, '[BOUNDARY_PRESSURES]') /= 0 ) then
read(iunit,*) bc(1:4)
cycle
endif
if ( index(word, '[NUMERICAL_TS_PARAMETERS]') /= 0 ) then
read(iunit,*) num_pts
cycle
endif
if ( index(word, '[NUMERICAL_BS_PARAMETERS]') /= 0 ) then
read(iunit,*) num_pbs
cycle
endif
if ( index(word, '[HEIGHT_STD_DEV]') /= 0 ) then
read(iunit,*) sq
cycle
endif
if ( index(word, '[VTK_OUTPUT]') /= 0 ) then
read(iunit,*) s_vtk, ms_vtk
read(iunit,*) prof_ts
read(iunit,*) prof_bs
read(iunit,*) res_file
cycle
endif
enddo
ms_vtk = "out/"//res_dir//"/"//trim(ms_vtk )
prof_ts = "out/"//res_dir//"/"//trim(prof_ts )
prof_bs = "out/"//res_dir//"/"//trim(prof_bs )
res_file = "out/"//res_dir//"/"//trim(res_file)
return
endsubroutine read_data