!####################################################################### ! SUBROUTINE --- sub_calc_pressure_sound_velocity.f --- ### !####################################################################### ! ### ! Subroutine for Calculating Pressure and Sound Velocity ### ! of All SPH Particles ### ! ### ! Calculated Variables ### ! p(i) : Pressure [Pa] ### ! sv(i) : Sound Velocity [m/s] ### ! ### ! Kind of Material ### ! 0 : Ideal Gas ### ! 1-7 : Tillotson EOS ### ! 8 : 5 Phase EOS ### ! 9 : Saumon EOS ### ! ### ! 2009/07/29 ### ! 2009/08/27 ### ! 2011/06/21 ### ! 2015/06/01 ### !####################################################################### subroutine sub_calc_pressure_sound_velocity(flag_out) use mod_parameter use mod_variable implicit none !==== Arguments ======================================================== !---- Output Arguments ------------------------------------------------- integer(4), intent(IN) :: flag_out !==== Variables Used in This Subroutine ================================ integer i real*8 temp real*8 temp1 !======================================================================= do i=1,np ! ---- Case for Ideal Gas ---- if (imat(i) .eq. 0) then p(i)=(GAMMA-1.0d0)*d(i)*e(i) sv(i)=dsqrt(GAMMA*(GAMMA-1.0d0)*dabs(e(i))) ! ---- Case for Tillotson EOS ---- else if (imat(i) .ge. 1 .and. imat(i) .le. 6) then call sub_eos_tillotson(imat(i),d(i),e(i),p(i),sv(i)) else if (imat(i) .eq. 7) then call sub_eos_wada(d(i),e(i),p(i),sv(i)) else if (imat(i) .eq. 8) then call sub_eos_5phase(d(i),e(i),p(i),sv(i),flag_out,t(i),s(i)) else if (imat(i) .eq. 9) then call sub_eos_saumon(d(i),e(i),p(i),sv(i),temp) else ! ---- Error ---- write(*,*) '*************************************' write(*,*) ' imat is invalid! Program stops!' write(*,*) '*************************************' stop end if end do return end