Merge branch 'master' into binaries

This commit is contained in:
Grzegorz Kowal 2019-01-31 22:00:41 -02:00
commit dc172efdb3
15 changed files with 414 additions and 181 deletions

View File

@ -87,14 +87,9 @@ endif
name = amun name = amun
files = algebra blocks boundaries constants coordinates domains driver \ sources := $(wildcard $(SRCSDIR)/*.F90)
equations evolution gravity integrals interpolations io mesh \ objects := $(sources:$(SRCSDIR)/%.F90=$(OBJSDIR)/%.o)
mpitools operators parameters problems random refinement schemes \ modules := $(sources:$(SRCSDIR)/%.F90=$(OBJSDIR)/%.mod)
shapes sources timers user_problem
sources := $(addprefix $(SRCSDIR)/,$(addsuffix .F90, $(files)))
objects := $(addprefix $(OBJSDIR)/,$(addsuffix .o, $(files)))
modules := $(addprefix $(OBJSDIR)/,$(addsuffix .mod, $(files)))
all: $(name).x all: $(name).x

View File

@ -358,6 +358,7 @@ module boundaries
! import external procedures and variables ! import external procedures and variables
! !
use helpers , only : print_section, print_parameter
use parameters, only : get_parameter use parameters, only : get_parameter
! local variables are not implicit by default ! local variables are not implicit by default
@ -370,7 +371,8 @@ module boundaries
! local variables ! local variables
! !
character(len=64) :: sfmts character(len=80) :: msg
character(len=64) :: sfmt
character(len=32) :: xlbndry = "periodic" character(len=32) :: xlbndry = "periodic"
character(len=32) :: xubndry = "periodic" character(len=32) :: xubndry = "periodic"
character(len=32) :: ylbndry = "periodic" character(len=32) :: ylbndry = "periodic"
@ -389,13 +391,15 @@ module boundaries
call get_parameter("zlbndry", zlbndry) call get_parameter("zlbndry", zlbndry)
call get_parameter("zubndry", zubndry) call get_parameter("zubndry", zubndry)
write(*,*) call print_section(verbose, "Boundaries")
write(*,"(1x,a)") "Boundaries:" sfmt = "(a,1x,'...',1x,a)"
sfmts = "(4x,a10,13x,'=',2(1x,a))" write(msg,sfmt) trim(xlbndry), trim(xubndry)
write(*,sfmts) "X-boundary", trim(xlbndry), trim(xubndry) call print_parameter(verbose, "X-boundary", msg)
write(*,sfmts) "Y-boundary", trim(ylbndry), trim(yubndry) write(msg,sfmt) trim(ylbndry), trim(yubndry)
call print_parameter(verbose, "Y-boundary", msg)
#if NDIMS == 3 #if NDIMS == 3
write(*,sfmts) "Z-boundary", trim(zlbndry), trim(zubndry) write(msg,sfmt) trim(zlbndry), trim(zubndry)
call print_parameter(verbose, "Z-boundary", msg)
#endif /* NDIMS == 3 */ #endif /* NDIMS == 3 */
end if end if

View File

@ -805,6 +805,10 @@ module coordinates
! !
subroutine print_coordinates(verbose) subroutine print_coordinates(verbose)
! include external procedures
!
use helpers , only : print_section, print_parameter
! local variables are not implicit by default ! local variables are not implicit by default
! !
implicit none implicit none
@ -815,8 +819,9 @@ module coordinates
! local variables ! local variables
! !
character(len=80) :: sfmts character(len= 80) :: sfmt
integer :: p, q character(len=255) :: msg
integer :: p, q
! local arrays ! local arrays
! !
@ -833,30 +838,33 @@ module coordinates
cm(:) = bm(:) * nc cm(:) = bm(:) * nc
fm(:) = rm(:) * nc fm(:) = rm(:) * nc
write(*,*) call print_section(verbose, "Geometry")
write(*,"(1x,a)") "Geometry:" call print_parameter(verbose, "refinement to level" , maxlev)
sfmts = "(4x,a,1x,i0)" call print_parameter(verbose, "number of block cells", nc )
write(*,sfmts) "refinement to level =", maxlev call print_parameter(verbose, "number of ghost zones", ng )
write(*,sfmts) "number of block cells =", nc write(msg,"(i0)") maxval(fm(1:NDIMS))
write(*,sfmts) "number of ghost zones =", ng p = len(trim(adjustl(msg)))
write(sfmts,"(i0)") maxval(fm(1:NDIMS)) write(msg,"(i0)") maxval(rm(1:NDIMS))
p = len(trim(adjustl(sfmts))) q = len(trim(adjustl(msg)))
write(sfmts,"(i0)") maxval(rm(1:NDIMS))
q = len(trim(adjustl(sfmts)))
#if NDIMS == 3 #if NDIMS == 3
write(sfmts,'(6(a,i0),a)') "(4x,a,1x,i", p, ",' x ',i", p, ",' x ',i", p,& write(sfmt,"(6(a,i0),a)") "('[',i", p, ",' x ',i", p, ",' x ',i", p, &
",' (',i", q, ",' x ',i", q, ",' x ',i", q, ",' blocks)')" ",'] ([',i", q, ",' x ',i", q, ",' x ',i", q, ",'] blocks)')"
#else /* NDIMS == 3 */ #else /* NDIMS == 3 */
write(sfmts,'(4(a,i0),a)') "(4x,a,1x,i", p, ",' x ',i", p, & write(sfmt,"(4(a,i0),a)") "('[',i", p, ",' x ',i", p, &
",' (',i", q, ",' x ',i", q, ",' blocks)')" ",'] ([',i", q, ",' x ',i", q, ",'] blocks)')"
#endif /* NDIMS == 3 */ #endif /* NDIMS == 3 */
write(*,sfmts) "base resolution =", cm(1:NDIMS), bm(1:NDIMS) write(msg,sfmt) cm(1:NDIMS), bm(1:NDIMS)
write(*,sfmts) "effective resolution =", fm(1:NDIMS), rm(1:NDIMS) call print_parameter(verbose, "base resolution" , msg )
sfmts = "(4x,a,1x,1es12.5,1x,'...',1x,1es12.5)" write(msg,sfmt) fm(1:NDIMS), rm(1:NDIMS)
write(*,sfmts) "X-bounds =", xmin, xmax call print_parameter(verbose, "effective resolution" , msg )
write(*,sfmts) "Y-bounds =", ymin, ymax sfmt = "(1es12.5,1x,'...',1x,1es12.5)"
write(msg,sfmt) xmin, xmax
call print_parameter(verbose, "X-bounds" , msg )
write(msg,sfmt) ymin, ymax
call print_parameter(verbose, "Y-bounds" , msg )
#if NDIMS == 3 #if NDIMS == 3
write(*,sfmts) "Z-bounds =", zmin, zmax write(msg,sfmt) zmin, zmax
call print_parameter(verbose, "Z-bounds" , msg )
#endif /* NDIMS */ #endif /* NDIMS */
end if end if

View File

@ -51,6 +51,7 @@ program amun
use evolution , only : advance, new_time_step use evolution , only : advance, new_time_step
use evolution , only : step, time, dt use evolution , only : step, time, dt
use gravity , only : initialize_gravity, finalize_gravity use gravity , only : initialize_gravity, finalize_gravity
use helpers , only : print_welcome, print_section, print_parameter
use integrals , only : initialize_integrals, finalize_integrals use integrals , only : initialize_integrals, finalize_integrals
use integrals , only : store_integrals use integrals , only : store_integrals
use interpolations , only : initialize_interpolations, finalize_interpolations use interpolations , only : initialize_interpolations, finalize_interpolations
@ -218,28 +219,14 @@ program amun
go to 400 go to 400
end if end if
! print the welcome message ! print welcome messages
! !
if (master) then call print_welcome(master)
call print_section(master, "Parallelization")
write(*,"(1x,78('-'))")
write(*,"(1x,18('='),17x,a,17x,19('='))") 'A M U N'
write(*,"(1x,16('='),4x,a,4x,16('='))") &
'Copyright (C) 2008-2019 Grzegorz Kowal'
write(*,"(1x,18('='),9x,a,9x,19('='))") &
'under GNU GPLv3 license'
write(*,"(1x,78('-'))")
#ifdef MPI #ifdef MPI
! print the parallelization type and the number of parallel processes call print_parameter(master, "MPI processes", nprocs)
!
write(*,*)
write(*,"(1x,a)") "Parallelization:"
write(*,"(4x,a,1x,i0)") "MPI processes =", nprocs
#endif /* MPI */ #endif /* MPI */
end if
! initialize and read parameters from the parameter file ! initialize and read parameters from the parameter file
! !
if (master) call read_parameters(iterm) if (master) call read_parameters(iterm)
@ -390,6 +377,8 @@ program amun
! print module information ! print module information
! !
call print_section(master, "Problem")
call print_parameter(master, "problem name", trim(problem))
call print_equations(master) call print_equations(master)
call print_sources(master) call print_sources(master)
call print_coordinates(master) call print_coordinates(master)

View File

@ -1029,7 +1029,7 @@ module equations
! include external procedures and variables ! include external procedures and variables
! !
use parameters, only : get_parameter use helpers, only : print_section, print_parameter
! local variables are not implicit by default ! local variables are not implicit by default
! !
@ -1041,35 +1041,31 @@ module equations
! local variables ! local variables
! !
character(len=64) :: sfmts, sfmti character(len= 80) :: sfmt
character(len=255) :: msg
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
!
! print information about the equation module
! !
if (verbose) then if (verbose) then
write(*,*) call print_section(verbose, "Physics")
write(*,"(1x,a)") "Physics:" call print_parameter(verbose, "equation system" , name_eqsys)
sfmts = "(4x,a,1x,a)" call print_parameter(verbose, "equation of state" , name_eos )
write(*,sfmts) "equation system =", trim(name_eqsys) call print_parameter(verbose, "number of variables" , nv )
write(*,sfmts) "equation of state =", trim(name_eos) write(sfmt,"(a,i0,a)") "(", nv, "(1x,a))"
sfmti = "(4x,a,1x,i0)" write(msg,sfmt) cvars
write(*,sfmti) "number of variables =", nv call print_parameter(verbose, "conservative variables", msg )
write(sfmti,"(a,i0,a)") "(4x,a,", nv, "(1x,a))" write(msg,sfmt) pvars
write(*,sfmti) "conservative variables =", cvars call print_parameter(verbose, "primitive variables" , msg )
write(*,sfmti) "primitive variables =", pvars
if (relativistic) then if (relativistic) then
write(*,sfmts) "variable conversion =", trim(name_c2p) call print_parameter(verbose, "variable conversion" , name_c2p )
end if end if
sfmts = "(4x,a20,3x,'=',1x,a)"
if (fix_unphysical_cells) then if (fix_unphysical_cells) then
write(*,sfmts) "fix unphysical cells", "on" call print_parameter(verbose, "fix unphysical cells" , "on" )
sfmti = "(4x,a20,3x,'=',1x,i0)" call print_parameter(verbose, "ngavg" , ngavg )
write(*,sfmti) "ngavg ", ngavg call print_parameter(verbose, "npavg" , npavg )
write(*,sfmti) "npavg ", npavg
else else
write(*,sfmts) "fix unphysical cells", "off" call print_parameter(verbose, "fix unphysical cells" , "off" )
end if end if
end if end if

View File

@ -284,6 +284,7 @@ module evolution
! import external procedures and variables ! import external procedures and variables
! !
use equations, only : magnetized use equations, only : magnetized
use helpers , only : print_section, print_parameter
! local variables are not implicit by default ! local variables are not implicit by default
! !
@ -292,23 +293,16 @@ module evolution
! subroutine arguments ! subroutine arguments
! !
logical, intent(in) :: verbose logical, intent(in) :: verbose
! local variables
!
character(len=64) :: sfmts
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
if (verbose) then if (verbose) then
write(*,*) call print_section(verbose, "Evolution")
write(*,"(1x,a)") "Evolution:" call print_parameter(verbose, "time advance" , name_int)
sfmts = "(4x,a,1x,a)" call print_parameter(verbose, "CFL coefficient" , cfl )
write(*,sfmts) "time advance =", trim(name_int)
sfmts = "(4x,a,es9.2)"
write(*,sfmts) "CFL coefficient =", cfl
if (magnetized) then if (magnetized) then
write(*,sfmts) "GLM alpha coefficient =", alpha call print_parameter(verbose, "GLM alpha coefficient", alpha )
end if end if
end if end if

267
sources/helpers.F90 Normal file
View File

@ -0,0 +1,267 @@
!!******************************************************************************
!!
!! This file is part of the AMUN source code, a program to perform
!! Newtonian or relativistic magnetohydrodynamical simulations on uniform or
!! adaptive mesh.
!!
!! Copyright (C) 2019 Grzegorz Kowal <grzegorz@amuncode.org>
!!
!! This program is free software: you can redistribute it and/or modify
!! it under the terms of the GNU General Public License as published by
!! the Free Software Foundation, either version 3 of the License, or
!! (at your option) any later version.
!!
!! This program is distributed in the hope that it will be useful,
!! but WITHOUT ANY WARRANTY; without even the implied warranty of
!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
!! GNU General Public License for more details.
!!
!! You should have received a copy of the GNU General Public License
!! along with this program. If not, see <http://www.gnu.org/licenses/>.
!!
!!******************************************************************************
!!
!! module: HELPERS
!!
!! This module provides miscellaneous support subroutines.
!!
!!
!!******************************************************************************
!
module helpers
! module variables are not implicit by default
!
implicit none
! MODULE INTERFACES:
! =================
!
interface print_parameter
module procedure print_parameter_integer
module procedure print_parameter_double
module procedure print_parameter_string
end interface
! by default everything is private
!
private
! declare public subroutines
!
public :: print_welcome, print_section, print_parameter
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
!
contains
!
!===============================================================================
!!
!!*** PUBLIC SUBROUTINES *****************************************************
!!
!===============================================================================
!
!===============================================================================
!
! subroutine PRINT_WELCOME:
! ------------------------
!
! Subroutine prints welcome message.
!
! Arguments:
!
! verbose - if true, the subroutine is executed, otherwise it is skipped;
!
!===============================================================================
!
subroutine print_welcome(verbose)
! local variables are not implicit by default
!
implicit none
! subroutine arguments
!
logical, intent(in) :: verbose
!
!-------------------------------------------------------------------------------
!
if (.not. verbose) return
write(*,"(1x,78('-'))")
write(*,"(1x,18('='),17x,a,17x,19('='))") 'A M U N'
write(*,"(1x,16('='),4x,a,4x,16('='))") &
'Copyright (C) 2008-2019 Grzegorz Kowal'
write(*,"(1x,18('='),9x,a,9x,19('='))") &
'under GNU GPLv3 license'
write(*,"(1x,78('-'))")
!-------------------------------------------------------------------------------
!
end subroutine print_welcome
!
!===============================================================================
!
! subroutine PRINT_SECTION:
! ------------------------
!
! Subroutine prints section lines.
!
! Arguments:
!
! verbose - if true, the subroutine is executed, otherwise it is skipped;
! title - the section title;
!
!===============================================================================
!
subroutine print_section(verbose, title)
! local variables are not implicit by default
!
implicit none
! subroutine arguments
!
logical , intent(in) :: verbose
character(len=*), intent(in) :: title
!
!-------------------------------------------------------------------------------
!
if (.not. verbose) return
write(*,*)
write(*,"(1x,a,':')") trim(adjustl(title))
!-------------------------------------------------------------------------------
!
end subroutine print_section
!
!===============================================================================
!
! subroutine PRINT_PARAMETER_INTEGER:
! ----------------------------------
!
! Subroutine prints integer parameter.
!
! Arguments:
!
! verbose - if true, the subroutine is executed, otherwise it is skipped;
! desciption - the parameter description;
! value - the parameter value;
!
!===============================================================================
!
subroutine print_parameter_integer(verbose, description, value)
! local variables are not implicit by default
!
implicit none
! subroutine arguments
!
logical , intent(in) :: verbose
character(len=*), intent(in) :: description
integer , intent(in) :: value
! local variables
!
character(len=26) :: msg
!
!-------------------------------------------------------------------------------
!
if (.not. verbose) return
msg = trim(adjustl(description))
write(*,"(4x,a26,1x,'=',1x,i0)") msg, value
!-------------------------------------------------------------------------------
!
end subroutine print_parameter_integer
!
!===============================================================================
!
! subroutine PRINT_PARAMETER_DOUBLE:
! ----------------------------------
!
! Subroutine prints double precision parameter.
!
! Arguments:
!
! verbose - if true, the subroutine is executed, otherwise it is skipped;
! desciption - the parameter description;
! value - the parameter value;
!
!===============================================================================
!
subroutine print_parameter_double(verbose, description, value)
! local variables are not implicit by default
!
implicit none
! subroutine arguments
!
logical , intent(in) :: verbose
character(len=*), intent(in) :: description
real(kind=8) , intent(in) :: value
! local variables
!
character(len=26) :: msg
!
!-------------------------------------------------------------------------------
!
if (.not. verbose) return
msg = trim(adjustl(description))
write(*,"(4x,a26,1x,'=',1x,es9.2)") msg, value
!-------------------------------------------------------------------------------
!
end subroutine print_parameter_double
!
!===============================================================================
!
! subroutine PRINT_PARAMETER_STRING:
! ---------------------------------
!
! Subroutine prints string parameter.
!
! Arguments:
!
! verbose - if true, the subroutine is executed, otherwise it is skipped;
! desciption - the parameter description;
! value - the parameter value;
!
!===============================================================================
!
subroutine print_parameter_string(verbose, description, value)
! local variables are not implicit by default
!
implicit none
! subroutine arguments
!
logical , intent(in) :: verbose
character(len=*), intent(in) :: description
character(len=*), intent(in) :: value
! local variables
!
character(len=26) :: msg
!
!-------------------------------------------------------------------------------
!
if (.not. verbose) return
msg = trim(adjustl(description))
write(*,"(4x,a26,1x,'=',1x,a)") msg, trim(adjustl(value))
!-------------------------------------------------------------------------------
!
end subroutine print_parameter_string
!===============================================================================
!
end module helpers

View File

@ -547,6 +547,10 @@ module interpolations
! !
subroutine print_interpolations(verbose) subroutine print_interpolations(verbose)
! import external procedures and variables
!
use helpers, only : print_section, print_parameter
! local variables are not implicit by default ! local variables are not implicit by default
! !
implicit none implicit none
@ -554,36 +558,29 @@ module interpolations
! subroutine arguments ! subroutine arguments
! !
logical, intent(in) :: verbose logical, intent(in) :: verbose
! local variables
!
character(len=64) :: sfmts
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
if (verbose) then if (verbose) then
call print_section(verbose, "Interpolations")
write(*,*) call print_parameter(verbose, "reconstruction" , name_rec )
write(*,"(1x,a)") "Interpolations:" call print_parameter(verbose, "TVD limiter" , name_tlim)
sfmts = "(4x,a,1x,a)" call print_parameter(verbose, "prolongation limiter", name_plim)
write(*,sfmts) "reconstruction =", trim(name_rec)
write(*,sfmts) "TVD limiter =", trim(name_tlim)
write(*,sfmts) "prolongation limiter =", trim(name_plim)
if (mlp) then if (mlp) then
write(*,sfmts) "MLP limiting =", "on" call print_parameter(verbose, "MLP limiting" , "on" )
else else
write(*,sfmts) "MLP limiting =", "off" call print_parameter(verbose, "MLP limiting" , "off" )
end if end if
if (positivity) then if (positivity) then
write(*,sfmts) "fix positivity =", "on" call print_parameter(verbose, "fix positivity" , "on" )
else else
write(*,sfmts) "fix positivity =", "off" call print_parameter(verbose, "fix positivity" , "off" )
end if end if
if (clip) then if (clip) then
write(*,sfmts) "clip extrema =", "on" call print_parameter(verbose, "clip extrema" , "on" )
write(*,sfmts) "extrema limiter =", trim(name_clim) call print_parameter(verbose, "extrema limiter" , name_clim)
else else
write(*,sfmts) "clip extrema =", "off" call print_parameter(verbose, "clip extrema" , "off" )
end if end if
end if end if

View File

@ -469,72 +469,69 @@ module io
! !
subroutine print_io(verbose) subroutine print_io(verbose)
! import external procedures and variables
!
use helpers, only : print_section, print_parameter
! local variables are not implicit by default ! local variables are not implicit by default
! !
implicit none implicit none
! subroutine arguments ! subroutine arguments
! !
logical, intent(in) :: verbose logical, intent(in) :: verbose
! local variables ! local variables
! !
character(len=64) :: sfmts, sfmtc, sfmti character(len=80) :: sfmt, msg
integer :: dd, hh, mm, ss integer :: dd, hh, mm, ss
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
if (verbose) then if (verbose) then
call print_section(verbose, "Snapshots")
write(*,*)
write(*,"(1x,a)") "Snapshots:"
sfmts = "(4x,a22,1x,'=',1x,a)"
if (precise_snapshots) then if (precise_snapshots) then
write(*,sfmts) "precise snapshot times", "on" call print_parameter(verbose, "precise snapshot intervals", "on" )
else else
write(*,sfmts) "precise snapshot times", "off" call print_parameter(verbose, "precise snapshot intervals", "off")
end if end if
write(*,sfmts) "snapshot type ", ftype_name call print_parameter(verbose, "snapshot type", ftype_name)
if (with_ghosts) then if (with_ghosts) then
write(*,sfmts) "with ghosts cells ", "on" call print_parameter(verbose, "with ghosts cells", "on" )
else else
write(*,sfmts) "with ghosts cells ", "off" call print_parameter(verbose, "with ghosts cells", "off")
end if end if
sfmti = "(4x,a21,2x,'=',1x,i0)"
#ifdef HDF5 #ifdef HDF5
sfmtc = "(4x,a21,2x,'=',1x,a)"
select case(compression) select case(compression)
case(H5Z_ZSTANDARD) case(H5Z_ZSTANDARD)
write(*,sfmtc) "HDF5 compression ", "zstd" call print_parameter(verbose, "HDF5 compression" , "zstd" )
write(*,sfmti) "compression level ", clevel call print_parameter(verbose, "compression level", clevel )
case(H5Z_DEFLATE) case(H5Z_DEFLATE)
write(*,sfmtc) "HDF5 compression ", "deflate" call print_parameter(verbose, "HDF5 compression" , "deflate")
write(*,sfmti) "compression level ", clevel call print_parameter(verbose, "compression level", clevel )
case default case default
write(*,sfmtc) "HDF5 compression ", "none" call print_parameter(verbose, "HDF5 compression" , "none" )
end select end select
#endif /* HDF5 */ #endif /* HDF5 */
if (with_xdmf) then if (with_xdmf) then
write(*,sfmts) "generate XDMF files ", "on" call print_parameter(verbose, "generate XDMF files", "on" )
else else
write(*,sfmts) "generate XDMF files ", "off" call print_parameter(verbose, "generate XDMF files", "off")
end if end if
sfmtc = "(4x,a22,1x,'=',es9.2)" call print_parameter(verbose, "snapshot interval" , hsnap)
write(*,sfmtc) "snapshot interval ", hsnap
if (hrest > 0.0d+00) then if (hrest > 0.0d+00) then
dd = int(hrest / 2.4d+01) dd = int(hrest / 2.4d+01)
hh = int(mod(hrest, 2.4d+01)) hh = int(mod(hrest, 2.4d+01))
mm = int(mod(6.0d+01 * hrest, 6.0d+01)) mm = int(mod(6.0d+01 * hrest, 6.0d+01))
ss = int(mod(3.6d+03 * hrest, 6.0d+01)) ss = int(mod(3.6d+03 * hrest, 6.0d+01))
sfmtc = "(4x,a16,7x,'=',1x,i2.2,'d',i2.2,'h',i2.2,'m',i2.2,'s')" sfmt = "(i2.2,'d',i2.2,'h',i2.2,'m',i2.2,'s')"
write(*,sfmtc) "restart interval", dd, hh, mm, ss write(msg,sfmt) dd, hh, mm, ss
call print_parameter(verbose, "restart interval" , msg )
end if end if
if (restart_from_snapshot()) then if (restart_from_snapshot()) then
sfmtc = "(4x,a18,5x,'=',1x,'[',a,']')" call print_parameter(verbose, "restart from path" , respath)
write(*,sfmtc) "restart from path ", trim(respath) call print_parameter(verbose, "restart from snapshot", nrest )
write(*,sfmti) "restart from snapshot", nrest
end if end if
end if end if
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------

View File

@ -109,6 +109,7 @@ module parameters
! include external procedures and variables ! include external procedures and variables
! !
use helpers , only : print_section, print_parameter
use iso_fortran_env, only : error_unit use iso_fortran_env, only : error_unit
! local variables are not implicit by default ! local variables are not implicit by default
@ -151,9 +152,8 @@ module parameters
! print the name of parameter file ! print the name of parameter file
! !
write (*,*) call print_section(.true., "Configuration")
write (*,"(1x,a)" ) "Configuration:" call print_parameter(.true., "parameter file", fname)
write (*,"(4x,a,1x,a)") "parameter file =", trim(fname)
! check if the file exists ! check if the file exists
! !

View File

@ -237,6 +237,7 @@ module refinement
! import external procedures and variables ! import external procedures and variables
! !
use helpers , only : print_section, print_parameter
use equations, only : magnetized, pvars, nv use equations, only : magnetized, pvars, nv
! local variables are not implicit by default ! local variables are not implicit by default
@ -249,9 +250,9 @@ module refinement
! local variables ! local variables
! !
character(len=64) :: sfmts character(len=80) :: rvars = "", msg
character(len=255) :: rvars = "" character(len=64) :: sfmt
integer :: p integer :: p
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
@ -268,17 +269,18 @@ module refinement
rvars = adjustl(trim(rvars) // ' jabs') rvars = adjustl(trim(rvars) // ' jabs')
end if end if
write(*,*) call print_section(verbose, "Refinement")
write(*,"(1x,a)") "Refinement:" call print_parameter(verbose, "refined variables", rvars)
sfmts = "(4x,a,1x,a)" sfmt = "(es9.2,1x,'...',1x,es9.2)"
write(*,sfmts) "refined variables =", trim(rvars) write(msg,sfmt) crefmin, crefmax
sfmts = "(4x,a,2es9.2)" call print_parameter(verbose, "2nd order error limits", msg)
write(*,sfmts) "2nd order error limits =", crefmin, crefmax
if (vort_ref) then if (vort_ref) then
write(*,sfmts) "vorticity limits =", vortmin, vortmax write(msg,sfmt) vortmin, vortmax
call print_parameter(verbose, "vorticity limits" , msg)
end if end if
if (magnetized .and. jabs_ref) then if (magnetized .and. jabs_ref) then
write(*,sfmts) "current density limits =", jabsmin, jabsmax write(msg,sfmt) jabsmin, jabsmax
call print_parameter(verbose, "current density limits", msg)
end if end if
end if end if

View File

@ -576,6 +576,10 @@ module schemes
! !
subroutine print_schemes(verbose) subroutine print_schemes(verbose)
! import external procedures and variables
!
use helpers, only : print_section, print_parameter
! local variables are not implicit by default ! local variables are not implicit by default
! !
implicit none implicit none
@ -583,21 +587,13 @@ module schemes
! subroutine arguments ! subroutine arguments
! !
logical, intent(in) :: verbose logical, intent(in) :: verbose
! local variables
!
character(len=64) :: sfmts
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
if (verbose) then if (verbose) then
call print_section(verbose, "Schemes")
write(*,*) call print_parameter(verbose, "Riemann solver" , name_sol)
write(*,"(1x,a)") "Schemes:" call print_parameter(verbose, "state variables", name_sts)
sfmts = "(4x,a,1x,a)"
write(*,sfmts) "Riemann solver =", trim(name_sol)
write(*,sfmts) "state variables =", trim(name_sts)
end if end if
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------

View File

@ -240,6 +240,10 @@ module shapes
! !
subroutine print_shapes(verbose) subroutine print_shapes(verbose)
! import external procedures and variables
!
use helpers, only : print_section, print_parameter
! local variables are not implicit by default ! local variables are not implicit by default
! !
implicit none implicit none
@ -251,13 +255,11 @@ module shapes
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
if (verbose) then if (verbose) then
if (enabled) then if (enabled) then
write (*,"(4x,a,1x,a)") "embedded shapes =", "on" call print_parameter(verbose, "embedded shapes", "on" )
else else
write (*,"(4x,a,1x,a)") "embedded shapes =", "off" call print_parameter(verbose, "embedded shapes", "off")
end if end if
end if end if
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------

View File

@ -221,6 +221,7 @@ module sources
! include external procedures ! include external procedures
! !
use equations, only : magnetized use equations, only : magnetized
use helpers , only : print_section, print_parameter
! local variables are not implicit by default ! local variables are not implicit by default
! !
@ -229,25 +230,16 @@ module sources
! subroutine arguments ! subroutine arguments
! !
logical, intent(in) :: verbose logical, intent(in) :: verbose
! local variables
!
character(len=64) :: sfmts
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
if (verbose) then if (verbose) then
write(*,*) call print_section(verbose, "Source terms")
write(*,"(1x,a)") "Source terms:" call print_parameter(verbose, "viscosity" , viscosity )
if (magnetized) then if (magnetized) then
sfmts = "(4x,a,1x,a)" call print_parameter(verbose, "resistivity" , resistivity)
write(*,sfmts) "glm source terms =", trim(glm_name) call print_parameter(verbose, "glm source terms", glm_name )
end if
sfmts = "(4x,a,1es9.2)"
write(*,sfmts) "viscosity =", viscosity
if (magnetized) then
write(*,sfmts) "resistivity =", resistivity
end if end if
end if end if

View File

@ -235,12 +235,6 @@ module user_problem
! !
if (verbose) then if (verbose) then
! print information about the problem
!
write (*,*)
write (*,"(1x,a)") "Problem:"
write (*,"(4x,a12,11x,'=',1x,a)") "problem name", trim(problem)
end if end if
#ifdef PROFILE #ifdef PROFILE