COORDINATES: Improve initialization/finalization subroutines.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2013-12-11 17:01:22 -02:00
parent 8b11a56312
commit ad15dec7cd
3 changed files with 39 additions and 17 deletions

View File

@ -108,7 +108,7 @@ module coordinates
!
!===============================================================================
!
subroutine initialize_coordinates(flag)
subroutine initialize_coordinates(verbose, iret)
! include external procedures and variables
!
@ -118,9 +118,10 @@ module coordinates
!
implicit none
! input arguments
! subroutine arguments
!
logical, intent(in) :: flag
logical, intent(in) :: verbose
integer, intent(inout) :: iret
! local variables
!
@ -312,7 +313,7 @@ module coordinates
! print general information about the level resolutions
!
if (flag) then
if (verbose) then
! the base resolution
!
@ -338,8 +339,6 @@ module coordinates
! print info
!
write(*,*)
write(*,"(1x,a)" ) "Geometry:"
write(*,"(4x,a, 1x,i6)" ) "refinement to level =", toplev
write(*,"(4x,a,3(1x,i6))") "base configuration =", ir, jr, kr
write(*,"(4x,a,3(1x,i6))") "top level blocks =", dm(:)
@ -362,12 +361,16 @@ module coordinates
!
!===============================================================================
!
subroutine finalize_coordinates()
subroutine finalize_coordinates(iret)
! local variables are not implicit by default
!
implicit none
! subroutine arguments
!
integer, intent(inout) :: iret
!
!-------------------------------------------------------------------------------
!
! deallocating coordinate variables

View File

@ -273,6 +273,23 @@ program amun
!
call initialize_random(nprocs, nproc)
! initialize geometry modules and print info
!
if (master) then
write (*,*)
write (*,"(1x,a)" ) "Geometry:"
end if
! initialize module COORDINATES
!
call initialize_coordinates(master, iret)
! jump to the end if the equations could not be initialized
!
if (iret > 0) go to 60
! initialize physics modules and print info
!
if (master) then
write (*,*)
write (*,"(1x,a)" ) "Physics:"
@ -286,6 +303,8 @@ program amun
!
if (iret > 0) go to 50
! initialize methods modules and print info
!
if (master) then
write (*,*)
write (*,"(1x,a)" ) "Methods:"
@ -311,10 +330,6 @@ program amun
!
call initialize_blocks()
! initialize module COORDINATES
!
call initialize_coordinates(master)
! initialize module INTERPOLATIONS
!
call initialize_interpolations()
@ -597,10 +612,6 @@ program amun
!
call clear_mesh()
! finalize module COORDINATES
!
call finalize_coordinates()
! deallocate block structure
!
call finalize_blocks()
@ -742,6 +753,14 @@ program amun
!
50 continue
! finalize module COORDINATES
!
call finalize_coordinates(iret)
! jump point
!
60 continue
! finalize parameters
!
call finalize_parameters()

View File

@ -1083,8 +1083,8 @@ module io
! regenerate coordinates
!
call finalize_coordinates()
call initialize_coordinates(.false.)
call finalize_coordinates(err)
call initialize_coordinates(.false., err)
! calculate a factor to rescale the block coordinates
!