EQUATIONS: Completely rewrite this module.
Now, module EQUATIONS provides a complet interface for equation systems, including the definition of the number of equations/independent variables, variable indices and names, conversion subroutines between primitive and conservative variables, flux and characteristic speed calculation, and maximum speed determination. Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
386fd36f5e
commit
f48950aa4d
@ -37,7 +37,7 @@ program amun
|
||||
use blocks , only : initialize_blocks, finalize_blocks, get_nleafs
|
||||
use boundaries , only : initialize_boundaries
|
||||
use coordinates , only : initialize_coordinates, finalize_coordinates
|
||||
use equations , only : initialize_equations
|
||||
use equations , only : initialize_equations, finalize_equations
|
||||
use evolution , only : initialize_evolution, advance
|
||||
use evolution , only : n, t, dt, dtn, cfl
|
||||
#ifdef FORCE
|
||||
@ -225,29 +225,13 @@ program amun
|
||||
!
|
||||
iterm = 0
|
||||
|
||||
! print configuration information
|
||||
! initialize module EQUATIONS
|
||||
!
|
||||
if (master) then
|
||||
call initialize_equations(master, iret)
|
||||
|
||||
write (*,"(1x,a)" ) "Physics:"
|
||||
write (*,"(4x,a,1x,a)" ) "equations =", &
|
||||
#ifdef HYDRO
|
||||
"HD"
|
||||
#endif /* HYDRO */
|
||||
#ifdef MHD
|
||||
"MHD"
|
||||
#endif /* MHD */
|
||||
write (*,"(4x,a,1x,a)" ) "equation of state =", &
|
||||
#ifdef ADI
|
||||
"adiabatic"
|
||||
#endif /* ADI */
|
||||
#ifdef ISO
|
||||
"isothermal"
|
||||
#endif /* ISO */
|
||||
write (*,"(4x,a,1x,a)" ) "geometry =", &
|
||||
"rectangular"
|
||||
|
||||
end if
|
||||
! jump to the end if the equations could not be initialized
|
||||
!
|
||||
if (iret > 0) go to 30
|
||||
|
||||
! check if the domain is periodic
|
||||
!
|
||||
@ -309,10 +293,6 @@ program amun
|
||||
!
|
||||
call initialize_interpolations()
|
||||
|
||||
! initialize module EQUATIONS
|
||||
!
|
||||
call initialize_equations()
|
||||
|
||||
! initialize boundaries
|
||||
!
|
||||
call initialize_boundaries()
|
||||
@ -716,6 +696,14 @@ program amun
|
||||
|
||||
end if
|
||||
|
||||
! finalize module EQUATIONS
|
||||
!
|
||||
call finalize_equations(iret)
|
||||
|
||||
! jump point
|
||||
!
|
||||
30 continue
|
||||
|
||||
! finalize parameters
|
||||
!
|
||||
call finalize_parameters()
|
||||
|
1582
src/equations.F90
1582
src/equations.F90
File diff suppressed because it is too large
Load Diff
@ -426,7 +426,7 @@ module evolution
|
||||
|
||||
! include external procedures
|
||||
!
|
||||
use equations , only : maxspeed
|
||||
use equations , only : maxspeed, cmax, cmax2
|
||||
#ifdef MPI
|
||||
use mpitools , only : reduce_maximum_real, reduce_maximum_integer
|
||||
#endif /* MPI */
|
||||
@ -436,7 +436,6 @@ module evolution
|
||||
use blocks , only : block_data, list_data
|
||||
use coordinates , only : adx, ady, adz
|
||||
use coordinates , only : toplev
|
||||
use variables , only : cmax
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
@ -494,6 +493,10 @@ module evolution
|
||||
call reduce_maximum_integer(lev , iret)
|
||||
#endif /* MPI */
|
||||
|
||||
! calculate squared cmax
|
||||
!
|
||||
cmax2 = cmax * cmax
|
||||
|
||||
! find the smallest spatial step
|
||||
!
|
||||
#if NDIMS == 2
|
||||
|
@ -1072,7 +1072,7 @@ module schemes
|
||||
|
||||
! include external procedures
|
||||
!
|
||||
use equations , only : prim2cons, fluxspeed
|
||||
use equations , only : prim2cons, fluxspeed, cmax
|
||||
use interpolations, only : reconstruct
|
||||
#ifdef FIX_POSITIVITY
|
||||
use interpolations, only : fix_positivity
|
||||
@ -1088,7 +1088,6 @@ module schemes
|
||||
use variables , only : ibx, iby, ibz
|
||||
#ifdef GLM
|
||||
use variables , only : iph
|
||||
use variables , only : cmax
|
||||
#endif /* GLM */
|
||||
|
||||
! local variables are not implicit by default
|
||||
|
@ -55,10 +55,6 @@ module variables
|
||||
#endif /* MHD */
|
||||
integer(kind=4), parameter :: nvr = nqt
|
||||
integer(kind=4), parameter :: nt = nqt
|
||||
|
||||
! the maximum characteristic speed in the domain
|
||||
!
|
||||
real , save :: cmax = 0.0d+0
|
||||
!
|
||||
!===============================================================================
|
||||
!
|
||||
|
Loading…
x
Reference in New Issue
Block a user