Merge branch 'master' into reconnection

This commit is contained in:
Grzegorz Kowal 2022-05-27 21:53:48 -03:00
commit 4107099f44
2 changed files with 47 additions and 9 deletions

View File

@ -1479,9 +1479,14 @@ module equations
n = n + 1 n = n + 1
#if NDIMS == 3
sfmt = '("n: ",i0,", [i,j,k]: ",3(1x,i0),", [x,y,z]: ",3es12.4)' sfmt = '("n: ",i0,", [i,j,k]: ",3(1x,i0),", [x,y,z]: ",3es12.4)'
write(msg,sfmt) n, i, j, k, x(i), y(j), z(k) write(msg,sfmt) n, i, j, k, x(i), y(j), z(k)
call print_message(loc, msg) #else /* NDIMS == 3 */
sfmt = '("n: ",i0,", [i,j]: ",2(1x,i0),", [x,y]: ",2es12.4)'
write(msg,sfmt) n, i, j, x(i), y(j)
#endif /* NDIMS == 3 */
call print_message(msg)
idx(:,n) = [ i, j, k ] idx(:,n) = [ i, j, k ]
@ -1528,14 +1533,14 @@ module equations
! neighbours failed ! neighbours failed
! !
msg = "Not sufficient number of physical neighbors!" msg = "Not sufficient number of physical neighbors!"
call print_message(loc, msg) call print_message(msg)
sfmt = '("Block ID:",i0,", cell position = ( ",3(i4," ")," ).")' sfmt = '("Block ID:",i0,", cell position = ( ",3(i4," ")," ).")'
write(msg,sfmt) pdata%meta%id, i, j, k write(msg,sfmt) pdata%meta%id, i, j, k
call print_message(loc, msg) call print_message(msg)
write(msg,"('Q = ',10(1x,1es24.16e3))") pdata%q(:,i,j,k) write(msg,"('Q = ',10(1x,1es24.16e3))") pdata%q(:,i,j,k)
call print_message(loc, msg) call print_message(msg)
msg = "Applying lower bounds for positive variables." msg = "Applying lower bounds for positive variables."
call print_message(loc, msg) call print_message(msg)
q( : ,n) = pdata%q( : ,i,j,k) q( : ,n) = pdata%q( : ,i,j,k)
q(idn,n) = max(pdata%q(idn,i,j,k), dmin) q(idn,n) = max(pdata%q(idn,i,j,k), dmin)

View File

@ -44,6 +44,10 @@ module helpers
module procedure print_parameter_double_range module procedure print_parameter_double_range
module procedure print_parameter_string_range module procedure print_parameter_string_range
end interface end interface
interface print_message
module procedure print_message_loc
module procedure print_message_msg
end interface
private private
@ -417,8 +421,8 @@ module helpers
! !
!=============================================================================== !===============================================================================
! !
! subroutine PRINT_MESSAGE: ! subroutine PRINT_MESSAGE_LOC:
! ------------------------ ! ----------------------------
! !
! Subroutine prints a message for a given location. ! Subroutine prints a message for a given location.
! !
@ -429,7 +433,7 @@ module helpers
! !
!=============================================================================== !===============================================================================
! !
subroutine print_message(loc, msg) subroutine print_message_loc(loc, msg)
use iso_fortran_env, only : error_unit use iso_fortran_env, only : error_unit
@ -444,7 +448,36 @@ module helpers
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
end subroutine print_message end subroutine print_message_loc
!
!===============================================================================
!
! subroutine PRINT_MESSAGE_LOC:
! ----------------------------
!
! Subroutine prints just a message without the location.
!
! Arguments:
!
! msg - the warning message;
!
!===============================================================================
!
subroutine print_message_msg(msg)
use iso_fortran_env, only : error_unit
implicit none
character(len=*), intent(in) :: msg
!-------------------------------------------------------------------------------
!
write(error_unit,"(4x,a)" ) trim(msg)
!-------------------------------------------------------------------------------
!
end subroutine print_message_msg
! !
!=============================================================================== !===============================================================================
! !