diff --git a/sources/evolution.F90 b/sources/evolution.F90 index 3063bae..65fee1f 100644 --- a/sources/evolution.F90 +++ b/sources/evolution.F90 @@ -425,6 +425,10 @@ module evolution ! input variables ! real(kind=8), intent(in) :: dtnext + +! local variables +! + integer :: status ! !------------------------------------------------------------------------------- ! @@ -452,7 +456,7 @@ module evolution ! check refinement and refine ! - call update_mesh() + call update_mesh(status) ! update primitive variables ! diff --git a/sources/mesh.F90 b/sources/mesh.F90 index 154b3db..b0b4274 100644 --- a/sources/mesh.F90 +++ b/sources/mesh.F90 @@ -758,25 +758,28 @@ module mesh ! In the MPI version the data blocks are redistributed among all processes ! after the mesh update. ! +! Arguments: +! +! status - the subroutine call status: 0 for success, otherwise failure; ! !=============================================================================== ! - subroutine update_mesh() + subroutine update_mesh(status) ! import external procedures and variables ! - use blocks , only : build_leaf_list + use blocks, only : build_leaf_list #ifdef DEBUG - use blocks , only : check_neighbors + use blocks, only : check_neighbors #endif /* DEBUG */ ! local variables are not implicit by default ! implicit none -! local variables +! subroutine arguments ! - integer :: status + integer, intent(out) :: status !------------------------------------------------------------------------------- ! @@ -809,6 +812,7 @@ module mesh ! update the list of leafs ! call build_leaf_list(status) + if (status /= 0) go to 100 #ifdef MPI ! redistribute blocks equally among all processors @@ -822,6 +826,10 @@ module mesh call check_neighbors() #endif /* DEBUG */ +! error entry point +! + 100 continue + #ifdef PROFILE ! stop accounting time for the adaptive mesh refinement update !