/[MITgcm]/manual/s_examples/held_suarez_cs/preprocess.sh
ViewVC logotype

Annotation of /manual/s_examples/held_suarez_cs/preprocess.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (hide annotations) (download) (as text)
Fri Aug 27 13:22:57 2010 UTC (14 years, 11 months ago) by jmc
Branch: MAIN
Changes since 1.3: +2 -2 lines
File MIME type: application/x-sh
changed for new directory path.

1 jmc 1.1 #!/bin/sh
2    
3    
4     here=`pwd`
5     tutor=`basename $here`
6     echo 'tutorial:' $tutor
7 jmc 1.4 src='../../../MITgcm/verification/tutorial_'$tutor
8 jmc 1.1
9     if test -d $src
10     then
11     #---------------------------------------------------------------------
12     cd $src
13     listI=`ls input/eedata input/data input/data.* code/packages.conf code/*.h code/*.F`
14     cd $here
15    
16     echo ' Import from:' $src ' files:'
17     for xx in $listI
18     do
19     echo ' ' $xx
20     if test -f $src/$xx ; then
21     echo "\begin{verbatim}" > $xx.tex
22     nl -ba $src/$xx >> $xx.tex
23     echo "\end{verbatim}" >> $xx.tex
24     else echo 'file:' $src/$xx 'not found'
25     fi
26     done
27    
28     #---------------------------------------------------------------------
29 jmc 1.3 else
30     echo 'dir:' $src 'is missing'
31     fi
32    
33 jmc 1.1 listT=`ls *.templ`
34    
35     echo ' Generate from template:'
36     for xx in $listT
37     do
38     zz=`echo $xx | sed 's/\.templ//'`
39     #- file name of the corresponding data file:
40     yy=`echo $zz | sed 's/inp_/input\//' | sed 's/cod_/code\//'`
41     #echo 'xx='$xx ' ; yy='$yy
42     if test -f $src/$yy ; then
43 jmc 1.4 ../../tools/replace_line_nb $xx $src/$yy
44 jmc 1.1 echo ' ' `ls $zz.tex`' <-- ' $xx '(using:' $yy')'
45     else
46     if test -f $zz.tex ; then :
47     else
48     touch $zz.tex
49     fi
50     echo 'file:' $src/$yy 'not found'
51     fi
52     done
53    
54     #---------------------------------------------------------------------
55    
56     exit

  ViewVC Help
Powered by ViewVC 1.1.22