1 | #!/bin/sh
2 |
3 | echo " INITBC v1.0"
4 | echo " Description : tool to create the boundary conditions for PRISSMA"
5 |
6 | #
7 | # Path definitions
8 | #
9 |
10 | LOCALDIR=`pwd`
11 | CHOICESD=$DOMHOME/TOOLS/CHOICES
12 | PERSODIR=$DOMHOME/TOOLS/INCLUDE
13 | TOOLDIR=$DOMHOME/TOOLS/INITBC
14 |
15 | #
16 | # Detect if all files are ready for run
17 | #
18 |
19 | ECHOICES=0
20 | EPERSO=0
21 | DORUN=1
22 |
23 | if [ -f 'initbc.choices' ]
24 | then
25 | ECHOICES=1
26 | fi
27 |
28 | if [ -f 'clperso.inc' ]
29 | then
30 | EPERSO=1
31 | fi
32 |
33 | if [ $ECHOICES -eq 1 ]
34 | then
35 | echo " Choices file found"
36 | else
37 | cp $CHOICESD/initbc.choices .
38 | echo " -- No initbc.choices file found, copying default file."
39 | echo " Fill the choices file and run again initbc"
40 | DORUN=0
41 | fi
42 |
43 | if [ $EPERSO -eq 1 ]
44 | then
45 | echo " clperso.inc profile found"
46 | else
47 | cp $PERSODIR/clperso.inc ./clperso.inc
48 | echo " -- No clperso.inc file found, copying default file."
49 | echo " Fill in the desired profile and run again initbc"
50 | DORUN=0
51 | fi
52 |
53 | if [ $DORUN -eq 1 ]
54 | then
55 | cp ./clperso.inc ./clperso.inc_bup
56 | cp $PERSODIR/clperso.inc $PERSODIR/clperso.inc_old
57 | cp ./clperso.inc $PERSODIR/clperso.inc_new
58 | cp ./clperso.inc $PERSODIR/clperso.inc
59 |
60 | make -f $TOOLDIR/Makefile all
61 | mv ./clperso.inc_bup ./clperso.inc
62 | $DOMHOME/HOSTS/$DOM_HOSTTYPE/initbc_$DOM_VERSION.e_$DOM_HOSTTYPE
63 | fi