Index: palm/trunk/SCRIPTS/nc2vdf
===================================================================
--- palm/trunk/SCRIPTS/nc2vdf	(revision 1109)
+++ palm/trunk/SCRIPTS/nc2vdf	(revision 1110)
@@ -19,5 +19,6 @@
 # Current revisions:
 # -----------------
-#
+# adapted for use on desktop machines
+
 # Former revisions:
 # -----------------
@@ -30,5 +31,5 @@
 # ------------
 # Starting script for nc2vdf. The script does only work on hicegate2, bicegate2,
-# uv as well as on the server at imuk.
+# uv, on the imuk server. It can be adapted for use on any desktop machine.
 #------------------------------------------------------------------------------#
 
@@ -38,4 +39,26 @@
     sys="unknown"
 
+    line=""
+    more $1 | grep "check_workstation" > tmp_mrun
+    while read line
+    do
+      check_workstation=`echo $line | cut -d"=" -s -f2`
+    done < tmp_mrun
+
+    line=""
+    more $1 | grep "WS_init" > tmp_mrun
+    while read line
+    do
+      WS_init=`echo $line | cut -d"=" -s -f2`
+    done < tmp_mrun
+
+    line=""
+    more $1 | grep "init_script" > tmp_mrun
+    while read line
+    do
+      vapor_init_path=`echo $line | cut -d"=" -s -f2`
+    done < tmp_mrun
+
+    rm tmp_mrun
 
     echo "*** checking hostname..."
@@ -61,8 +84,6 @@
        check_hlrn=true
     fi
-#    if [ $(expr "$HOSTNAME" : "") -eq 1 ] ### insert $HOSTNAME of your workstation here if you are not running vapor on one of the systems above
-#    then
-#       check_workstation=true
-#    fi
+
+
 
 
@@ -71,5 +92,5 @@
     then
        sys="IMUK"
-       . /muksoft/packages/vapor/2.1.0/bin/vapor-setup.sh
+       . /muksoft/packages/vapor/2.2.0/bin/vapor-setup.sh
     fi
 
@@ -81,8 +102,16 @@
        module load ncl
     fi
-    
-    if [ $check_workstation == "true" ]
+
+    if [ $check_workstation == "True" ]
     then
        sys="workstation"
+       if [ $WS_init == "True" ]
+       then
+          . $vapor_init_path
+       fi
+       if [ $WS_load == "True" ]
+       then
+          $WS_load_command
+       fi
     fi
 
Index: palm/trunk/SCRIPTS/nc2vdf.config
===================================================================
--- palm/trunk/SCRIPTS/nc2vdf.config	(revision 1109)
+++ palm/trunk/SCRIPTS/nc2vdf.config	(revision 1110)
@@ -18,5 +18,5 @@
 ; Current revisions:
 ; -----------------
-;
+; adapted for use on desktop machines
 ;
 ; Former revisions:
@@ -24,8 +24,5 @@
 ; $Id$
 ;
-; 1078 2012-12-11 10:44:49Z maronga
-; Minor changes
-;
-; 1067 2012-11-26 10:13:14Z maronga
+; 1067 2012-11-26 10:13:14Z marong
 ; Initial revision
 ;
@@ -34,29 +31,37 @@
 ; Configuration file for nc2vdf.
 ;------------------------------------------------------------------------------!
+; This configuration file uses NCL syntax.
+;------------------------------------------------------------------------------!
+; Define name of output file:
+    outputfile      = "vaporoutput" +".vdf"
 
 ; Insert number and names of input files
     numberoffiles   = 2
     files           = new( (/numberoffiles/), string)
-    files(0)        = "../OUTPUT/example_3d.nc"
-    files(1)        = "../OUTPUT/example_3d.1.nc"
+    files(0)        = "palm/current_version/JOBS/building/OUTPUT/building_3d.nc"
+    files(1)        = "palm/current_version/JOBS/building/OUTPUT/building_3d.nc"
+    ;files(2)        = 
+ ; path from where nc2vdf is called
 
-; Insert names of variables to be taken from files specifyed above
+; Insert names of variables to be taken from files specified above
     alt_varnames = False
-    ;for using the alternative method (alt_varnames = True):
+    ; for using the alternative method (alt_varnames = True)
+    ; e.g. for varnames containing double quotes, get numbers from ncdump:
+
     ;vars = new( (/numberoffiles,1/), integer)
     ;vars(0,0) = 10
     ;vars(1,0) = 9
 
-    nvars = 2 ;number of variables (per file)
+    nvars = 2 ; number of variables (per file)
 
-    ;normal method (alt_varnames = False):
+    ; normal method:
     varString = new( (/numberoffiles,1/), string)
     varString(0,0) = "u"
     varString(1,0) = "w"
 
-; specify index of start and end time step? 'False' will include all time steps
+; Specify index of start and end time step, 'False' will include all time steps
     spec_ts = True
     t_start = 0
-    t_end   = 10
+    t_end   = 3
 
 ; Specify a maximum refinement level? 'False' will set the default value.
@@ -71,6 +76,27 @@
     stretch_level = 999
 
+;------------------------------------------------------------------------------!
+; Configuration for workstations (none IMUK/HLRN systems)
+    check_workstation = False
+                       ; Set check True to run script on none IMUK/HLRN systems.
 
