Changeset 190 for palm/trunk/SCRIPTS/NCL/cross_sections.ncl
 Timestamp:
 Aug 16, 2008 12:18:08 PM (15 years ago)
 File:

 1 edited
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 710)") 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(nt1)/3600) 434 print(" ") 435 print("'start_time_step' = "+ parameter(13) +"h is greater than last time step = " + t_all(nt1)+"s = "+t_all(nt1)/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(nt1)/3600) … … 467 314 end if 468 315 end if 469 start_time_step = start_time_step*3600470 316 do i=0,nt1 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(nt1)/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(nt1)/3600) 493 print(" ") 494 print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt1)+"s = "+t_all(nt1)/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(nt1)/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,nt1 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 VectorPlot") 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 VectorPlot") 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 VectorPlot 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 VectorPlot 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,dim1 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. 0delta_x/2) then 716 print(" ") 717 print("range start for xcoordinate = "+parameter(63)+"m is lower than first value x = "+0+"m or xu = "+(0delta_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 xcoordinate = "+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 xcoordinate = "+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. 0delta_y/2) then 781 print(" ") 782 print("range start for ycoordinate = "+parameter(67)+"m is lower than first value = "+0delta_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 ycoordinate = "+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 ycoordinate = "+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 zcoordinate 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 zcoordinate = "+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 zcoordinate = "+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 zcoordinate = "+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 xcoordinate = "+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. 0delta_x/2) 921 print(" ") 922 print("range end for xcoordinate = "+parameter(65)+"m is equal or lower than first value = "+(0delta_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 xcoordinate = "+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. 0delta_x/2) 934 print(" ") 935 print("range end for xcoordinate = "+parameter(65)+"m is lower than first value = "+(0delta_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 xcoordinate = "+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 xcoordinate = "+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 ycoordinate = "+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. 0delta_y/2) 1016 print(" ") 1017 print("range end for ycoordinate = "+parameter(69)+"m is equal or lower than first value = "+(0delta_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 ycoordinate = "+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 ycoordinate = "+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. 0delta_y/2) 1035 print(" ") 1036 print("range end for ycoordinate = "+parameter(69)+"m is lower than first value = "+(0delta_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 ycoordinate = "+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 zcoordinate = "+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 zcoordinate = "+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 zcoordinate = "+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 zcoordinate = "+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 zcoordinate = "+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 zcoordinate = "+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 = (xexs)/(yeys) 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 xcoordinate="+ 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 xcoordinate="+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 ycoordinate="+ 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 ycoordinate="+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 xcoordinate="+ 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 xcoordinate="+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 = (zezs)+1 1267 data = new((/dim,nt, zdim+1,(yeys)+1,(xexs)+1/),float)857 data = new((/dim,nt,(zezs)+1,(yeys)+1,(xexs)+1/),float) 1268 858 end if 1269 859 if (xzc .EQ. 1) then 1270 860 no_layer = (yeys)+1 1271 data = new((/dim,nt,(zezs)+1, ydim+1,(xexs)+1/),float)861 data = new((/dim,nt,(zezs)+1,(yeys)+1,(xexs)+1/),float) 1272 862 end if 1273 863 if (yzc .EQ. 1) then 1274 864 no_layer = (xexs)+1 1275 data = new((/dim,nt,(zezs)+1,(yeys)+1, xdim+1/),float)865 data = new((/dim,nt,(zezs)+1,(yeys)+1,(xexs)+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 = layelays 1303 893 else 1304 lis = lays1305 lie = laye 894 lis = 0 895 lie = layelays 1306 896 los = start_time_step 1307 897 loe = end_time_step … … 1314 904 n=0 1315 905 1316 do varn=dim1,0,1 1317 1318 data_all = f>$vNam(varn)$ 906 do varn=dim1,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=dim1,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 vectorplot ('vec1') must be one of the varibles for plot ('var')") 1002 print("Component 1 for the vectorplot ('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 vectorplot ('vec2') must be one of the varibles for plot ('var')") 1011 print("Component 2 for the vectorplot ('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=dim1,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)
Note: See TracChangeset
for help on using the changeset viewer.