[1046] | 1 | #!/bin/ksh |
---|
[1067] | 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 | # |
---|
[1310] | 16 | # Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1067] | 17 | #--------------------------------------------------------------------------------# |
---|
| 18 | # |
---|
[1046] | 19 | # Current revisions: |
---|
| 20 | # ----------------- |
---|
[1328] | 21 | # |
---|
| 22 | # |
---|
[1046] | 23 | # Former revisions: |
---|
| 24 | # ----------------- |
---|
| 25 | # $Id: nc2vdf 1328 2014-03-21 11:00:33Z witha $ |
---|
| 26 | # |
---|
[1328] | 27 | # 1310 2014-03-14 08:01:56Z raasch |
---|
| 28 | # adapted for use on desktop machines |
---|
| 29 | |
---|
[1068] | 30 | # 1067 2012-11-26 10:13:14Z maronga |
---|
| 31 | # Code put under GNU GPL |
---|
| 32 | # |
---|
[1046] | 33 | # Description: |
---|
| 34 | # ------------ |
---|
[1067] | 35 | # Starting script for nc2vdf. The script does only work on hicegate2, bicegate2, |
---|
[1110] | 36 | # uv, on the imuk server. It can be adapted for use on any desktop machine. |
---|
[1046] | 37 | #------------------------------------------------------------------------------# |
---|
| 38 | |
---|
| 39 | check_muk=false |
---|
| 40 | check_hlrn=false |
---|
[1062] | 41 | check_workstation=false |
---|
[1046] | 42 | sys="unknown" |
---|
| 43 | |
---|
[1110] | 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 |
---|
[1046] | 50 | |
---|
[1110] | 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 | |
---|
[1046] | 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 | |
---|
[1062] | 91 | |
---|
[1110] | 92 | |
---|
| 93 | |
---|
[1046] | 94 | if [ $check_muk == "true" ] |
---|
| 95 | then |
---|
| 96 | sys="IMUK" |
---|
[1110] | 97 | . /muksoft/packages/vapor/2.2.0/bin/vapor-setup.sh |
---|
[1046] | 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 |
---|
[1110] | 107 | |
---|
| 108 | if [ $check_workstation == "True" ] |
---|
[1062] | 109 | then |
---|
| 110 | sys="workstation" |
---|
[1110] | 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 |
---|
[1062] | 119 | fi |
---|
[1046] | 120 | |
---|
| 121 | if [ $sys == "unknown" ] |
---|
| 122 | then |
---|
[1062] | 123 | echo "+++ unknown system." |
---|
| 124 | #exit 0 |
---|
[1046] | 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." |
---|
[1110] | 133 | fi |
---|