/usr/share/mocassin/dustData/makenk.f90 is in mocassin-data 2.02.72-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | program makenk
implicit none
character(len=50) :: fn, fnout, rubbish
real,pointer :: lam(:), n(:), k(:)
real :: skip
integer :: ios,nwav,i,nh
print*, 'filename in?'
read*, fn
print*, 'filename out?'
read*, fnout
print*, 'how many lines in the header?'
read*, nh
open(unit=10,file=fn,status='old')
do i = 1,nh
read(10,*) rubbish
end do
do i = 1,1000000
read(unit=10,fmt=*,iostat=ios)
if (ios/=0) then
nwav = i-1
print*, 'lines of data = ', nwav
exit
end if
end do
rewind(10)
allocate(lam(nwav))
allocate(n(nwav))
allocate(k(nwav))
do i = 1,nh
read(10,*) rubbish
end do
do i = 1,nwav
read(unit=10,fmt=*,iostat=ios) lam(i), skip, skip, n(i),k(i)
if (ios/=0) then
print*, 'problem reading'
stop
end if
end do
close(10)
open (unit=11,file=fnout, status='unknown')
do i = nwav, 1, -1
write(11,fmt='(3e12.5)') lam(i), n(i)+1, k(i)
end do
close(11)
end program makenk
|