forked from NREL/SOWFA
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bash_profile
115 lines (97 loc) · 3.75 KB
/
.bash_profile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# OpenFOAM-2.4.x
OpenFOAM-2.4.x()
{
# Unset OpenFOAM environment variables.
if [ -z "$FOAM_INST_DIR" ]; then
echo "Nothing to unset..."
else
echo "Unsetting OpenFOAM environment variables..."
. $FOAM_INST_DIR/OpenFOAM-$OPENFOAM_VERSION/etc/config/unset.sh
fi
# Unload any compilers already loaded
echo "Purging modules..."
module purge
# Load the appropriate modules
echo "Loading modules..."
module load openmpi-gcc/1.7.3-4.8.2
module load mkl/13.5.192
module load cmake/3.7.2
module list
# Set the OpenFOAM version and installation directory
export OPENFOAM_VERSION=2.4.x
export OPENFOAM_NAME=OpenFOAM-$OPENFOAM_VERSION
export FOAM_INST_DIR=/projects/windsim/OpenFOAM
# Set the ZeroMQ compilation option to false
echo "Disabling the compilation and usage of ZeroMQ."
export COMPILEZEROMQ=0
foamDotFile=$FOAM_INST_DIR/$OPENFOAM_NAME/etc/bashrc
if [ -f $foamDotFile ] ; then
echo "Sourcing $foamDotFile..."
source $foamDotFile
fi
export WM_PROJECT_USER_DIR=$FOAM_INST_DIR/SOWFA-$OPENFOAM_VERSION
export WM_NCOMPPROCS=12
export WM_COLOURS="white blue green cyan red magenta yellow"
export OPENFAST_DIR=$FOAM_INST_DIR/openfast-openmpi-gcc-1.7.3-4.8.2/install
export HDF5_DIR=$FOAM_INST_DIR/openfast-openmpi-gcc-1.7.3-4.8.2/install
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
export FOAM_RUN=$WM_PROJECT_USER_DIR/run
export LD_LIBRARY_PATH=$FOAM_USER_LIBBIN:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$OPENFAST_DIR/lib/:$LD_LIBRARY_PATH
export PATH=$FOAM_USER_APPBIN:$PATH
}
# OpenFOAM-2.4.x
OpenFOAM-2.4.x_SSC()
{
# Unset OpenFOAM environment variables.
if [ -z "$FOAM_INST_DIR" ]; then
echo "Nothing to unset..."
else
echo "Unsetting OpenFOAM environment variables..."
. $FOAM_INST_DIR/OpenFOAM-$OPENFOAM_VERSION/etc/config/unset.sh
fi
# Unload any compilers already loaded
echo "Purging modules..."
module purge
# Load the appropriate modules
echo "Loading modules..."
module load openmpi-gcc/1.7.3-4.8.2
module load mkl/13.5.192
module load cmake/3.7.2
module list
# Set the OpenFOAM version and installation directory
export OPENFOAM_VERSION=2.4.x
export OPENFOAM_NAME=OpenFOAM-$OPENFOAM_VERSION
export FOAM_INST_DIR=/projects/windsim/OpenFOAM
# Set the ZeroMQ compilation option to true
echo "Enabling the compilation and usage of ZeroMQ."
export COMPILEZEROMQ=1
export ZEROMQ_HOME=$HOME/OpenFOAM/zeroMQ/libzmq/install
export ZEROMQ_INCLUDE=$ZEROMQ_HOME/include
export ZEROMQ_LIB=$ZEROMQ_HOME/lib64
export LD_LIBRARY_PATH=$ZEROMQ_HOME/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$ZEROMQ_HOME/lib64:$LD_LIBRARY_PATH
echo "Specified ZeroMQ directory: $ZEROMQ_HOME"
foamDotFile=$FOAM_INST_DIR/$OPENFOAM_NAME/etc/bashrc
if [ -f $foamDotFile ] ; then
echo "Sourcing $foamDotFile..."
source $foamDotFile
fi
export WM_PROJECT_USER_DIR=$FOAM_INST_DIR/SOWFA-$OPENFOAM_VERSION
export WM_NCOMPPROCS=12
export WM_COLOURS="white blue green cyan red magenta yellow"
export OPENFAST_DIR=$FOAM_INST_DIR/openfast-openmpi-gcc-1.7.3-4.8.2/install
export HDF5_DIR=$FOAM_INST_DIR/openfast-openmpi-gcc-1.7.3-4.8.2/install
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
export FOAM_RUN=$WM_PROJECT_USER_DIR/run
export LD_LIBRARY_PATH=$FOAM_USER_LIBBIN:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$OPENFAST_DIR/lib/:$LD_LIBRARY_PATH
export PATH=$FOAM_USER_APPBIN:$PATH
}