source: palm/trunk/SCRIPTS/nc2vdf @ 1535

Last change on this file since 1535 was 1328, checked in by maronga, 11 years ago

last commit documented

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1#!/bin/ksh
2#--------------------------------------------------------------------------------#
3# This file is part of PALM.
4#
5# PALM is free software: you can redistribute it and/or modify it under the terms
6# of the GNU General Public License as published by the Free Software Foundation,
7# either version 3 of the License, or (at your option) any later version.
8#
9# PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along with
14# PALM. If not, see <http://www.gnu.org/licenses/>.
15#
16# Copyright 1997-2014  Leibniz Universitaet Hannover
17#--------------------------------------------------------------------------------#
18#
19# Current revisions:
20# -----------------
21#
22#
23# Former revisions:
24# -----------------
25# $Id: nc2vdf 1328 2014-03-21 11:00:33Z maronga $
26#
27# 1310 2014-03-14 08:01:56Z raasch
28# adapted for use on desktop machines
29
30# 1067 2012-11-26 10:13:14Z maronga
31# Code put under GNU GPL
32#
33# Description:
34# ------------
35# Starting script for nc2vdf. The script does only work on hicegate2, bicegate2,
36# uv, on the imuk server. It can be adapted for use on any desktop machine.
37#------------------------------------------------------------------------------#
38
39    check_muk=false
40    check_hlrn=false
41    check_workstation=false
42    sys="unknown"
43
44    line=""
45    more $1 | grep "check_workstation" > tmp_mrun
46    while read line
47    do
48      check_workstation=`echo $line | cut -d"=" -s -f2`
49    done < tmp_mrun
50
51    line=""
52    more $1 | grep "WS_init" > tmp_mrun
53    while read line
54    do
55      WS_init=`echo $line | cut -d"=" -s -f2`
56    done < tmp_mrun
57
58    line=""
59    more $1 | grep "init_script" > tmp_mrun
60    while read line
61    do
62      vapor_init_path=`echo $line | cut -d"=" -s -f2`
63    done < tmp_mrun
64
65    rm tmp_mrun
66
67    echo "*** checking hostname..."
68    if [ $(expr "$HOSTNAME" : ".*muk.uni-hannover.de") -gt 0 ]
69    then
70       check_muk=true
71    fi
72
73    if [ $(expr "$HOSTNAME" : ".*hicegate2") -gt 0 ]
74    then
75       check_hlrn=true
76    fi
77    if [ $(expr "$HOSTNAME" : ".*bicegate2") -gt 0 ]
78    then
79       check_hlrn=true
80    fi
81    if [ $(expr "$HOSTNAME" : ".*huv") -gt 0 ]
82    then
83       check_hlrn=true
84    fi
85    if [ $(expr "$HOSTNAME" : ".*buv") -gt 0 ]
86    then
87       check_hlrn=true
88    fi
89
90
91
92
93
94    if [ $check_muk == "true" ]
95    then
96       sys="IMUK"
97       . /muksoft/packages/vapor/2.2.0/bin/vapor-setup.sh
98    fi
99
100    if [ $check_hlrn == "true" ]
101    then
102       sys="HLRN"
103       . /usr/share/modules/init/ksh
104       module load vapor
105       module load ncl
106    fi
107
108    if [ $check_workstation == "True" ]
109    then
110       sys="workstation"
111       if [ $WS_init == "True" ]
112       then
113          . $vapor_init_path
114       fi
115       if [ $WS_load == "True" ]
116       then
117          $WS_load_command
118       fi
119    fi
120
121    if [ $sys == "unknown" ]
122    then
123       echo "+++ unknown system."
124       #exit 0
125    else
126       echo "*** nc2vdf will execute at $sys"
127    fi
128
129    if which nc2vdf.ncl >/dev/null; then
130       ncl $PALM_BIN/nc2vdf.ncl "inputfile= \"$1\""
131    else
132       echo "  +++ nc2vdf.ncl not found."
133    fi
Note: See TracBrowser for help on using the repository browser.