forcedrefine_grid Subroutine

private subroutine forcedrefine_grid()

Uses

  • proc~~forcedrefine_grid~~UsesGraph proc~forcedrefine_grid forcedrefine_grid mod_usr mod_usr proc~forcedrefine_grid->mod_usr module~mod_forest mod_forest proc~forcedrefine_grid->module~mod_forest module~mod_global_parameters mod_global_parameters proc~forcedrefine_grid->module~mod_global_parameters module~mod_basic_types mod_basic_types module~mod_global_parameters->module~mod_basic_types module~mod_connectivity mod_connectivity module~mod_global_parameters->module~mod_connectivity module~mod_constants mod_constants module~mod_global_parameters->module~mod_constants module~mod_physicaldata mod_physicaldata module~mod_global_parameters->module~mod_physicaldata module~mod_variables mod_variables module~mod_global_parameters->module~mod_variables mpi mpi module~mod_global_parameters->mpi module~mod_variables->module~mod_basic_types

Arguments

None

Calls

proc~~forcedrefine_grid~~CallsGraph proc~forcedrefine_grid forcedrefine_grid usr_refine_grid usr_refine_grid proc~forcedrefine_grid->usr_refine_grid

Called by

proc~~forcedrefine_grid~~CalledByGraph proc~forcedrefine_grid forcedrefine_grid proc~errest errest proc~errest->proc~forcedrefine_grid proc~resettree resettree proc~resettree->proc~errest proc~settree settree proc~settree->proc~errest proc~main main proc~main->proc~settree proc~timeintegration timeintegration proc~main->proc~timeintegration proc~timeintegration->proc~resettree program~agile agile program~agile->proc~main

Source Code

  subroutine forcedrefine_grid()
    use mod_usr, only: usr_refine_grid
    use mod_forest, only: coarsen, refine
    use mod_global_parameters

    integer :: igrid, iigrid
    integer :: level
    logical :: refineflag, coarsenflag, norefineflag, nocoarsenflag
    double precision :: qt
    integer :: ix1, ix2, ix3

    if (time_advance) then
       qt=global_time+dt
    else
       qt=global_time
    end if

    
    do iigrid=1,igridstail; igrid=igrids(iigrid);

       level=node(plevel_,igrid)

       refineflag = .false.
       coarsenflag = .true.
       norefineflag = .true.
       nocoarsenflag = .false.

       
       do ix3 = ixMlo3, ixMhi3
          do ix2 = ixMlo2, ixMhi2
             do ix1 = ixMlo1, ixMhi1
                call usr_refine_grid(level,qt, &
                     bg(1)%w(ix1, ix2, ix3, :, igrid), bgeo%x(ix1, ix2, ix3, :, igrid), &
                     refineflag, coarsenflag, norefineflag, nocoarsenflag)
             end do
          end do
       end do

       if (coarsenflag) then
          if (level>1) then
             refine(igrid,mype)=.false.
             coarsen(igrid,mype)=.true.
          else
             refine(igrid,mype)=.false.
             coarsen(igrid,mype)=.false.
          end if
       end if

       if (nocoarsenflag) then
          coarsen(igrid,mype)=.false.
       end if

       if (refineflag) then
          if (level<refine_max_level) then
             refine(igrid,mype)=.true.
             coarsen(igrid,mype)=.false.
          else
             refine(igrid,mype)=.false.
             coarsen(igrid,mype)=.false.
          end if
       end if

       if (norefineflag) then
         refine(igrid,mype)=.false.
       end if

    end do
  end subroutine forcedrefine_grid