Do all local error estimation which determines (de)refinement
subroutine errest use mod_forest, only: refine, coarsen use mod_global_parameters if (igridstail==0) return select case (refine_criterion) case (1) ! all refinement solely based on user routine usr_refine_grid case (3) ! Error estimation is based on Lohner's scheme call lohner_grid() case default call mpistop("Unknown error estimator") end select if ( refine_usr ) then call forcedrefine_grid() end if end subroutine errest