Changeset 1110
- Timestamp:
- Mar 7, 2013 11:42:45 AM (12 years ago)
- Location:
- palm/trunk/SCRIPTS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/nc2vdf
r1068 r1110 19 19 # Current revisions: 20 20 # ----------------- 21 # 21 # adapted for use on desktop machines 22 22 23 # Former revisions: 23 24 # ----------------- … … 30 31 # ------------ 31 32 # Starting script for nc2vdf. The script does only work on hicegate2, bicegate2, 32 # uv as well as on the server at imuk.33 # uv, on the imuk server. It can be adapted for use on any desktop machine. 33 34 #------------------------------------------------------------------------------# 34 35 … … 38 39 sys="unknown" 39 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 40 63 41 64 echo "*** checking hostname..." … … 61 84 check_hlrn=true 62 85 fi 63 # if [ $(expr "$HOSTNAME" : "") -eq 1 ] ### insert $HOSTNAME of your workstation here if you are not running vapor on one of the systems above 64 # then 65 # check_workstation=true 66 # fi 86 87 67 88 68 89 … … 71 92 then 72 93 sys="IMUK" 73 . /muksoft/packages/vapor/2. 1.0/bin/vapor-setup.sh94 . /muksoft/packages/vapor/2.2.0/bin/vapor-setup.sh 74 95 fi 75 96 … … 81 102 module load ncl 82 103 fi 83 84 if [ $check_workstation == " true" ]104 105 if [ $check_workstation == "True" ] 85 106 then 86 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 87 116 fi 88 117 -
palm/trunk/SCRIPTS/nc2vdf.config
r1079 r1110 18 18 ; Current revisions: 19 19 ; ----------------- 20 ; 20 ; adapted for use on desktop machines 21 21 ; 22 22 ; Former revisions: … … 24 24 ; $Id$ 25 25 ; 26 ; 1078 2012-12-11 10:44:49Z maronga 27 ; Minor changes 28 ; 29 ; 1067 2012-11-26 10:13:14Z maronga 26 ; 1067 2012-11-26 10:13:14Z marong 30 27 ; Initial revision 31 28 ; … … 34 31 ; Configuration file for nc2vdf. 35 32 ;------------------------------------------------------------------------------! 33 ; This configuration file uses NCL syntax. 34 ;------------------------------------------------------------------------------! 35 ; Define name of output file: 36 outputfile = "vaporoutput" +".vdf" 36 37 37 38 ; Insert number and names of input files 38 39 numberoffiles = 2 39 40 files = new( (/numberoffiles/), string) 40 files(0) = "../OUTPUT/example_3d.nc" 41 files(1) = "../OUTPUT/example_3d.1.nc" 41 files(0) = "palm/current_version/JOBS/building/OUTPUT/building_3d.nc" 42 files(1) = "palm/current_version/JOBS/building/OUTPUT/building_3d.nc" 43 ;files(2) = 44 ; path from where nc2vdf is called 42 45 43 ; Insert names of variables to be taken from files specif yed above46 ; Insert names of variables to be taken from files specified above 44 47 alt_varnames = False 45 ;for using the alternative method (alt_varnames = True): 48 ; for using the alternative method (alt_varnames = True) 49 ; e.g. for varnames containing double quotes, get numbers from ncdump: 50 46 51 ;vars = new( (/numberoffiles,1/), integer) 47 52 ;vars(0,0) = 10 48 53 ;vars(1,0) = 9 49 54 50 nvars = 2 ; number of variables (per file)55 nvars = 2 ; number of variables (per file) 51 56 52 ; normal method (alt_varnames = False):57 ; normal method: 53 58 varString = new( (/numberoffiles,1/), string) 54 59 varString(0,0) = "u" 55 60 varString(1,0) = "w" 56 61 57 ; specify index of start and end time step?'False' will include all time steps62 ; Specify index of start and end time step, 'False' will include all time steps 58 63 spec_ts = True 59 64 t_start = 0 60 t_end = 1065 t_end = 3 61 66 62 67 ; Specify a maximum refinement level? 'False' will set the default value. … … 71 76 stretch_level = 999 72 77 78 ;------------------------------------------------------------------------------! 79 ; Configuration for workstations (none IMUK/HLRN systems) 80 check_workstation = False 81 ; Set check True to run script on none IMUK/HLRN systems. 73 82 74 ; define name of output file 75 outputfile = "vaporoutput" +".vdf" 83 ;WS_init = False 84 ;init_script = /muksoft/packages/vapor/2.2.0/bin/vapor-setup.sh 85 ; Note: These lines alway stay comments for NCL 86 ; as they are read by the shell script only. 76 87 88 ; Set init True if VAPORs initialization script 89 ; needs to run on the workstation (most linux systems). 90 ; Provide path to script (without quotes; . /path/init.sh). 91 92 ;WS_load = False 93 ;WS_load_command = module load vapor ncl 94 ; pass any command to the shell 95 96 install_path = "/Applications/VAPOR.app/Contents/MacOS/" 97 ; customize VAPOR installation path 98 ; when running this script on a (Mac OS) workstation 99 ; * will be ignored on HLRN or IMUK systems * 100 101 ;------------------------------------------------------------------------------! 102 -
palm/trunk/SCRIPTS/nc2vdf.ncl
r1068 r1110 18 18 ; Current revisions: 19 19 ; ----------------- 20 ; adapted for use on desktop machines 20 21 ; 21 22 ; Former revisions: … … 41 42 ; order to run this script, NCL version 5.2.0 or higher is required. 42 43 ; Default setting will be loaded from .nc2vdf.config. 43 ; Note that on HLRN, vapor is only available on hicegate2, bicegate2 and the UV44 ; sytem.44 ; The script does only work on hicegate2, bicegate2, 45 ; uv, on the imuk server. It can be adapted for use on any desktop machine. 45 46 ;------------------------------------------------------------------------------! 46 47 … … 76 77 print("*** loading " + dimsizes(files) + ":") 77 78 do i=0,dimsizes(files)-1 78 print(" " + i + ") " + files(i)) 79 print(" " + i + ") " + files(i)) 79 80 end do 80 81 … … 87 88 sys = "unknown" 88 89 query = systemfunc("echo $HOSTNAME") 89 check_muk = isStrSubset(query,"muk.uni-hannover.de") 90 check_hice = isStrSubset(query,"hicegate2") 90 check_muk = isStrSubset(query,"muk.uni-hannover.de") 91 check_hice = isStrSubset(query,"hicegate2") 91 92 check_bice = isStrSubset(query,"bicegate2") 92 93 check_huv = isStrSubset(query,"huv") 93 94 check_buv = isStrSubset(query,"buv") 94 check_WS = isStrSubset(query,"kookaburra") ;*** insert name of your workstation here 95 95 96 96 97 … … 108 109 sys = "HLRN" 109 110 else 110 if ( check_ WS.eq. True) then111 if ( check_workstation .eq. True) then 111 112 print("*** nc2vdf will execute on a workstation PC/Mac") 112 113 sys = "workstation" 113 path = "/Applications/VAPOR.app/Contents/MacOS/" ;*** costomize path for WS114 path = install_path 114 115 end if 115 116 end if … … 121 122 end if 122 123 123 124 124 125 workpath = systemfunc("echo $PWD") + "/" 125 126 … … 152 153 153 154 if man then 154 ;**** Get names of variables wanted to appearin the VDF file, then get their dimensions with min/max x,y,z155 ;**** Get names of variables appearing in the VDF file, then get their dimensions with min/max x,y,z 155 156 print(" ") 156 157 print("Choose the *.nc files containing 3D data by typing their indices (seperated by ','). Start with the first files of the timeseries.") … … 190 191 191 192 varNames = getfilevarnames(f) 192 193 193 194 194 195 if man then 195 196 print(" ") … … 205 206 nvars = dimsizes(vars) 206 207 end if; man 207 208 208 209 if (nofiles .eq. 1) then 209 210 if man then … … 219 220 varString(i,n) = varNames(vars(n)) 220 221 end if; man 221 222 222 223 if alt_varnames then 223 224 varString(i,n) = varNames(vars(i,n)) 224 225 end if 225 226 226 227 if (vars3d .ne. "") then 227 228 vars3d = vars3d + ":" + varString(i,n) … … 234 235 dimNames(i,n,:) = getfilevardims(f, varString(i,n)) 235 236 236 237 237 238 238 239 time = f->$dimNames(i,n,0)$ … … 373 374 end if 374 375 375 376 376 377 377 378 ;******************************************************************************* … … 437 438 438 439 delete(f) 439 440 440 441 do i=0,nofiles-1 441 442 … … 447 448 print(" ") 448 449 file_in(i) = files_avail(toint(systemfunc("read file; echo $file"))) 449 450 450 451 end do 451 452 … … 489 490 end do 490 491 end if 491 492 493 492 493 494 494 495 t_end = dimsizes(time)-1 495 496 496 497 497 498 498 499 end if 499 500 … … 539 540 dims2d = getfilevardimsizes(f,varString2d(n)) 540 541 dimNames2d(n,:) = getfilevardims(f,varString2d(n)) 541 542 542 543 543 544 end do … … 556 557 end do 557 558 end do 558 delete(varNames2d) 559 delete(varNames2d) 559 560 end if 560 561
Note: See TracChangeset
for help on using the changeset viewer.