Open the residual file to write
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(filetype), | intent(in) | :: | files | Files' name and handler |
||
type(controltype), | intent(in) | :: | control | Control parameters |
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