summaryrefslogtreecommitdiff
path: root/Donjon/data/pulseTHM_0d.save
blob: a3cb9f614e8815f6b1ece810f0c87d2acaf9477b (plain)
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
#!/bin/sh
if [ $# = 0 ]
   then
   echo "usage: pulseTHM_0d.save directory" 1>&2
   exit 1
fi
echo access pulseTHM_0d.save
MACH=`uname -s`
Sysx="`echo $MACH | cut -b -6`"
if [ $Sysx = "CYGWIN" ]; then
   MACH=`uname -o`
elif [ $Sysx = "AIX" ]; then
   MACH=`uname -s`
else
   MACH=`uname -sm | sed 's/[ ]/_/'`
fi
if [ $Sysx = "Linux" -o $Sysx = "Darwin" ]; then
mkdir Rundir
cd Rundir
grep ">|#PKINS#:" ../pulseTHM_0d.result > input_file
head input_file
cat >conv.f90 <<'eof2'
program conv
  parameter(maxtim=3000)
  real time(maxtim),power(maxtim)
  character(len=8) :: text
  it=0
  10 it=it+1
  if(it.gt.maxtim) then
    print *,'maxtim overflow'
    stop
  endif
  open(7,file='input_file')
  open(8,file='matlab_pulseTHM_0d.m')
  read(7,*,end=20) text,itt,time(it),power(it)
  go to 10
  20 close(7)
  write(8,200,advance='no') (time(i),i=1,it-1)
  write(8,'(2h ])')
  write(8,300,advance='no') (power(i),i=1,it-1)
  write(8,'(2h ])')
  close(8)
  200 format(7h time=[,1p,10e12.4,4h .../(7x,10e12.4,4h ...))
  300 format(8h power=[,1p,10e12.4,4h .../(8x,10e12.4,4h ...))
end program conv
eof2
gfortran conv.f90
./a.out <input_file
rm input_file conv.f90 a.out
mv matlab_pulseTHM_0d.m $1/"$MACH"
cd ..
rm -r Rundir
fi
echo "pulseTHM_0d.save completed"