diff --git a/sources/driver.F90 b/sources/driver.F90 index 41c8902..4c2bf20 100644 --- a/sources/driver.F90 +++ b/sources/driver.F90 @@ -540,7 +540,7 @@ program amun ! performe one step evolution ! - call advance(dtnext) + call advance(dtnext, iret) ! advance the iteration number and time ! diff --git a/sources/evolution.F90 b/sources/evolution.F90 index 65fee1f..e1004a6 100644 --- a/sources/evolution.F90 +++ b/sources/evolution.F90 @@ -403,20 +403,18 @@ module evolution ! ! Arguments: ! -! dtnext - next time step; +! dtnext - the next time step; +! status - the subroutine call status: 0 for success, otherwise failure; ! !=============================================================================== ! - subroutine advance(dtnext) + subroutine advance(dtnext, status) -! include external procedures +! references ! - use blocks , only : set_blocks_update - use mesh , only : update_mesh - -! include external variables -! - use coordinates , only : toplev + use blocks , only : set_blocks_update + use coordinates, only : toplev + use mesh , only : update_mesh ! local variables are not implicit by default ! @@ -424,11 +422,8 @@ module evolution ! input variables ! - real(kind=8), intent(in) :: dtnext - -! local variables -! - integer :: status + real(kind=8), intent(in) :: dtnext + integer , intent(out) :: status ! !------------------------------------------------------------------------------- ! @@ -457,6 +452,7 @@ module evolution ! check refinement and refine ! call update_mesh(status) + if (status /= 0) go to 100 ! update primitive variables ! @@ -474,6 +470,10 @@ module evolution call check_variables() #endif /* DEBUG */ +! error entry point +! + 100 continue + #ifdef PROFILE ! stop accounting time for solution advance !