Changeset 175 for palm/trunk/SCRIPTS/NCL/cross_sections.ncl
- Timestamp:
- Jul 8, 2008 8:29:06 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/NCL/cross_sections.ncl
r174 r175 11 11 ; *************************************************** 12 12 13 if (isfilepresent(" .ncl_preferences")) then14 parameter = asciiread(" .ncl_preferences",77,"string")13 if (isfilepresent("~/.ncl_preferences")) then 14 parameter = asciiread("~/.ncl_preferences",129,"string") 15 15 delete(parameter@_FillValue) 16 16 else 17 print(" ") 18 print("'.ncl_preferences' is not existent") 19 print(" ") 20 exit 17 if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then 18 parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string") 19 delete(parameter@_FillValue) 20 else 21 print(" ") 22 print("'.ncl_preferences' is not present in '~/palm/current_version/trunk/SRIPTS/NCL/'") 23 print(" ") 24 exit 25 end if 21 26 end if 22 27 … … 25 30 ; *************************************************** 26 31 27 if ( .not. isvar("file_ in") ) then ; path+name of input file28 if (parameter(7) .EQ. " input file") then29 print(" ") 30 print("Please provide input file 'file_in =' either in prompt or parameter_list")32 if ( .not. isvar("file_1") ) then 33 if (parameter(7) .EQ. "File in") then 34 print(" ") 35 print("Please provide 1st input file 'file_1=' either in prompt or parameter_list") 31 36 print(" ") 32 37 exit 33 38 else 34 39 file_in = parameter(7) 35 end if 36 end if 37 if ( .not. isvar("format_out") ) then ; format of output file 40 end if 41 else 42 file_in = file_1 43 end if 44 if (.not. isfilepresent(file_in)) then 45 print(" ") 46 print("Your 1st input file: '"+file_in+"' does not exist") 47 print(" ") 48 exit 49 end if 50 51 if ( .not. isvar("format_out") ) then 38 52 format_out = "x11" 39 53 if (parameter(9) .NE. "x11") then 40 54 format_out = parameter(9) 55 if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then 56 print(" ") 57 print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") 58 print(" ") 59 end if 41 60 end if 42 end if 43 if ( .not. isvar("file_out") ) then ; path+name of output file 61 else 62 if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then 63 print(" ") 64 print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") 65 print(" ") 66 end if 67 end if 68 69 if ( .not. isvar("file_out") ) then 44 70 file_out = "test" 45 71 if (parameter(11) .NE. "test") then … … 47 73 end if 48 74 end if 49 if ( .not. isvar("no_columns") ) then ; number of plots in one row75 if ( .not. isvar("no_columns") ) then 50 76 no_columns = 1 51 77 if (parameter(17) .NE. "1") then … … 53 79 end if 54 80 end if 55 if ( .not. isvar("no_lines") ) then ; number of plot-lines on one sheet81 if ( .not. isvar("no_lines") ) then 56 82 no_lines = 2 57 83 if (parameter(19) .NE. "2") then … … 59 85 end if 60 86 end if 61 if ( .not. isvar("sort") ) then ; sort of plots 62 sort = "time" 63 if (parameter(51) .NE. "time") then 87 88 if ( .not. isvar("sort") ) then 89 sort = "layer" 90 if (parameter(51) .NE. "layer") then 64 91 sort = parameter(51) 92 if (sort .NE. "time") then 93 print(" ") 94 print("Your 'sort'= "+sort+" is invalid and set to 'layer'") 95 print(" ") 96 sort = "layer" 97 end if 98 end if 99 else 100 if (sort .NE. "time" .OR. sort .NE. "layer")then 101 print(" ") 102 print("Your 'sort'= "+sort+" is invalid and set to 'layer'") 103 print(" ") 104 sort = "layer" 65 105 end if 66 106 end if 67 if ( .not. isvar("mode") ) then ; pattern of contour plots 107 108 if ( .not. isvar("mode") ) then 68 109 mode = "Fill" 69 110 if (parameter(49) .NE. "Fill") then 70 111 mode = parameter(49) 71 end if 72 end if 73 if ( .not. isvar("fill_mode") ) then ; pattern of filling 112 if (mode .NE. "Line" .AND. mode .NE. "Both")then 113 print(" ") 114 print("Your 'mode'= "+mode+" is invalid and set to 'Fill'") 115 print(" ") 116 mode = "Fill" 117 end if 118 end if 119 else 120 if (mode .NE. "Line" .AND. mode .NE. "Both")then 121 print(" ") 122 print("Your 'mode'= "+mode+" is invalid and set to 'Fill'") 123 print(" ") 124 mode = "Fill" 125 end if 126 end if 127 128 if ( .not. isvar("fill_mode") ) then 74 129 fill_mode = "AreaFill" 75 130 if (parameter(53) .NE. "AreaFill") then 76 mode = parameter(53) 131 fill_mode = parameter(53) 132 if (fill_mode .NE. "RasterFill" .AND. fill_mode .NE. "CellFill")then 133 print(" ") 134 print("Your 'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'") 135 print(" ") 136 fill_mode = "AreaFill" 137 end if 77 138 end if 78 end if 79 if ( .not. isvar("shape") ) then ; keeping of aspect ratio 139 else 140 if (fill_mode .NE. "RasterFill" .AND. fill_mode .NE. "CellFill")then 141 print(" ") 142 print("Your 'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'") 143 print(" ") 144 fill_mode = "AreaFill" 145 end if 146 end if 147 148 if ( .not. isvar("shape") ) then 80 149 shape = 1 81 150 if (parameter(55) .NE. "1") then 82 151 shape = stringtointeger(parameter(55)) 83 if (s tringtointeger(parameter(55)).NE. 0) then84 print(" ") 85 print(" Please set 'shape' to 0 or1")86 print(" ") 87 exit152 if (shape .NE. 0) then 153 print(" ") 154 print("Your 'shape'= "+shape+" is invalid and set to 1") 155 print(" ") 156 shape = 1 88 157 end if 89 end if 90 end if 91 if ( .not. isvar("var") ) then ; set output of all variables 158 end if 159 else 160 if (shape .NE. 0) then 161 print(" ") 162 print("Your 'shape'= "+shape+" is invalid and set to 1") 163 print(" ") 164 shape = 1 165 end if 166 end if 167 168 if ( .not. isvar("var") ) then 92 169 check = True 93 170 end if 94 171 95 if ( .not. isvar("xyc") ) then ; turn xy cross-section on or off172 if ( .not. isvar("xyc") ) then 96 173 xyc = 0 97 174 if (parameter(57) .NE. "0") then 98 175 xyc = stringtointeger(parameter(57)) 99 if ( stringtointeger(parameter(57)).NE. 1) then100 print(" ") 101 print(" Please set 'xyc' to 0 or 1")102 print(" ") 103 exit176 if (xyc .NE. 1) then 177 print(" ") 178 print("Your 'xyc'= "+xyc+" is invalid and set to 0") 179 print(" ") 180 xyc = 0 104 181 end if 105 182 end if 183 else 184 if (xyc .NE. 1) then 185 print(" ") 186 print("Your 'xyc'= "+xyc+" is invalid and set to 0") 187 print(" ") 188 xyc = 0 189 end if 106 190 end if 107 if ( .not. isvar("xzc") ) then ; turn xz cross-section on or off191 if ( .not. isvar("xzc") ) then 108 192 xzc = 0 109 193 if (parameter(59) .NE. "0") then 110 194 xzc = stringtointeger(parameter(59)) 111 if ( stringtointeger(parameter(59)).NE. 1) then112 print(" ") 113 print(" Please set 'xzc' to 0 or 1")114 print(" ") 115 exit195 if (xzc .NE. 1) then 196 print(" ") 197 print("Your 'xzc'= "+xzc+" is invalid and set to 0") 198 print(" ") 199 xzc = 0 116 200 end if 117 201 end if 118 end if 119 if ( .not. isvar("yzc") ) then ; turn yz cross-section on or off 202 else 203 if (xzc .NE. 1) then 204 print(" ") 205 print("Your 'xzc'= "+xzc+" is invalid and set to 0") 206 print(" ") 207 xzc = 0 208 end if 209 end if 210 if ( .not. isvar("yzc") ) then 120 211 yzc = 0 121 212 if (parameter(61) .NE. "0") then 122 213 yzc = stringtointeger(parameter(61)) 123 if ( stringtointeger(parameter(61)).NE. 1) then124 print(" ") 125 print(" Please set 'yzc' to 0 or 1")126 print(" ") 127 exit214 if (yzc .NE. 1) then 215 print(" ") 216 print("Your 'yzc'= "+yzc+" is invalid and set to 0") 217 print(" ") 218 yzc = 0 128 219 end if 129 220 end if 221 else 222 if (yzc .NE. 1) then 223 print(" ") 224 print("Your 'yzc'= "+yzc+" is invalid and set to 0") 225 print(" ") 226 yzc = 0 227 end if 130 228 end if 131 229 … … 160 258 end if 161 259 end if 162 if ( .not. isvar("vector") ) then ; sort of plots260 if ( .not. isvar("vector") ) then 163 261 vector = 0 164 262 if (parameter(39) .NE. "0") then … … 172 270 end if 173 271 end if 174 if ( .not. isvar("ref_mag") ) then ; sort of plots272 if ( .not. isvar("ref_mag") ) then 175 273 ref_mag = 0.05 176 274 if (parameter(47) .NE. "0.05") then … … 272 370 cs_res@gsnYAxisIrregular2Linear = True 273 371 274 if( shape .eq. 1 ) then ; keep the shape372 if( shape .eq. 1 ) then 275 373 cs_res@gsnShape = True 276 374 end if … … 296 394 cs_resP = True 297 395 cs_resP@txString = f@title 298 cs_resP@txFuncCode = "~" ; necessary for title396 cs_resP@txFuncCode = "~" 299 397 cs_resP@txFontHeightF = .02 300 398 … … 304 402 cs_res@gsnSpreadColors = True 305 403 cs_res@cnFillMode = fill_mode 306 cs_res@lbOrientation = "Vertical" ; vertical label bar404 cs_res@lbOrientation = "Vertical" 307 405 cs_res@cnLinesOn = False 308 406 cs_res@cnLineLabelsOn = False … … 313 411 cs_res@gsnSpreadColors = True 314 412 cs_res@cnFillMode = fill_mode 315 cs_res@lbOrientation = "Vertical" ; vertical label bar413 cs_res@lbOrientation = "Vertical" 316 414 cs_res@cnLinesOn = True 317 415 cs_res@cnLineLabelsOn = True … … 450 548 451 549 print(" ") 452 print("Output from "+t_all(start_time_step)/3600+"h = "+t_all(start_time_step)+"s => index = "+start_time_step)453 print(" till "+t_all(end_time_step)/3600+"h = "+t_all(end_time_step)+"s => index = "+end_time_step)550 print("Output of time steps from "+t_all(start_time_step)/3600+" h = "+t_all(start_time_step)+" s => index = "+start_time_step) 551 print(" till "+t_all(end_time_step)/3600+" h = "+t_all(end_time_step)+" s => index = "+end_time_step) 454 552 print(" ") 455 553 … … 735 833 end if 736 834 737 if ( .not. isvar("zs") ) then ; start of z-coordinate range835 if ( .not. isvar("zs") ) then 738 836 zs = 0 739 837 if (parameter(71) .NE. "z0") then … … 1283 1381 end do 1284 1382 1285 if (n o_var.EQ. 0) then1383 if (n .EQ. 0) then 1286 1384 print(" ") 1287 print("Please select a variable 'var=' or use the default value") 1288 print(" ") 1289 print("Your selection '"+var+"' does not exist on the input file") 1385 print("The variables 'var=°"+var+"°' do not exist on your input file") 1290 1386 print(" ") 1291 1387 exit
Note: See TracChangeset
for help on using the changeset viewer.