source: palm/trunk/SCRIPTS/nc2vdf @ 1121

Last change on this file since 1121 was 1110, checked in by maronga, 12 years ago

updates in nc2vdf

  • 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-2012  Leibniz University Hannover
17#--------------------------------------------------------------------------------#
18#
19# Current revisions:
20# -----------------
21# adapted for use on desktop machines
22
23# Former revisions:
24# -----------------
25# $Id: nc2vdf 1110 2013-03-07 11:42:45Z raasch $
26#
27# 1067 2012-11-26 10:13:14Z maronga
28# Code put under GNU GPL
29#
30# Description:
31# ------------
32# Starting script for nc2vdf. The script does only work on hicegate2, bicegate2,
33# uv, on the imuk server. It can be adapted for use on any desktop machine.
34#------------------------------------------------------------------------------#
35
36    check_muk=false
37    check_hlrn=false
38    check_workstation=false
39    sys="unknown"
40
41    line=""
42    more $1 | grep "check_workstation" > tmp_mrun
43    while read line
44    do
45      check_workstation=`echo $line | cut -d"=" -s -f2`
46    done < tmp_mrun
47
48    line=""
49    more $1 | grep "WS_init" > tmp_mrun
50    while read line
51    do
52      WS_init=`echo $line | cut -d"=" -s -f2`
53    done < tmp_mrun
54
55    line=""
56    more $1 | grep "init_script" > tmp_mrun
57    while read line
58    do
59      vapor_init_path=`echo $line | cut -d"=" -s -f2`
60    done < tmp_mrun
61
62    rm tmp_mrun
63
64    echo "*** checking hostname..."
65    if [ $(expr "$HOSTNAME" : ".*muk.uni-hannover.de") -gt 0 ]
66    then
67       check_muk=true
68    fi
69
70    if [ $(expr "$HOSTNAME" : ".*hicegate2") -gt 0 ]
71    then
72       check_hlrn=true
73    fi
74    if [ $(expr "$HOSTNAME" : ".*bicegate2") -gt 0 ]
75    then
76       check_hlrn=true
77    fi
78    if [ $(expr "$HOSTNAME" : ".*huv") -gt 0 ]
79    then
80       check_hlrn=true
81    fi
82    if [ $(expr "$HOSTNAME" : ".*buv") -gt 0 ]
83    then
84       check_hlrn=true
85    fi
86
87
88
89
90
91    if [ $check_muk == "true" ]
92    then
93       sys="IMUK"
94       . /muksoft/packages/vapor/2.2.0/bin/vapor-setup.sh
95    fi
96
97    if [ $check_hlrn == "true" ]
98    then
99       sys="HLRN"
100       . /usr/share/modules/init/ksh
101       module load vapor
102       module load ncl
103    fi
104
105    if [ $check_workstation == "True" ]
106    then
107       sys="workstation"
108       if [ $WS_init == "True" ]
109       then
110          . $vapor_init_path
111       fi
112       if [ $WS_load == "True" ]
113       then
114          $WS_load_command
115       fi
116    fi
117
118    if [ $sys == "unknown" ]
119    then
120       echo "+++ unknown system."
121       #exit 0
122    else
123       echo "*** nc2vdf will execute at $sys"
124    fi
125
126    if which nc2vdf.ncl >/dev/null; then
127       ncl $PALM_BIN/nc2vdf.ncl "inputfile= \"$1\""
128    else
129       echo "  +++ nc2vdf.ncl not found."
130    fi
Note: See TracBrowser for help on using the repository browser.