improve_initial_condition Subroutine

public subroutine improve_initial_condition()

Uses

  • proc~~improve_initial_condition~~UsesGraph proc~improve_initial_condition improve_initial_condition mod_physics mod_physics proc~improve_initial_condition->mod_physics module~mod_constrained_transport mod_constrained_transport proc~improve_initial_condition->module~mod_constrained_transport module~mod_ghostcells_update mod_ghostcells_update proc~improve_initial_condition->module~mod_ghostcells_update module~mod_global_parameters mod_global_parameters proc~improve_initial_condition->module~mod_global_parameters module~mod_multigrid_coupling mod_multigrid_coupling proc~improve_initial_condition->module~mod_multigrid_coupling module~mod_usr_methods mod_usr_methods proc~improve_initial_condition->module~mod_usr_methods module~mod_mpi_wrapper mod_mpi_wrapper module~mod_ghostcells_update->module~mod_mpi_wrapper 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~m_octree_mg_3d m_octree_mg_3d module~mod_multigrid_coupling->module~m_octree_mg_3d module~m_octree_mg_3d->module~mod_mpi_wrapper module~m_octree_mg_3d->mpi module~mod_mpi_wrapper->mpi module~mod_variables->module~mod_basic_types

improve initial condition after initialization

Arguments

None

Calls

