/[MITgcm]/manual/tools/preprocess.sh
ViewVC logotype

Annotation of /manual/tools/preprocess.sh

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


Revision 1.1 - (hide annotations) (download) (as text)
Thu Apr 21 19:56:37 2011 UTC (13 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint01, HEAD
File MIME type: application/x-sh
move script "preprocess.sh" from s_examples/held_suarez_cs to tools dir.

1 jmc 1.1 #!/bin/sh
2    
3    
4     here=`pwd`
5     tutor=`basename $here`
6     echo 'tutorial:' $tutor
7     src='../../../MITgcm/verification/tutorial_'$tutor
8    
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     else
30     echo 'dir:' $src 'is missing'
31     fi
32    
33     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     ../../tools/replace_line_nb $xx $src/$yy
44     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