fill_coarse_boundary Subroutine

public subroutine fill_coarse_boundary(time, igrid, i1, i2, i3)

Uses

  • proc~~fill_coarse_boundary~~UsesGraph proc~fill_coarse_boundary fill_coarse_boundary module~mod_boundary_conditions mod_boundary_conditions proc~fill_coarse_boundary->module~mod_boundary_conditions module~mod_global_parameters mod_global_parameters proc~fill_coarse_boundary->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

Type IntentOptional Attributes Name
double precision, intent(in) :: time
integer, intent(in) :: igrid
integer, intent(in) :: i1
integer, intent(in) :: i2
integer, intent(in) :: i3

Calls

proc~~fill_coarse_boundary~~CallsGraph proc~fill_coarse_boundary fill_coarse_boundary proc~bc_phys bc_phys proc~fill_coarse_boundary->proc~bc_phys specialbound_usr specialbound_usr proc~bc_phys->specialbound_usr

Called by

proc~~fill_coarse_boundary~~CalledByGraph proc~fill_coarse_boundary fill_coarse_boundary proc~getbc getbc proc~getbc->proc~fill_coarse_boundary proc~add_split_source add_split_source proc~add_split_source->proc~getbc proc~add_split_source~2 add_split_source proc~add_split_source~2->proc~getbc proc~add_split_source~3 add_split_source proc~add_split_source~3->proc~getbc proc~add_split_source~4 add_split_source proc~add_split_source~4->proc~getbc proc~advect1 advect1 proc~advect1->proc~getbc proc~amr_coarsen_refine amr_coarsen_refine proc~amr_coarsen_refine->proc~getbc proc~global_implicit_update global_implicit_update proc~global_implicit_update->proc~getbc proc~improve_initial_condition improve_initial_condition proc~improve_initial_condition->proc~getbc proc~recalculateb recalculateB proc~improve_initial_condition->proc~recalculateb proc~initlevelone initlevelone proc~initlevelone->proc~getbc proc~main main proc~main->proc~getbc proc~main->proc~improve_initial_condition proc~main->proc~initlevelone proc~process process proc~main->proc~process proc~resettree_convert resettree_convert proc~main->proc~resettree_convert proc~settree settree proc~main->proc~settree proc~timeintegration timeintegration proc~main->proc~timeintegration proc~process->proc~getbc proc~process_advanced process_advanced proc~process_advanced->proc~getbc proc~recalculateb->proc~getbc proc~resettree_convert->proc~getbc proc~resettree_convert->proc~amr_coarsen_refine proc~saveamrfile saveamrfile proc~saveamrfile->proc~getbc proc~advect advect proc~advect->proc~advect1 proc~resettree resettree proc~resettree->proc~amr_coarsen_refine proc~settree->proc~amr_coarsen_refine proc~timeintegration->proc~process proc~timeintegration->proc~process_advanced proc~timeintegration->proc~saveamrfile proc~timeintegration->proc~resettree proc~advance advance proc~timeintegration->proc~advance program~agile agile program~agile->proc~main proc~advance->proc~advect

Source Code

  subroutine fill_coarse_boundary(time,igrid,i1,i2,i3)
    use mod_global_parameters
    use mod_boundary_conditions, only: bc_phys
    
    integer, intent(in) :: igrid,i1,i2,i3
    double precision, intent(in) :: time

    integer :: idims,iside,kmin1,kmin2,kmin3,kmax1,kmax2,kmax3,ixBmin1,&
         ixBmin2,ixBmin3,ixBmax1,ixBmax2,ixBmax3,ii1,ii2,ii3

    if(phyboundblock(igrid).and..not.stagger_grid.and.bcphys) then
       ! filling physical boundary ghost cells of a coarser representative block for
       ! sending swap region with width of nghostcells to its coarser neighbor
       do idims=1,ndim
          ! to avoid using as yet unknown corner info in more than 1D, we
          ! fill only interior mesh ranges of the ghost cell ranges at first,
          ! and progressively enlarge the ranges to include corners later
          kmin1=merge(0, 1, idims==1)
          kmax1=merge(0, 1, idims==1)
          ixBmin1=ixCoGmin1+kmin1*nghostcells
          ixBmax1=ixCoGmax1-kmax1*nghostcells
          kmin2=merge(0, 1, idims==2)
          kmax2=merge(0, 1, idims==2)
          ixBmin2=ixCoGmin2+kmin2*nghostcells
          ixBmax2=ixCoGmax2-kmax2*nghostcells
          kmin3=merge(0, 1, idims==3)
          kmax3=merge(0, 1, idims==3)
          ixBmin3=ixCoGmin3+kmin3*nghostcells
          ixBmax3=ixCoGmax3-kmax3*nghostcells


          if(idims > 1 .and. neighbor_type(-1,0,0,&
               igrid)==neighbor_boundary) ixBmin1=ixCoGmin1
          if(idims > 1 .and. neighbor_type( 1,0,0,&
               igrid)==neighbor_boundary) ixBmax1=ixCoGmax1
          if(idims > 2 .and. neighbor_type(0,-1,0,&
               igrid)==neighbor_boundary) ixBmin2=ixCoGmin2
          if(idims > 2 .and. neighbor_type(0, 1,0,&
               igrid)==neighbor_boundary) ixBmax2=ixCoGmax2
          if(i1==-1) then
             ixBmin1=ixCoGmin1+nghostcells
             ixBmax1=ixCoGmin1+2*nghostcells-1
          else if(i1==1) then
             ixBmin1=ixCoGmax1-2*nghostcells+1
             ixBmax1=ixCoGmax1-nghostcells
          end if
          if(i2==-1) then
             ixBmin2=ixCoGmin2+nghostcells
             ixBmax2=ixCoGmin2+2*nghostcells-1
          else if(i2==1) then
             ixBmin2=ixCoGmax2-2*nghostcells+1
             ixBmax2=ixCoGmax2-nghostcells
          end if
          if(i3==-1) then
             ixBmin3=ixCoGmin3+nghostcells
             ixBmax3=ixCoGmin3+2*nghostcells-1
          else if(i3==1) then
             ixBmin3=ixCoGmax3-2*nghostcells+1
             ixBmax3=ixCoGmax3-nghostcells
          end if
          do iside=1,2
             ii1=kr(1,idims)*(2*iside-3);ii2=kr(2,idims)*(2*iside-3)
             ii3=kr(3,idims)*(2*iside-3);
             if (abs(i1)==1.and.abs(ii1)==1.or.abs(i2)==1.and.abs(ii2)==&
                  1.or.abs(i3)==1.and.abs(ii3)==1) cycle
             if (neighbor_type(ii1,ii2,ii3,igrid)/=neighbor_boundary) cycle
             call bc_phys(iside,idims,time,0.d0,psc(igrid),&
                  bgeoc%x(:,:,:,:,igrid),ixCoGmin1,&
                  ixCoGmin2,ixCoGmin3,ixCoGmax1,ixCoGmax2,ixCoGmax3,ixBmin1,&
                  ixBmin2,ixBmin3,ixBmax1,ixBmax2,ixBmax3)
          end do
       end do
    end if

  end subroutine fill_coarse_boundary