- Timestamp:
- Aug 16, 2008 12:18:08 PM (16 years ago)
- Location:
- palm/trunk/SCRIPTS/NCL
- Files:
-
- 1 added
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/NCL/cross_sections.ncl
r175 r190 5 5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" 6 6 7 ;*************************************************** 8 ; load ncl_preferences.ncl 9 ;*************************************************** 10 11 if (isfilepresent("~/ncl_preferences.ncl")) then 12 loadscript("~/ncl_preferences.ncl") 13 else 14 if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")) then 15 loadscript( "~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl") 16 else 17 print(" ") 18 print("'ncl_preferences.ncl' does not exist in $home or $home/palm/current_version/trunk/SCRIPTS/NCL/") 19 print(" ") 20 exit 21 end if 22 end if 23 7 24 begin 8 25 9 ; *************************************************** 10 ; read parameter_list 11 ; *************************************************** 12 13 if (isfilepresent("~/.ncl_preferences")) then 14 parameter = asciiread("~/.ncl_preferences",129,"string") 15 delete(parameter@_FillValue) 16 else 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 26 if (cross_sections .NE. 1 .OR. profiles .NE. 0 .OR. timeseries .NE. 0 .OR. spectra .NE. 0)then 27 print(" ") 28 print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)") 29 print(" ") 30 print("Set 'cross_sections' equal 1 and the other variables equal 0") 31 print(" ") 32 exit 26 33 end if 27 34 … … 30 37 ; *************************************************** 31 38 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") 36 print(" ") 37 exit 38 else 39 file_in = parameter(7) 40 end if 39 if (file_1 .EQ. "File in") then 40 print(" ") 41 print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'") 42 print(" ") 43 exit 41 44 else 42 45 file_in = file_1 … … 44 47 if (.not. isfilepresent(file_in)) then 45 48 print(" ") 46 print(" Your1st input file: '"+file_in+"' does not exist")49 print("1st input file: '"+file_in+"' does not exist") 47 50 print(" ") 48 51 exit 49 52 end if 50 53 51 if ( .not. isvar("format_out") ) then 52 format_out = "x11" 53 if (parameter(9) .NE. "x11") then 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 60 end if 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 70 file_out = "test" 71 if (parameter(11) .NE. "test") then 72 file_out = parameter(11) 73 end if 74 end if 75 if ( .not. isvar("no_columns") ) then 76 no_columns = 1 77 if (parameter(17) .NE. "1") then 78 no_columns = stringtointeger(parameter(17)) 79 end if 80 end if 81 if ( .not. isvar("no_lines") ) then 82 no_lines = 2 83 if (parameter(19) .NE. "2") then 84 no_lines = stringtointeger(parameter(19)) 85 end if 54 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 55 print(" ") 56 print("'format_out = "+format_out+"' is invalid and set to'x11'") 57 print(" ") 58 format_out="x11" 59 end if 60 61 if (sort .NE. "layer" .AND. sort .NE. "time") then 62 print(" ") 63 print("'sort'= "+sort+" is invalid and set to 'layer'") 64 print(" ") 65 sort = "layer" 66 end if 67 68 if (mode .NE. "Fill" .AND. mode .NE. "Line" .AND. mode .NE. "Both") then 69 print(" ") 70 print("'mode'= "+mode+" is invalid and set to 'Fill'") 71 print(" ") 72 mode = "Fill" 73 end if 74 75 if (fill_mode .NE. "AreaFill" .AND. fill_mode .NE. "RasterFill" .AND. fill_mode .NE. "CellFill") then 76 print(" ") 77 print("Your 'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'") 78 print(" ") 79 fill_mode = "AreaFill" 80 end if 81 82 if (shape .NE. 0 .AND. shape .NE. 1) then 83 print(" ") 84 print("'shape'= "+shape+" is invalid and set to 1") 85 print(" ") 86 shape = 1 86 87 end if 87 88 if ( .not. isvar("sort") ) then 89 sort = "layer" 90 if (parameter(51) .NE. "layer") then 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" 105 end if 106 end if 107 108 if ( .not. isvar("mode") ) then 109 mode = "Fill" 110 if (parameter(49) .NE. "Fill") then 111 mode = parameter(49) 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 129 fill_mode = "AreaFill" 130 if (parameter(53) .NE. "AreaFill") then 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 138 end if 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 149 shape = 1 150 if (parameter(55) .NE. "1") then 151 shape = stringtointeger(parameter(55)) 152 if (shape .NE. 0) then 153 print(" ") 154 print("Your 'shape'= "+shape+" is invalid and set to 1") 155 print(" ") 156 shape = 1 157 end if 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 169 check = True 170 end if 171 172 if ( .not. isvar("xyc") ) then 173 xyc = 0 174 if (parameter(57) .NE. "0") then 175 xyc = stringtointeger(parameter(57)) 176 if (xyc .NE. 1) then 177 print(" ") 178 print("Your 'xyc'= "+xyc+" is invalid and set to 0") 179 print(" ") 180 xyc = 0 181 end if 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 190 end if 191 if ( .not. isvar("xzc") ) then 192 xzc = 0 193 if (parameter(59) .NE. "0") then 194 xzc = stringtointeger(parameter(59)) 195 if (xzc .NE. 1) then 196 print(" ") 197 print("Your 'xzc'= "+xzc+" is invalid and set to 0") 198 print(" ") 199 xzc = 0 200 end if 201 end if 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 211 yzc = 0 212 if (parameter(61) .NE. "0") then 213 yzc = stringtointeger(parameter(61)) 214 if (yzc .NE. 1) then 215 print(" ") 216 print("Your 'yzc'= "+yzc+" is invalid and set to 0") 217 print(" ") 218 yzc = 0 219 end if 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 228 end if 229 88 89 if (xyc .NE. 0 .AND. xyc .NE. 1)then 90 print(" ") 91 print("'xyc'= "+xyc+" is invalid and set to 0") 92 print(" ") 93 xyc = 0 94 end if 95 96 if (xzc .NE. 0 .AND. xzc .NE. 1)then 97 print(" ") 98 print("'xzc'= "+xzc+" is invalid and set to 0") 99 print(" ") 100 xyc = 0 101 end if 102 103 if (yzc .NE. 0 .AND. yzc .NE. 1)then 104 print(" ") 105 print("'yzc'= "+yzc+" is invalid and set to 0") 106 print(" ") 107 xyc = 0 108 end if 109 230 110 if (xyc .EQ. 0 .AND. xzc .EQ. 0 .AND. yzc .EQ. 0) then 231 111 print(" ") … … 258 138 end if 259 139 end if 260 if ( .not. isvar("vector") ) then 261 vector = 0 262 if (parameter(39) .NE. "0") then 263 vector = stringtointeger(parameter(39)) 264 if (stringtointeger(parameter(39)) .NE. 1) then 265 print(" ") 266 print("Please set 'vector' to 0 or 1") 267 print(" ") 268 exit 269 end if 270 end if 271 end if 272 if ( .not. isvar("ref_mag") ) then 273 ref_mag = 0.05 274 if (parameter(47) .NE. "0.05") then 275 ref_mag = stringtofloat(parameter(47)) 276 end if 277 end if 278 140 141 if (vector .NE. 0 .AND. vector .NE. 1) then 142 print(" ") 143 print("Please set 'vector' to 0 or 1") 144 print(" ") 145 exit 146 end if 147 279 148 ; *************************************************** 280 149 ; open input file … … 285 154 vNam = getfilevarnames(f) 286 155 print(" ") 287 print("Variable on netCDF file: " + vNam) 156 print("Variables in input file:") 157 print("- "+ vNam) 288 158 print(" ") 289 159 dim = dimsizes(vNam) … … 369 239 cs_res = True 370 240 cs_res@gsnYAxisIrregular2Linear = True 371 372 if( shape .eq. 1 ) then373 cs_res@gsnShape = True374 end if375 241 376 242 cs_res@gsnDraw = False … … 381 247 cs_res@gsnPaperHeight = 11.69 382 248 cs_res@gsnPaperMargin = 0.79 383 cs_res@tmXBLabelFontHeightF = .0 2384 cs_res@tmYLLabelFontHeightF = .0 2385 cs_res@tiXAxisFontHeightF = .0 2386 cs_res@tiYAxisFontHeightF = .0 2249 cs_res@tmXBLabelFontHeightF = .03 250 cs_res@tmYLLabelFontHeightF = .03 251 cs_res@tiXAxisFontHeightF = .03 252 cs_res@tiYAxisFontHeightF = .03 387 253 cs_res@tmXBMode ="Automatic" 388 254 cs_res@tmYLMode ="Automatic" 389 cs_res@lgTitleFontHeightF = .0 2390 cs_res@lgLabelFontHeightF = .0 2391 cs_res@txFontHeightF = .0 2255 cs_res@lgTitleFontHeightF = .03 256 cs_res@lgLabelFontHeightF = .03 257 cs_res@txFontHeightF = .03 392 258 cs_res@cnLevelSelectionMode = "ManualLevels" 393 259 … … 428 294 ; **************************************************** 429 295 430 if ( .not. isvar("start_time_step") ) then 431 start_time_step=t_all(0)/3600 432 if (parameter(13) .NE. "t(0)") then 433 if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600) 434 print(" ") 435 print("'start_time_step' = "+ parameter(13) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") 436 print(" ") 437 print("Please select another 'start_time_step'") 438 print(" ") 439 exit 440 end if 441 if (stringtofloat(parameter(13)) .LT. t_all(0)/3600) 442 print(" ") 443 print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") 444 print(" ") 445 print("Please select another 'start_time_step'") 446 print(" ") 447 exit 448 end if 449 start_time_step=stringtodouble(parameter(13)) 450 end if 296 if (start_time_step .EQ. -1.) then 297 start_time_step=t_all(0)/3600 451 298 else 452 299 if (start_time_step .GT. t_all(nt-1)/3600) … … 467 314 end if 468 315 end if 469 start_time_step = start_time_step*3600470 316 do i=0,nt-1 471 if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then317 if (start_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. start_time_step .LT. (t_all(i)+delta_t/2)/3600)then 472 318 st=i 473 319 break 474 320 end if 475 321 end do 322 323 if (.not. isvar("st"))then 324 print(" ") 325 print("'start_time_step' = "+ start_time_step +"h is invalid") 326 print(" ") 327 print("Please select another 'start_time_step'") 328 print(" ") 329 exit 330 end if 476 331 477 332 ; **************************************************** … … 479 334 ; **************************************************** 480 335 481 if ( .not. isvar("end_time_step") ) then 482 end_time_step = t_all(nt-1)/3600 483 if (parameter(15) .NE. "t(end)") then 484 if (stringtodouble(parameter(15)) .LT. t_all(0)/3600) 485 print(" ") 486 print("'end_time_step' = "+parameter(15)+ "h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") 487 print(" ") 488 print("Please select another 'end_time_step'") 489 print(" ") 490 exit 491 end if 492 if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600) 493 print(" ") 494 print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") 495 print(" ") 496 print("Please select another 'end_time_step'") 497 print(" ") 498 exit 499 end if 500 if (stringtodouble(parameter(15)) .LT. start_time_step/3600) 501 print(" ") 502 print("'end_time_step' = "+ parameter(15) +"h is lower than 'start_time_step' = "+parameter(13)+"h") 503 print(" ") 504 print("Please select another 'start_time_step' or 'end_time_step'") 505 print(" ") 506 exit 507 end if 508 end_time_step = stringtodouble(parameter(15)) 509 end if 510 else 336 if (end_time_step .EQ. -1.) then 337 end_time_step = t_all(nt-1)/3600 338 else 511 339 if (end_time_step .LT. t_all(0)/3600) 512 340 print(" ") … … 534 362 end if 535 363 end if 536 end_time_step = end_time_step*3600537 364 do i=0,nt-1 538 if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then365 if (end_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. end_time_step .LT. (t_all(i)+delta_t/2)/3600)then 539 366 et=i 540 367 break 541 368 end if 542 369 end do 370 371 if (.not. isvar("et"))then 372 print(" ") 373 print("'end_time_step' = "+ end_time_step +"h is invalid") 374 print(" ") 375 print("Please select another 'end_time_step'") 376 print(" ") 377 exit 378 end if 543 379 544 380 delete(start_time_step) … … 559 395 560 396 if (vector .EQ. 1) then 561 if ( .not. isvar("plotvec") ) then 562 plotvec = parameter(45) 563 end if 564 if ( .not. isvar("vec1") ) then 565 vec1 = parameter(41) 566 if (parameter(41) .EQ. "vec1") then 567 print(" ") 568 print("Please indicate Vector 1 ('vec1') for Vector-Plot") 569 print(" ") 570 exit 571 end if 572 end if 573 if ( .not. isvar("vec2") ) then 574 vec2 = parameter(43) 575 if (parameter(43) .EQ. "vec2") then 576 print(" ") 577 print("Please indicate Vector 2 ('vec2') for Vector-Plot") 578 print(" ") 579 exit 580 end if 581 end if 397 if (vec1 .EQ. "component1") then 398 print(" ") 399 print("Please indicate Vector 1 ('vec1') for Vector-Plot or set 'vector' to 0") 400 print(" ") 401 exit 402 end if 403 if (vec2 .EQ. "component2") then 404 print(" ") 405 print("Please indicate Vector 2 ('vec2') for Vector-Plot or set 'vector' to 0") 406 print(" ") 407 exit 408 end if 582 409 end if 583 410 … … 592 419 if (xyc .EQ. 1) then 593 420 do varn=0,dim-1 594 if (vNam(varn) .eq. "xu" 421 if (vNam(varn) .eq. "xu" .OR. vNam(varn) .eq. "x")then 595 422 x_d = f->$vNam(varn)$ 596 423 xdim = dimsizes(x_d)-1 … … 703 530 ; **************************************************** 704 531 705 if ( .not. isvar("xs") ) then 706 xs = 0.0d 707 xstart = 0 708 if (parameter(63) .NE. "x0") then 709 if (delta_x .EQ. -1) then 710 print(" ") 711 print("You cannot choose a start value for x, there are preseted layers for x") 712 print(" ") 713 xstart=0 714 else 715 if (stringtodouble(parameter(63)) .LT. 0-delta_x/2) then 716 print(" ") 717 print("range start for x-coordinate = "+parameter(63)+"m is lower than first value x = "+0+"m or xu = "+(0-delta_x/2)+"m") 718 print(" ") 719 exit 720 end if 721 if (xyc .EQ. 1 .OR. xzc .EQ. 1) then 722 if (stringtodouble(parameter(63)) .GE. xdim*delta_x) then 723 print(" ") 724 print("range start for x-coordinate = "+parameter(63)+"m is equal or greater than last value = "+xdim*delta_x+"m") 725 print(" ") 726 exit 727 end if 728 else 729 if (stringtodouble(parameter(63)) .GT. xdim*delta_x) then 730 print(" ") 731 print("range start for x-coordinate = "+parameter(63)+"m is greater than last value = "+xdim*delta_x+"m") 732 print(" ") 733 exit 734 end if 735 end if 736 xs = stringtodouble(parameter(63)) 737 end if 738 end if 739 else 532 if (xs .EQ. -1.d) then 533 xs = x_d(0) 534 else 740 535 if (delta_x .EQ. -1) then 741 536 print(" ") … … 768 563 end if 769 564 770 if ( .not. isvar("ys") ) then 771 ys = 0.0d 772 ystart = 0 773 if (parameter(67) .NE. "y0") then 774 if (delta_y .EQ. -1) then 775 print(" ") 776 print("You cannot choose a start value for y, there are preseted layers for y") 777 print(" ") 778 ystart=0 779 else 780 if (stringtodouble(parameter(67)) .LT. 0-delta_y/2) then 781 print(" ") 782 print("range start for y-coordinate = "+parameter(67)+"m is lower than first value = "+0-delta_y/2+"m") 783 print(" ") 784 exit 785 end if 786 if (xyc .EQ. 1 .OR. yzc .EQ. 1) then 787 if (stringtodouble(parameter(67)) .GE. ydim*delta_y) then 788 print(" ") 789 print("range start for y-coordinate = "+parameter(67)+"m is equal or greater than last value = "+ydim*delta_y+"m") 790 print(" ") 791 exit 792 end if 793 else 794 if (stringtodouble(parameter(67)) .GT. ydim*delta_y) then 795 print(" ") 796 print("range start for y-coordinate = "+parameter(67)+"m is greater than last value = "+ydim*delta_y+"m") 797 print(" ") 798 exit 799 end if 800 end if 801 ys = stringtodouble(parameter(67)) 802 end if 803 end if 565 if (ys .EQ. -1.d) then 566 ys = y_d(0) 804 567 else 805 568 if (delta_y .EQ. -1) then … … 833 596 end if 834 597 835 if ( .not. isvar("zs")) then598 if (zs .EQ. -1) then 836 599 zs = 0 837 if (parameter(71) .NE. "z0") then838 if (delta_z .EQ. -1) then839 print(" ")840 print("You cannot choose a start value for z, there are preseted layers for z")841 print(" ")842 else843 print(" ")844 print("Please mind to indicate start and end ranges for the z-coordinate in")845 print("indices not in 'meters'. Corresponding index and meter:")846 print(" ")847 print(" = "+z_d+" m")848 print(" ")849 if (stringtointeger(parameter(71)) .LT. 0) then850 print(" ")851 print("range start for z-coordinate = "+parameter(71)+" is lower than first gridpoint = 0")852 print(" ")853 exit854 end if855 if (xzc .EQ. 1 .OR. yzc .EQ. 1) then856 if (stringtointeger(parameter(71)) .GE. zdim) then857 print(" ")858 print("range start for z-coordinate = "+parameter(71)+" is equal or greater than last gridpoint = "+zdim)859 print(" ")860 exit861 end if862 else863 if (stringtodouble(parameter(71)) .GT. zdim) then864 print(" ")865 print("range start for z-coordinate = "+parameter(71)+" is greater than last gridpoint = "+zdim)866 print(" ")867 exit868 end if869 end if870 zs = stringtointeger(parameter(71))871 end if872 end if873 600 else 874 601 if (delta_z .EQ. -1) then … … 901 628 end if 902 629 903 if ( .not. isvar("xe")) then 904 xe = xdim*delta_x 905 xend = xdim 906 if (parameter(65) .NE. "xdim") then 907 if (delta_x .EQ. -1) then 908 print(" ") 909 print("You cannot choose an end value for x, there are preseted layers for x") 910 print(" ") 911 xend=xdim 912 else 913 if (stringtodouble(parameter(65)) .GT. xdim*delta_x) then 914 print(" ") 915 print("range end for x-coordinate = "+parameter(65)+"m is greater than last value = "+xdim*delta_x+"m") 916 print(" ") 917 exit 918 end if 919 if (xyc .EQ. 1 .OR. xzc .EQ. 1) then 920 if (stringtodouble(parameter(65)) .LE. 0-delta_x/2) 921 print(" ") 922 print("range end for x-coordinate = "+parameter(65)+"m is equal or lower than first value = "+(0-delta_x/2)+"m") 923 print(" ") 924 exit 925 end if 926 if (stringtodouble(parameter(65)) .LE. xs) then 927 print(" ") 928 print("range end for x-coordinate = "+parameter(65)+"m is equal or lower than start range = "+xs+"m") 929 print(" ") 930 exit 931 end if 932 else 933 if (stringtodouble(parameter(65)) .LT. 0-delta_x/2) 934 print(" ") 935 print("range end for x-coordinate = "+parameter(65)+"m is lower than first value = "+(0-delta_x/2)+"m") 936 print(" ") 937 exit 938 end if 939 if (stringtodouble(parameter(65)) .LT. xs) then 940 print(" ") 941 print("range end for x-coordinate = "+parameter(65)+"m is lower than start range = "+xs+"m") 942 print(" ") 943 exit 944 end if 945 end if 946 xe = stringtodouble(parameter(65)) 947 end if 948 end if 630 if (xe .EQ. -1) then 631 xe = x_d(xdim) 949 632 else 950 633 if (delta_x .EQ. -1) then … … 973 656 exit 974 657 end if 975 if ( stringtodouble(xe .EQ. xs+1)) then658 if (xe .EQ. xs+1) then 976 659 print(" ") 977 660 print("range end for x-coordinate = "+xe+"m must be at least two more gridpoints greater than start range = "+xs+"m") … … 995 678 end if 996 679 end if 997 998 if ( .not. isvar("ye")) then 999 ye = ydim*delta_y 1000 yend = ydim 1001 if (parameter(69) .NE. "ydim") then 1002 if (delta_y .EQ. -1) then 1003 print(" ") 1004 print("You cannot choose an end value for y, there are preseted layers for y") 1005 print(" ") 1006 yend=ydim 1007 else 1008 if (stringtodouble(parameter(69)) .GT. ydim*delta_y) then 1009 print(" ") 1010 print("range end for y-coordinate = "+parameter(69)+"m is greater than last value = "+ydim*delta_y+"m") 1011 print(" ") 1012 exit 1013 end if 1014 if (xyc .EQ. 1 .OR. yzc .EQ. 1) then 1015 if (stringtodouble(parameter(69)) .LE. 0-delta_y/2) 1016 print(" ") 1017 print("range end for y-coordinate = "+parameter(69)+"m is equal or lower than first value = "+(0-delta_y/2)+"m") 1018 print(" ") 1019 exit 1020 end if 1021 if (stringtodouble(parameter(69)) .LE. ys) then 1022 print(" ") 1023 print("range end for y-coordinate = "+parameter(69)+"m is equal or lower than start range = "+ys+"m") 1024 print(" ") 1025 exit 1026 end if 1027 if (stringtodouble(parameter(69)) .EQ. ys+1) then 1028 print(" ") 1029 print("range end for y-coordinate = "+parameter(69)+"m must be at least two more gridpoints greater than start range = "+ys+"m") 1030 print(" ") 1031 exit 1032 end if 1033 else 1034 if (stringtodouble(parameter(69)) .LT. 0-delta_y/2) 1035 print(" ") 1036 print("range end for y-coordinate = "+parameter(69)+"m is lower than first value = "+(0-delta_y/2)+"m") 1037 print(" ") 1038 exit 1039 end if 1040 if (stringtodouble(parameter(69)) .LT. ys) then 1041 print(" ") 1042 print("range end for y-coordinate = "+parameter(69)+"m is lower than start range = "+ys+"m") 1043 print(" ") 1044 exit 1045 end if 1046 end if 1047 ye = stringtodouble(parameter(69)) 1048 end if 1049 end if 680 681 if (ye .EQ. -1) then 682 ye = y_d(ydim) 1050 683 else 1051 684 if (delta_y .EQ. -1) then … … 1097 730 end if 1098 731 1099 if ( .not. isvar("ze")) then732 if (ze .EQ. -1) then 1100 733 ze = zdim 1101 if (parameter(73) .NE. "zdim") then1102 if (delta_z .EQ. -1) then1103 print(" ")1104 print("You cannot choose an end value for z, there are preseted layers for z")1105 print(" ")1106 else1107 if (stringtointeger(parameter(73)) .GT. zdim) then1108 print(" ")1109 print("range end for z-coordinate = "+parameter(73)+" is greater than last gridpoint = "+zdim)1110 print(" ")1111 exit1112 end if1113 if (xzc .EQ. 1 .OR. yzc .EQ. 1) then1114 if (stringtointeger(parameter(73)) .LE. 0)1115 print(" ")1116 print("range end for z-coordinate = "+parameter(73)+" is equal or lower than first gridpoint = 0")1117 print(" ")1118 exit1119 end if1120 if (stringtointeger(parameter(73)) .LE. zs) then1121 print(" ")1122 print("range end for z-coordinate = "+parameter(73)+" is equal or lower than start range = "+zs)1123 print(" ")1124 exit1125 end if1126 if (stringtodouble(parameter(73)) .EQ. zs+1) then1127 print(" ")1128 print("range end for z-coordinate = "+parameter(73)+" must be at least two more gridpoints greater than start range = "+zs)1129 print(" ")1130 exit1131 end if1132 else1133 if (stringtointeger(parameter(73)) .LT. 0)1134 print(" ")1135 print("range end for z-coordinate = "+parameter(73)+" is lower than first gridpoint = 0")1136 print(" ")1137 exit1138 end if1139 if (stringtointeger(parameter(73)) .LT. zs) then1140 print(" ")1141 print("range end for z-coordinate = "+parameter(73)+" is lower than start range = "+zs)1142 print(" ")1143 exit1144 end if1145 end if1146 ze = stringtointeger(parameter(73))1147 end if1148 end if1149 734 else 1150 735 if (delta_z .EQ. -1) then … … 1211 796 end if 1212 797 if (delta_y .NE. -1) then 1213 do i=0, xdim798 do i=0,ydim 1214 799 if (ys .GT. y_d(i)-delta_y/2 .AND. ys .LE. y_d(i)+delta_y/2)then 1215 800 ystart=i … … 1217 802 end if 1218 803 end do 1219 do i=0, xdim804 do i=0,ydim 1220 805 if (ye .GT. y_d(i)-delta_y/2 .AND. ye .LE. y_d(i)+delta_y/2)then 1221 806 yend=i … … 1223 808 end if 1224 809 end do 810 end if 811 812 if( shape .eq. 1 ) then 813 cs_res@vpWidthF = (xe-xs)/(ye-ys) 814 cs_res@vpHeightF = 1 1225 815 end if 1226 816 … … 1238 828 if (xe .EQ. xs+1) then 1239 829 print(" ") 1240 print("range end for x-coordinate="+ parameter(65)+"m(=>value on file="+xe*delta_x+"m) must be at least two")1241 print("more gridpoints(="+2*delta_x+"m) greater than start range="+ parameter(63)+"m(=>value on file="+xs*delta_x+"m)")830 print("range end for x-coordinate="+xe*delta_x+"m) must be at least two") 831 print("more gridpoints(="+2*delta_x+"m) greater than start range="+xs*delta_x+"m)") 1242 832 print(" ") 1243 833 exit … … 1247 837 if (ye .EQ. ys+1) then 1248 838 print(" ") 1249 print("range end for y-coordinate="+ parameter(69)+"m(=>value on file="+ye*delta_y+"m) must be at least two")1250 print("more gridpoints(="+2*delta_y+"m) greater than start range="+ parameter(67)+"m(=>value on file="+ys*delta_y+"m)")839 print("range end for y-coordinate="+ye*delta_y+"m) must be at least two") 840 print("more gridpoints(="+2*delta_y+"m) greater than start range="+ys*delta_y+"m)") 1251 841 print(" ") 1252 842 exit … … 1256 846 if (ze .EQ. zs+1) then 1257 847 print(" ") 1258 print("range end for x-coordinate="+ parameter(73)+"(=> value on file="+ze+") must be at least two")1259 print("more gridpoints greater than start range="+ parameter(71)+"(=>value on file="+zs+")")848 print("range end for x-coordinate="+ze+") must be at least two") 849 print("more gridpoints greater than start range="+zs+")") 1260 850 print(" ") 1261 851 exit … … 1265 855 if (xyc .EQ. 1) then 1266 856 no_layer = (ze-zs)+1 1267 data = new((/dim,nt, zdim+1,(ye-ys)+1,(xe-xs)+1/),float)857 data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float) 1268 858 end if 1269 859 if (xzc .EQ. 1) then 1270 860 no_layer = (ye-ys)+1 1271 data = new((/dim,nt,(ze-zs)+1, ydim+1,(xe-xs)+1/),float)861 data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float) 1272 862 end if 1273 863 if (yzc .EQ. 1) then 1274 864 no_layer = (xe-xs)+1 1275 data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1, xdim+1/),float)865 data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float) 1276 866 end if 1277 867 … … 1299 889 lis = start_time_step 1300 890 lie = end_time_step 1301 los = lays1302 loe = laye 891 los = 0 892 loe = laye-lays 1303 893 else 1304 lis = lays1305 lie = laye 894 lis = 0 895 lie = laye-lays 1306 896 los = start_time_step 1307 897 loe = end_time_step … … 1314 904 n=0 1315 905 1316 do varn=dim-1,0,1 1317 1318 data_all = f->$vNam(varn)$ 906 do varn=dim-1,0,1 1319 907 1320 908 if (vector .EQ. 1) then … … 1328 916 check = True 1329 917 end if 1330 if ( isvar("var") ) then 1331 check = isStrSubset( var,","+vNam(varn)+",") 1332 end if 1333 if (parameter(21) .NE. "variables") then 1334 var = parameter(21) 918 919 if (var .NE. "all") then 1335 920 check = isStrSubset( var,","+vNam(varn)+"," ) 1336 921 end if … … 1350 935 1351 936 if (xyc .EQ. 1) then 1352 data(varn,:,:,:,:)= data_all(:,:,ys:ye,xs:xe)937 data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 1353 938 end if 1354 939 if ( xzc .eq. 1 ) then 1355 data(varn,:,:,:,:)= data_all(:,zs:ze,:,xs:xe)940 data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 1356 941 end if 1357 942 if ( yzc .eq. 1) then 1358 data(varn,:,:,:,:)=data_all(:,zs:ze,ys:ye,:) 1359 end if 1360 943 data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 944 end if 1361 945 if (check_vec1) then 1362 vect1=data _all946 vect1=data(varn,:,:,:,:) 1363 947 end if 1364 948 if (check_vec2) then 1365 vect2=data _all949 vect2=data(varn,:,:,:,:) 1366 950 end if 1367 951 … … 1377 961 end if 1378 962 1379 delete(data_all)1380 1381 963 end do 1382 964 1383 if (n .EQ. 0) then 1384 print(" ") 1385 print("The variables 'var=°"+var+"°' do not exist on your input file") 965 var_input=new(no_var,string) 966 numb=0 967 do varn=dim-1,0,1 968 969 if (vector .EQ. 1) then 970 check_vec1 = isStrSubset( vec1,","+vNam(varn)+",") 971 check_vec2 = isStrSubset( vec2,","+vNam(varn)+",") 972 end if 973 974 if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "zu" .or. vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi" .or. vNam(varn) .eq. "time" .or. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d" .or. vNam(varn) .eq. "x".or. vNam(varn) .eq. "y" .or. vNam(varn) .eq. "zu_xy" .or. vNam(varn) .eq. "zw_xy" .or. vNam(varn) .eq. "zu1_xy" .or. vNam(varn) .eq. "ind_z_xy" .or. vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz" .or. vNam(varn) .eq. "ind_y_xz" .or. vNam(varn) .eq. "x_yz" .or. vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "ind_x_yz") then 975 check = False 976 else 977 check = True 978 end if 979 980 if (var .NE. "all") then 981 check = isStrSubset( var,","+vNam(varn)+"," ) 982 end if 983 984 if(check) then 985 var_input(numb)=vNam(varn) 986 numb=numb+1 987 end if 988 989 end do 990 991 if (no_var .EQ. 0) then 992 print(" ") 993 print("The variables var='"+var+"' do not exist on your input file;") 994 print("be sure to have one comma berfore and after each variable") 1386 995 print(" ") 1387 996 exit … … 1391 1000 if (v1 .EQ. 0)then 1392 1001 print(" ") 1393 print("Varible for vector-plot ('vec1') must be one of the varibles for plot ('var')") 1002 print("Component 1 for the vector-plot ('vec1') must be one of the input varibles:") 1003 print("- "+var_input) 1004 print("be sure to have one comma berfore and after the variable") 1394 1005 print(" ") 1395 1006 exit … … 1398 1009 if (v2 .EQ. 0)then 1399 1010 print(" ") 1400 print("Varible for vector-plot ('vec2') must be one of the varibles for plot ('var')") 1011 print("Component 2 for the vector-plot ('vec2') must be one of the input varibles:") 1012 print("- "+var_input) 1013 print("be sure to have one comma berfore and after the variable") 1401 1014 print(" ") 1402 1015 exit … … 1423 1036 ; *************************************************** 1424 1037 1425 if (vector .EQ. 1 .AND. p arameter(45).EQ. "plotvec") then1038 if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then 1426 1039 do lo = los, loe 1427 1040 do li = lis, lie … … 1441 1054 end do 1442 1055 end if 1443 1444 check = True1445 1056 1446 1057 do varn=dim-1,0,1 … … 1455 1066 check = True 1456 1067 end if 1457 if ( isvar("var") ) then 1458 check = isStrSubset( var,","+vNam(varn)+",") 1459 end if 1460 if (parameter(21) .NE. "variables") then 1461 var = parameter(21) 1068 1069 if (var .NE. "all") then 1462 1070 check = isStrSubset( var,","+vNam(varn)+"," ) 1463 1071 end if 1464 1072 1465 1073 if(check) then 1466 print(vNam(varn))1074 1467 1075 space=(MaxVal(varn)-MinVal(varn))/24 1468 1076 … … 1496 1104 level = "=" + data&z(lo) + "m" 1497 1105 end if 1498 cs_res@gsnCenterString = "t=" + d ata&t(li) +"s z"+level1106 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h z"+level 1499 1107 plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo,:,:),cs_res) 1500 1108 if (vector .EQ. 1 .AND. check_vecp) then … … 1514 1122 1515 1123 if ( sort .eq. "layer" ) then 1516 1124 if ( data&z(li) .eq. -1 ) then 1517 1125 level = "-average" 1518 1126 else 1519 1127 level = "=" + data&z(li) + "m" 1520 end if 1521 cs_res@gsnCenterString = "t=" + d ata&t(lo) + "s z"+ level1128 end if 1129 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h z"+ level 1522 1130 plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li,:,:),cs_res) 1523 1131 if (vector .EQ. 1 .AND. check_vecp) then … … 1548 1156 1549 1157 if ( sort .eq. "time" ) then 1550 if ( data& z(lo) .eq. -1 ) then1158 if ( data&y(lo) .eq. -1 ) then 1551 1159 level = "-average" 1552 1160 else 1553 1161 level = "=" + data&y(lo) + "m" 1554 1162 end if 1555 cs_res@gsnCenterString = "t=" + d ata&t(li) + "s y"+ level1163 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "s y"+ level 1556 1164 plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res) 1557 1165 if (vector .EQ. 1 .AND. check_vecp) then … … 1571 1179 1572 1180 if ( sort .eq. "layer" ) then 1573 if ( data& z(li) .eq. -1 ) then1181 if ( data&y(li) .eq. -1 ) then 1574 1182 level = "-average" 1575 1183 else 1576 1184 level = "=" + data&y(li) + "m" 1577 1185 end if 1578 cs_res@gsnCenterString = "t=" + d ata&t(lo) + "s y"+ level1186 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "s y"+ level 1579 1187 plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res) 1580 1188 if (vector .EQ. 1 .AND. check_vecp) then … … 1605 1213 1606 1214 if ( sort .eq. "time" ) then 1607 if ( data& z(lo) .eq. -1 ) then1215 if ( data&x(lo) .eq. -1 ) then 1608 1216 level = "-average" 1609 1217 else 1610 level = "=" + data& z(lo) + "m"1218 level = "=" + data&x(lo) + "m" 1611 1219 end if 1612 cs_res@gsnCenterString = "t=" + d ata&t(li) + "s x"+ level1220 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "s x"+ level 1613 1221 plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res) 1614 1222 if (vector .EQ. 1 .AND. check_vecp) then … … 1628 1236 1629 1237 if ( sort .eq. "layer" ) then 1630 if ( data& z(li) .eq. -1 ) then1238 if ( data&x(li) .eq. -1 ) then 1631 1239 level = "-average" 1632 1240 else 1633 level = "=" + data& z(li) + "m"1241 level = "=" + data&x(li) + "m" 1634 1242 end if 1635 cs_res@gsnCenterString = "t=" + d ata&t(lo) + "s x"+ level1243 cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "s x"+ level 1636 1244 plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res) 1637 1245 if (vector .EQ. 1 .AND. check_vecp)then … … 1660 1268 ; *************************************************** 1661 1269 1662 if (vector .EQ. 1 .AND. p arameter(45).EQ. "plotvec")then1270 if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec")then 1663 1271 if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then 1664 1272 gsn_panel(wks_ps,plot(0:(no_time*no_layer*(no_var+1))-1),(/no_var+1,no_layer*no_time/),cs_resP) -
palm/trunk/SCRIPTS/NCL/profiles.ncl
r175 r190 2 2 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" 3 3 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" 4 5 ;*************************************************** 6 ; load ncl_preferences.ncl 7 ;*************************************************** 8 9 if (isfilepresent("~/ncl_preferences.ncl")) then 10 loadscript("~/ncl_preferences.ncl") 11 else 12 if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")) then 13 loadscript( "~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl") 14 else 15 print(" ") 16 print("'ncl_preferences.ncl' does not exist in $home or $home/palm/current_version/trunk/SCRIPTS/NCL/") 17 print(" ") 18 exit 19 end if 20 end if 21 22 begin 23 24 if (cross_sections .NE. 0 .OR. profiles .NE. 1 .OR. timeseries .NE. 0 .OR. spectra .NE. 0)then 25 print(" ") 26 print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)") 27 print(" ") 28 print("Set 'profiles' equal 1 and the other variables equal 0") 29 print(" ") 30 exit 31 end if 4 32 5 begin 6 7 ; *************************************************** 8 ; read parameter_list 9 ; *************************************************** 10 11 if (isfilepresent("~/.ncl_preferences")) then 12 parameter = asciiread("~/.ncl_preferences",129,"string") 13 delete(parameter@_FillValue) 14 else 15 if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then 16 parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string") 17 delete(parameter@_FillValue) 18 else 19 print(" ") 20 print("'.ncl_preferences' is not present in '~/palm/current_version/trunk/SRIPTS/NCL/'") 21 print(" ") 22 exit 23 end if 24 end if 25 26 ; *************************************************** 27 ; set up default parameter values and strings if not assigned in prompt or parameter list 28 ; *************************************************** 29 30 if ( .not. isvar("no_files") ) then 31 no_files = 1 32 if (parameter(81) .NE. "1") then 33 no_files = stringtointeger(parameter(81)) 34 if (no_files .LT. 1 .OR. no_files .GT. 12) then 35 print(" ") 36 print("Please assign 'no_files' between 1 and 12") 37 print(" ") 38 exit 39 end if 40 end if 41 else 42 if (no_files .LT. 1 .OR. no_files .GT. 12) then 43 print(" ") 44 print("Please assign 'no_files' between 1 and 12") 45 print(" ") 46 exit 47 end if 33 ;*************************************************** 34 ; set up default parameter values and strings 35 ;*************************************************** 36 37 if (no_files .LT. 1 .OR. no_files .GT. 12) then 38 print(" ") 39 print("Please assign 'no_files' between 1 and 12") 40 print(" ") 41 exit 48 42 end if 49 43 50 44 file_in = new(no_files,string) 51 52 if ( .not. isvar("file_1") ) then 53 if (parameter(7) .EQ. "File in") then 54 print(" ") 55 print("Please provide 1st input file 'file_1=' either in prompt or parameter_list") 56 print(" ") 57 exit 58 else 59 file_in(0) = parameter(7) 60 end if 45 46 if (file_1 .EQ. "File in") then 47 print(" ") 48 print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'") 49 print(" ") 50 exit 61 51 else 62 52 file_in(0) = file_1 … … 64 54 if (.not. isfilepresent(file_in(0))) then 65 55 print(" ") 66 print("Your 1st input file: '"+file_in(0)+"' does not exist") 56 print("Your 1st input file: '"+file_in+"' does not exist") 57 print(" ") 58 exit 59 end if 60 61 if (prof3d .EQ. -1)then 62 print(" ") 63 print("Please set 'prof3d' to 0 or 1") 64 print(" ") 65 exit 66 else 67 if (prof3d .NE. 0 .AND. prof3d .NE. 1)then 68 print(" ") 69 print("'prof3d'= "+prof3d+" is invalid; set 'prof3d' to 0 or 1") 70 print(" ") 71 exit 72 end if 73 end if 74 75 if (no_files .GT. 1) then 76 if (file_2 .EQ. "File in") then 77 print(" ") 78 print("Please provide 2nd input file 'file_2=' in 'ncl_preferences.ncl'") 79 print(" ") 80 exit 81 else 82 file_in(1) = file_2 83 end if 84 if (.not. isfilepresent(file_in(1))) then 85 print(" ") 86 print("Your 2nd input file: '"+file_in+"' does not exist") 87 print(" ") 88 exit 89 end if 90 end if 91 92 if (no_files .GT. 2) then 93 if (file_3 .EQ. "File in") then 94 print(" ") 95 print("Please provide 3rd input file 'file_3=' in 'ncl_preferences.ncl'") 96 print(" ") 97 exit 98 else 99 file_in(2) = file_3 100 end if 101 if (.not. isfilepresent(file_in(2))) then 102 print(" ") 103 print("Your 3rd input file: '"+file_in+"' does not exist") 104 print(" ") 105 exit 106 end if 107 end if 108 109 if (no_files .GT. 3) then 110 if (file_4 .EQ. "File in") then 111 print(" ") 112 print("Please provide 4th input file 'file_4=' in 'ncl_preferences.ncl'") 113 print(" ") 114 exit 115 else 116 file_in(3) = file_4 117 end if 118 if (.not. isfilepresent(file_in(3))) then 119 print(" ") 120 print("Your 4th input file: '"+file_in+"' does not exist") 121 print(" ") 122 exit 123 end if 124 end if 125 126 if (no_files .GT. 4) then 127 if (file_5 .EQ. "File in") then 128 print(" ") 129 print("Please provide 5th input file 'file_5=' in 'ncl_preferences.ncl'") 130 print(" ") 131 exit 132 else 133 file_in(4) = file_5 134 end if 135 if (.not. isfilepresent(file_in(4))) then 136 print(" ") 137 print("Your 5th input file: '"+file_in+"' does not exist") 138 print(" ") 139 exit 140 end if 141 end if 142 if (no_files .GT. 5) then 143 if (file_6 .EQ. "File in") then 144 print(" ") 145 print("Please provide 6th input file 'file_6=' in 'ncl_preferences.ncl'") 146 print(" ") 147 exit 148 else 149 file_in(5) = file_6 150 end if 151 if (.not. isfilepresent(file_in(5))) then 152 print(" ") 153 print("Your 6th input file: '"+file_in+"' does not exist") 154 print(" ") 155 exit 156 end if 157 end if 158 if (no_files .GT. 6) then 159 if (file_7 .EQ. "File in") then 160 print(" ") 161 print("Please provide 7th input file 'file_7=' in 'ncl_preferences.ncl'") 162 print(" ") 163 exit 164 else 165 file_in(6) = file_7 166 end if 167 if (.not. isfilepresent(file_in(6))) then 168 print(" ") 169 print("Your 7th input file: '"+file_in+"' does not exist") 170 print(" ") 171 exit 172 end if 173 end if 174 if (no_files .GT. 7) then 175 if (file_8 .EQ. "File in") then 176 print(" ") 177 print("Please provide 8th input file 'file_8=' in 'ncl_preferences.ncl'") 178 print(" ") 179 exit 180 else 181 file_in(7) = file_8 182 end if 183 if (.not. isfilepresent(file_in(7))) then 184 print(" ") 185 print("Your 8th input file: '"+file_in+"' does not exist") 186 print(" ") 187 exit 188 end if 189 end if 190 if (no_files .GT. 8) then 191 if (file_9 .EQ. "File in") then 192 print(" ") 193 print("Please provide 9th input file 'file_9=' in 'ncl_preferences.ncl'") 194 print(" ") 195 exit 196 else 197 file_in(8) = file_9 198 end if 199 if (.not. isfilepresent(file_in(8))) then 200 print(" ") 201 print("Your 9th input file: '"+file_in+"' does not exist") 202 print(" ") 203 exit 204 end if 205 end if 206 if (no_files .GT. 9) then 207 if (file_10 .EQ. "File in") then 208 print(" ") 209 print("Please provide 10th input file 'file_10=' in 'ncl_preferences.ncl'") 210 print(" ") 211 exit 212 else 213 file_in(9) = file_10 214 end if 215 if (.not. isfilepresent(file_in(9))) then 216 print(" ") 217 print("Your 10th input file: '"+file_in+"' does not exist") 218 print(" ") 219 exit 220 end if 221 end if 222 if (no_files .GT. 10) then 223 if (file_11 .EQ. "File in") then 224 print(" ") 225 print("Please provide 11th input file 'file_11=' in 'ncl_preferences.ncl'") 226 print(" ") 227 exit 228 else 229 file_in(10) = file_11 230 end if 231 if (.not. isfilepresent(file_in(10))) then 232 print(" ") 233 print("Your 11th input file: '"+file_in+"' does not exist") 234 print(" ") 235 exit 236 end if 237 end if 238 if (no_files .GT. 11) then 239 if (file_12 .EQ. "File in") then 240 print(" ") 241 print("Please provide 12th input file 'file_12=' in 'ncl_preferences.ncl'") 242 print(" ") 243 exit 244 else 245 file_in(11) = file_12 246 end if 247 if (.not. isfilepresent(file_in(11))) then 248 print(" ") 249 print("Your 12th input file: '"+file_in+"' does not exist") 250 print(" ") 251 exit 252 end if 253 end if 254 255 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 256 print(" ") 257 print("'format_out = "+format_out+"' is invalid and set to'x11'") 258 print(" ") 259 format_out="x11" 260 end if 261 262 if (over .NE. 0 .AND. over .NE. 1) then 263 print(" ") 264 print("'over'= "+over+" is invalid and set to 0") 265 print(" ") 266 over = 0 267 end if 268 if (no_files .GT. 1) then 269 over = 0 270 print(" ") 271 print("If you have more than one input file - you cannot overlay variables: over is set to 0") 272 print(" ") 273 end if 274 275 if (combine .NE. 0 .AND. combine .NE. 1)then 276 print(" ") 277 print("Your 'combine'= "+combine+" is invalid and set to 0") 278 print(" ") 279 combine = 0 280 end if 281 if (no_files .GT. 1) then 282 combine = 0 283 print(" ") 284 print("If you have more than one input file you cannot combine variables: combine is set to 0") 285 print(" ") 286 end if 287 if (combine .EQ. 1 .AND. number_comb .EQ. -1) then 288 print(" ") 289 print("Please set 'number_comb' to 2 or 3 or combine to 0") 67 290 print(" ") 68 291 exit 69 292 end if 70 71 if (no_files .GT. 1) then 72 if (.not. isvar("file_2"))then 73 file_in(1) = parameter(85) 74 if (file_in(1) .EQ. "File in") 75 print(" ") 76 print("Please provide 2nd input file 'file_2=' either in prompt or parameter_list or change 'no_files' to 1") 77 print(" ") 78 exit 79 end if 80 else 81 file_in(1) = file_2 82 end if 83 if (.not. isfilepresent(file_in(1))) then 84 print(" ") 85 print("Your 2nd input file: '"+file_in(1)+"' does not exist") 293 if (combine .EQ. 1)then 294 if (number_comb .EQ. -1) then 295 print(" ") 296 print("Please set 'number_comb' to 2 or 3 or combine to 0") 86 297 print(" ") 87 298 exit 88 299 end if 89 end if 90 if (no_files .GT. 2) then 91 if (.not. isvar("file_3"))then 92 file_in(2) = parameter(89) 93 if (file_in(2) .EQ. "File in") 94 print(" ") 95 print("Please provide 3rd input file 'file_3=' either in prompt or parameter_list or change 'no_files' to 2") 96 print(" ") 97 exit 98 end if 99 else 100 file_in(2) = file_3 101 end if 102 if (.not. isfilepresent(file_in(2))) then 103 print(" ") 104 print("Your 3rd input file: '"+file_in(2)+"' does not exist") 300 if (number_comb .NE. 2 .AND. number_comb .NE. 3) then 301 print(" ") 302 print("Please set 'number_comb' to 2 or 3 or combine to 0") 105 303 print(" ") 106 304 exit 107 305 end if 108 end if 109 if (no_files .GT. 3) then 110 if (.not. isvar("file_4"))then 111 file_in(3) = parameter(93) 112 if (file_in(3) .EQ. "File in") 113 print(" ") 114 print("Please provide 4th input file 'file_4=' either in prompt or parameter_list or change 'no_files' to 3") 115 print(" ") 116 exit 117 end if 118 else 119 file_in(3) = file_4 120 end if 121 if (.not. isfilepresent(file_in(3))) then 122 print(" ") 123 print("Your 4th input file: '"+file_in(3)+"' does not exist") 124 print(" ") 125 exit 126 end if 127 end if 128 if (no_files .GT. 4) then 129 if (.not. isvar("file_5"))then 130 file_in(4) = parameter(97) 131 if (file_in(4) .EQ. "File in") 132 print(" ") 133 print("Please provide 5th input file 'file_5=' either in prompt or parameter_list or change 'no_files' to 4") 134 print(" ") 135 exit 136 end if 137 else 138 file_in(4) = file_5 139 end if 140 if (.not. isfilepresent(file_in(4))) then 141 print(" ") 142 print("Your 5th input file: '"+file_in(4)+"' does not exist") 143 print(" ") 144 exit 145 end if 146 end if 147 if (no_files .GT. 5) then 148 if (.not. isvar("file_6"))then 149 file_in(5) = parameter(101) 150 if (file_in(5) .EQ. "File in") 151 print(" ") 152 print("Please provide 6th input file 'file_6=' either in prompt or parameter_list or change 'no_files' to 5") 153 print(" ") 154 exit 155 end if 156 else 157 file_in(5) = file_6 158 end if 159 if (.not. isfilepresent(file_in(5))) then 160 print(" ") 161 print("Your 6th input file: '"+file_in(5)+"' does not exist") 162 print(" ") 163 exit 164 end if 165 end if 166 if (no_files .GT. 6) then 167 if (.not. isvar("file_7"))then 168 file_in(6) = parameter(105) 169 if (file_in(6) .EQ. "File in") 170 print(" ") 171 print("Please provide 7th input file 'file_7=' either in prompt or parameter_list or change 'no_files' to 6") 172 print(" ") 173 exit 174 end if 175 else 176 file_in(6) = file_7 177 end if 178 if (.not. isfilepresent(file_in(6))) then 179 print(" ") 180 print("Your 7th input file: '"+file_in(6)+"' does not exist") 181 print(" ") 182 exit 183 end if 184 end if 185 if (no_files .GT. 7) then 186 if (.not. isvar("file_8"))then 187 file_in(7) = parameter(109) 188 if (file_in(7) .EQ. "File in") 189 print(" ") 190 print("Please provide 8th input file 'file_8=' either in prompt or parameter_list or change 'no_files' to 7") 191 print(" ") 192 exit 193 end if 194 else 195 file_in(7) = file_8 196 end if 197 if (.not. isfilepresent(file_in(7))) then 198 print(" ") 199 print("Your 8th input file: '"+file_in(7)+"' does not exist") 200 print(" ") 201 exit 202 end if 203 end if 204 if (no_files .GT. 8) then 205 if (.not. isvar("file_9"))then 206 file_in(8) = parameter(113) 207 if (file_in(8) .EQ. "File in") 208 print(" ") 209 print("Please provide 9th input file 'file_9=' either in prompt or parameter_list or change 'no_files' to 8") 210 print(" ") 211 exit 212 end if 213 else 214 file_in(8) = file_9 215 end if 216 if (.not. isfilepresent(file_in(8))) then 217 print(" ") 218 print("Your 9th input file: '"+file_in(8)+"' does not exist") 219 print(" ") 220 exit 221 end if 222 end if 223 if (no_files .GT. 9) then 224 if (.not. isvar("file_10"))then 225 file_in(9) = parameter(117) 226 if (file_in(9) .EQ. "File in") 227 print(" ") 228 print("Please provide 10th input file 'file_10=' either in prompt or parameter_list or change 'no_files' to 9") 229 print(" ") 230 exit 231 end if 232 else 233 file_in(9) = file_10 234 end if 235 if (.not. isfilepresent(file_in(9))) then 236 print(" ") 237 print("Your 10th input file: '"+file_in(9)+"' does not exist") 238 print(" ") 239 exit 240 end if 241 end if 242 if (no_files .GT. 10) then 243 if (.not. isvar("file_11"))then 244 file_in(10) = parameter(121) 245 if (file_in(10) .EQ. "File in") 246 print(" ") 247 print("Please provide 11th input file 'file_11=' either in prompt or parameter_list or change 'no_files' to 10") 248 print(" ") 249 exit 250 end if 251 else 252 file_in(10) = file_11 253 end if 254 if (.not. isfilepresent(file_in(10))) then 255 print(" ") 256 print("Your 11th input file: '"+file_in(10)+"' does not exist") 257 print(" ") 258 exit 259 end if 260 end if 261 if (no_files .GT. 11) then 262 if (.not. isvar("file_12"))then 263 file_in(11) = parameter(125) 264 if (file_in(11) .EQ. "File in") 265 print(" ") 266 print("Please provide 12th input file 'file_12=' either in prompt or parameter_list or change 'no_files' to 11") 267 print(" ") 268 exit 269 end if 270 else 271 file_in(11) = file_12 272 end if 273 if (.not. isfilepresent(file_in(11))) then 274 print(" ") 275 print("Your 12th input file: '"+file_in(11)+"' does not exist") 276 print(" ") 277 exit 278 end if 279 end if 280 281 if ( .not. isvar("format_out") ) then 282 format_out = "x11" 283 if (parameter(9) .NE. "x11") then 284 format_out = parameter(9) 285 if (format_out .NE. "x11" .OR. format_out .NE. "pdf" .OR. format_out .NE. "eps" .OR. format_out .NE. "ps" .OR. format_out .NE. "epsi" .OR. format_out .NE. "ncgm")then 286 print(" ") 287 print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") 288 print(" ") 289 end if 290 end if 291 else 292 if (format_out .NE. "x11" .OR. format_out .NE. "pdf" .OR. format_out .NE. "eps" .OR. format_out .NE. "ps" .OR. format_out .NE. "epsi" .OR. format_out .NE. "ncgm")then 293 print(" ") 294 print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") 295 print(" ") 296 end if 297 end if 298 299 if ( .not. isvar("file_out") ) then 300 file_out = "test" 301 if (parameter(11) .NE. "test_ts") then 302 file_out = parameter(11) 303 end if 304 end if 305 if ( .not. isvar("no_columns") ) then 306 no_columns = 1 307 if (parameter(17) .NE. "1") then 308 no_columns = stringtointeger(parameter(17)) 309 end if 310 end if 311 if ( .not. isvar("no_lines") ) then ; number of plot-lines on one sheet 312 no_lines = 2 313 if (parameter(19) .NE. "2") then 314 no_lines = stringtointeger(parameter(19)) 315 end if 316 end if 317 if ( .not. isvar("combine") ) then ; color of lines 318 combine = 0 319 if (parameter(23) .NE. "0") then 320 combine = stringtointeger(parameter(23)) 321 if (stringtointeger(parameter(23)) .NE. 1) then 322 print(" ") 323 print("Your 'combine'= "+combine+" is invalid and set to 0") 324 print(" ") 325 combine = 0 326 else 327 if (no_files .GT. 1) then 328 print(" ") 329 print("If you have more than one input file you cannot combine variables: combine is set to 0") 330 print(" ") 331 combine = 0 332 end if 333 end if 334 end if 335 else 336 if (combine .NE. 0 .AND. combine .NE. 1)then 337 print(" ") 338 print("Your 'combine'= "+combine+" is invalid and set to 0") 339 print(" ") 340 combine = 0 341 end if 342 if (no_files .GT. 1) then 343 combine = 0 344 print(" ") 345 print("If you have more than one input file you cannot combine variables: combine is set to 0") 346 print(" ") 347 end if 348 end if 349 350 if (combine .EQ. 1) then 351 if( .not. isvar("c_var") ) then 352 if (parameter(27) .EQ. "c_variables") then 353 print(" ") 354 print("Please select variables for overlaying ('c_var')") 355 print(" ") 356 exit 357 else 358 c_var=parameter(27) 359 end if 360 end if 361 end if 362 363 if ( .not. isvar("black") ) then ; color of lines 364 black = 0 365 if (parameter(31) .NE. "0") then 366 black = stringtointeger(parameter(31)) 367 if (stringtointeger(parameter(31)) .NE. 1) then 368 print(" ") 369 print("Your 'black'= "+black+" is invalid and set to 0") 370 print(" ") 371 black = 0 372 end if 373 end if 374 else 375 if (black .NE. 0 .AND. black .NE. 1)then 376 print(" ") 377 print("Your 'black'= "+black+" is invalid and set to 0") 378 print(" ") 379 black = 0 380 end if 381 end if 382 383 if ( .not. isvar("dash") ) then 384 dash = 0 385 if (parameter(29) .NE. "0") then 386 dash = stringtointeger(parameter(29)) 387 if (stringtointeger(parameter(29)) .NE. 1) then 388 print(" ") 389 print("Your 'dash'= "+dash+" is invalid and set to 0") 390 print(" ") 391 dash = 0 392 end if 393 end if 394 else 395 if (dash .NE. 0 .AND. dash .NE. 1)then 396 print(" ") 397 print("Your 'dash'= "+dash+" is invalid and set to 0") 398 print(" ") 399 dash = 0 400 end if 401 end if 402 403 if ( .not. isvar("over") ) then ; switches overlaying plots on 404 over = 0 405 if (stringtointeger(parameter(37)) .NE. 0) then 406 over = stringtointeger(parameter(37)) 407 if (stringtointeger(parameter(37)) .NE. 1) then 408 print(" ") 409 print("Your 'over'= "+over+" is invalid and set to 0") 410 print(" ") 411 over = 0 412 else 413 if (no_files .GT. 1) then 414 over = 0 415 print(" ") 416 print("If you have more than one input file you cannot overlay variables: over is set to 0") 417 print(" ") 418 end if 419 end if 420 end if 421 else 422 if (over .NE. 0 .AND. over .NE. 1)then 423 print(" ") 424 print("Your 'over'= "+over+" is invalid and set to 0") 425 print(" ") 426 over = 0 427 end if 428 end if 429 430 if (.not. isvar("prof3d"))then 431 prof3d = 0 432 if (stringtointeger(parameter(75)) .NE. 0) then 433 prof3d = stringtointeger(parameter(75)) 434 if (stringtointeger(parameter(75)) .NE. 1) then 435 print(" ") 436 print("Please set 'prof3d' to 0 or 1") 437 print(" ") 438 exit 439 end if 440 end if 441 else 442 if (prof3d .NE. 0 .AND. prof3d .NE. 1)then 443 print(" ") 444 print("Your 'prof3d'= "+prof3d+" is invalid; please set 'prof3d' to 0 or 1") 445 print(" ") 446 exit 447 end if 448 end if 449 450 if (.not. isvar("logy"))then 306 end if 307 if (combine .EQ. 1 .AND. c_var .EQ. "c_variables") then 308 print(" ") 309 print("Please select variables for overlaying ('c_var') or set combine to 0") 310 print(" ") 311 exit 312 end if 313 314 if (logy .NE. 0 .AND. logy .NE. 1)then 315 print(" ") 316 print("'logy'= "+logy+" is invalid and set to 0") 317 print(" ") 451 318 logy = 0 452 if (stringtointeger(parameter(77)) .NE. 0) then 453 logy = stringtointeger(parameter(77)) 454 if (stringtointeger(parameter(77)) .NE. 1) then 455 print(" ") 456 print("Your 'logy'= "+logy+" is invalid and set to 0") 457 print(" ") 458 logy = 0 459 end if 460 end if 461 else 462 if (logy .NE. 0 .AND. logy .NE. 1)then 463 print(" ") 464 print("Your 'logy'= "+logy+" is invalid and set to 0") 465 print(" ") 466 logy = 0 467 end if 468 end if 469 470 if ( .not. isvar("norm") ) then 319 end if 320 321 if (norm .EQ. 0) then 322 print(" ") 323 print("You cannot normalise with 0, 'norm' is set to 1") 324 print(" ") 471 325 norm = 1.0 472 if (parameter(79) .NE. "1") then 473 norm = stringtofloat(parameter(79)) 474 if (stringtofloat(parameter(79)) .EQ. 0) then 475 print(" ") 476 print("You cannot normalise with 0, 'norm' is set to 1") 477 print(" ") 478 norm = 1.0 479 end if 480 end if 481 else 482 if (norm .EQ. 0) then 483 print(" ") 484 print("You cannot normalise with 0, 'norm' is set to 1") 485 print(" ") 486 norm = 1.0 487 end if 488 end if 489 490 ; *************************************************** 326 end if 327 328 ;*************************************************** 491 329 ; open input file 492 ; 330 ;*************************************************** 493 331 494 332 do nof=0,no_files-1 … … 503 341 if (dim0 .NE. dim)then 504 342 print(" ") 505 print("Your Input files doesnot contain the same variables")343 print("There are 'no_files'="+no_files+" input files but they do not contain the same variables") 506 344 print(" ") 507 345 exit … … 510 348 if (vNam0(i) .NE. vNam(i))then 511 349 print(" ") 512 print(" Your Input files doesnot contain the same variables")350 print("There are 'no_files'="+no_files+" input files but they do not contain the same variables") 513 351 print(" ") 514 352 exit … … 519 357 nof=nof+1 520 358 print(" ") 521 print("Variable in input file "+nof+": " + vNam) 359 print("Variables in input file "+nof+":") 360 print("- "+ vNam) 522 361 print(" ") 523 362 nof=nof-1 … … 555 394 break 556 395 else 557 if (vNam(varn) .EQ. "v" .OR. isStrSubset(vNam(varn), "v_"))then 558 396 if (vNam(varn) .EQ. "v" .OR. isStrSubset(vNam(varn), "v_"))then 559 397 z_u = f->$vNam(varn+1)$ 560 398 break … … 835 673 varn=varn-1 836 674 end do 837 if ( .not. isvar("z_u") ) then 838 zu = 0 839 else 840 zu = 1 841 end if 842 if ( .not. isvar("z_w") ) then 843 zw = 0 844 else 845 zw = 1 846 end if 847 848 if (zu .EQ. 0 .AND. zw .EQ. 0) then 675 676 if (.not. isvar("z_u") .AND. .not. isvar ("z_w")) then 849 677 co=0 850 678 do varn=0,dim-1 … … 852 680 check = False 853 681 else 854 if (.not. isvar("var")) then 855 check = True 856 if (parameter(21) .NE. "variables") then 857 var=parameter(21) 858 check = isStrSubset( var,","+vNam(varn)+"," ) 859 end if 860 else 682 check = True 683 if (var .NE. "all") then 861 684 check = isStrSubset( var,","+vNam(varn)+"," ) 862 end if 685 end if 863 686 end if 864 687 if (check)then 865 688 co=co+1 866 689 z = f->$vNam(varn+1)$ 690 if (getvardims(z) .EQ. "zu")then 691 z_u = z 692 else 693 if (getvardims(z) .EQ. "zw")then 694 z_w = z 695 end if 696 end if 867 697 dimz = dimsizes(z) 868 698 break … … 871 701 if (co .EQ. 0) then 872 702 print(" ") 873 print("The variables 'var=°"+var+"°' do not exist on your input file") 703 print("The variables 'var="+var+"' do not exist on your input file;") 704 print("be sure to have one comma berfore and after each variable") 874 705 print(" ") 875 706 exit … … 901 732 end if 902 733 734 if(.not. isvar("z_u") .AND. .not. isvar("z_w"))then 735 print(" ") 736 print("Program aborts - there are no z-variables available") 737 print("Please be sure if 'plot_3d' is set correctly") 738 print(" ") 739 exit 740 end if 741 903 742 t_all = f->time 904 743 nt = dimsizes(t_all) … … 910 749 ; **************************************************** 911 750 912 if ( .not. isvar("start_time_step") ) then 913 start_time_step=t_all(0)/3600 914 if (parameter(13) .NE. "t(0)") then 915 if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600)then 916 print(" ") 917 print("'start_time_step' = "+ parameter(13) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") 918 print(" ") 919 print("Please select another 'start_time_step'") 920 print(" ") 921 exit 922 end if 923 if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)then 924 print(" ") 925 print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") 926 exit 927 end if 928 start_time_step=stringtodouble(parameter(13)) 929 end if 751 if (start_time_step .EQ. -1.) then 752 start_time_step=t_all(0)/3600 930 753 else 931 754 if (start_time_step .GT. t_all(nt-1)/3600)then … … 940 763 print(" ") 941 764 print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") 942 765 print(" ") 943 766 exit 944 767 end if 945 768 end if 946 start_time_step = start_time_step*3600947 769 948 770 do i=0,nt-1 949 if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then771 if (start_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. start_time_step .LT. (t_all(i)+delta_t/2)/3600)then 950 772 st=i 951 773 break 952 774 end if 953 775 end do 776 if (.not. isvar("st"))then 777 print(" ") 778 print("'start_time_step' = "+ start_time_step +"h is invalid") 779 print(" ") 780 print("Please select another 'start_time_step'") 781 print(" ") 782 exit 783 end if 954 784 955 785 ; **************************************************** … … 957 787 ; **************************************************** 958 788 959 if ( .not. isvar("end_time_step") ) then 960 end_time_step = t_all(nt-1)/3600 961 if (parameter(15) .NE. "t(end)") then 962 if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)then 963 print(" ") 964 print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") 965 print(" ") 966 print("Please select another 'end_time_step'") 967 print(" ") 968 exit 969 end if 970 if (stringtodouble(parameter(15)) .LT. start_time_step/3600)then 971 print(" ") 972 print("'end_time_step' = "+ parameter(15) +"h is lower than 'start_time_step' = "+start_time_step/3600+"h") 973 print(" ") 974 print("Please select another 'start_time_step' or 'end_time_step'") 975 print(" ") 976 exit 977 end if 978 end_time_step = stringtodouble(parameter(15)) 979 end if 789 if (end_time_step .EQ. -1.) then 790 end_time_step = t_all(nt-1)/3600 980 791 else 981 792 if (end_time_step .GT. t_all(nt-1)/3600)then … … 996 807 end if 997 808 end if 998 end_time_step = end_time_step*3600999 809 1000 810 do i=0,nt-1 1001 if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then811 if (end_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. end_time_step .LT. (t_all(i)+delta_t/2)/3600)then 1002 812 et=i 1003 813 break 1004 814 end if 1005 815 end do 816 if (.not. isvar("et"))then 817 print(" ") 818 print("'end_time_step' = "+ end_time_step +"h is invalid") 819 print(" ") 820 print("Please select another 'end_time_step'") 821 print(" ") 822 exit 823 end if 1006 824 1007 825 delete(start_time_step) … … 1056 874 res@pmLegendWidthF = 0.12 1057 875 res@pmLegendHeightF = 0.04*(end_time_step-start_time_step+1) 1058 res@lgLabelFontHeightF = .02 876 res@lgLabelFontHeightF = .02 877 res@lgTitleString = "Time [h]" 878 res@lgTitleFontHeightF = 0.02 1059 879 res@txFontHeightF = 0.02 1060 880 res@tiXAxisFontHeightF = 0.02 … … 1074 894 end if 1075 895 1076 if ( dash .eq. 0 ) then896 if (dash .EQ. 0 ) then 1077 897 res@xyMonoDashPattern = True 1078 898 else … … 1082 902 print("If you use more than one file, patterns for different timesteps cannot be used") 1083 903 print(" ") 1084 end if 904 end if 1085 905 end if 1086 906 … … 1096 916 1097 917 if (combine .EQ. 1) then 1098 if ( .not. isvar("number_comb") ) then 1099 if (parameter(25) .EQ. "0") then 1100 print(" ") 1101 print("Please set 'number_comb' to 2 or 3 if you would like to overlay 2 or 3 variables in one plot") 1102 print(" ") 1103 exit 1104 else 1105 number_comb=stringtointeger(parameter(25)) 1106 plot_o = new(number_comb,graphic) 1107 end if 1108 else 1109 if(number_comb .EQ. 2 .OR. number_comb .EQ. 3) then 1110 plot_o = new(number_comb,graphic) 1111 else 1112 print(" ") 1113 print("Please set 'number_comb' to 2 or 3 if you would like to overlay 2 or 3 variables in one plot") 1114 print(" ") 1115 exit 1116 end if 1117 end if 918 plot_o = new(number_comb,graphic) 1118 919 label=new(number_comb,string) 1119 920 color_o=new(number_comb,integer) … … 1121 922 maxi=new(number_comb,float) 1122 923 end if 1123 924 1124 925 wks=gsn_open_wks(format_out,file_out) 1125 926 gsn_define_colormap(wks,"rainbow+white") … … 1130 931 1131 932 if (logy .EQ. 1)then 1132 if ( .not. isvar("min_z"))then933 if (min_z .EQ. -1)then 1133 934 if (isvar("z_u"))then 1134 935 min_z=z_u(1) 1135 936 else 1136 937 min_z=z_w(1) 938 end if 939 else 940 if (isvar("z_w"))then 941 if (min_z .GE. max(z_w) ) then 942 print(" ") 943 print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_w)+")") 944 print(" ") 945 exit 946 end if 947 else 948 if (min_z .GE. max(z_u) ) then 949 print(" ") 950 print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")") 951 print(" ") 952 exit 953 end if 954 end if 955 if (isvar("z_u"))then 956 if (min_z .LT. z_u(1) ) then 957 print(" ") 958 print("Begin height 'min_z' at least at level k=1 (="+z_u(1)+"m) due to the logarithmic scale of the y-axis") 959 print(" ") 960 exit 961 end if 962 else 963 if (min_z .LT. z_w(1) ) then 964 print(" ") 965 print("Begin height 'min_z' at least at level k=1 (="+z_w(1)+"m) due to the logarithmic scale of the y-axis") 966 print(" ") 967 exit 968 end if 1137 969 end if 1138 if (stringtofloat(parameter(33)) .NE. z_u(1) .OR. stringtofloat(parameter(33)) .NE. z_w(1)) then 1139 if (stringtofloat(parameter(33)) .EQ. 0) then 1140 if (isvar("z_u"))then 1141 min_z=z_u(1) 1142 else 1143 min_z=z_w(1) 1144 end if 1145 else 1146 if (stringtofloat(parameter(33)) .GE. max(z_u) ) then 1147 print(" ") 1148 print("Minimum of height ('min_z'="+stringtofloat(parameter(33))+") is greater than available heights (="+max(z_u)+")") 1149 print(" ") 1150 exit 1151 end if 1152 if (stringtofloat(parameter(33)) .LT. z_u(1)) then 1153 print(" ") 1154 print("Begin height 'min_z' at least at level k=1 (="+z_u(1)+"m) due to the logarithmic scale of the y-axis") 1155 print(" ") 1156 exit 1157 end if 1158 min_z=stringtofloat(parameter(33)) 1159 end if 970 end if 971 else 972 if (isvar("z_u"))then 973 if (min_z .EQ. -1)then 974 min_z=z_u(0) 975 end if 976 else 977 if (min_z .EQ. -1)then 978 min_z=z_w(0) 979 end if 980 end if 981 if (isvar("z_w"))then 982 if (min_z .GE. max(z_w) ) then 983 print(" ") 984 print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_w)+")") 985 print(" ") 986 exit 1160 987 end if 1161 988 else 1162 if (min_z .GE. max(z_u) ) then 989 if (min_z .EQ. -1)then 990 min_z=z_u(0) 991 end if 992 if (min_z .GE. max(z_u) ) then 1163 993 print(" ") 1164 994 print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")") 1165 995 print(" ") 1166 996 exit 1167 end if 1168 if (min_z .LT. z_u(1) ) then1169 print(" ")1170 print("Begin height 'min_z' at least at level k=1 (="+z_u(1)+"m) due to the logarithmic scale of the y-axis")1171 print(" ")1172 exit1173 end if1174 end if 997 end if 998 end if 999 end if 1000 1001 if (isvar("z_w"))then 1002 if (max_z .EQ. -1)then 1003 max_z=max(z_w) 1004 end if 1175 1005 else 1176 if (.not. isvar("min_z"))then 1177 min_z=0.0 1178 if (stringtofloat(parameter(33)) .NE. 0) then 1179 if (stringtofloat(parameter(33)) .GE. max(z_u) ) then 1180 print(" ") 1181 print("Minimum of height ('min_z'="+stringtofloat(parameter(33))+") is greater than available heights (="+max(z_u)+")") 1182 print(" ") 1183 exit 1184 end if 1185 if (stringtofloat(parameter(33)) .LT. 0 ) then 1186 print(" ") 1187 print("Begin minimum of height 'min_z' with 0") 1188 print(" ") 1189 exit 1190 end if 1191 min_z=stringtofloat(parameter(33)) 1192 end if 1193 else 1194 if (min_z .GE. max(z_u) ) then 1195 print(" ") 1196 print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")") 1197 print(" ") 1198 exit 1199 end if 1200 if (min_z .LT. 0 ) then 1201 print(" ") 1202 print("Begin minimum of height 'min_z' with 0") 1203 print(" ") 1204 exit 1205 end if 1206 end if 1207 end if 1208 1209 if (.not. isvar("max_z"))then 1210 max_z=max(z_u) 1211 if ((parameter(35)) .NE. "max(z_u)") then 1212 if (stringtofloat(parameter(35)) .GE. max(z_u) ) then 1213 print(" ") 1214 print("Maximum of height ('max_z'="+parameter(35)+") is greater than available heights (="+max(z_u)+")") 1215 print(" ") 1216 exit 1217 end if 1218 if (stringtofloat(parameter(35)) .LE. 0 ) then 1219 print(" ") 1220 print("Maximum of height 'max_z' should be at least 1") 1221 print(" ") 1222 exit 1223 end if 1224 max_z=stringtofloat(parameter(35)) 1225 end if 1226 else 1227 if (max_z .GE. max(z_u) ) then 1228 print(" ") 1229 print("Maximum of height ('max_z'="+max_z+") is greater than available heights (="+max(z_u)+")") 1230 print(" ") 1231 exit 1232 end if 1233 if (max_z .LE. 0 ) then 1234 print(" ") 1235 print("Maximum of height 'max_z' should be at least 1") 1006 if (max_z .EQ. -1)then 1007 max_z=max(z_u) 1008 end if 1009 end if 1010 1011 if (isvar("z_w"))then 1012 if (max_z .GT. max(z_w) ) then 1013 print(" ") 1014 print("Maximum of height ('max_z'="+max_z+") is greater than available heights (="+max(z_w)+")") 1236 1015 print(" ") 1237 1016 exit … … 1493 1272 end if 1494 1273 1495 if (.not. isvar("var")) then 1496 if (parameter(21) .NE. "variables") then 1497 var=parameter(21) 1498 check = isStrSubset( var,","+vNam(varn)+"," ) 1499 end if 1500 else 1274 if (var .NE. "all") then 1501 1275 check = isStrSubset( var,","+vNam(varn)+"," ) 1502 1276 end if … … 1535 1309 if (n_o .GT. number_comb-1) then 1536 1310 print(" ") 1537 print("Please set 'number_comb' to the right number of overlaying variables ('c_var')")1311 print("Please set 'number_comb' to the number of overlaying variables ('c_var' = "+c_var+")") 1538 1312 print(" ") 1539 1313 exit … … 1625 1399 1626 1400 if (over .EQ. 0) then 1627 res@xyDashPattern = nof1628 1401 res@gsnLeftString = vNam(varn) 1629 1402 res@gsnRightString = unit(varn) 1630 1403 res@trYMinF = min_z 1631 1404 res@trYMaxF = max_z 1632 if (.not. isvar("xs")) then 1633 if (parameter(63) .NE. "x0") then 1634 res@trXMinF = stringtofloat(parameter(63)) 1635 else 1636 res@trXMinF = min(data(varn,:,:)) 1637 end if 1405 if (xs .EQ. -1) then 1406 res@trXMinF = min(data(varn,:,:)) 1638 1407 else 1639 1408 res@trXMinF = xs 1640 1409 end if 1641 if (.not. isvar("xe")) then 1642 if (parameter(65) .NE. "xdim") then 1643 res@trXMaxF = stringtofloat(parameter(65)) 1644 else 1645 res@trXMaxF = max(data(varn,:,:)) 1646 end if 1410 if (xe .EQ. -1) then 1411 res@trXMaxF = max(data(varn,:,:)) 1647 1412 else 1648 1413 res@trXMaxF = xe … … 1660 1425 res@gsnLeftString = vNam(varn) 1661 1426 res@gsnRightString = unit(varn) 1662 if (.not. isvar("xs")) then 1663 if (parameter(63) .NE. "x0") then 1664 res@trXMinF = stringtofloat(parameter(63)) 1665 else 1666 res@trXMinF = miniu 1667 end if 1668 else 1669 res@trXMinF = xs 1670 end if 1671 if (.not. isvar("xe")) then 1672 if (parameter(65) .NE. "xdim") then 1673 res@trXMaxF = stringtofloat(parameter(65)) 1674 else 1675 res@trXMaxF = maxiu 1676 end if 1427 if (xs .EQ. -1) then 1428 res@trXMinF = miniu 1429 else 1430 res@trXMinF = xs 1431 end if 1432 if (xe .EQ. -1) then 1433 res@trXMaxF = maxiu 1677 1434 else 1678 1435 res@trXMaxF = xe … … 1690 1447 res@gsnLeftString = vNam(varn) 1691 1448 res@gsnRightString = unit(varn) 1692 if (.not. isvar("xs")) then 1693 if (parameter(63) .NE. "x0") then 1694 res@trXMinF = stringtofloat(parameter(63)) 1695 else 1696 res@trXMinF = miniv 1697 end if 1698 else 1699 res@trXMinF = xs 1700 end if 1701 if (.not. isvar("xe")) then 1702 if (parameter(65) .NE. "xdim") then 1703 res@trXMaxF = stringtofloat(parameter(65)) 1704 else 1705 res@trXMaxF = maxiv 1706 end if 1449 if (xs .EQ. -1) then 1450 res@trXMinF = miniv 1451 else 1452 res@trXMinF = xs 1453 end if 1454 if (xe .EQ. -1) then 1455 res@trXMaxF = maxiv 1707 1456 else 1708 1457 res@trXMaxF = xe … … 1720 1469 res@gsnLeftString = vNam(varn) 1721 1470 res@gsnRightString = unit(varn) 1722 if (.not. isvar("xs")) then 1723 if (parameter(63) .NE. "x0") then 1724 res@trXMinF = stringtofloat(parameter(63)) 1725 else 1726 res@trXMinF = miniw 1727 end if 1728 else 1729 res@trXMinF = xs 1730 end if 1731 if (.not. isvar("xe")) then 1732 if (parameter(65) .NE. "xdim") then 1733 res@trXMaxF = stringtofloat(parameter(65)) 1734 else 1735 res@trXMaxF = maxiw 1736 end if 1471 if (xs .EQ. -1) then 1472 res@trXMinF = miniw 1473 else 1474 res@trXMinF = xs 1475 end if 1476 if (xe .EQ. -1) then 1477 res@trXMaxF = maxiw 1737 1478 else 1738 1479 res@trXMaxF = xe … … 1751 1492 res@gsnLeftString = vNam(varn) 1752 1493 res@gsnRightString = unit(varn) 1753 if (.not. isvar("xs")) then 1754 if (parameter(63) .NE. "x0") then 1755 res@trXMinF = stringtofloat(parameter(63)) 1756 else 1757 res@trXMinF = minipt 1758 end if 1759 else 1760 res@trXMinF = xs 1761 end if 1762 if (.not. isvar("xe")) then 1763 if (parameter(65) .NE. "xdim") then 1764 res@trXMaxF = stringtofloat(parameter(65)) 1765 else 1766 res@trXMaxF = maxipt 1767 end if 1494 if (xs .EQ. -1) then 1495 res@trXMinF = minipt 1496 else 1497 res@trXMinF = xs 1498 end if 1499 if (xe .EQ. -1) then 1500 res@trXMaxF = maxipt 1768 1501 else 1769 1502 res@trXMaxF = xe … … 1781 1514 res@gsnLeftString = vNam(varn) 1782 1515 res@gsnRightString = unit(varn) 1783 if (.not. isvar("xs")) then 1784 if (parameter(63) .NE. "x0") then 1785 res@trXMinF = stringtofloat(parameter(63)) 1786 else 1787 res@trXMinF = minivpt 1788 end if 1789 else 1790 res@trXMinF = xs 1791 end if 1792 if (.not. isvar("xe")) then 1793 if (parameter(65) .NE. "xdim") then 1794 res@trXMaxF = stringtofloat(parameter(65)) 1795 else 1796 res@trXMaxF = maxivpt 1797 end if 1798 else 1799 res@trXMaxF = xe 1800 end if 1516 if (xs .EQ. -1) then 1517 res@trXMinF = minivpt 1518 else 1519 res@trXMinF = xs 1520 end if 1521 if (xe .EQ. -1) then 1522 res@trXMaxF = maxivpt 1523 else 1524 res@trXMaxF = xe 1525 end if 1801 1526 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 1802 1527 end if … … 1811 1536 res@gsnLeftString = vNam(varn) 1812 1537 res@gsnRightString = unit(varn) 1813 if (.not. isvar("xs")) then 1814 if (parameter(63) .NE. "x0") then 1815 res@trXMinF = stringtofloat(parameter(63)) 1816 else 1817 res@trXMinF = minilpt 1818 end if 1819 else 1820 res@trXMinF = xs 1821 end if 1822 if (.not. isvar("xe")) then 1823 if (parameter(65) .NE. "xdim") then 1824 res@trXMaxF = stringtofloat(parameter(65)) 1825 else 1826 res@trXMaxF = maxilpt 1827 end if 1538 if (xs .EQ. -1) then 1539 res@trXMinF = minilpt 1540 else 1541 res@trXMinF = xs 1542 end if 1543 if (xe .EQ. -1) then 1544 res@trXMaxF = maxilpt 1828 1545 else 1829 1546 res@trXMaxF = xe … … 1842 1559 res@gsnLeftString = vNam(varn) 1843 1560 res@gsnRightString = unit(varn) 1844 if (.not. isvar("xs")) then 1845 if (parameter(63) .NE. "x0") then 1846 res@trXMinF = stringtofloat(parameter(63)) 1847 else 1848 res@trXMinF = minilq 1849 end if 1850 else 1851 res@trXMinF = xs 1852 end if 1853 if (.not. isvar("xe")) then 1854 if (parameter(65) .NE. "xdim") then 1855 res@trXMaxF = stringtofloat(parameter(65)) 1856 else 1857 res@trXMaxF = maxilq 1858 end if 1561 if (xs .EQ. -1) then 1562 res@trXMinF = minilq 1563 else 1564 res@trXMinF = xs 1565 end if 1566 if (xe .EQ. -1) then 1567 res@trXMaxF = maxilq 1859 1568 else 1860 1569 res@trXMaxF = xe … … 1872 1581 res@gsnLeftString = vNam(varn) 1873 1582 res@gsnRightString = unit(varn) 1874 if (.not. isvar("xs")) then 1875 if (parameter(63) .NE. "x0") then 1876 res@trXMinF = stringtofloat(parameter(63)) 1877 else 1878 res@trXMinF = minilqv 1879 end if 1880 else 1881 res@trXMinF = xs 1882 end if 1883 if (.not. isvar("xe")) then 1884 if (parameter(65) .NE. "xdim") then 1885 res@trXMaxF = stringtofloat(parameter(65)) 1886 else 1887 res@trXMaxF = maxilqv 1888 end if 1583 if (xs .EQ. -1) then 1584 res@trXMinF = minilqv 1585 else 1586 res@trXMinF = xs 1587 end if 1588 if (xe .EQ. -1) then 1589 res@trXMaxF = maxilqv 1889 1590 else 1890 1591 res@trXMaxF = xe … … 1902 1603 res@gsnLeftString = vNam(varn) 1903 1604 res@gsnRightString = unit(varn) 1904 if (.not. isvar("xs")) then 1905 if (parameter(63) .NE. "x0") then 1906 res@trXMinF = stringtofloat(parameter(63)) 1907 else 1908 res@trXMinF = miniql 1909 end if 1910 else 1911 res@trXMinF = xs 1912 end if 1913 if (.not. isvar("xe")) then 1914 if (parameter(65) .NE. "xdim") then 1915 res@trXMaxF = stringtofloat(parameter(65)) 1916 else 1917 res@trXMaxF = maxiql 1918 end if 1605 if (xs .EQ. -1) then 1606 res@trXMinF = miniql 1607 else 1608 res@trXMinF = xs 1609 end if 1610 if (xe .EQ. -1) then 1611 res@trXMaxF = maxiql 1919 1612 else 1920 1613 res@trXMaxF = xe … … 1933 1626 res@gsnLeftString = vNam(varn) 1934 1627 res@gsnRightString = unit(varn) 1935 if (.not. isvar("xs")) then 1936 if (parameter(63) .NE. "x0") then 1937 res@trXMinF = stringtofloat(parameter(63)) 1938 else 1939 res@trXMinF = minie 1940 end if 1941 else 1942 res@trXMinF = xs 1943 end if 1944 if (.not. isvar("xe")) then 1945 if (parameter(65) .NE. "xdim") then 1946 res@trXMaxF = stringtofloat(parameter(65)) 1947 else 1948 res@trXMaxF = maxie 1949 end if 1628 if (xs .EQ. -1) then 1629 res@trXMinF = minie 1630 else 1631 res@trXMinF = xs 1632 end if 1633 if (xe .EQ. -1) then 1634 res@trXMaxF = maxie 1950 1635 else 1951 1636 res@trXMaxF = xe … … 1963 1648 res@gsnLeftString = vNam(varn) 1964 1649 res@gsnRightString = unit(varn) 1965 if (.not. isvar("xs")) then 1966 if (parameter(63) .NE. "x0") then 1967 res@trXMinF = stringtofloat(parameter(63)) 1968 else 1969 res@trXMinF = minies 1970 end if 1971 else 1972 res@trXMinF = xs 1973 end if 1974 if (.not. isvar("xe")) then 1975 if (parameter(65) .NE. "xdim") then 1976 res@trXMaxF = stringtofloat(parameter(65)) 1977 else 1978 res@trXMaxF = maxies 1979 end if 1650 if (xs .EQ. -1) then 1651 res@trXMinF = minies 1652 else 1653 res@trXMinF = xs 1654 end if 1655 if (xe .EQ. -1) then 1656 res@trXMaxF = maxies 1980 1657 else 1981 1658 res@trXMaxF = xe … … 1994 1671 res@gsnLeftString = vNam(varn) 1995 1672 res@gsnRightString = unit(varn) 1996 if (.not. isvar("xs")) then 1997 if (parameter(63) .NE. "x0") then 1998 res@trXMinF = stringtofloat(parameter(63)) 1999 else 2000 res@trXMinF = minikm 2001 end if 2002 else 2003 res@trXMinF = xs 2004 end if 2005 if (.not. isvar("xe")) then 2006 if (parameter(65) .NE. "xdim") then 2007 res@trXMaxF = stringtofloat(parameter(65)) 2008 else 2009 res@trXMaxF = maxikm 2010 end if 1673 if (xs .EQ. -1) then 1674 res@trXMinF = minikm 1675 else 1676 res@trXMinF = xs 1677 end if 1678 if (xe .EQ. -1) then 1679 res@trXMaxF = maxikm 2011 1680 else 2012 1681 res@trXMaxF = xe … … 2024 1693 res@gsnLeftString = vNam(varn) 2025 1694 res@gsnRightString = unit(varn) 2026 if (.not. isvar("xs")) then 2027 if (parameter(63) .NE. "x0") then 2028 res@trXMinF = stringtofloat(parameter(63)) 2029 else 2030 res@trXMinF = minikh 2031 end if 2032 else 2033 res@trXMinF = xs 2034 end if 2035 if (.not. isvar("xe")) then 2036 if (parameter(65) .NE. "xdim") then 2037 res@trXMaxF = stringtofloat(parameter(65)) 2038 else 2039 res@trXMaxF = maxikh 2040 end if 1695 if (xs .EQ. -1) then 1696 res@trXMinF = minikh 1697 else 1698 res@trXMinF = xs 1699 end if 1700 if (xe .EQ. -1) then 1701 res@trXMaxF = maxikh 2041 1702 else 2042 1703 res@trXMaxF = xe … … 2055 1716 res@gsnLeftString = vNam(varn) 2056 1717 res@gsnRightString = unit(varn) 2057 if (.not. isvar("xs")) then 2058 if (parameter(63) .NE. "x0") then 2059 res@trXMinF = stringtofloat(parameter(63)) 2060 else 2061 res@trXMinF = miniwpup 2062 end if 2063 else 2064 res@trXMinF = xs 2065 end if 2066 if (.not. isvar("xe")) then 2067 if (parameter(65) .NE. "xdim") then 2068 res@trXMaxF = stringtofloat(parameter(65)) 2069 else 2070 res@trXMaxF = maxiwpup 2071 end if 1718 if (xs .EQ. -1) then 1719 res@trXMinF = miniwpup 1720 else 1721 res@trXMinF = xs 1722 end if 1723 if (xe .EQ. -1) then 1724 res@trXMaxF = maxiwpup 2072 1725 else 2073 1726 res@trXMaxF = xe … … 2085 1738 res@gsnLeftString = vNam(varn) 2086 1739 res@gsnRightString = unit(varn) 2087 if (.not. isvar("xs")) then 2088 if (parameter(63) .NE. "x0") then 2089 res@trXMinF = stringtofloat(parameter(63)) 2090 else 2091 res@trXMinF = miniwsus 2092 end if 2093 else 2094 res@trXMinF = xs 2095 end if 2096 if (.not. isvar("xe")) then 2097 if (parameter(65) .NE. "xdim") then 2098 res@trXMaxF = stringtofloat(parameter(65)) 2099 else 2100 res@trXMaxF = maxiwsus 2101 end if 1740 if (xs .EQ. -1) then 1741 res@trXMinF = miniwsus 1742 else 1743 res@trXMinF = xs 1744 end if 1745 if (xe .EQ. -1) then 1746 res@trXMaxF = maxiwsus 2102 1747 else 2103 1748 res@trXMaxF = xe … … 2115 1760 res@gsnLeftString = vNam(varn) 2116 1761 res@gsnRightString = unit(varn) 2117 if (.not. isvar("xs")) then 2118 if (parameter(63) .NE. "x0") then 2119 res@trXMinF = stringtofloat(parameter(63)) 2120 else 2121 res@trXMinF = miniwu 2122 end if 2123 else 2124 res@trXMinF = xs 2125 end if 2126 if (.not. isvar("xe")) then 2127 if (parameter(65) .NE. "xdim") then 2128 res@trXMaxF = stringtofloat(parameter(65)) 2129 else 2130 res@trXMaxF = maxiwu 2131 end if 1762 if (xs .EQ. -1) then 1763 res@trXMinF = miniwu 1764 else 1765 res@trXMinF = xs 1766 end if 1767 if (xe .EQ. -1) then 1768 res@trXMaxF = maxiwu 2132 1769 else 2133 1770 res@trXMaxF = xe … … 2146 1783 res@gsnLeftString = vNam(varn) 2147 1784 res@gsnRightString = unit(varn) 2148 if (.not. isvar("xs")) then 2149 if (parameter(63) .NE. "x0") then 2150 res@trXMinF = stringtofloat(parameter(63)) 2151 else 2152 res@trXMinF = miniwpvp 2153 end if 2154 else 2155 res@trXMinF = xs 2156 end if 2157 if (.not. isvar("xe")) then 2158 if (parameter(65) .NE. "xdim") then 2159 res@trXMaxF = stringtofloat(parameter(65)) 2160 else 2161 res@trXMaxF = maxiwpvp 2162 end if 1785 if (xs .EQ. -1) then 1786 res@trXMinF = miniwpvp 1787 else 1788 res@trXMinF = xs 1789 end if 1790 if (xe .EQ. -1) then 1791 res@trXMaxF = maxiwpvp 2163 1792 else 2164 1793 res@trXMaxF = xe … … 2176 1805 res@gsnLeftString = vNam(varn) 2177 1806 res@gsnRightString = unit(varn) 2178 if (.not. isvar("xs")) then 2179 if (parameter(63) .NE. "x0") then 2180 res@trXMinF = stringtofloat(parameter(63)) 2181 else 2182 res@trXMinF = miniwsvs 2183 end if 2184 else 2185 res@trXMinF = xs 2186 end if 2187 if (.not. isvar("xe")) then 2188 if (parameter(65) .NE. "xdim") then 2189 res@trXMaxF = stringtofloat(parameter(65)) 2190 else 2191 res@trXMaxF = maxiwsvs 2192 end if 1807 if (xs .EQ. -1) then 1808 res@trXMinF = miniwsvs 1809 else 1810 res@trXMinF = xs 1811 end if 1812 if (xe .EQ. -1) then 1813 res@trXMaxF = maxiwsvs 2193 1814 else 2194 1815 res@trXMaxF = xe … … 2206 1827 res@gsnLeftString = vNam(varn) 2207 1828 res@gsnRightString = unit(varn) 2208 if (.not. isvar("xs")) then 2209 if (parameter(63) .NE. "x0") then 2210 res@trXMinF = stringtofloat(parameter(63)) 2211 else 2212 res@trXMinF = miniwv 2213 end if 2214 else 2215 res@trXMinF = xs 2216 end if 2217 if (.not. isvar("xe")) then 2218 if (parameter(65) .NE. "xdim") then 2219 res@trXMaxF = stringtofloat(parameter(65)) 2220 else 2221 res@trXMaxF = maxiwv 2222 end if 1829 if (xs .EQ. -1) then 1830 res@trXMinF = miniwv 1831 else 1832 res@trXMinF = xs 1833 end if 1834 if (xe .EQ. -1) then 1835 res@trXMaxF = maxiwv 2223 1836 else 2224 1837 res@trXMaxF = xe … … 2237 1850 res@gsnLeftString = vNam(varn) 2238 1851 res@gsnRightString = unit(varn) 2239 if (.not. isvar("xs")) then 2240 if (parameter(63) .NE. "x0") then 2241 res@trXMinF = stringtofloat(parameter(63)) 2242 else 2243 res@trXMinF = miniwpptp 2244 end if 2245 else 2246 res@trXMinF = xs 2247 end if 2248 if (.not. isvar("xe")) then 2249 if (parameter(65) .NE. "xdim") then 2250 res@trXMaxF = stringtofloat(parameter(65)) 2251 else 2252 res@trXMaxF = maxiwpptp 2253 end if 1852 if (xs .EQ. -1) then 1853 res@trXMinF = miniwpptp 1854 else 1855 res@trXMinF = xs 1856 end if 1857 if (xe .EQ. -1) then 1858 res@trXMaxF = maxiwpptp 2254 1859 else 2255 1860 res@trXMaxF = xe … … 2267 1872 res@gsnLeftString = vNam(varn) 2268 1873 res@gsnRightString = unit(varn) 2269 if (.not. isvar("xs")) then 2270 if (parameter(63) .NE. "x0") then 2271 res@trXMinF = stringtofloat(parameter(63)) 2272 else 2273 res@trXMinF = miniwspts 2274 end if 2275 else 2276 res@trXMinF = xs 2277 end if 2278 if (.not. isvar("xe")) then 2279 if (parameter(65) .NE. "xdim") then 2280 res@trXMaxF = stringtofloat(parameter(65)) 2281 else 2282 res@trXMaxF = maxiwspts 2283 end if 1874 if (xs .EQ. -1) then 1875 res@trXMinF = miniwspts 1876 else 1877 res@trXMinF = xs 1878 end if 1879 if (xe .EQ. -1) then 1880 res@trXMaxF = maxiwspts 2284 1881 else 2285 1882 res@trXMaxF = xe … … 2297 1894 res@gsnLeftString = vNam(varn) 2298 1895 res@gsnRightString = unit(varn) 2299 if (.not. isvar("xs")) then 2300 if (parameter(63) .NE. "x0") then 2301 res@trXMinF = stringtofloat(parameter(63)) 2302 else 2303 res@trXMinF = miniwpt 2304 end if 2305 else 2306 res@trXMinF = xs 2307 end if 2308 if (.not. isvar("xe")) then 2309 if (parameter(65) .NE. "xdim") then 2310 res@trXMaxF = stringtofloat(parameter(65)) 2311 else 2312 res@trXMaxF = maxiwpt 2313 end if 1896 if (xs .EQ. -1) then 1897 res@trXMinF = miniwpt 1898 else 1899 res@trXMinF = xs 1900 end if 1901 if (xe .EQ. -1) then 1902 res@trXMaxF = maxiwpt 2314 1903 else 2315 1904 res@trXMaxF = xe … … 2328 1917 res@gsnLeftString = vNam(varn) 2329 1918 res@gsnRightString = unit(varn) 2330 if (.not. isvar("xs")) then 2331 if (parameter(63) .NE. "x0") then 2332 res@trXMinF = stringtofloat(parameter(63)) 2333 else 2334 res@trXMinF = miniwsptsBC 2335 end if 2336 else 2337 res@trXMinF = xs 2338 end if 2339 if (.not. isvar("xe")) then 2340 if (parameter(65) .NE. "xdim") then 2341 res@trXMaxF = stringtofloat(parameter(65)) 2342 else 2343 res@trXMaxF = maxiwsptsBC 2344 end if 2345 else 2346 res@trXMaxF = xe 2347 end if 1919 if (xs .EQ. -1) then 1920 res@trXMinF = miniwsptsBC 1921 else 1922 res@trXMinF = xs 1923 end if 1924 if (xe .EQ. -1) then 1925 res@trXMaxF = maxiwsptsBC 1926 else 1927 res@trXMaxF = xe 1928 end if 2348 1929 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2349 1930 end if … … 2358 1939 res@gsnLeftString = vNam(varn) 2359 1940 res@gsnRightString = unit(varn) 2360 if (.not. isvar("xs")) then 2361 if (parameter(63) .NE. "x0") then 2362 res@trXMinF = stringtofloat(parameter(63)) 2363 else 2364 res@trXMinF = miniwptBC 2365 end if 2366 else 2367 res@trXMinF = xs 2368 end if 2369 if (.not. isvar("xe")) then 2370 if (parameter(65) .NE. "xdim") then 2371 res@trXMaxF = stringtofloat(parameter(65)) 2372 else 2373 res@trXMaxF = maxiwptBC 2374 end if 1941 if (xs .EQ. -1) then 1942 res@trXMinF = miniwptBC 1943 else 1944 res@trXMinF = xs 1945 end if 1946 if (xe .EQ. -1) then 1947 res@trXMaxF = maxiwptBC 2375 1948 else 2376 1949 res@trXMaxF = xe … … 2389 1962 res@gsnLeftString = vNam(varn) 2390 1963 res@gsnRightString = unit(varn) 2391 if (.not. isvar("xs")) then 2392 if (parameter(63) .NE. "x0") then 2393 res@trXMinF = stringtofloat(parameter(63)) 2394 else 2395 res@trXMinF = miniwpvptp 2396 end if 2397 else 2398 res@trXMinF = xs 2399 end if 2400 if (.not. isvar("xe")) then 2401 if (parameter(65) .NE. "xdim") then 2402 res@trXMaxF = stringtofloat(parameter(65)) 2403 else 2404 res@trXMaxF = maxiwpvptp 2405 end if 2406 else 2407 res@trXMaxF = xe 2408 end if 1964 if (xs .EQ. -1) then 1965 res@trXMinF = miniwpvptp 1966 else 1967 res@trXMinF = xs 1968 end if 1969 if (xe .EQ. -1) then 1970 res@trXMaxF = maxiwpvptp 1971 else 1972 res@trXMaxF = xe 1973 end if 2409 1974 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2410 1975 end if … … 2419 1984 res@gsnLeftString = vNam(varn) 2420 1985 res@gsnRightString = unit(varn) 2421 if (.not. isvar("xs")) then 2422 if (parameter(63) .NE. "x0") then 2423 res@trXMinF = stringtofloat(parameter(63)) 2424 else 2425 res@trXMinF = miniwsvpts 2426 end if 2427 else 2428 res@trXMinF = xs 2429 end if 2430 if (.not. isvar("xe")) then 2431 if (parameter(65) .NE. "xdim") then 2432 res@trXMaxF = stringtofloat(parameter(65)) 2433 else 2434 res@trXMaxF = maxiwsvpts 2435 end if 2436 else 2437 res@trXMaxF = xe 2438 end if 1986 if (xs .EQ. -1) then 1987 res@trXMinF = miniwsvpts 1988 else 1989 res@trXMinF = xs 1990 end if 1991 if (xe .EQ. -1) then 1992 res@trXMaxF = maxiwsvpts 1993 else 1994 res@trXMaxF = xe 1995 end if 2439 1996 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2440 1997 end if … … 2449 2006 res@gsnLeftString = vNam(varn) 2450 2007 res@gsnRightString = unit(varn) 2451 if (.not. isvar("xs")) then 2452 if (parameter(63) .NE. "x0") then 2453 res@trXMinF = stringtofloat(parameter(63)) 2454 else 2455 res@trXMinF = miniwvpt 2456 end if 2457 else 2458 res@trXMinF = xs 2459 end if 2460 if (.not. isvar("xe")) then 2461 if (parameter(65) .NE. "xdim") then 2462 res@trXMaxF = stringtofloat(parameter(65)) 2463 else 2464 res@trXMaxF = maxiwvpt 2465 end if 2008 if (xs .EQ. -1) then 2009 res@trXMinF = miniwvpt 2010 else 2011 res@trXMinF = xs 2012 end if 2013 if (xe .EQ. -1) then 2014 res@trXMaxF = maxiwvpt 2466 2015 else 2467 2016 res@trXMaxF = xe … … 2480 2029 res@gsnLeftString = vNam(varn) 2481 2030 res@gsnRightString = unit(varn) 2482 if (.not. isvar("xs")) then 2483 if (parameter(63) .NE. "x0") then 2484 res@trXMinF = stringtofloat(parameter(63)) 2485 else 2486 res@trXMinF = miniwpqp 2487 end if 2488 else 2489 res@trXMinF = xs 2490 end if 2491 if (.not. isvar("xe")) then 2492 if (parameter(65) .NE. "xdim") then 2493 res@trXMaxF = stringtofloat(parameter(65)) 2494 else 2495 res@trXMaxF = maxiwpqp 2496 end if 2031 if (xs .EQ. -1) then 2032 res@trXMinF = miniwpqp 2033 else 2034 res@trXMinF = xs 2035 end if 2036 if (xe .EQ. -1) then 2037 res@trXMaxF = maxiwpqp 2497 2038 else 2498 2039 res@trXMaxF = xe … … 2510 2051 res@gsnLeftString = vNam(varn) 2511 2052 res@gsnRightString = unit(varn) 2512 if (.not. isvar("xs")) then 2513 if (parameter(63) .NE. "x0") then 2514 res@trXMinF = stringtofloat(parameter(63)) 2515 else 2516 res@trXMinF = miniwsqs 2517 end if 2518 else 2519 res@trXMinF = xs 2520 end if 2521 if (.not. isvar("xe")) then 2522 if (parameter(65) .NE. "xdim") then 2523 res@trXMaxF = stringtofloat(parameter(65)) 2524 else 2525 res@trXMaxF = maxiwsqs 2526 end if 2053 if (xs .EQ. -1) then 2054 res@trXMinF = miniwsqs 2055 else 2056 res@trXMinF = xs 2057 end if 2058 if (xe .EQ. -1) then 2059 res@trXMaxF = maxiwsqs 2527 2060 else 2528 2061 res@trXMaxF = xe … … 2540 2073 res@gsnLeftString = vNam(varn) 2541 2074 res@gsnRightString = unit(varn) 2542 if (.not. isvar("xs")) then 2543 if (parameter(63) .NE. "x0") then 2544 res@trXMinF = stringtofloat(parameter(63)) 2545 else 2546 res@trXMinF = miniwq 2547 end if 2548 else 2549 res@trXMinF = xs 2550 end if 2551 if (.not. isvar("xe")) then 2552 if (parameter(65) .NE. "xdim") then 2553 res@trXMaxF = stringtofloat(parameter(65)) 2554 else 2555 res@trXMaxF = maxiwq 2556 end if 2557 else 2558 res@trXMaxF = xe 2559 end if 2075 if (xs .EQ. -1) then 2076 res@trXMinF = miniwq 2077 else 2078 res@trXMinF = xs 2079 end if 2080 if (xe .EQ. -1) then 2081 res@trXMaxF = maxiwq 2082 else 2083 res@trXMaxF = xe 2084 end if 2560 2085 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2561 2086 end if … … 2571 2096 res@gsnLeftString = vNam(varn) 2572 2097 res@gsnRightString = unit(varn) 2573 if (.not. isvar("xs")) then 2574 if (parameter(63) .NE. "x0") then 2575 res@trXMinF = stringtofloat(parameter(63)) 2576 else 2577 res@trXMinF = miniwpqvp 2578 end if 2579 else 2580 res@trXMinF = xs 2581 end if 2582 if (.not. isvar("xe")) then 2583 if (parameter(65) .NE. "xdim") then 2584 res@trXMaxF = stringtofloat(parameter(65)) 2585 else 2586 res@trXMaxF = maxiwpqvp 2587 end if 2588 else 2589 res@trXMaxF = xe 2590 end if 2098 if (xs .EQ. -1) then 2099 res@trXMinF = miniwpqvp 2100 else 2101 res@trXMinF = xs 2102 end if 2103 if (xe .EQ. -1) then 2104 res@trXMaxF = maxiwpqvp 2105 else 2106 res@trXMaxF = xe 2107 end if 2591 2108 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2592 2109 end if … … 2601 2118 res@gsnLeftString = vNam(varn) 2602 2119 res@gsnRightString = unit(varn) 2603 if (.not. isvar("xs")) then 2604 if (parameter(63) .NE. "x0") then 2605 res@trXMinF = stringtofloat(parameter(63)) 2606 else 2607 res@trXMinF = miniwsqvs 2608 end if 2609 else 2610 res@trXMinF = xs 2611 end if 2612 if (.not. isvar("xe")) then 2613 if (parameter(65) .NE. "xdim") then 2614 res@trXMaxF = stringtofloat(parameter(65)) 2615 else 2616 res@trXMaxF = maxiwsqvs 2617 end if 2120 if (xs .EQ. -1) then 2121 res@trXMinF = miniwsqvs 2122 else 2123 res@trXMinF = xs 2124 end if 2125 if (xe .EQ. -1) then 2126 res@trXMaxF = maxiwsqvs 2618 2127 else 2619 2128 res@trXMaxF = xe … … 2631 2140 res@gsnLeftString = vNam(varn) 2632 2141 res@gsnRightString = unit(varn) 2633 if (.not. isvar("xs")) then 2634 if (parameter(63) .NE. "x0") then 2635 res@trXMinF = stringtofloat(parameter(63)) 2636 else 2637 res@trXMinF = miniwqv 2638 end if 2639 else 2640 res@trXMinF = xs 2641 end if 2642 if (.not. isvar("xe")) then 2643 if (parameter(65) .NE. "xdim") then 2644 res@trXMaxF = stringtofloat(parameter(65)) 2645 else 2646 res@trXMaxF = maxiwqv 2647 end if 2142 if (xs .EQ. -1) then 2143 res@trXMinF = miniwqv 2144 else 2145 res@trXMinF = xs 2146 end if 2147 if (xe .EQ. -1) then 2148 res@trXMaxF = maxiwqv 2648 2149 else 2649 2150 res@trXMaxF = xe … … 2662 2163 res@gsnLeftString = vNam(varn) 2663 2164 res@gsnRightString = unit(varn) 2664 if (.not. isvar("xs")) then 2665 if (parameter(63) .NE. "x0") then 2666 res@trXMinF = stringtofloat(parameter(63)) 2667 else 2668 res@trXMinF = miniwpsp 2669 end if 2670 else 2671 res@trXMinF = xs 2672 end if 2673 if (.not. isvar("xe")) then 2674 if (parameter(65) .NE. "xdim") then 2675 res@trXMaxF = stringtofloat(parameter(65)) 2676 else 2677 res@trXMaxF = maxiwpsp 2678 end if 2165 if (xs .EQ. -1) then 2166 res@trXMinF = miniwpsp 2167 else 2168 res@trXMinF = xs 2169 end if 2170 if (xe .EQ. -1) then 2171 res@trXMaxF = maxiwpsp 2679 2172 else 2680 2173 res@trXMaxF = xe … … 2692 2185 res@gsnLeftString = vNam(varn) 2693 2186 res@gsnRightString = unit(varn) 2694 if (.not. isvar("xs")) then 2695 if (parameter(63) .NE. "x0") then 2696 res@trXMinF = stringtofloat(parameter(63)) 2697 else 2698 res@trXMinF = miniwsss 2699 end if 2700 else 2701 res@trXMinF = xs 2702 end if 2703 if (.not. isvar("xe")) then 2704 if (parameter(65) .NE. "xdim") then 2705 res@trXMaxF = stringtofloat(parameter(65)) 2706 else 2707 res@trXMaxF = maxiwsss 2708 end if 2187 if (xs .EQ. -1) then 2188 res@trXMinF = miniwsss 2189 else 2190 res@trXMinF = xs 2191 end if 2192 if (xe .EQ. -1) then 2193 res@trXMaxF = maxiwsss 2709 2194 else 2710 2195 res@trXMaxF = xe … … 2722 2207 res@gsnLeftString = vNam(varn) 2723 2208 res@gsnRightString = unit(varn) 2724 if (.not. isvar("xs")) then 2725 if (parameter(63) .NE. "x0") then 2726 res@trXMinF = stringtofloat(parameter(63)) 2727 else 2728 res@trXMinF = miniws 2729 end if 2730 else 2731 res@trXMinF = xs 2732 end if 2733 if (.not. isvar("xe")) then 2734 if (parameter(65) .NE. "xdim") then 2735 res@trXMaxF = stringtofloat(parameter(65)) 2736 else 2737 res@trXMaxF = maxiws 2738 end if 2209 if (xs .EQ. -1) then 2210 res@trXMinF = miniws 2211 else 2212 res@trXMinF = xs 2213 end if 2214 if (xe .EQ. -1) then 2215 res@trXMaxF = maxiws 2739 2216 else 2740 2217 res@trXMaxF = xe … … 2753 2230 res@gsnLeftString = vNam(varn) 2754 2231 res@gsnRightString = unit(varn) 2755 if (.not. isvar("xs")) then 2756 if (parameter(63) .NE. "x0") then 2757 res@trXMinF = stringtofloat(parameter(63)) 2758 else 2759 res@trXMinF = miniwpsap 2760 end if 2761 else 2762 res@trXMinF = xs 2763 end if 2764 if (.not. isvar("xe")) then 2765 if (parameter(65) .NE. "xdim") then 2766 res@trXMaxF = stringtofloat(parameter(65)) 2767 else 2768 res@trXMaxF = maxiwpsap 2769 end if 2770 else 2771 res@trXMaxF = xe 2772 end if 2232 if (xs .EQ. -1) then 2233 res@trXMinF = miniwpsap 2234 else 2235 res@trXMinF = xs 2236 end if 2237 if (xe .EQ. -1) then 2238 res@trXMaxF = maxiwpsap 2239 else 2240 res@trXMaxF = xe 2241 end if 2773 2242 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2774 2243 end if … … 2783 2252 res@gsnLeftString = vNam(varn) 2784 2253 res@gsnRightString = unit(varn) 2785 if (.not. isvar("xs")) then 2786 if (parameter(63) .NE. "x0") then 2787 res@trXMinF = stringtofloat(parameter(63)) 2788 else 2789 res@trXMinF = miniwssas 2790 end if 2791 else 2792 res@trXMinF = xs 2793 end if 2794 if (.not. isvar("xe")) then 2795 if (parameter(65) .NE. "xdim") then 2796 res@trXMaxF = stringtofloat(parameter(65)) 2797 else 2798 res@trXMaxF = maxiwssas 2799 end if 2800 else 2801 res@trXMaxF = xe 2802 end if 2254 if (xs .EQ. -1) then 2255 res@trXMinF = miniwssas 2256 else 2257 res@trXMinF = xs 2258 end if 2259 if (xe .EQ. -1) then 2260 res@trXMaxF = maxiwssas 2261 else 2262 res@trXMaxF = xe 2263 end if 2803 2264 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2804 2265 end if … … 2813 2274 res@gsnLeftString = vNam(varn) 2814 2275 res@gsnRightString = unit(varn) 2815 if (.not. isvar("xs")) then 2816 if (parameter(63) .NE. "x0") then 2817 res@trXMinF = stringtofloat(parameter(63)) 2818 else 2819 res@trXMinF = miniwsa 2820 end if 2821 else 2822 res@trXMinF = xs 2823 end if 2824 if (.not. isvar("xe")) then 2825 if (parameter(65) .NE. "xdim") then 2826 res@trXMaxF = stringtofloat(parameter(65)) 2827 else 2828 res@trXMaxF = maxiwsa 2829 end if 2830 else 2831 res@trXMaxF = xe 2832 end if 2276 if (xs .EQ. -1) then 2277 res@trXMinF = miniwsa 2278 else 2279 res@trXMinF = xs 2280 end if 2281 if (xe .EQ. -1) then 2282 res@trXMaxF = maxiwsa 2283 else 2284 res@trXMaxF = xe 2285 end if 2833 2286 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2834 2287 end if … … 2844 2297 res@gsnLeftString = vNam(varn) 2845 2298 res@gsnRightString = unit(varn) 2846 if (.not. isvar("xs")) then 2847 if (parameter(63) .NE. "x0") then 2848 res@trXMinF = stringtofloat(parameter(63)) 2849 else 2850 res@trXMinF = minius2 2851 end if 2852 else 2853 res@trXMinF = xs 2854 end if 2855 if (.not. isvar("xe")) then 2856 if (parameter(65) .NE. "xdim") then 2857 res@trXMaxF = stringtofloat(parameter(65)) 2858 else 2859 res@trXMaxF = maxius2 2860 end if 2861 else 2862 res@trXMaxF = xe 2863 end if 2299 if (xs .EQ. -1) then 2300 res@trXMinF = minius2 2301 else 2302 res@trXMinF = xs 2303 end if 2304 if (xe .EQ. -1) then 2305 res@trXMaxF = maxius2 2306 else 2307 res@trXMaxF = xe 2308 end if 2864 2309 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2865 2310 end if … … 2874 2319 res@gsnLeftString = vNam(varn) 2875 2320 res@gsnRightString = unit(varn) 2876 if (.not. isvar("xs")) then 2877 if (parameter(63) .NE. "x0") then 2878 res@trXMinF = stringtofloat(parameter(63)) 2879 else 2880 res@trXMinF = minivs2 2881 end if 2882 else 2883 res@trXMinF = xs 2884 end if 2885 if (.not. isvar("xe")) then 2886 if (parameter(65) .NE. "xdim") then 2887 res@trXMaxF = stringtofloat(parameter(65)) 2888 else 2889 res@trXMaxF = maxivs2 2890 end if 2891 else 2892 res@trXMaxF = xe 2893 end if 2321 if (xs .EQ. -1) then 2322 res@trXMinF = minivs2 2323 else 2324 res@trXMinF = xs 2325 end if 2326 if (xe .EQ. -1) then 2327 res@trXMaxF = maxivs2 2328 else 2329 res@trXMaxF = xe 2330 end if 2894 2331 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2895 2332 end if … … 2904 2341 res@gsnLeftString = vNam(varn) 2905 2342 res@gsnRightString = unit(varn) 2906 if (.not. isvar("xs")) then 2907 if (parameter(63) .NE. "x0") then 2908 res@trXMinF = stringtofloat(parameter(63)) 2909 else 2910 res@trXMinF = miniws2 2911 end if 2912 else 2913 res@trXMinF = xs 2914 end if 2915 if (.not. isvar("xe")) then 2916 if (parameter(65) .NE. "xdim") then 2917 res@trXMaxF = stringtofloat(parameter(65)) 2918 else 2919 res@trXMaxF = maxiws2 2920 end if 2921 else 2922 res@trXMaxF = xe 2923 end if 2343 if (xs .EQ. -1) then 2344 res@trXMinF = miniws2 2345 else 2346 res@trXMinF = xs 2347 end if 2348 if (xe .EQ. -1) then 2349 res@trXMaxF = maxiws2 2350 else 2351 res@trXMaxF = xe 2352 end if 2924 2353 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2925 2354 end if … … 2935 2364 res@gsnLeftString = vNam(varn) 2936 2365 res@gsnRightString = unit(varn) 2937 if (.not. isvar("xs")) then 2938 if (parameter(63) .NE. "x0") then 2939 res@trXMinF = stringtofloat(parameter(63)) 2940 else 2941 res@trXMinF = miniwsususodz 2942 end if 2943 else 2944 res@trXMinF = xs 2945 end if 2946 if (.not. isvar("xe")) then 2947 if (parameter(65) .NE. "xdim") then 2948 res@trXMaxF = stringtofloat(parameter(65)) 2949 else 2950 res@trXMaxF = maxiwsususodz 2951 end if 2952 else 2953 res@trXMaxF = xe 2954 end if 2366 if (xs .EQ. -1) then 2367 res@trXMinF = miniwsususodz 2368 else 2369 res@trXMinF = xs 2370 end if 2371 if (xe .EQ. -1) then 2372 res@trXMaxF = maxiwsususodz 2373 else 2374 res@trXMaxF = xe 2375 end if 2955 2376 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2956 2377 end if … … 2965 2386 res@gsnLeftString = vNam(varn) 2966 2387 res@gsnRightString = unit(varn) 2967 if (.not. isvar("xs")) then 2968 if (parameter(63) .NE. "x0") then 2969 res@trXMinF = stringtofloat(parameter(63)) 2970 else 2971 res@trXMinF = miniwspsodz 2972 end if 2973 else 2974 res@trXMinF = xs 2975 end if 2976 if (.not. isvar("xe")) then 2977 if (parameter(65) .NE. "xdim") then 2978 res@trXMaxF = stringtofloat(parameter(65)) 2979 else 2980 res@trXMaxF = maxiwspsodz 2981 end if 2982 else 2983 res@trXMaxF = xe 2984 end if 2388 if (xs .EQ. -1) then 2389 res@trXMinF = miniwspsodz 2390 else 2391 res@trXMinF = xs 2392 end if 2393 if (xe .EQ. -1) then 2394 res@trXMaxF = maxiwspsodz 2395 else 2396 res@trXMaxF = xe 2397 end if 2985 2398 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 2986 2399 end if … … 2995 2408 res@gsnLeftString = vNam(varn) 2996 2409 res@gsnRightString = unit(varn) 2997 if (.not. isvar("xs")) then 2998 if (parameter(63) .NE. "x0") then 2999 res@trXMinF = stringtofloat(parameter(63)) 3000 else 3001 res@trXMinF = miniwpeodz 3002 end if 3003 else 3004 res@trXMinF = xs 3005 end if 3006 if (.not. isvar("xe")) then 3007 if (parameter(65) .NE. "xdim") then 3008 res@trXMaxF = stringtofloat(parameter(65)) 3009 else 3010 res@trXMaxF = maxiwpeodz 3011 end if 3012 else 3013 res@trXMaxF = xe 3014 end if 2410 if (xs .EQ. -1) then 2411 res@trXMinF = miniwpeodz 2412 else 2413 res@trXMinF = xs 2414 end if 2415 if (xe .EQ. -1) then 2416 res@trXMaxF = maxiwpeodz 2417 else 2418 res@trXMaxF = xe 2419 end if 3015 2420 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 3016 2421 end if … … 3039 2444 if (count_var .EQ. 0) then 3040 2445 print(" ") 3041 print("The variables 'var=°"+var+"°' do not exist on your input file") 2446 print("The variables 'var="+var+"' do not exist on your input file;") 2447 print("be sure to have one comma berfore and after each variable") 3042 2448 print(" ") 3043 2449 exit … … 3048 2454 string_len=new(12,integer) 3049 2455 multi_dash=new(no_files,string) 3050 if (.not. isvar("name_legend_1")) 3051 multi_legend(0)=" "+parameter(83) 3052 else 3053 multi_legend(0)=" "+name_legend_1 3054 end if 2456 multi_legend(0)=" "+name_legend_1 3055 2457 string_len(0)=strlen(multi_legend(0)) 3056 if (.not. isvar("name_legend_2")) 3057 multi_legend(1)=" "+parameter(87) 3058 else 3059 multi_legend(1)=" "+name_legend_2 3060 end if 2458 multi_legend(1)=" "+name_legend_2 3061 2459 string_len(1)=strlen(multi_legend(1)) 3062 if (.not. isvar("name_legend_3")) 3063 multi_legend(2)=" "+parameter(91) 3064 else 3065 multi_legend(2)=" "+name_legend_3 3066 end if 2460 multi_legend(2)=" "+name_legend_3 3067 2461 string_len(2)=strlen(multi_legend(2)) 3068 if (.not. isvar("name_legend_4")) 3069 multi_legend(3)=" "+parameter(95) 3070 else 3071 multi_legend(3)=" "+name_legend_4 3072 end if 2462 multi_legend(3)=" "+name_legend_4 3073 2463 string_len(3)=strlen(multi_legend(3)) 3074 if (.not. isvar("name_legend_5")) 3075 multi_legend(4)=" "+parameter(99) 3076 else 3077 multi_legend(4)=" "+name_legend_5 3078 end if 2464 multi_legend(4)=" "+name_legend_5 3079 2465 string_len(4)=strlen(multi_legend(4)) 3080 if (.not. isvar("name_legend_6")) 3081 multi_legend(5)=" "+parameter(103) 3082 else 3083 multi_legend(5)=" "+name_legend_6 3084 end if 2466 multi_legend(5)=" "+name_legend_6 3085 2467 string_len(5)=strlen(multi_legend(5)) 3086 if (.not. isvar("name_legend_7")) 3087 multi_legend(6)=" "+parameter(107) 3088 else 3089 multi_legend(6)=" "+name_legend_7 3090 end if 2468 multi_legend(6)=" "+name_legend_7 3091 2469 string_len(6)=strlen(multi_legend(6)) 3092 if (.not. isvar("name_legend_8")) 3093 multi_legend(7)=" "+parameter(111) 3094 else 3095 multi_legend(7)=" "+name_legend_8 3096 end if 2470 multi_legend(7)=" "+name_legend_8 3097 2471 string_len(7)=strlen(multi_legend(7)) 3098 if (.not. isvar("name_legend_9")) 3099 multi_legend(8)=" "+parameter(115) 3100 else 3101 multi_legend(8)=" "+name_legend_9 3102 end if 2472 multi_legend(8)=" "+name_legend_9 3103 2473 string_len(8)=strlen(multi_legend(8)) 3104 if (.not. isvar("name_legend_10")) 3105 multi_legend(9)=" "+parameter(119) 3106 else 3107 multi_legend(9)=" "+name_legend_10 3108 end if 2474 multi_legend(9)=" "+name_legend_10 3109 2475 string_len(9)=strlen(multi_legend(9)) 3110 if (.not. isvar("name_legend_11")) 3111 multi_legend(10)=" "+parameter(123) 3112 else 3113 multi_legend(10)=" "+name_legend_11 3114 end if 2476 multi_legend(10)=" "+name_legend_11 3115 2477 string_len(10)=strlen(multi_legend(10)) 3116 if (.not. isvar("name_legend_12")) 3117 multi_legend(11)=" "+parameter(127) 3118 else 3119 multi_legend(11)=" "+name_legend_12 3120 end if 2478 multi_legend(11)=" "+name_legend_12 3121 2479 string_len(11)=strlen(multi_legend(11)) 3122 2480 do ml=1,no_files … … 3235 2593 end if 3236 2594 3237 if (.not. isvar("var")) then 3238 if (parameter(21) .NE. "variables") then 3239 var=parameter(21) 3240 check = isStrSubset( var,","+vNam(varn)+"," ) 3241 end if 3242 else 2595 if (var .NE. "all") then 3243 2596 check = isStrSubset( var,","+vNam(varn)+"," ) 3244 2597 end if … … 3280 2633 res@trYMinF = min_z 3281 2634 res@trYMaxF = max_z 3282 if (.not. isvar("xs")) then 3283 if (parameter(63) .NE. "x0") then 3284 res@trXMinF = stringtofloat(parameter(63)) 3285 else 3286 res@trXMinF = min(data(varn,:,:)) 3287 end if 2635 if (xs .EQ. -1) then 2636 res@trXMinF = min(data(varn,:,:)) 3288 2637 else 3289 2638 res@trXMinF = xs 3290 2639 end if 3291 if (.not. isvar("xe")) then 3292 if (parameter(65) .NE. "xdim") then 3293 res@trXMaxF = stringtofloat(parameter(65)) 3294 else 3295 res@trXMaxF = max(data(varn,:,:)) 3296 end if 2640 if (xe .EQ. -1) then 2641 res@trXMaxF = max(data(varn,:,:)) 3297 2642 else 3298 2643 res@trXMaxF = xe … … 3304 2649 res@gsnLeftString = "u, v and w" 3305 2650 res@gsnRightString = unit(varn) 3306 if (.not. isvar("xs")) then 3307 if (parameter(63) .NE. "x0") then 3308 res@trXMinF = stringtofloat(parameter(63)) 3309 else 3310 res@trXMinF = min((/miniu,miniv,miniw/)) 3311 end if 2651 if (xs .EQ. -1) then 2652 res@trXMinF = min((/miniu,miniv,miniw/)) 3312 2653 else 3313 2654 res@trXMinF = xs 3314 2655 end if 3315 if (.not. isvar("xe")) then 3316 if (parameter(65) .NE. "xdim") then 3317 res@trXMaxF = stringtofloat(parameter(65)) 3318 else 3319 res@trXMaxF = max((/maxiu,maxiv,maxiw/)) 3320 end if 2656 if (xe .EQ. -1) then 2657 res@trXMaxF = max((/maxiu,maxiv,maxiw/)) 3321 2658 else 3322 2659 res@trXMaxF = xe … … 3355 2692 res@gsnLeftString = "pt, vpt and lpt" 3356 2693 res@gsnRightString = unit(varn) 3357 if (.not. isvar("xs")) then 3358 if (parameter(63) .NE. "x0") then 3359 res@trXMinF = stringtofloat(parameter(63)) 3360 else 3361 res@trXMinF = min((/minipt,minivpt,minilpt/)) 3362 end if 2694 if (xs .EQ. -1) then 2695 res@trXMinF = min((/minipt,minivpt,minilpt/)) 3363 2696 else 3364 2697 res@trXMinF = xs 3365 2698 end if 3366 if (.not. isvar("xe")) then 3367 if (parameter(65) .NE. "xdim") then 3368 res@trXMaxF = stringtofloat(parameter(65)) 3369 else 3370 res@trXMaxF = max((/maxipt,maxivpt,maxilpt/)) 3371 end if 2699 if (xe .EQ. -1) then 2700 res@trXMaxF = max((/maxipt,maxivpt,maxilpt/)) 3372 2701 else 3373 2702 res@trXMaxF = xe … … 3406 2735 res@gsnLeftString = "q, qv and ql" 3407 2736 res@gsnRightString = unit(varn) 3408 if (.not. isvar("xs")) then 3409 if (parameter(63) .NE. "x0") then 3410 res@trXMinF = stringtofloat(parameter(63)) 3411 else 3412 res@trXMinF = min((/miniq,miniqv,miniql/)) 3413 end if 2737 if (xs .EQ. -1) then 2738 res@trXMinF = min((/miniq,miniqv,miniql/)) 3414 2739 else 3415 2740 res@trXMinF = xs 3416 2741 end if 3417 if (.not. isvar("xe")) then 3418 if (parameter(65) .NE. "xdim") then 3419 res@trXMaxF = stringtofloat(parameter(65)) 3420 else 3421 res@trXMaxF = max((/maxiq,maxiqv,maxiql/)) 3422 end if 2742 if (xe .EQ. -1) then 2743 res@trXMaxF = max((/maxiq,maxiqv,maxiql/)) 3423 2744 else 3424 2745 res@trXMaxF = xe 3425 end if 2746 end if 3426 2747 3427 2748 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) … … 3458 2779 res@gsnLeftString = "e and es" 3459 2780 res@gsnRightString = unit(varn) 3460 if (.not. isvar("xs")) then 3461 if (parameter(63) .NE. "x0") then 3462 res@trXMinF = stringtofloat(parameter(63)) 3463 else 3464 res@trXMinF = min((/minie,minies/)) 3465 end if 2781 if (xs .EQ. -1) then 2782 res@trXMinF = min((/minie,minies/)) 3466 2783 else 3467 2784 res@trXMinF = xs 3468 2785 end if 3469 if (.not. isvar("xe")) then 3470 if (parameter(65) .NE. "xdim") then 3471 res@trXMaxF = stringtofloat(parameter(65)) 3472 else 3473 res@trXMaxF = max((/maxie,maxies/)) 3474 end if 2786 if (xe .EQ. -1) then 2787 res@trXMaxF = max((/maxie,maxies/)) 3475 2788 else 3476 2789 res@trXMaxF = xe 3477 end if 3478 2790 end if 2791 3479 2792 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 3480 2793 … … 3509 2822 res@gsnLeftString = "km and kh" 3510 2823 res@gsnRightString = unit(varn) 3511 if (.not. isvar("xs")) then 3512 if (parameter(63) .NE. "x0") then 3513 res@trXMinF = stringtofloat(parameter(63)) 3514 else 3515 res@trXMinF = min((/minikm,minikh/)) 3516 end if 2824 if (xs .EQ. -1) then 2825 res@trXMinF = min((/minikm,minikh/)) 3517 2826 else 3518 2827 res@trXMinF = xs 3519 2828 end if 3520 if (.not. isvar("xe")) then 3521 if (parameter(65) .NE. "xdim") then 3522 res@trXMaxF = stringtofloat(parameter(65)) 3523 else 3524 res@trXMaxF = max((/maxikm,maxikh/)) 3525 end if 2829 if (xe .EQ. -1) then 2830 res@trXMaxF = max((/maxikm,maxikh/)) 3526 2831 else 3527 2832 res@trXMaxF = xe 3528 end if 2833 end if 3529 2834 3530 2835 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) … … 3561 2866 res@gsnLeftString = "wpup, wsus and wu" 3562 2867 res@gsnRightString = unit(varn) 3563 if (.not. isvar("xs")) then 3564 if (parameter(63) .NE. "x0") then 3565 res@trXMinF = stringtofloat(parameter(63)) 3566 else 3567 res@trXMinF = min((/miniwpup,miniwsus,miniwu/)) 3568 end if 2868 if (xs .EQ. -1) then 2869 res@trXMinF = min((/miniwpup,miniwsus,miniwu/)) 3569 2870 else 3570 2871 res@trXMinF = xs 3571 2872 end if 3572 if (.not. isvar("xe")) then 3573 if (parameter(65) .NE. "xdim") then 3574 res@trXMaxF = stringtofloat(parameter(65)) 3575 else 3576 res@trXMaxF = max((/maxiwpup,maxiwsus,maxiwu/)) 3577 end if 2873 if (xe .EQ. -1) then 2874 res@trXMaxF = max((/maxiwpup,maxiwsus,maxiwu/)) 3578 2875 else 3579 2876 res@trXMaxF = xe 3580 end if 2877 end if 3581 2878 3582 2879 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) … … 3612 2909 res@gsnLeftString = "wpvp, wsus and wv" 3613 2910 res@gsnRightString = unit(varn) 3614 if (.not. isvar("xs")) then 3615 if (parameter(63) .NE. "x0") then 3616 res@trXMinF = stringtofloat(parameter(63)) 3617 else 3618 res@trXMinF = min((/miniwpvp,miniwsvs,miniwv/)) 3619 end if 2911 if (xs .EQ. -1) then 2912 res@trXMinF = min((/miniwpvp,miniwsvs,miniwv/)) 3620 2913 else 3621 2914 res@trXMinF = xs 3622 2915 end if 3623 if (.not. isvar("xe")) then 3624 if (parameter(65) .NE. "xdim") then 3625 res@trXMaxF = stringtofloat(parameter(65)) 3626 else 3627 res@trXMaxF = max((/maxiwpvp,maxiwsvs,maxiwv/)) 3628 end if 2916 if (xe .EQ. -1) then 2917 res@trXMaxF = max((/maxiwpvp,maxiwsvs,maxiwv/)) 3629 2918 else 3630 2919 res@trXMaxF = xe 3631 2920 end if 3632 2921 3633 2922 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 3634 2923 … … 3663 2952 res@gsnLeftString = "wpptp, wspts and wv" 3664 2953 res@gsnRightString = unit(varn) 3665 if (.not. isvar("xs")) then 3666 if (parameter(63) .NE. "x0") then 3667 res@trXMinF = stringtofloat(parameter(63)) 3668 else 3669 res@trXMinF = min((/miniwpptp,miniwspts,miniwpt/)) 3670 end if 2954 if (xs .EQ. -1) then 2955 res@trXMinF = min((/miniwpptp,miniwspts,miniwpt/)) 3671 2956 else 3672 2957 res@trXMinF = xs 3673 2958 end if 3674 if (.not. isvar("xe")) then 3675 if (parameter(65) .NE. "xdim") then 3676 res@trXMaxF = stringtofloat(parameter(65)) 3677 else 3678 res@trXMaxF = max((/maxiwpptp,maxiwspts,maxiwpt/)) 3679 end if 2959 if (xe .EQ. -1) then 2960 res@trXMaxF = max((/maxiwpptp,maxiwspts,maxiwpt/)) 3680 2961 else 3681 2962 res@trXMaxF = xe 3682 end if 2963 end if 3683 2964 3684 2965 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) … … 3714 2995 res@gsnLeftString = "wsptsBC and wptBC" 3715 2996 res@gsnRightString = unit(varn) 3716 if (.not. isvar("xs")) then 3717 if (parameter(63) .NE. "x0") then 3718 res@trXMinF = stringtofloat(parameter(63)) 3719 else 3720 res@trXMinF = min((/miniwsptsBC,miniwptBC/)) 3721 end if 2997 if (xs .EQ. -1) then 2998 res@trXMinF = min((/miniwsptsBC,miniwptBC/)) 3722 2999 else 3723 3000 res@trXMinF = xs 3724 3001 end if 3725 if (.not. isvar("xe")) then 3726 if (parameter(65) .NE. "xdim") then 3727 res@trXMaxF = stringtofloat(parameter(65)) 3728 else 3729 res@trXMaxF = max((/maxiwsptsBC,maxiwptBC/)) 3730 end if 3002 if (xe .EQ. -1) then 3003 res@trXMaxF = max((/maxiwsptsBC,maxiwptBC/)) 3731 3004 else 3732 3005 res@trXMaxF = xe 3733 end if 3006 end if 3734 3007 3735 3008 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) … … 3765 3038 res@gsnLeftString = "wpvptp, wsvpts and wv" 3766 3039 res@gsnRightString = unit(varn) 3767 if (.not. isvar("xs")) then 3768 if (parameter(63) .NE. "x0") then 3769 res@trXMinF = stringtofloat(parameter(63)) 3770 else 3771 res@trXMinF = min((/miniwpvptp,miniwsvpts,miniwvpt/)) 3772 end if 3040 if (xs .EQ. -1) then 3041 res@trXMinF = min((/miniwpvptp,miniwsvpts,miniwvpt/)) 3773 3042 else 3774 3043 res@trXMinF = xs 3775 3044 end if 3776 if (.not. isvar("xe")) then 3777 if (parameter(65) .NE. "xdim") then 3778 res@trXMaxF = stringtofloat(parameter(65)) 3779 else 3780 res@trXMaxF = max((/maxiwpvptp,maxiwsvpts,maxiwvpt/)) 3781 end if 3045 if (xe .EQ. -1) then 3046 res@trXMaxF = max((/maxiwpvptp,maxiwsvpts,maxiwvpt/)) 3782 3047 else 3783 3048 res@trXMaxF = xe 3784 end if 3785 3049 end if 3050 3786 3051 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 3787 3052 … … 3816 3081 res@gsnLeftString = "wpqp, wsqs and wq" 3817 3082 res@gsnRightString = unit(varn) 3818 if (.not. isvar("xs")) then 3819 if (parameter(63) .NE. "x0") then 3820 res@trXMinF = stringtofloat(parameter(63)) 3821 else 3822 res@trXMinF = min((/miniwpqp,miniwsqs,miniwq/)) 3823 end if 3083 if (xs .EQ. -1) then 3084 res@trXMinF = min((/miniwpqp,miniwsqs,miniwq/)) 3824 3085 else 3825 3086 res@trXMinF = xs 3826 3087 end if 3827 if (.not. isvar("xe")) then 3828 if (parameter(65) .NE. "xdim") then 3829 res@trXMaxF = stringtofloat(parameter(65)) 3830 else 3831 res@trXMaxF = max((/maxiwpqp,maxiwsqs,maxiwq/)) 3832 end if 3088 if (xe .EQ. -1) then 3089 res@trXMaxF = max((/maxiwpqp,maxiwsqs,maxiwq/)) 3833 3090 else 3834 3091 res@trXMaxF = xe 3835 end if 3836 3092 end if 3093 3837 3094 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 3838 3095 … … 3867 3124 res@gsnLeftString = "wpqvp, wsqvs and wqv" 3868 3125 res@gsnRightString = unit(varn) 3869 if (.not. isvar("xs")) then 3870 if (parameter(63) .NE. "x0") then 3871 res@trXMinF = stringtofloat(parameter(63)) 3872 else 3873 res@trXMinF = min((/miniwpqp,miniwsqvs,miniwqv/)) 3874 end if 3126 if (xs .EQ. -1) then 3127 res@trXMinF = min((/miniwpqp,miniwsqvs,miniwqv/)) 3875 3128 else 3876 3129 res@trXMinF = xs 3877 3130 end if 3878 if (.not. isvar("xe")) then 3879 if (parameter(65) .NE. "xdim") then 3880 res@trXMaxF = stringtofloat(parameter(65)) 3881 else 3882 res@trXMaxF = max((/maxiwpqp,maxiwsqvs,maxiwqv/)) 3883 end if 3131 if (xe .EQ. -1) then 3132 res@trXMaxF = max((/maxiwpqp,maxiwsqvs,maxiwqv/)) 3884 3133 else 3885 3134 res@trXMaxF = xe 3886 end if 3887 3135 end if 3136 3888 3137 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 3889 3138 … … 3918 3167 res@gsnLeftString = "wpsp, wsss and ws" 3919 3168 res@gsnRightString = unit(varn) 3920 if (.not. isvar("xs")) then 3921 if (parameter(63) .NE. "x0") then 3922 res@trXMinF = stringtofloat(parameter(63)) 3923 else 3924 res@trXMinF = min((/miniwpsp,miniwsss,miniws/)) 3925 end if 3169 if (xs .EQ. -1) then 3170 res@trXMinF = min((/miniwpsp,miniwsss,miniws/)) 3926 3171 else 3927 3172 res@trXMinF = xs 3928 3173 end if 3929 if (.not. isvar("xe")) then 3930 if (parameter(65) .NE. "xdim") then 3931 res@trXMaxF = stringtofloat(parameter(65)) 3932 else 3933 res@trXMaxF = max((/maxiwpsp,maxiwsss,maxiws/)) 3934 end if 3174 if (xe .EQ. -1) then 3175 res@trXMaxF = max((/maxiwpsp,maxiwsss,maxiws/)) 3935 3176 else 3936 3177 res@trXMaxF = xe 3937 end if 3178 end if 3938 3179 3939 3180 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) … … 3969 3210 res@gsnLeftString = "wpsap, wssas and wsa" 3970 3211 res@gsnRightString = unit(varn) 3971 if (.not. isvar("xs")) then 3972 if (parameter(63) .NE. "x0") then 3973 res@trXMinF = stringtofloat(parameter(63)) 3974 else 3975 res@trXMinF = min((/miniwpsap,miniwssas,miniwsa/)) 3976 end if 3212 if (xs .EQ. -1) then 3213 res@trXMinF = min((/miniwpsap,miniwssas,miniwsa/)) 3977 3214 else 3978 3215 res@trXMinF = xs 3979 3216 end if 3980 if (.not. isvar("xe")) then 3981 if (parameter(65) .NE. "xdim") then 3982 res@trXMaxF = stringtofloat(parameter(65)) 3983 else 3984 res@trXMaxF = max((/maxiwpsap,maxiwssas,maxiwsa/)) 3985 end if 3217 if (xe .EQ. -1) then 3218 res@trXMaxF = max((/maxiwpsap,maxiwssas,maxiwsa/)) 3986 3219 else 3987 3220 res@trXMaxF = xe 3988 end if 3221 end if 3989 3222 3990 3223 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) … … 4021 3254 res@gsnLeftString = "us2, vs2 and ws2" 4022 3255 res@gsnRightString = unit(varn) 4023 if (.not. isvar("xs")) then 4024 if (parameter(63) .NE. "x0") then 4025 res@trXMinF = stringtofloat(parameter(63)) 4026 else 4027 res@trXMinF = min((/minius2,minivs2,miniws2/)) 4028 end if 3256 if (xs .EQ. -1) then 3257 res@trXMinF = min((/minius2,minivs2,miniws2/)) 4029 3258 else 4030 3259 res@trXMinF = xs 4031 3260 end if 4032 if (.not. isvar("xe")) then 4033 if (parameter(65) .NE. "xdim") then 4034 res@trXMaxF = stringtofloat(parameter(65)) 4035 else 4036 res@trXMaxF = max((/maxius2,maxivs2,maxiws2/)) 4037 end if 4038 else 3261 if (xe .EQ. -1) then 3262 res@trXMaxF = max((/maxius2,maxivs2,maxiws2/)) 3263 else 4039 3264 res@trXMaxF = xe 4040 end if 4041 3265 end if 3266 4042 3267 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 4043 3268 … … 4073 3298 res@gsnLeftString = "wsususodz, wspsodz and ws2" 4074 3299 res@gsnRightString = unit(varn) 4075 if (.not. isvar("xs")) then 4076 if (parameter(63) .NE. "x0") then 4077 res@trXMinF = stringtofloat(parameter(63)) 4078 else 4079 res@trXMinF = min((/miniwsususodz,miniwspsodz,miniwpeodz/)) 4080 end if 3300 if (xs .EQ. -1) then 3301 res@trXMinF = min((/miniwsususodz,miniwspsodz,miniwpeodz/)) 4081 3302 else 4082 3303 res@trXMinF = xs 4083 3304 end if 4084 if (.not. isvar("xe")) then 4085 if (parameter(65) .NE. "xdim") then 4086 res@trXMaxF = stringtofloat(parameter(65)) 4087 else 4088 res@trXMaxF = max((/maxiwsususodz,maxiwspsodz,maxiwpeodz/)) 4089 end if 3305 if (xe .EQ. -1) then 3306 res@trXMaxF = max((/maxiwsususodz,maxiwspsodz,maxiwpeodz/)) 4090 3307 else 4091 3308 res@trXMaxF = xe 4092 end if 4093 3309 end if 3310 4094 3311 plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 4095 3312 … … 4126 3343 end if 4127 3344 end do 4128 end if 3345 end if 3346 3347 com_var_avail=new(count_var,string) 4129 3348 4130 3349 if (combine .EQ. 1) then … … 4145 3364 end if 4146 3365 4147 if (.not. isvar("var")) then 4148 if (parameter(21) .NE. "variables") then 4149 var=parameter(21) 4150 check = isStrSubset( var,","+vNam(varn)+"," ) 4151 end if 4152 else 3366 if (var .NE. "all") then 4153 3367 check = isStrSubset( var,","+vNam(varn)+"," ) 4154 3368 end if … … 4185 3399 4186 3400 z=z/norm 4187 3401 3402 com_var_avail(n_o)=vNam(varn) 3403 4188 3404 com=isStrSubset( c_var,","+vNam(varn)+"," ) 4189 3405 … … 4199 3415 res@gsnLeftString = "Combined Plot of "+c_var 4200 3416 res@gsnRightString = unit(varn) 4201 if (.not. isvar("xs")) then 4202 if (parameter(63) .NE. "x0") then 4203 res@trXMinF = stringtofloat(parameter(63)) 4204 else 4205 res@trXMinF = min(mini) 4206 end if 3417 if (xs .EQ. -1) then 3418 res@trXMinF = min(mini) 4207 3419 else 4208 3420 res@trXMinF = xs 4209 3421 end if 4210 if (.not. isvar("xe")) then 4211 if (parameter(65) .NE. "xdim") then 4212 res@trXMaxF = stringtofloat(parameter(65)) 4213 else 4214 res@trXMaxF = max(maxi) 4215 end if 3422 if (xe .EQ. -1) then 3423 res@trXMaxF = max(maxi) 4216 3424 else 4217 3425 res@trXMaxF = xe … … 4234 3442 overlay(plot_o(0),plot_o(1)) 4235 3443 else 4236 if (.not. isvar("var") .AND. parameter(21) .EQ. "variables") then 4237 print(" ") 4238 print("'c_var'(= "+c_var+") is not conform with existing variables on the input file") 4239 print(" ") 4240 else 4241 print(" ") 4242 print("'c_var'(= "+c_var+") must include two variables of the general plots ('var' = "+var+")") 4243 print(" ") 4244 end if 3444 print(" ") 3445 print("combining is not possible,") 3446 print("'c_var'(= "+c_var+") must include two variables of the general plots = ") 3447 print("- "+com_var_avail) 3448 print("be sure to have one comma berfore and after the variable") 3449 print(" ") 3450 exit 4245 3451 end if 4246 3452 end if … … 4250 3456 overlay(plot_o(0),plot_o(2)) 4251 3457 else 4252 if (.not. isvar("var") .AND. parameter(21) .EQ. "variables") then 4253 print(" ") 4254 print("'c_var'(= "+c_var+") is not conform with existing variables on the input file") 4255 print(" ") 4256 else 4257 print(" ") 4258 print("'c_var'(= "+c_var+") must include three variables of the general plots ('var' = "+var+")") 4259 print(" ") 4260 end if 3458 print(" ") 3459 print("combining is not possible,") 3460 print("'c_var'(= "+c_var+") must include three variables of the general plots = ") 3461 print("- "+com_var_avail) 3462 print("be sure to have one comma berfore and after the variable") 3463 print(" ") 3464 exit 4261 3465 end if 4262 3466 end if -
palm/trunk/SCRIPTS/NCL/spectra.ncl
r183 r190 2 2 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" 3 3 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" 4 4 5 ;*************************************************** 6 ; load ncl_preferences.ncl 7 ;*************************************************** 8 9 if (isfilepresent("~/ncl_preferences.ncl")) then 10 loadscript("~/ncl_preferences.ncl") 11 else 12 if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")) then 13 loadscript( "~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl") 14 else 15 print(" ") 16 print("'ncl_preferences.ncl' does not exist in $home or $home/palm/current_version/trunk/SCRIPTS/NCL/") 17 print(" ") 18 exit 19 end if 20 end if 21 5 22 begin 6 7 ; *************************************************** 8 ; read parameter_list 9 ; *************************************************** 10 11 if (isfilepresent("~/.ncl_preferences")) then 12 parameter = asciiread("~/.ncl_preferences",129,"string") 13 delete(parameter@_FillValue) 14 else 15 if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/.ncl_preferences")) then 16 parameter = asciiread("~/palm/current_version/trunk/SCRIPTS/NCL/.ncl_preferences",129,"string") 17 delete(parameter@_FillValue) 18 else 19 print(" ") 20 print("'.ncl_preferences' does not exist in '~/palm/current_version/trunk/SCRIPTS/NCL/'") 21 print(" ") 22 exit 23 end if 24 end if 25 26 if ( .not. isvar("file_1") ) then 27 if (parameter(7) .EQ. "File in") then 28 print(" ") 29 print("Please provide 1st input file 'file_1=' either in prompt or parameter_list") 30 print(" ") 31 exit 32 else 33 file_in = parameter(7) 34 end if 23 24 if (cross_sections .NE. 0 .OR. profiles .NE. 0 .OR. timeseries .NE. 0 .OR. spectra .NE. 1)then 25 print(" ") 26 print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)") 27 print(" ") 28 print("Set 'spectra' equal 1 and the other variables equal 0") 29 print(" ") 30 exit 31 end if 32 33 ;*************************************************** 34 ; set up default parameter values and strings 35 ;*************************************************** 36 37 if (file_1 .EQ. "File in") then 38 print(" ") 39 print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'") 40 print(" ") 41 exit 35 42 else 36 43 file_in = file_1 … … 38 45 if (.not. isfilepresent(file_in)) then 39 46 print(" ") 40 print(" Your1st input file: '"+file_in+"' does not exist")47 print("1st input file: '"+file_in+"' does not exist") 41 48 print(" ") 42 49 exit 43 50 end if 44 51 45 if ( .not. isvar("format_out") ) then 46 format_out = "x11" 47 if (parameter(9) .NE. "x11") then 48 format_out = parameter(9) 49 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 50 print(" ") 51 print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") 52 print(" ") 53 end if 54 end if 55 else 56 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 57 print(" ") 58 print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") 59 print(" ") 60 end if 61 end if 62 63 if ( .not. isvar("file_out") ) then 64 file_out = "test" 65 if (parameter(11) .NE. "test_ts") then 66 file_out = parameter(11) 67 end if 68 end if 69 if ( .not. isvar("no_columns") ) then 70 no_columns = 1 71 if (parameter(17) .NE. "1") then 72 no_columns = stringtointeger(parameter(17)) 73 end if 74 end if 75 if ( .not. isvar("no_lines") ) then 76 no_lines = 2 77 if (parameter(19) .NE. "2") then 78 no_lines = stringtointeger(parameter(19)) 79 end if 52 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 53 print(" ") 54 print("'format_out = "+format_out+"' is invalid and set to'x11'") 55 print(" ") 56 format_out="x11" 80 57 end if 81 82 if (.not. isvar("logy"))then 83 logy = 0 84 if (stringtointeger(parameter(77)) .NE. 0) then 85 logy = stringtointeger(parameter(77)) 86 if (stringtointeger(parameter(77)) .NE. 1) then 87 print(" ") 88 print("Your 'logy'= "+logy+" is invalid and set to 0") 89 print(" ") 90 logy = 0 91 end if 92 end if 93 else 94 if (logy .NE. 0 .AND. logy .NE. 1)then 95 print(" ") 96 print("Your 'logy'= "+logy+" is invalid and set to 0") 97 print(" ") 98 logy = 0 99 end if 100 end if 101 102 if ( .not. isvar("sort") ) then 103 sort = "layer" 104 if (parameter(51) .NE. "layer") then 105 sort = parameter(51) 106 if (sort .NE. "time") then 107 print(" ") 108 print("Your 'sort'= "+sort+" is invalid and set to 'layer'") 109 print(" ") 110 sort = "layer" 111 end if 112 end if 113 else 114 if (sort .NE. "time" .OR. sort .NE. "layer")then 115 print(" ") 116 print("Your 'sort'= "+sort+" is invalid and set to 'layer'") 117 print(" ") 118 sort = "layer" 119 end if 120 end if 121 122 if ( .not. isvar("black") ) then 58 59 if (logx .NE. 0 .AND. logx .NE. 1)then 60 print(" ") 61 print("'logx'= "+logx+" is invalid and set to 1") 62 print(" ") 63 logx = 1 64 end if 65 66 if (logy .NE. 0 .AND. logy .NE. 1)then 67 print(" ") 68 print("'logy'= "+logy+" is invalid and set to 1") 69 print(" ") 70 logy = 1 71 end if 72 73 if (normy .EQ. 0.) then 74 print(" ") 75 print("You cannot normalise the y-axis with 0, 'normy' is set to 1.0") 76 print(" ") 77 normy = 1.0 78 end if 79 if (normx .EQ. 0.) then 80 print(" ") 81 print("You cannot normalise the x-axis with 0, 'normx' is set to 1.0") 82 print(" ") 83 normx= 1.0 84 end if 85 86 if (sort .NE. "height" .AND. sort .NE. "time") then 87 print(" ") 88 print("'sort'= "+sort+" is invalid and set to 'height'") 89 print(" ") 90 sort = "height" 91 end if 92 93 if (black .NE. 0 .AND. black .NE. 1)then 94 print(" ") 95 print("'black'= "+black+" is invalid and set to 0") 96 print(" ") 123 97 black = 0 124 if (parameter(31) .NE. "0") then 125 black = stringtointeger(parameter(31)) 126 if (stringtointeger(parameter(31)) .NE. 1) then 127 print(" ") 128 print("Your 'black'= "+black+" is invalid and set to 0") 129 print(" ") 130 black = 0 131 end if 132 end if 133 else 134 if (black .NE. 0 .AND. black .NE. 1)then 135 print(" ") 136 print("Your 'black'= "+black+" is invalid and set to 0") 137 print(" ") 138 black = 0 139 end if 140 end if 141 if ( .not. isvar("dash") ) then 98 end if 99 100 if (dash .NE. 0 .AND. dash .NE. 1)then 101 print(" ") 102 print("'dash'= "+dash+" is invalid and set to 0") 103 print(" ") 142 104 dash = 0 143 if (parameter(29) .NE. "0") then 144 dash = stringtointeger(parameter(29)) 145 if (stringtointeger(parameter(29)) .NE. 1) then 146 print(" ") 147 print("Your 'dash'= "+dash+" is invalid and set to 0") 148 print(" ") 149 dash = 0 150 end if 151 end if 152 else 153 if (dash .NE. 0 .AND. dash .NE. 1)then 154 print(" ") 155 print("Your 'dash'= "+dash+" is invalid and set to 0") 156 print(" ") 157 dash = 0 158 end if 159 end if 160 161 if ( .not. isvar("norm") ) then 162 norm = 1.0 163 if (parameter(79) .NE. "1") then 164 norm = stringtofloat(parameter(79)) 165 if (stringtofloat(parameter(79)) .EQ. 0) then 166 print(" ") 167 print("You cannot normalise with 0, 'norm' is set to 1") 168 print(" ") 169 norm = 1.0 170 end if 171 end if 172 else 173 if (norm .EQ. 0) then 174 print(" ") 175 print("You cannot normalise with 0, 'norm' is set to 1") 176 print(" ") 177 norm = 1.0 178 end if 179 end if 105 end if 106 107 ;*************************************************** 108 ; open input file 109 ;*************************************************** 180 110 181 111 f=addfile(file_in,"r") … … 183 113 vNam = getfilevarnames(f) 184 114 print(" ") 185 print("Variable in input file: " + vNam) 115 print("Variables in input file:") 116 print("- "+ vNam) 186 117 print(" ") 187 118 dim = dimsizes(vNam) … … 192 123 delta_t=t_all(nt-1)/nt 193 124 125 k_x=f->k_x 126 dimx=dimsizes(k_x) 127 k_y=f->k_y 128 dimy=dimsizes(k_y) 129 130 131 dim_level=dimsizes(height_level) 132 194 133 do i=0,dim-1 195 134 if (vNam(i) .EQ. "zu_sp")then 196 zu=f->zu_sp 197 z=zu 198 dimz=dimsizes(zu) 135 zu=f->zu_sp 136 if (height_level(0) .EQ. -1)then 137 dimz=dimsizes(zu) 138 else 139 if (dim_level .GT. dimsizes(zu))then 140 print(" ") 141 print("'height_level' has more elements than available height levels in input file (= "+dimz+")") 142 print(" ") 143 exit 144 else 145 zuh=new(dim_level,double) 146 do le=0,dim_level-1 147 zuh(le)=zu(height_level(le)) 148 end do 149 dimz=dim_level 150 end if 151 end if 199 152 else 200 153 if (vNam(i) .EQ. "zw_sp")then 201 zw=f->zw_sp 202 z=zw 203 dimz=dimsizes(zw) 154 zw=f->zw_sp 155 if (height_level(0) .EQ. -1)then 156 dimz=dimsizes(zw) 157 else 158 if (dim_level .GT. dimsizes(zw))then 159 print(" ") 160 print("'height_level' has more elements than available height levels in input file (= "+dimz+")") 161 print(" ") 162 exit 163 else 164 zwh=new(dim_level,double) 165 do le=0,dim_level-1 166 zwh(le)=zw(height_level(le)) 167 end do 168 dimz=dim_level 169 end if 170 end if 204 171 end if 205 172 end if 206 173 end do 207 208 ; 174 175 ;**************************************************** 209 176 ; start of time step and different types of mistakes that could be done 210 ; 211 212 if ( .not. isvar("start_time_step")) then177 ;**************************************************** 178 179 if (start_time_step .EQ. -1.d) then 213 180 start_time_step=t_all(0)/3600 214 if (parameter(13) .NE. "t(0)") then 215 if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600)then 216 print(" ") 217 print("'start_time_step' = "+ parameter(13) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") 218 print(" ") 219 print("Please select another 'start_time_step'") 220 print(" ") 221 exit 222 end if 223 if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)then 224 print(" ") 225 print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") 226 exit 227 end if 228 start_time_step=stringtodouble(parameter(13)) 229 end if 230 else 181 else 231 182 if (start_time_step .GT. t_all(nt-1)/3600)then 232 183 print(" ") … … 243 194 end if 244 195 end if 245 start_time_step = start_time_step*3600246 196 247 197 do i=0,nt-1 248 if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then198 if (start_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. start_time_step .LT. (t_all(i)+delta_t/2)/3600)then 249 199 st=i 250 200 break … … 252 202 end do 253 203 254 ; **************************************************** 204 if (.not. isvar("st"))then 205 print(" ") 206 print("'start_time_step' = "+ start_time_step +"h is invalid") 207 print(" ") 208 print("Please select another 'start_time_step'") 209 print(" ") 210 exit 211 end if 212 213 ;**************************************************** 255 214 ; end of time step and different types of mistakes that could be done 256 ; 257 258 if ( .not. isvar("end_time_step")) then215 ;**************************************************** 216 217 if (end_time_step .EQ. -1.d) then 259 218 end_time_step = t_all(nt-1)/3600 260 if (parameter(15) .NE. "t(end)") then261 if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)then262 print(" ")263 print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")264 print(" ")265 print("Please select another 'end_time_step'")266 print(" ")267 exit268 end if269 if (stringtodouble(parameter(15)) .LT. start_time_step/3600)then270 print(" ")271 print("'end_time_step' = "+ parameter(15) +"h is lower than 'start_time_step' = "+start_time_step/3600+"h")272 print(" ")273 print("Please select another 'start_time_step' or 'end_time_step'")274 print(" ")275 exit276 end if277 end_time_step = stringtodouble(parameter(15))278 end if279 219 else 280 220 if (end_time_step .GT. t_all(nt-1)/3600)then … … 295 235 end if 296 236 end if 297 end_time_step = end_time_step*3600298 237 299 238 do i=0,nt-1 300 if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then239 if (end_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. end_time_step .LT. (t_all(i)+delta_t/2)/3600)then 301 240 et=i 302 241 break 303 242 end if 304 243 end do 244 245 if (.not. isvar("et"))then 246 print(" ") 247 print("'end_time_step' = "+ end_time_step +"h is invalid") 248 print(" ") 249 print("Please select another 'end_time_step'") 250 print(" ") 251 exit 252 end if 305 253 306 254 delete(start_time_step) … … 316 264 dimt = end_time_step-start_time_step+1 317 265 318 ; 266 ;*************************************************** 319 267 ; set up recourses 320 ; 268 ;*************************************************** 321 269 322 270 res = True … … 337 285 res@pmLegendDisplayMode = "Always" 338 286 res@pmLegendSide = "Top" 339 res@pmLegendParallelPosF = 1. 15287 res@pmLegendParallelPosF = 1.2 340 288 res@pmLegendOrthogonalPosF = -1.0 341 289 res@pmLegendWidthF = 0.12 … … 345 293 res@pmLegendHeightF = 0.04*dimz 346 294 end if 347 res@lgLabelFontHeightF = .02 348 res@lgTitleFontHeightF = .02 349 res@txFontHeightF = 0.02 350 res@tiXAxisFontHeightF = 0.02 351 res@tiYAxisFontHeightF = 0.02 352 353 if (log y.EQ. 1) then295 res@lgLabelFontHeightF = .025 296 res@lgTitleFontHeightF = .025 297 res@txFontHeightF = 0.025 298 res@tiXAxisFontHeightF = 0.025 299 res@tiYAxisFontHeightF = 0.025 300 301 if (logx .EQ. 1) then 354 302 res@trXLog = True 303 else 304 res@trXLog = False 305 end if 306 if (logy .EQ. 1)then 355 307 res@trYLog = True 356 else 357 res@trXLog = False 308 else 358 309 res@trYLog = False 359 310 end if … … 379 330 res@lgTitleString = "Height [m]" 380 331 do p=0,dimz-1 381 legend_label_zu(p)=round(zu(p),3) 382 legend_label_zw(p)=round(zw(p),3) 332 if (height_level(0) .EQ. -1)then 333 legend_label_zu(p)=round(zu(p),3) 334 legend_label_zw(p)=round(zw(p),3) 335 else 336 legend_label_zu(p)=round(zuh(p),3) 337 legend_label_zw(p)=round(zwh(p),3) 338 end if 383 339 end do 384 340 end if 385 386 if ( black .eq. 0 ) then 387 res@xyLineColors = ispan(2,237,235/np) 341 342 step=round(235/(np-1),3) 343 if (black .eq. 0 ) then 344 res@xyLineColors = ispan(2,237,step) 388 345 end if 389 346 if ( dash .eq. 0 ) then 390 res@xyMonoDashPattern 347 res@xyMonoDashPattern = True 391 348 end if 392 349 393 350 wks=gsn_open_wks(format_out,file_out) 394 351 gsn_define_colormap(wks,"rainbow+white") 352 353 temp=new((/dimt,dimz,dimx/),float) 395 354 396 355 n=0 … … 403 362 end if 404 363 405 if (.not. isvar("var")) then 406 if (parameter(21) .NE. "variables") then 407 var=parameter(21) 408 check = isStrSubset( var,","+vNam(varn)+"," ) 409 end if 410 else 364 if (var .NE. "all") then 411 365 check = isStrSubset( var,","+vNam(varn)+"," ) 412 366 end if 413 367 414 if(check) then 415 368 if(check) then 369 416 370 temp = f->$vNam(varn)$(start_time_step:end_time_step,0:dimz-1,:) 417 418 temp=temp/norm ;SMOOTHING: #temp=smth9(temp/norm, 0.50, -0.25, False)# 419 371 420 372 a=getvardims(temp) 421 b=dimsizes(a) 373 b=dimsizes(a) 374 375 if (height_level(0) .NE. -1)then 376 do te=0,dimz-1 377 temp(:,te,:) = f->$vNam(varn)$(start_time_step:end_time_step,height_level(te),:) 378 end do 379 end if 380 381 temp=temp/(normy*normx) ;SMOOTHING: #temp=smth9(temp/norm, 0.50, -0.25, False)# 382 422 383 do i=0,b-1 423 384 if (isStrSubset( a(i),"zu_sp" ))then 424 385 legend_label_z=legend_label_zu 386 if (height_level(0) .NE. -1)then 387 z=zuh 388 else 389 z=zu 390 end if 425 391 else 426 392 if (isStrSubset( a(i),"zw_sp" ))then 427 legend_label_z=legend_label_zw 393 legend_label_z=legend_label_zw 394 if (height_level(0) .NE. -1)then 395 z=zwh 396 else 397 z=zw 398 end if 428 399 end if 429 400 end if 430 401 end do 402 431 403 if (isStrSubset(vNam(varn),"x"))then 432 404 x_axis = f->k_x 433 res@tiXAxisString = "k_x" 405 x_axis = x_axis/normx 406 if (normx .NE. 1.)then 407 res@tiXAxisString = "k_x / "+normx 408 else 409 res@tiXAxisString = "k_x" 410 end if 434 411 else 435 412 x_axis = f->k_y 436 res@tiXAxisString = "k_y" 413 x_axis = x_axis/normx 414 if (normx .NE. 1.)then 415 res@tiXAxisString = "k_y / "+normx 416 else 417 res@tiXAxisString = "k_y" 418 end if 437 419 end if 438 420 439 421 if (sort .EQ. "time") 440 do p=dimz-1,0,1 441 do q=0,dimt-1 442 do r=0,dimsizes(x_axis)-1 443 if (temp(q,p,r) .EQ. 0)then 444 st=p+start_time_step 445 print(" ") 446 print("'"+vNam(varn)+"("+st+","+q+","+r+")' is equal 0; Logarithmic scale for y-axis cannot be used") 447 print(" ") 448 res@trYLog = False 449 end if 422 do p=dimz-1,0,1 423 if (logy .EQ. 1)then 424 do q=0,dimt-1 425 do r=0,dimsizes(x_axis)-1 426 if (temp(q,p,r) .EQ. 0)then 427 st=p+start_time_step 428 print(" ") 429 print("'"+vNam(varn)+"("+st+","+q+","+r+")' is equal 0; Logarithmic scale for y-axis and height "+z(p)+" cannot be used") 430 print(" ") 431 res@trYLog = False 432 end if 433 end do 450 434 end do 451 end do 435 end if 452 436 res@trXMinF = min(x_axis) 453 437 res@trXMaxF = max(x_axis) 454 438 res@gsnLeftString = vNam(varn) 455 439 res@gsnRightString = "Height = "+z(p)+"m" 456 if (norm .NE. 1)then457 res@tiYAxisString = vNam(varn)+" / "+norm 440 if (normy .NE. 1.)then 441 res@tiYAxisString = vNam(varn)+" / "+normy 458 442 else 459 443 res@tiYAxisString = vNam(varn) … … 464 448 end do 465 449 else 466 if (sort .EQ. " layer")467 do p= dimt-1,0,1450 if (sort .EQ. "height") 451 do p=0,dimt-1 468 452 do q=0,dimz-1 469 453 do r=0,dimsizes(x_axis)-1 … … 471 455 st=p+start_time_step 472 456 print(" ") 473 print("'"+vNam(varn)+"("+st+","+q+","+r+")' is equal 0; Logarithmic scale for y-axis cannot be used")457 print("'"+vNam(varn)+"("+st+","+q+","+r+")' is equal 0; Logarithmic scale for y-axis and time "+legend_label(p)+" cannot be used") 474 458 print(" ") 475 459 res@trYLog = False … … 481 465 res@gsnLeftString = vNam(varn) 482 466 res@gsnRightString = "Time = "+legend_label(p)+"h" 483 if (norm .NE. 1)then484 res@tiYAxisString = vNam(varn)+" / "+norm 467 if (normy .NE. 1.)then 468 res@tiYAxisString = vNam(varn)+" / "+normy 485 469 else 486 470 res@tiYAxisString = vNam(varn) … … 490 474 n=n+1 491 475 end do 492 else493 print(" ")494 print("Please choose 'sort' either equal 'time' or 'height'")495 print(" ")496 exit497 476 end if 498 477 end if 499 478 delete(temp) 500 479 delete(x_axis) … … 504 483 if (n .EQ. 0) then 505 484 print(" ") 506 print("The variables 'var=°"+var+"°' do not exist on your input file") 485 print("The variables 'var="+var+"' do not exist on your input file;") 486 print("be sure to have one comma berfore and after each variable") 507 487 print(" ") 508 488 exit -
palm/trunk/SCRIPTS/NCL/timeseries.ncl
r175 r190 1 load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"1 6load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl" 2 2 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" 3 3 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" 4 4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" 5 5 6 ;*************************************************** 7 ; load ncl_preferences.ncl 8 ;*************************************************** 9 10 if (isfilepresent("~/ncl_preferences.ncl")) then 11 loadscript("~/ncl_preferences.ncl") 12 else 13 if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")) then 14 loadscript( "~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl") 15 else 16 print(" ") 17 print("'ncl_preferences.ncl' does not exist in $home or $home/palm/current_version/trunk/SCRIPTS/NCL/") 18 print(" ") 19 exit 20 end if 21 end if 22 6 23 begin 7 8 ; *************************************************** 9 ; read parameter_list 10 ; *************************************************** 11 12 if (isfilepresent("~/.ncl_preferences")) then 13 parameter = asciiread("~/.ncl_preferences",129,"string") 14 delete(parameter@_FillValue) 15 else 16 if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then 17 parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string") 18 delete(parameter@_FillValue) 19 else 20 print(" ") 21 print("'.ncl_preferences' is not present in '~/palm/current_version/trunk/SRIPTS/NCL/'") 22 print(" ") 23 exit 24 end if 24 25 if (cross_sections .NE. 0 .OR. profiles .NE. 0 .OR. timeseries .NE. 1 .OR. spectra .NE. 0)then 26 print(" ") 27 print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)") 28 print(" ") 29 print("Set 'timeseries' equal 1 and the other variables equal 0") 30 print(" ") 31 exit 25 32 end if 26 33 27 ; 28 ; set up default parameter values and strings if not assigned in prompt or parameter list29 ; 34 ;*************************************************** 35 ; set up default parameter values and strings 36 ;*************************************************** 30 37 31 if ( .not. isvar("file_1") ) then 32 if (parameter(7) .EQ. "File in") then 33 print(" ") 34 print("Please provide 1st input file 'file_1=' either in prompt or parameter_list") 35 print(" ") 36 exit 37 else 38 file_in = parameter(7) 39 end if 38 if (file_1 .EQ. "File in") then 39 print(" ") 40 print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'") 41 print(" ") 42 exit 40 43 else 41 44 file_in = file_1 … … 43 46 if (.not. isfilepresent(file_in)) then 44 47 print(" ") 45 print(" Your1st input file: '"+file_in+"' does not exist")48 print("1st input file: '"+file_in+"' does not exist") 46 49 print(" ") 47 50 exit 48 51 end if 49 52 50 if ( .not. isvar("format_out") ) then 51 format_out = "x11" 52 if (parameter(9) .NE. "x11") then 53 format_out = parameter(9) 54 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 55 print(" ") 56 print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") 57 print(" ") 58 end if 59 end if 60 else 61 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 62 print(" ") 63 print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") 64 print(" ") 65 end if 66 end if 67 68 if ( .not. isvar("file_out") ) then ; path+name of output file 69 file_out = "test" 70 if (parameter(11) .NE. "test") then 71 file_out = parameter(11) 72 end if 73 end if 74 75 if ( .not. isvar("no_columns") ) then ; number of plots in one row 76 no_columns = 1 77 if (parameter(17) .NE. "1") then 78 no_columns = stringtointeger(parameter(17)) 79 end if 80 end if 81 82 if ( .not. isvar("no_lines") ) then ; number of plot-lines on one sheet 83 no_lines = 2 84 if (parameter(19) .NE. "2") then 85 no_lines = stringtointeger(parameter(19)) 86 end if 53 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 54 print(" ") 55 print("'format_out = "+format_out+"' is invalid and set to'x11'") 56 print(" ") 57 format_out="x11" 87 58 end if 88 59 89 if ( .not. isvar("var") ) then ; variable name 90 check = True 91 end if 92 93 if ( .not. isvar("over") ) then ; switches overlaying plots on 60 if (over .NE. 0 .AND. over .NE. 1) then 61 print(" ") 62 print("'over'= "+over+" is invalid and set to 0") 63 print(" ") 94 64 over = 0 95 if (stringtointeger(parameter(37)) .NE. 0) then 96 over = stringtointeger(parameter(37)) 97 if (stringtointeger(parameter(37)) .NE. 1) then 98 print(" ") 99 print("Your 'over'= "+over+" is invalid and set to 0") 100 print(" ") 101 over = 0 102 end if 103 end if 104 else 105 if (over .NE. 0 .AND. over .NE. 1)then 106 print(" ") 107 print("Your 'over'= "+over+" is invalid and set to 0") 108 print(" ") 109 over = 0 110 end if 111 end if 112 113 ; *************************************************** 65 end if 66 67 68 ;*************************************************** 114 69 ; open input file 115 ; 70 ;*************************************************** 116 71 117 72 f = addfile(file_in , "r" ) … … 119 74 vNam = getfilevarnames(f) 120 75 print(" ") 121 print("Variable on netCDF file: " + vNam) 76 print("Variables in input file:") 77 print("- "+ vNam) 122 78 print(" ") 123 79 dim = dimsizes(vNam) … … 131 87 nt = dimsizes(t_all) 132 88 delta_t=t_all(nt-1)/nt 133 134 ; 89 90 ;**************************************************** 135 91 ; start of time step and different types of mistakes that could be done 136 ; **************************************************** 137 138 if ( .not. isvar("start_time_step") ) then 139 start_time_step=t_all(0)/3600 140 if (parameter(13) .NE. "t(0)") then 141 if (stringtodouble(parameter(13)) .GE. t_all(nt-1)/3600) 142 print(" ") 143 print("'start_time_step' = "+ parameter(13) +"h is equal or greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") 144 print(" ") 145 print("Please select another 'start_time_step'") 146 print(" ") 147 exit 148 end if 149 if (stringtofloat(parameter(13)) .LT. t_all(0)/3600) 150 print(" ") 151 print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") 152 print(" ") 153 print("Please select another 'start_time_step'") 154 print(" ") 155 exit 156 end if 157 start_time_step=stringtodouble(parameter(13)) 158 end if 92 ;**************************************************** 93 94 if (start_time_step .EQ. -1.) then 95 start_time_step=t_all(0)/3600 159 96 else 160 97 if (start_time_step .GE. t_all(nt-1)/3600) … … 175 112 end if 176 113 end if 177 start_time_step = start_time_step*3600178 114 do i=0,nt-2 179 if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then115 if (start_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. start_time_step .LT. (t_all(i)+delta_t/2)/3600)then 180 116 st=i 181 117 break … … 185 121 st=nt-2 186 122 end if 187 188 ; **************************************************** 123 if (.not. isvar("st"))then 124 print(" ") 125 print("'start_time_step' = "+ start_time_step +"h is invalid") 126 print(" ") 127 print("Please select another 'start_time_step'") 128 print(" ") 129 exit 130 end if 131 132 ;**************************************************** 189 133 ; end of time step and different types of mistakes that could be done 190 ; **************************************************** 191 192 if ( .not. isvar("end_time_step") ) then 193 end_time_step = t_all(nt-1)/3600 194 if (parameter(15) .NE. "t(end)") then 195 if (stringtodouble(parameter(15)) .LE. t_all(0)/3600) 196 print(" ") 197 print("'end_time_step' = "+parameter(15)+ "h is lower or equal than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") 198 print(" ") 199 print("Please select another 'end_time_step'") 200 print(" ") 201 exit 202 end if 203 if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600) 204 print(" ") 205 print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") 206 print(" ") 207 print("Please select another 'end_time_step'") 208 print(" ") 209 exit 210 end if 211 if (stringtodouble(parameter(15)) .LE. start_time_step/3600) 212 print(" ") 213 print("'end_time_step' = "+ parameter(15) +"h is equal or lower than 'start_time_step' = "+parameter(13)+"h") 214 print(" ") 215 print("Please select another 'start_time_step' or 'end_time_step'") 216 print(" ") 217 exit 218 end if 219 end_time_step = stringtodouble(parameter(15)) 220 end if 134 ;**************************************************** 135 136 if (end_time_step .EQ. -1.) then 137 end_time_step = t_all(nt-1)/3600 221 138 else 222 139 if (end_time_step .LE. t_all(0)/3600) … … 245 162 end if 246 163 end if 247 end_time_step = end_time_step*3600248 164 do i=0,nt-1 249 if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then165 if (end_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. end_time_step .LT. (t_all(i)+delta_t/2)/3600)then 250 166 et=i 251 167 break 252 168 end if 253 169 end do 170 171 if (.not. isvar("et"))then 172 print(" ") 173 print("'end_time_step' = "+ end_time_step +"h is invalid") 174 print(" ") 175 print("Please select another 'end_time_step'") 176 print(" ") 177 exit 178 end if 254 179 255 180 delete(start_time_step) … … 358 283 check = True 359 284 end if 360 if( isvar("var") ) then 361 check = isStrSubset( var,","+vNam(varn)+"," ) 362 end if 363 if (parameter(21) .NE. "variables") then 364 var = parameter(21) 285 286 if (var .NE. "all") then 365 287 check = isStrSubset( var,","+vNam(varn)+"," ) 366 288 end if … … 519 441 if (count_var .EQ. 0) then 520 442 print(" ") 521 print("The variables 'var=°"+var+"°' do not exist on your input file") 443 print("The variables 'var="+var+"' do not exist on your input file;") 444 print("be sure to have one comma berfore and after each variable") 522 445 print(" ") 523 446 exit … … 531 454 check = True 532 455 end if 533 if( isvar("var") ) then 534 check = isStrSubset( var,","+vNam(varn)+"," ) 535 end if 536 if (parameter(21) .NE. "variables") then 537 var = parameter(21) 456 457 if (var .NE. "all") then 538 458 check = isStrSubset( var,","+vNam(varn)+"," ) 539 459 end if … … 709 629 check = True 710 630 end if 711 if( isvar("var") ) then 712 check = isStrSubset( var,","+vNam(varn)+"," ) 713 end if 714 if (parameter(21) .NE. "variables") then 715 var = parameter(21) 631 632 if (var.NE. "all") then 716 633 check = isStrSubset( var,","+vNam(varn)+"," ) 717 634 end if
Note: See TracChangeset
for help on using the changeset viewer.