[Fortran] 纯文本查看 复制代码
subroutine Renew_Wave
!**********************************************************************
!
! 定义子程序更新
!
!**********************************************************************
implicit none
! local variables
integer::wave_num!地震波定义
integer::i,j
real,dimension(1400)::wave_t,wave_v
real,dimension(CalParams%PrescribedVelo%NNodePrescribedVelo,3)::Prevel
wave_num=1400
CalParams%PrescribedVelo%NodalPrescribedVelocityValue=Prevel
do i = 1, CalParams%PrescribedVelo%NNodePrescribedVelo
if (Prevel(i,1)==0.or.Prevel(i,2)==0.or.Prevel(i,3)==0) then!地震波触发条件,输入999
open(10,file='v-t.txt',status='old')
do j=1,wave_num
read(10,*)wave_t(j),wave_v(j)
if (j==CalParams%IStep) then! 时间步
CalParams%PrescribedVelo%NodalPrescribedVelocityValue(I, 1:NVECTOR)=wave_v(j)
end if
end do
close (10)
else
CalParams%PrescribedVelo%NodalPrescribedVelocityValue(I, 1:NVECTOR) = CalParams%PrescribedVelo%NodalPrescribedVelocityValue(I, 1:NVECTOR)
end if
end do
write(*,*)CalParams%PrescribedVelo%NodalPrescribedVelocityValue(1, 2)
end subroutine Renew_Wave