-; define name of output file
-   outputfile = "vaporoutput" +".vdf"
+    ;WS_init          = False
+    ;init_script      = /muksoft/packages/vapor/2.2.0/bin/vapor-setup.sh
+                       ; Note: These lines alway stay comments for NCL
+                       ; as they are read by the shell script only.
 
+                       ; Set init True if VAPORs initialization script
+                       ; needs to run on the workstation (most linux systems).
+                       ; Provide path to script (without quotes; . /path/init.sh).
+
+    ;WS_load          = False
+    ;WS_load_command  = module load vapor ncl
+                       ; pass any command to the shell
+
+    install_path      = "/Applications/VAPOR.app/Contents/MacOS/" 
+                       ; customize VAPOR installation path 
+                       ; when running this script on a (Mac OS) workstation
+                       ; * will be ignored on HLRN or IMUK systems *
+
+;------------------------------------------------------------------------------!
+
Index: palm/trunk/SCRIPTS/nc2vdf.ncl
===================================================================
--- palm/trunk/SCRIPTS/nc2vdf.ncl	(revision 1109)
+++ palm/trunk/SCRIPTS/nc2vdf.ncl	(revision 1110)
@@ -18,4 +18,5 @@
 ; Current revisions:
 ; -----------------
+; adapted for use on desktop machines
 ;
 ; Former revisions:
@@ -41,6 +42,6 @@
 ; order to run this script, NCL version 5.2.0 or higher is required.
 ; Default setting will be loaded from .nc2vdf.config.
-; Note that on HLRN, vapor is only available on hicegate2, bicegate2 and the UV
-; sytem.
+; The script does only work on hicegate2, bicegate2,
+; uv, on the imuk server. It can be adapted for use on any desktop machine.
 ;------------------------------------------------------------------------------!
 
@@ -76,5 +77,5 @@
     print("*** loading " + dimsizes(files) + ":")
     do i=0,dimsizes(files)-1
-       print("    " + i + ") " + files(i))  
+       print("    " + i + ") " + files(i))
     end do
 
@@ -87,10 +88,10 @@
     sys        = "unknown"
     query      = systemfunc("echo $HOSTNAME")
-    check_muk  = isStrSubset(query,"muk.uni-hannover.de") 
-    check_hice = isStrSubset(query,"hicegate2") 
+    check_muk  = isStrSubset(query,"muk.uni-hannover.de")
+    check_hice = isStrSubset(query,"hicegate2")
     check_bice = isStrSubset(query,"bicegate2")
     check_huv  = isStrSubset(query,"huv")
     check_buv  = isStrSubset(query,"buv")
-    check_WS   = isStrSubset(query,"kookaburra") ;*** insert name of your workstation here
+
 
 
@@ -108,8 +109,8 @@
              sys = "HLRN"
              else
-                if ( check_WS .eq. True) then
+                if ( check_workstation .eq. True) then
                 print("*** nc2vdf will execute on a workstation PC/Mac")
                 sys = "workstation"
-                path     = "/Applications/VAPOR.app/Contents/MacOS/" ;*** costomize path for WS
+                path = install_path
           end if
           end if
@@ -121,5 +122,5 @@
     end if
 
-    
+
 workpath = systemfunc("echo $PWD") + "/"
 
@@ -152,5 +153,5 @@
 
 if man then
-    ;**** Get names of variables wanted to appear in the VDF file, then get their dimensions with min/max x,y,z
+    ;**** Get names of variables appearing in the VDF file, then get their dimensions with min/max x,y,z
     print(" ")
     print("Choose the *.nc files containing 3D data by typing their indices (seperated by ','). Start with the first files of the timeseries.")
@@ -190,6 +191,6 @@
 
     varNames      = getfilevarnames(f)
-    
-    
+
+
     if man then
     print(" ")
@@ -205,5 +206,5 @@
     nvars = dimsizes(vars)
     end if; man
-    
+
     if (nofiles .eq. 1) then
     if man then
@@ -219,9 +220,9 @@
        varString(i,n) = varNames(vars(n))
        end if; man
-       
+
        if alt_varnames then
             varString(i,n) = varNames(vars(i,n))
        end if
-       
+
        if (vars3d .ne. "") then
        vars3d       = vars3d + ":" + varString(i,n)
@@ -234,5 +235,5 @@
        dimNames(i,n,:) = getfilevardims(f, varString(i,n))
 
-       
+
 
        time     = f->$dimNames(i,n,0)$
@@ -373,5 +374,5 @@
 end if
 
-        
+
 
 ;*******************************************************************************
@@ -437,5 +438,5 @@
 
     delete(f)
-          
+
     do i=0,nofiles-1
 
@@ -447,5 +448,5 @@
         print(" ")
         file_in(i)    = files_avail(toint(systemfunc("read file; echo $file")))
-        
+
     end do
 
@@ -489,11 +490,11 @@
        end do
     end if
-            
-            
-            
+
+
+
     t_end	= dimsizes(time)-1
 
 
-    
+
     end if
 
@@ -539,5 +540,5 @@
 	 dims2d     = getfilevardimsizes(f,varString2d(n))
 	 dimNames2d(n,:) = getfilevardims(f,varString2d(n))
-	 
+
 
       end do
@@ -556,5 +557,5 @@
 	 end do
       end do
-      delete(varNames2d)      
+      delete(varNames2d)
    end if
 