proc~~improve_initial_condition~~CallsGraph proc~improve_initial_condition improve_initial_condition phys_clean_divb phys_clean_divb proc~improve_initial_condition->phys_clean_divb proc~getbc getbc proc~improve_initial_condition->proc~getbc proc~mg_setup_multigrid mg_setup_multigrid proc~improve_initial_condition->proc~mg_setup_multigrid proc~recalculateb recalculateB proc~improve_initial_condition->proc~recalculateb mpi_waitall mpi_waitall proc~getbc->mpi_waitall mpi_wtime mpi_wtime proc~getbc->mpi_wtime phys_boundary_adjust phys_boundary_adjust proc~getbc->phys_boundary_adjust proc~fill_boundary_after_gc fill_boundary_after_gc proc~getbc->proc~fill_boundary_after_gc proc~fill_boundary_before_gc fill_boundary_before_gc proc~getbc->proc~fill_boundary_before_gc proc~fill_coarse_boundary fill_coarse_boundary proc~getbc->proc~fill_coarse_boundary proc~getintbc getintbc proc~getbc->proc~getintbc proc~idecode~2 idecode proc~getbc->proc~idecode~2 proc~mpi_irecv_wrapper mpi_irecv_wrapper proc~getbc->proc~mpi_irecv_wrapper proc~mpi_isend_wrapper mpi_isend_wrapper proc~getbc->proc~mpi_isend_wrapper proc~nvtxendrange~2 nvtxEndRange proc~getbc->proc~nvtxendrange~2 proc~nvtxstartrange~2 nvtxStartRange proc~getbc->proc~nvtxstartrange~2 proc~skip_direction skip_direction proc~getbc->proc~skip_direction proc~mg_comm_init~3 mg_comm_init proc~mg_setup_multigrid->proc~mg_comm_init~3 proc~mg_set_methods~3 mg_set_methods proc~mg_setup_multigrid->proc~mg_set_methods~3 proc~mg_tree_from_amrvac mg_tree_from_amrvac proc~mg_setup_multigrid->proc~mg_tree_from_amrvac proc~recalculateb->proc~getbc phys_face_to_center phys_face_to_center proc~recalculateb->phys_face_to_center phys_to_conserved phys_to_conserved proc~recalculateb->phys_to_conserved phys_to_primitive phys_to_primitive proc~recalculateb->phys_to_primitive proc~fake_advance fake_advance proc~recalculateb->proc~fake_advance proc~fix_conserve fix_conserve proc~recalculateb->proc~fix_conserve proc~fix_edges fix_edges proc~recalculateb->proc~fix_edges proc~init_comm_fix_conserve init_comm_fix_conserve proc~recalculateb->proc~init_comm_fix_conserve proc~recvflux recvflux proc~recalculateb->proc~recvflux proc~sendflux sendflux proc~recalculateb->proc~sendflux proc~fake_update fake_update proc~fake_advance->proc~fake_update proc~store_edge store_edge proc~fake_advance->proc~store_edge proc~store_flux store_flux proc~fake_advance->proc~store_flux proc~bc_phys bc_phys proc~fill_boundary_after_gc->proc~bc_phys proc~fill_boundary_before_gc->proc~bc_phys proc~fill_coarse_boundary->proc~bc_phys proc~fix_conserve->mpi_waitall mpi_get_count mpi_get_count proc~fix_conserve->mpi_get_count proc~mpistop mpistop proc~fix_conserve->proc~mpistop proc~sync_positions_host sync_positions_host proc~getintbc->proc~sync_positions_host proc~build_message_layout build_message_layout proc~init_comm_fix_conserve->proc~build_message_layout proc~init_comm_fix_conserve->proc~mpistop mpi_comm_rank mpi_comm_rank proc~mg_comm_init~3->mpi_comm_rank mpi_comm_size mpi_comm_size proc~mg_comm_init~3->mpi_comm_size mpi_init mpi_init proc~mg_comm_init~3->mpi_init mpi_initialized mpi_initialized proc~mg_comm_init~3->mpi_initialized proc~ahelmholtz_set_methods~3 ahelmholtz_set_methods proc~mg_set_methods~3->proc~ahelmholtz_set_methods~3 proc~helmholtz_set_methods~3 helmholtz_set_methods proc~mg_set_methods~3->proc~helmholtz_set_methods~3 proc~laplacian_set_methods~3 laplacian_set_methods proc~mg_set_methods~3->proc~laplacian_set_methods~3 proc~vhelmholtz_set_methods~3 vhelmholtz_set_methods proc~mg_set_methods~3->proc~vhelmholtz_set_methods~3 proc~vlaplacian_set_methods~3 vlaplacian_set_methods proc~mg_set_methods~3->proc~vlaplacian_set_methods~3 proc~mg_add_children~3 mg_add_children proc~mg_tree_from_amrvac->proc~mg_add_children~3 proc~mg_allocate_storage~3 mg_allocate_storage proc~mg_tree_from_amrvac->proc~mg_allocate_storage~3 proc~mg_build_rectangle~3 mg_build_rectangle proc~mg_tree_from_amrvac->proc~mg_build_rectangle~3 proc~mg_load_balance_parents~3 mg_load_balance_parents proc~mg_tree_from_amrvac->proc~mg_load_balance_parents~3 proc~mg_set_leaves_parents~3 mg_set_leaves_parents proc~mg_tree_from_amrvac->proc~mg_set_leaves_parents~3 proc~mg_set_neighbors_lvl~3 mg_set_neighbors_lvl proc~mg_tree_from_amrvac->proc~mg_set_neighbors_lvl~3 proc~mg_set_next_level_ids~3 mg_set_next_level_ids proc~mg_tree_from_amrvac->proc~mg_set_next_level_ids~3 proc~mg_set_refinement_boundaries~3 mg_set_refinement_boundaries proc~mg_tree_from_amrvac->proc~mg_set_refinement_boundaries~3 mpi_irecv mpi_irecv proc~mpi_irecv_wrapper->mpi_irecv mpi_isend mpi_isend proc~mpi_isend_wrapper->mpi_isend proc~recvflux->proc~mpi_irecv_wrapper proc~sendflux->proc~mpi_isend_wrapper specialbound_usr specialbound_usr proc~bc_phys->specialbound_usr proc~build_message_layout->proc~mpistop proc~layout_runs layout_runs proc~build_message_layout->proc~layout_runs proc~b_from_vector_potentiala b_from_vector_potentialA proc~fake_update->proc~b_from_vector_potentiala proc~mg_ghost_cell_buffer_size~3 mg_ghost_cell_buffer_size proc~mg_allocate_storage~3->proc~mg_ghost_cell_buffer_size~3 proc~mg_prolong_buffer_size~3 mg_prolong_buffer_size proc~mg_allocate_storage~3->proc~mg_prolong_buffer_size~3 proc~mg_restrict_buffer_size~3 mg_restrict_buffer_size proc~mg_allocate_storage~3->proc~mg_restrict_buffer_size~3 proc~mg_build_rectangle~3->proc~mg_add_children~3 proc~mg_build_rectangle~3->proc~mg_set_leaves_parents~3 proc~mg_build_rectangle~3->proc~mg_set_neighbors_lvl~3 proc~mg_build_rectangle~3->proc~mg_set_next_level_ids~3 proc~add_single_child~3 add_single_child proc~mg_build_rectangle~3->proc~add_single_child~3 proc~most_popular~3 most_popular proc~mg_load_balance_parents~3->proc~most_popular~3 proc~update_lvl_info~3 update_lvl_info proc~mg_load_balance_parents~3->proc~update_lvl_info~3 proc~mg_has_children~3 mg_has_children proc~mg_set_leaves_parents~3->proc~mg_has_children~3 proc~set_neighbs~3 set_neighbs proc~mg_set_neighbors_lvl~3->proc~set_neighbs~3 proc~mg_set_refinement_boundaries~3->proc~mg_has_children~3 mpi_abort mpi_abort proc~mpistop->mpi_abort proc~b_from_vector_potentiala->proc~mpistop proc~rank_keys rank_keys proc~layout_runs->proc~rank_keys proc~buffer_ghost_cells~3 buffer_ghost_cells proc~mg_ghost_cell_buffer_size~3->proc~buffer_ghost_cells~3 proc~buffer_refinement_boundaries~3 buffer_refinement_boundaries proc~mg_ghost_cell_buffer_size~3->proc~buffer_refinement_boundaries~3 proc~set_ghost_cells~3 set_ghost_cells proc~mg_ghost_cell_buffer_size~3->proc~set_ghost_cells~3 proc~find_neighb~3 find_neighb proc~set_neighbs~3->proc~find_neighb~3 proc~buffer_for_nb~3 buffer_for_nb proc~buffer_ghost_cells~3->proc~buffer_for_nb~3 proc~buffer_refinement_boundaries~3->proc~mg_has_children~3 proc~buffer_for_fine_nb~3 buffer_for_fine_nb proc~buffer_refinement_boundaries~3->proc~buffer_for_fine_nb~3 proc~mg_ix_to_ichild~3 mg_ix_to_ichild proc~find_neighb~3->proc~mg_ix_to_ichild~3 proc~bc_to_gc~3 bc_to_gc proc~set_ghost_cells~3->proc~bc_to_gc~3 proc~box_get_gc~3 box_get_gc proc~set_ghost_cells~3->proc~box_get_gc~3 proc~box_set_gc~3 box_set_gc proc~set_ghost_cells~3->proc~box_set_gc~3 proc~copy_from_nb~3 copy_from_nb proc~set_ghost_cells~3->proc~copy_from_nb~3 proc~fill_buffered_nb~3 fill_buffered_nb proc~set_ghost_cells~3->proc~fill_buffered_nb~3 proc~fill_refinement_bnd~3 fill_refinement_bnd proc~set_ghost_cells~3->proc~fill_refinement_bnd~3 proc~box_gc_for_fine_neighbor~3 box_gc_for_fine_neighbor proc~buffer_for_fine_nb~3->proc~box_gc_for_fine_neighbor~3 proc~mg_get_child_offset~3 mg_get_child_offset proc~buffer_for_fine_nb~3->proc~mg_get_child_offset~3 proc~box_gc_for_neighbor~3 box_gc_for_neighbor proc~buffer_for_nb~3->proc~box_gc_for_neighbor~3 proc~copy_from_nb~3->proc~box_set_gc~3 proc~copy_from_nb~3->proc~box_gc_for_neighbor~3 proc~fill_buffered_nb~3->proc~box_set_gc~3 proc~fill_refinement_bnd~3->proc~box_gc_for_fine_neighbor~3 proc~fill_refinement_bnd~3->proc~mg_get_child_offset~3 proc~sides_rb~3 sides_rb proc~fill_refinement_bnd~3->proc~sides_rb~3

Called by

proc~~improve_initial_condition~~CalledByGraph proc~improve_initial_condition improve_initial_condition proc~main main proc~main->proc~improve_initial_condition program~agile agile program~agile->proc~main

Source Code

  subroutine improve_initial_condition()
    use mod_global_parameters
    use mod_usr_methods
    use mod_constrained_transport
    use mod_multigrid_coupling
    use mod_physics
    use mod_ghostcells_update
  
    logical :: active
  
    if(associated(usr_improve_initial_condition)) then
      call usr_improve_initial_condition
    else if(stagger_grid) then
      if(associated(usr_init_vector_potential)) then
        ! re-calculate magnetic field from the vector potential in a 
        ! completely divergency free way for AMR mesh in 3D
        if(levmax>levmin.and.ndim==3) call recalculateB
      end if
      if(slab_uniform.and.associated(phys_clean_divb)) then
        ! Project out the divB using multigrid poisson solver 
        ! if not initialised from vector potential
        if(.not.use_multigrid) call mg_setup_multigrid()
        call phys_clean_divb(global_time,0.d0,active)
        call getbc(global_time,0.d0,ps,iwstart,nwgc)
      end if
    end if
  
  end subroutine improve_initial_condition