sample_update_payload Subroutine

private subroutine sample_update_payload(igrid, xpart, upart, qpart, mpart, mypayload, mynpayload, particle_time)

Uses

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

Payload update

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: igrid
double precision, intent(in) :: xpart(1:ndir)
double precision, intent(in) :: upart(1:ndir)
double precision, intent(in) :: qpart
double precision, intent(in) :: mpart
double precision, intent(out) :: mypayload(mynpayload)
integer, intent(in) :: mynpayload
double precision, intent(in) :: particle_time

Calls

proc~~sample_update_payload~~CallsGraph proc~sample_update_payload sample_update_payload phys_to_conserved phys_to_conserved proc~sample_update_payload->phys_to_conserved proc~interpolate_var interpolate_var proc~sample_update_payload->proc~interpolate_var proc~mpistop mpistop proc~interpolate_var->proc~mpistop mpi_abort mpi_abort proc~mpistop->mpi_abort

Called by

proc~~sample_update_payload~~CalledByGraph proc~sample_update_payload sample_update_payload proc~sample_create_particles sample_create_particles proc~sample_create_particles->proc~sample_update_payload proc~sample_integrate_particles sample_integrate_particles proc~sample_integrate_particles->proc~sample_update_payload proc~particles_create particles_create proc~particles_create->proc~sample_create_particles proc~main main proc~main->proc~particles_create program~agile agile program~agile->proc~main

Source Code

  subroutine sample_update_payload(igrid,xpart,upart,qpart,mpart,mypayload,&
     mynpayload,particle_time)
    use mod_global_parameters
    integer, intent(in)           :: igrid,mynpayload
    double precision, intent(in)  :: xpart(1:ndir),upart(1:ndir),qpart,mpart,&
       particle_time
    double precision, intent(out) :: mypayload(mynpayload)
    double precision              :: myw(ixGlo1:ixGhi1,ixGlo2:ixGhi2,&
       ixGlo3:ixGhi3,1:nw),mywold(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,&
       1:nw)
    double precision              :: wp, wpold, td
    integer                       :: ii


    ! There are npayload=nw payloads, one for each primitive fluid quantity
    myw(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,&
       1:nw) = gridvars(igrid)%w(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,&
       1:nw)
    if (time_advance) mywold(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,&
       1:nw) = gridvars(igrid)%wold(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,&
       1:nw)

    if (.not.saveprim) then
      call phys_to_conserved(ixGlo1,ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,ixGlo1,&
         ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,myw,ps(igrid)%x)
      if (time_advance) call phys_to_conserved(ixGlo1,ixGlo2,ixGlo3,ixGhi1,&
         ixGhi2,ixGhi3,ixGlo1,ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,mywold,&
         ps(igrid)%x)
    end if

    do ii=1,mynpayload
      call interpolate_var(igrid,ixGlo1,ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,&
         ixMlo1,ixMlo2,ixMlo3,ixMhi1,ixMhi2,ixMhi3,myw(ixGlo1:ixGhi1,&
         ixGlo2:ixGhi2,ixGlo3:ixGhi3,ii),ps(igrid)%x,xpart,wp)
      if (time_advance) then
        td = (particle_time - global_time) / dt
        call interpolate_var(igrid,ixGlo1,ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,&
           ixMlo1,ixMlo2,ixMlo3,ixMhi1,ixMhi2,ixMhi3,mywold(ixGlo1:ixGhi1,&
           ixGlo2:ixGhi2,ixGlo3:ixGhi3,ii),ps(igrid)%x,xpart,wpold)
        wp = wpold * (1.0d0 - td) + wp * td
      end if
      mypayload(ii) = wp*w_convert_factor(ii)
    end do

  end subroutine sample_update_payload