/[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.1 - (hide annotations) (download) (as text)
Mon Aug 8 21:10:27 2005 UTC (19 years, 11 months ago) by jmc
Branch: MAIN
File MIME type: application/x-sh
add small script to import data & source code from MITgcm

1 jmc 1.1 #!/bin/sh
2    
3    
4     here=`pwd`
5     tutor=`basename $here`
6     echo 'tutorial:' $tutor
7     src='../../../../wrk57/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     listT=`ls *.templ`
30    
31     echo ' Generate from template:'
32     for xx in $listT
33     do
34     zz=`echo $xx | sed 's/\.templ//'`
35     #- file name of the corresponding data file:
36     yy=`echo $zz | sed 's/inp_/input\//' | sed 's/cod_/code\//'`
37     #echo 'xx='$xx ' ; yy='$yy
38     if test -f $src/$yy ; then
39     ../../../tools/replace_line_nb $xx $src/$yy
40     echo ' ' `ls $zz.tex`' <-- ' $xx '(using:' $yy')'
41     else
42     if test -f $zz.tex ; then :
43     else
44     touch $zz.tex
45     fi
46     echo 'file:' $src/$yy 'not found'
47     fi
48     done
49    
50     #---------------------------------------------------------------------
51     else
52     echo 'dir:' $src 'is missing'
53     fi
54    
55     exit

  ViewVC Help
Powered by ViewVC 1.1.22