USER_PROBLEM: Use helper subroutines to print problem parameters.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2019-02-18 12:46:04 -03:00
parent 9eb3293245
commit d0c5833c2b

View File

@ -101,6 +101,7 @@ module user_problem
! !
use constants , only : pi, pi2 use constants , only : pi, pi2
use coordinates, only : ng => nghosts, ady use coordinates, only : ng => nghosts, ady
use helpers , only : print_section, print_parameter
use parameters , only : get_parameter use parameters , only : get_parameter
use random , only : randomu, randomn use random , only : randomu, randomn
@ -117,7 +118,6 @@ module user_problem
! local variables ! local variables
! !
character(len=64) :: perturbation = "noise" character(len=64) :: perturbation = "noise"
character(len=64) :: sfmts, sfmtf, sfmti
integer :: n integer :: n
real(kind=8) :: thh, fc real(kind=8) :: thh, fc
#if NDIMS == 3 #if NDIMS == 3
@ -246,50 +246,35 @@ module user_problem
end if end if
! print information about the user problem such as problem name, its ! print information about the user problem setup
! parameters, etc.
! !
if (verbose) then call print_section(verbose, "Parameters")
call print_parameter(verbose, 'dens' , dens )
! print information about the problem call print_parameter(verbose, 'bamp' , bamp )
! call print_parameter(verbose, 'bgui' , bgui )
write (*,*) call print_parameter(verbose, 'zeta' , zeta )
write (*,"(1x,a)") "Problem:" call print_parameter(verbose, 'yth' , yth )
sfmts = "(4x,a14,9x,'=',2x,a)" call print_parameter(verbose, 'perturbation', perturbation)
write (*,sfmts) "problem name ", trim(problem) if (pert /= 3) then
sfmts = "(6x,a12,9x)" call print_parameter(verbose, 'vper' , vper )
write (*,sfmts) "parameters: " end if
sfmtf = "(8x,a10,9x,'=',1es12.4)" if (pert >= 3) then
sfmti = "(8x,a10,9x,'=',1i12)" call print_parameter(verbose, 'bper' , bper )
write (*,sfmtf) "dens ", dens end if
write (*,sfmtf) "bamp ", bamp if (pert >= 1) then
write (*,sfmtf) "bgui ", bgui call print_parameter(verbose, 'kper' , kper )
write (*,sfmtf) "zeta ", zeta end if
write (*,sfmtf) "yth ", yth if (pert == 1) then
sfmts = "(8x,a12,7x,'=',2x,a)" call print_parameter(verbose, 'nper' , nper )
write (*,sfmts) "perturbation", trim(perturbation) end if
if (pert /= 3) then if (pert >= 3) then
write (*,sfmtf) "vper ", vper call print_parameter(verbose, 'pth' , pth )
end if end if
if (pert >= 3) then if (pert <= 1) then
write (*,sfmtf) "bper ", bper call print_parameter(verbose, 'xcut' , xcut )
end if call print_parameter(verbose, 'ycut' , ycut )
if (pert >= 1) then call print_parameter(verbose, 'xdec' , xdec )
write (*,sfmtf) "kper ", kper call print_parameter(verbose, 'ydec' , ydec )
end if
if (pert == 1) then
write (*,sfmti) "nper ", nper
end if
if (pert >= 3) then
write (*,sfmtf) "pth ", pth
end if
if (pert <= 1) then
write (*,sfmtf) "xcut ", xcut
write (*,sfmtf) "ycut ", ycut
write (*,sfmtf) "xdec ", xdec
write (*,sfmtf) "ydec ", ydec
end if
end if end if
#ifdef PROFILE #ifdef PROFILE