Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/common/m_helper.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ module m_helper

private; public :: s_compute_finite_difference_coefficients, &
s_comp_n_from_prim, &
s_comp_n_from_cons
s_comp_n_from_cons, &
s_int_to_str

contains

Expand Down Expand Up @@ -120,4 +121,11 @@ subroutine s_comp_n_from_cons(vftmp, nRtmp, ntmp, weight)

end subroutine s_comp_n_from_cons

subroutine s_int_to_str(i, res)
character(len=*) :: res
integer,intent(in) :: i
write(res,'(I0)') i
res = trim(res)
end subroutine

end module m_helper
12 changes: 10 additions & 2 deletions src/common/m_mpi_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,22 @@ contains
end subroutine s_mpi_reduce_maxloc ! -----------------------------------

!> The subroutine terminates the MPI execution environment.
subroutine s_mpi_abort() ! ---------------------------------------------
subroutine s_mpi_abort(prnt) ! ---------------------------------------------

character(len=*), intent(in), optional :: prnt

if (present(prnt)) then
print*, prnt
call flush(6)

end if

#ifndef MFC_MPI

stop 1

#else

! Terminating the MPI environment
call MPI_ABORT(MPI_COMM_WORLD, 1, ierr)

Expand Down
5 changes: 2 additions & 3 deletions src/common/m_variables_conversion.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,9 @@ contains

#else
if (proc_rank == 0) then
print '(A)', 'Conversion from primitive to '// &
call s_mpi_abort('Conversion from primitive to '// &
'conservative variables not '// &
'implemented. Exiting ...'
call s_mpi_abort()
'implemented. Exiting ...')
end if
#endif

Expand Down
37 changes: 14 additions & 23 deletions src/post_process/m_data_input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ subroutine s_read_serial_data_files(t_step) ! -----------------------------

! If the time-step directory is missing, the post-process exits.
if (dir_check .neqv. .true.) then
print '(A)', 'Time-step folder '//trim(t_step_dir)// &
' is missing. Exiting ...'
call s_mpi_abort()
call s_mpi_abort('Time-step folder '//trim(t_step_dir)// &
' is missing. Exiting ...')
end if

