[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 | # |
---|
| 16 | # Copyright 1997-2012 Leibniz University Hannover |
---|
| 17 | #--------------------------------------------------------------------------------# |
---|
| 18 | # |
---|
[1046] | 19 | # Current revisions: |
---|
| 20 | # ----------------- |
---|
[1110] | 21 | # adapted for use on desktop machines |
---|
| 22 | |
---|
[1046] | 23 | # Former revisions: |
---|
| 24 | # ----------------- |
---|
| 25 | # $Id: nc2vdf 1110 2013-03-07 11:42:45Z heinze $ |
---|
| 26 | # |
---|
[1068] | 27 | # 1067 2012-11-26 10:13:14Z maronga |
---|
| 28 | # Code put under GNU GPL |
---|
| 29 | # |
---|
[1046] | 30 | # Description: |
---|
| 31 | # ------------ |
---|
[1067] | 32 | # Starting script for nc2vdf. The script does only work on hicegate2, bicegate2, |
---|
[1110] | 33 | # uv, on the imuk server. It can be adapted for use on any desktop machine. |
---|
[1046] | 34 | #------------------------------------------------------------------------------# |
---|
| 35 | |
---|
| 36 | check_muk=false |
---|
| 37 | check_hlrn=false |
---|
[1062] | 38 | check_workstation=false |
---|
[1046] | 39 | sys="unknown" |
---|
| 40 | |
---|
[1110] | 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 |
---|
[1046] | 47 | |
---|
[1110] | 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 | |
---|
[1046] | 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 | |
---|
[1062] | 88 | |
---|
[1110] | 89 | |
---|
| 90 | |
---|
[1046] | 91 | if [ $check_muk == "true" ] |
---|
| 92 | then |
---|
| 93 | sys="IMUK" |
---|
[1110] | 94 | . /muksoft/packages/vapor/2.2.0/bin/vapor-setup.sh |
---|
[1046] | 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 |
---|
[1110] | 104 | |
---|
| 105 | if [ $check_workstation == "True" ] |
---|
[1062] | 106 | then |
---|
| 107 | sys="workstation" |
---|
[1110] | 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 |
---|
[1062] | 116 | fi |
---|
[1046] | 117 | |
---|
| 118 | if [ $sys == "unknown" ] |
---|
| 119 | then |
---|
[1062] | 120 | echo "+++ unknown system." |
---|
| 121 | #exit 0 |
---|
[1046] | 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." |
---|
[1110] | 130 | fi |
---|