awk '/!/{gsub(/./," ",$1); print }' OFS=! FS=! radon3d_subs.f90
/: Event not found.
The problem was that when I captured the command in the history it chucked that thing out. Another reason against csh!!!
---------- Post updated at 06:04 AM ---------- Previous update was at 05:49 AM ----------
I have tried
grep "!" radon3d_subs.f90 | sed 's/.*\! //'
on the following
!!
!! SUB radon3d_temporal_fourier
subroutine radon3d_temporal_fourier( tcube, fcube, c_dir )
implicit none
! Arguments
real, dimension(:,:,:), intent(in) :: tcube
complex, dimension(:,:,:), intent(in) :: fcube
character(len=*), intent(in) :: c_dir
! Local variables
real, dimension(:), allocatable :: ft ! stores a single trace
real, dimension(:), allocatable :: tr ! stores a single trace (extended to size of ft)
! IMPLEMENTATION ---------------------------------------------------------------------------------
nt = size(tcube,1)
nx = size(tcube,2)
ny = size(tcube,3)
nf = size(fcube,1)
! trace in the frequency domain
allocate( ft(nf) )
! trace extended to size(ft)
allocate( tr(nf) )
!!> SELECT TRANSFORMATION DIRECTION
select case ( c_dir(1:1) )
!!> time to frequency
case ('+')
do iy = 1, ny
do ix = 1, nx
tr(nf) = 0.0 !!> ensures last sample is zero when nf > nt
tr(1:nt) = (tcube(1:nt,ix,iy)
ft = cfft(tr, '+')
fcube(1:nf,ix,iy) = ft(1:nf)
enddo
enddo
!!> frequency to time
case ('-')
do iy = 1, ny
do ix = 1, nx
ft(1:nf) = fcube(1:nf,ix,iy)
tr = cfft(ft, '-')
tcube(1:nt,ix,iy) = tr(1:nt) !!> nt may be smaller than nt
enddo
enddo
case default
! do nothing
end select
and I am getting
SUB radon3d_temporal_fourier
Arguments
Local variables
stores a single trace
stores a single trace (extended to size of ft)
IMPLEMENTATION ---------------------------------------------------------------------------------
trace in the frequency domain
trace extended to size(ft)
!!> SELECT TRANSFORMATION DIRECTION
!!> time to frequency
tr(nf) = 0.0 !!> ensures last sample is zero when nf > nt
!!> frequency to time
tcube(1:nt,ix,iy) = tr(1:nt) !!> nt may be smaller than nt
do nothing
Almost correct. There is a problem that the match in sed
grep "!" radon3d_subs.f90 | sed 's/.*\! //'
removes the '!'
---------- Post updated at 06:44 AM ---------- Previous update was at 06:04 AM ----------
I tried the following
!!
!! SUB radon3d_temporal_fourier
! Arguments
! Local variables
real, dimension(:), allocatable :: ft ! stores a single trace
real, dimension(:), allocatable :: tr ! stores a single trace (extended to size of ft)
! trace in the frequency domain
! trace extended to size(ft)
!!> SELECT TRANSFORMATION DIRECTION
!!> time to frequency
tr(nf) = 0.0 !!> ensures last sample is zero when nf > nt
!!> frequency to time
tcube(1:nt,ix,iy) = tr(1:nt) !!> nt may be smaller than nt
! do nothing
grep "!" radon3d_subs.f90 | sed 's/(.*)(!.*)/\2/'
This produces the following. As you can see when I have '!!', these are changed to
a single '!'. How can I modify this so I get '!!'?
! SUB radon3d_temporal_fourier
! Arguments
! Local variables
! stores a single trace
! stores a single trace (extended to size of ft)
! trace in the frequency domain
! trace extended to size(ft)
!> SELECT TRANSFORMATION DIRECTION
!> time to frequency
!> ensures last sample is zero when nf > nt
!> frequency to time
!> nt may be smaller than nt
! do nothing