! Reading the Grid Data File for the x-direction ===================
Expand All @@ -110,9 +109,8 @@ subroutine s_read_serial_data_files(t_step) ! -----------------------------
read (1) x_cb(-1:m)
close (1)
else
print '(A)', 'File x_cb.dat is missing in '// &
trim(t_step_dir)//'. Exiting ...'
call s_mpi_abort()
call s_mpi_abort('File x_cb.dat is missing in '// &
trim(t_step_dir)//'. Exiting ...')
end if

! Computing the cell-width distribution
Expand All @@ -138,9 +136,8 @@ subroutine s_read_serial_data_files(t_step) ! -----------------------------
read (1) y_cb(-1:n)
close (1)
else
print '(A)', 'File y_cb.dat is missing in '// &
trim(t_step_dir)//'. Exiting ...'
call s_mpi_abort()
call s_mpi_abort('File y_cb.dat is missing in '// &
trim(t_step_dir)//'. Exiting ...')
end if

! Computing the cell-width distribution
Expand All @@ -166,9 +163,8 @@ subroutine s_read_serial_data_files(t_step) ! -----------------------------
read (1) z_cb(-1:p)
close (1)
else
print '(A)', 'File z_cb.dat is missing in '// &
trim(t_step_dir)//'. Exiting ...'
call s_mpi_abort()
call s_mpi_abort('File z_cb.dat is missing in '// &
trim(t_step_dir)//'. Exiting ...')
end if

! Computing the cell-width distribution
Expand Down Expand Up @@ -200,10 +196,9 @@ subroutine s_read_serial_data_files(t_step) ! -----------------------------
read (1) q_cons_vf(i)%sf(0:m, 0:n, 0:p)
close (1)
else
print '(A)', 'File q_cons_vf'//trim(file_num)// &
call s_mpi_abort('File q_cons_vf'//trim(file_num)// &
'.dat is missing in '//trim(t_step_dir)// &
'. Exiting ...'
call s_mpi_abort()
'. Exiting ...')
end if

end do
Expand Down Expand Up @@ -253,8 +248,7 @@ subroutine s_read_parallel_data_files(t_step) ! ---------------------------
call MPI_FILE_READ(ifile, x_cb_glb, data_size, MPI_DOUBLE_PRECISION, status, ierr)
call MPI_FILE_CLOSE(ifile, ierr)
else
print '(A)', 'File ', trim(file_loc), ' is missing. Exiting...'
call s_mpi_abort()
call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...')
end if

! Assigning local cell boundary locations
Expand All @@ -275,8 +269,7 @@ subroutine s_read_parallel_data_files(t_step) ! ---------------------------
call MPI_FILE_READ(ifile, y_cb_glb, data_size, MPI_DOUBLE_PRECISION, status, ierr)
call MPI_FILE_CLOSE(ifile, ierr)
else
print '(A)', 'File ', trim(file_loc), ' is missing. Exiting...'
call s_mpi_abort()
call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...')
end if

! Assigning local cell boundary locations
Expand All @@ -297,8 +290,7 @@ subroutine s_read_parallel_data_files(t_step) ! ---------------------------
call MPI_FILE_READ(ifile, z_cb_glb, data_size, MPI_DOUBLE_PRECISION, status, ierr)
call MPI_FILE_CLOSE(ifile, ierr)
else
print '(A)', 'File ', trim(file_loc), ' is missing. Exiting...'
call s_mpi_abort()
call s_mpi_abort( 'File '//trim(file_loc)//' is missing. Exiting...')
end if

! Assigning local cell boundary locations
Expand Down Expand Up @@ -364,8 +356,7 @@ subroutine s_read_parallel_data_files(t_step) ! ---------------------------

call MPI_FILE_CLOSE(ifile, ierr)
else
print '(A)', 'File ', trim(file_loc), ' is missing. Exiting...'
call s_mpi_abort()
call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...')
end if

deallocate (x_cb_glb, y_cb_glb, z_cb_glb)
Expand Down
26 changes: 11 additions & 15 deletions src/post_process/m_data_output.f90
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,9 @@ subroutine s_open_formatted_database_file(t_step) ! --------------------
! database slave file has been performed without errors. If this
! is not the case, the post-process exits.
if (dbfile == -1) then
print '(A)', 'Unable to create Silo-HDF5 database '// &
call s_mpi_abort('Unable to create Silo-HDF5 database '// &
'slave file '//trim(file_loc)//'. '// &
'Exiting ...'
call s_mpi_abort()
'Exiting ...')
end if

! Next, analogous steps to the ones above are carried out by the
Expand All @@ -502,10 +501,9 @@ subroutine s_open_formatted_database_file(t_step) ! --------------------
DB_HDF5, dbroot)

if (dbroot == -1) then
print '(A)', 'Unable to create Silo-HDF5 database '// &
call s_mpi_abort('Unable to create Silo-HDF5 database '// &
'master file '//trim(file_loc)//'. '// &
'Exiting ...'
call s_mpi_abort()
'Exiting ...')
end if

end if
Expand All @@ -529,10 +527,9 @@ subroutine s_open_formatted_database_file(t_step) ! --------------------
! Verifying that the creation and setup process of the formatted
! database slave file has been performed without errors. If this
! is not the case, the post-process exits.
if (err /= 0) then
print '(A)', 'Unable to create Binary database slave '// &
'file '//trim(file_loc)//'. Exiting ...'
call s_mpi_abort()
if (err /= 0) then
call s_mpi_abort('Unable to create Binary database slave '// &
'file '//trim(file_loc)//'. Exiting ...')
end if

! Further defining the structure of the formatted database slave
Expand All @@ -552,11 +549,10 @@ subroutine s_open_formatted_database_file(t_step) ! --------------------
open (dbroot, IOSTAT=err, FILE=trim(file_loc), &
FORM='unformatted', STATUS='replace')

if (err /= 0) then
print '(A)', 'Unable to create Binary database '// &
'master file '//trim(file_loc)// &
'. Exiting ...'
call s_mpi_abort()
if (err /= 0) then
call s_mpi_abort('Unable to create Binary database '// &
'master file '//trim(file_loc)// &
'. Exiting ...')
end if

write (dbroot) m_root, 0, 0, dbvars
Expand Down
16 changes: 0 additions & 16 deletions src/post_process/m_derived_variables.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,22 +365,6 @@ contains

integer :: i, j, k

! Solve linear system using Intel MKL (Hooke)
! nrhs = 1
! lda = ndim
! ldb = ndim
!
! CALL DGESV(ndim, nrhs, A, lda, ipiv, b, ldb, info)
!
! DO i = 1, ndim
! sol(i) = b(i)
! END DO
!
! IF (info /= 0) THEN
! PRINT '(A)', 'Trouble solving linear system'
! CALL s_mpi_abort()
! END IF

! Solve linear system using own linear solver (Thomson/Darter/Comet/Stampede)
! Forward elimination
do i = 1, ndim
Expand Down
Loading