initstate Subroutine

private subroutine initstate(files, qp, control, scheme, flow, dims)

Initialize the state. If load file(start_from) is 0, then the state should be set to the infinity values. Otherwise, read the state_file to get the state values

Arguments

Type IntentOptional AttributesName
type(filetype), intent(inout) :: files

Files' name and handler

real(kind=wp), intent(inout), dimension(-2:dims%imx+2, -2:dims%jmx+2, -2:dims%kmx+2, 1:dims%n_var), target:: qp

Store primitive variable at cell center

type(controltype), intent(inout) :: control

Control parameters

type(schemetype), intent(in) :: scheme

finite-volume Schemes

type(flowtype), intent(in) :: flow

Information about fluid flow: freestream-speed, ref-viscosity,etc.

type(extent), intent(in) :: dims

Extent of the domain:imx,jmx,kmx


Calls

proc~~initstate~~CallsGraph proc~initstate initstate proc~verify_write_control verify_write_control proc~initstate->proc~verify_write_control debugcall debugcall proc~initstate->debugcall proc~init_state_with_infinity_values init_state_with_infinity_values proc~initstate->proc~init_state_with_infinity_values proc~read_file~3 read_file proc~initstate->proc~read_file~3 proc~lcase lcase proc~verify_write_control->proc~lcase proc~init_state_with_infinity_values->debugcall proc~verify_read_control verify_read_control proc~read_file~3->proc~verify_read_control read_file_tec read_file_tec proc~read_file~3->read_file_tec proc~open_file~2 open_file proc~read_file~3->proc~open_file~2 proc~read_restart_file read_restart_file proc~read_file~3->proc~read_restart_file proc~close_file~2 close_file proc~read_file~3->proc~close_file~2 read_file_vtk read_file_vtk proc~read_file~3->read_file_vtk proc~setup_file~3 setup_file proc~read_file~3->proc~setup_file~3 proc~verify_read_control->proc~lcase proc~open_file~2->debugcall proc~close_file~2->debugcall proc~setup_file~3->debugcall

Called by

proc~~initstate~~CalledByGraph proc~initstate initstate proc~setup_state setup_state proc~setup_state->proc~initstate proc~setup_solver setup_solver proc~setup_solver->proc~setup_state proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents

Source Code


Source Code

        subroutine initstate(files, qp, control, scheme, flow, dims)
            !< Initialize the state.
            !< If load file(start_from) is 0, then the state should be 
            !< set to the infinity values. Otherwise, read the state_file
            !< to get the state values
            !-----------------------------------------------------------

            implicit none
            type(filetype), intent(inout) :: files
            !< Files' name and handler
            type(extent), intent(in) :: dims
            !< Extent of the domain:imx,jmx,kmx
            type(controltype), intent(inout) :: control
            !< Control parameters
            type(schemetype), intent(in) :: scheme
            !< finite-volume Schemes
            type(flowtype), intent(in) :: flow
            !< Information about fluid flow: freestream-speed, ref-viscosity,etc.
            real(wp), dimension(-2:dims%imx+2, -2:dims%jmx+2, -2:dims%kmx+2, 1:dims%n_var), intent(inout), target :: qp
            !< Store primitive variable at cell center
            
            DebugCall("initstate")

            call  verify_write_control(control, scheme, flow)

            if (control%start_from .eq. 0) then
                ! Set the state to the infinity values
                call init_state_with_infinity_values(qp, scheme, flow, dims)
            else
                write(files%infile,'(a,i4.4,a,i2.2)') &
                  "time_directories/",control%start_from,"/process_",process_id
                ! Set the state to the infinity values so if some
                ! variable are not restart variable they get free_stream value
                call init_state_with_infinity_values(qp, scheme, flow, dims)
                call read_file(files, qp, control, scheme, dims)

            end if

        end subroutine initstate