setup_file Subroutine

private subroutine setup_file(files, control)

Open the residual file to write

Arguments

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

Files' name and handler

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

Control parameters


Called by

proc~~setup_file~~CalledByGraph proc~setup_file setup_file proc~setup_resnorm setup_resnorm proc~setup_resnorm->proc~setup_file proc~setup_solver setup_solver proc~setup_solver->proc~setup_resnorm 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 setup_file(files, control)
      !< Open the residual file to write
      implicit none
      type(filetype), intent(in) :: files
      !< Files' name and handler
      type(controltype), intent(in) :: control
      !< Control parameters
      integer :: i
      if(process_id==0)then
        if(control%start_from==0)then
          open(files%RESNORM_FILE_UNIT,file=files%resnorm_file)
        else
          open(files%RESNORM_FILE_UNIT,file=files%resnorm_file, status='old', position='append', action='write')
        end if
        write(files%RESNORM_FILE_UNIT, '(A,2x)', advance='no') "Iteration"
        do i=1,control%Res_count
          write(files%RESNORM_FILE_UNIT, '(A,2x)', advance='no') trim(control%Res_list(i))
        end do
        write(files%RESNORM_FILE_UNIT, *)
      end if
    end subroutine setup_file