Changeset 161 for palm/trunk/SCRIPTS/NCL/cross_sections.ncl
 Timestamp:
 Apr 11, 2008 10:54:53 AM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SCRIPTS/NCL/cross_sections.ncl
r157 r161 12 12 13 13 if (isfilepresent("~/.ncl_preferences")) then 14 parameter = asciiread("~/.ncl_preferences",7 3,"string")14 parameter = asciiread("~/.ncl_preferences",75,"string") 15 15 delete(parameter@_FillValue) 16 16 else … … 208 208 print(" ") 209 209 dim = dimsizes(vNam) 210 210 if (dim .EQ. 0) then 211 print(" ") 212 print("There are no data on file") 213 print(" ") 214 end if 215 211 216 ; *************************************************** 212 217 ; set up recourses … … 259 264 end if 260 265 261 ; ***************************************************262 ; open workstation(s)263 ; ***************************************************264 265 wks_ps = gsn_open_wks(format_out,file_out)266 gsn_define_colormap(wks_ps,"rainbow+white")267 268 plot=new((/no_columns*no_lines/),graphic)269 270 page = 0271 272 nc1 = no_columns273 nl1 = no_lines274 275 print("plots sorted by '"+sort+"'")276 print(" ")277 278 266 ; ********************************************* 279 267 ; set up of start_time_step and end_time_step 280 268 ; ********************************************* 281 269 282 t = f>time270 t = f>time 283 271 nt = dimsizes(t) 284 272 … … 288 276 289 277 if ( .not. isvar("start_time_step") ) then 290 start_time_step = 1278 start_time_step = 0 291 279 if (parameter(13) .NE. "1") then 292 if (parameter(13) .L E. "0")280 if (parameter(13) .LT. "1") 293 281 print(" ") 294 282 print("Begin with time step 1") … … 302 290 exit 303 291 end if 304 start_time_step = stringtointeger(parameter(13)) 292 start_time_step = stringtointeger(parameter(13))1 305 293 end if 306 294 else … … 317 305 exit 318 306 end if 307 start_time_step = start_time_step  1 319 308 end if 320 309 … … 324 313 325 314 if ( .not. isvar("end_time_step") ) then 326 end_time_step = nt 315 end_time_step = nt1 327 316 if (parameter(15) .NE. "nt") then 328 317 if (parameter(15) .LE. "0") … … 344 333 exit 345 334 end if 346 end_time_step = stringtointeger(parameter(15)) 335 end_time_step = stringtointeger(parameter(15))1 347 336 end if 348 337 else … … 365 354 exit 366 355 end if 367 end if 356 end_time_step = end_time_step1 357 end if 358 359 no_time=(end_time_stepstart_time_step)+1 368 360 369 361 ; **************************************************** … … 374 366 if ( .not. isvar("plotvec") ) then 375 367 plotvec = parameter(69) 376 if (parameter(69) .EQ. "plotvec") then377 print(" ")378 print("Please indicate the variable where the vector plot shall overlay ('plotvec')")379 print(" ")380 exit381 end if382 368 end if 383 369 if ( .not. isvar("vec1") ) then … … 409 395 ; **************************************************** 410 396 411 do varn= 0,dim1412 413 if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" ) then397 do varn=dim1,0,1 398 399 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 414 400 check = False 415 end if 416 if ( vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi") then 417 check = False 418 end if 401 else 402 check = True 403 end if 419 404 if ( isvar("var") ) then 420 check = isStrSubset( var, vNam(varn)+",")405 check = isStrSubset( var,","+vNam(varn)+",") 421 406 end if 422 407 if (parameter(21) .NE. "variables") then 423 408 var = parameter(21) 424 check = isStrSubset( var, vNam(varn)+"," )409 check = isStrSubset( var,","+vNam(varn)+"," ) 425 410 end if 426 411 427 412 if(check) then 428 413 print(vNam(varn)) 429 414 data_all = f>$vNam(varn)$ 430 415 … … 536 521 end do 537 522 523 if (xyc .EQ. 1) then 524 no_layer = (zezs)+1 525 end if 526 if (xzc .EQ. 1) then 527 no_layer = (yeys)+1 528 end if 529 if (yzc .EQ. 1) then 530 no_layer = (xexs)+1 531 end if 532 538 533 data = new((/dim,nt,(zezs)+1,(yeys)+1,(xexs)+1/),float) 539 534 … … 570 565 v1=0 571 566 v2=0 572 573 do varn=0,dim1 567 no_var=0 568 n=0 569 570 do varn=dim1,0,1 574 571 575 572 data_all = f>$vNam(varn)$ 576 573 577 574 if (vector .EQ. 1) then 578 check_vec1 = isStrSubset( vec1, vNam(varn)+",")579 check_vec2 = isStrSubset( vec2, vNam(varn)+",")575 check_vec1 = isStrSubset( vec1,","+vNam(varn)+",") 576 check_vec2 = isStrSubset( vec2,","+vNam(varn)+",") 580 577 end if 581 578 582 if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" ) then579 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 583 580 check = False 584 end if 585 if ( vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi") then 586 check = False 587 end if 581 else 582 check = True 583 end if 588 584 if ( isvar("var") ) then 589 check = isStrSubset( var,vNam(varn)+",") 590 end if 591 585 check = isStrSubset( var,","+vNam(varn)+",") 586 end if 592 587 if (parameter(21) .NE. "variables") then 593 588 var = parameter(21) 594 check = isStrSubset( var, vNam(varn)+"," )589 check = isStrSubset( var,","+vNam(varn)+"," ) 595 590 end if 596 591 597 592 if(check) then 598 593 594 no_var=no_var+1 595 599 596 if (vector .EQ. 1) then 600 if ( vNam(varn)+"," .EQ. vec1) then597 if (","+vNam(varn)+"," .EQ. vec1) then 601 598 v1=v1+1 602 599 end if 603 if ( vNam(varn)+"," .EQ. vec2) then600 if (","+vNam(varn)+"," .EQ. vec2) then 604 601 v2=v2+1 605 602 end if … … 608 605 data(varn,:,:,:,:)=data_all(0:nt1,zs:ze,ys:ye,xs:xe) 609 606 if (check_vec1) then 610 print("in vec1")611 607 vect1=data_all 612 608 end if 613 609 if (check_vec2) then 614 print("in vec2")615 610 vect2=data_all 616 611 end if … … 626 621 delete(data_all) 627 622 628 end do 623 end do 624 625 plot_panel=new((/no_time*no_layer*no_var/),graphic) 629 626 630 627 if (vector .EQ. 1) then … … 645 642 646 643 ; *************************************************** 644 ; open workstation(s) 645 ; *************************************************** 646 647 wks_ps = gsn_open_wks(format_out,file_out) 648 gsn_define_colormap(wks_ps,"rainbow+white") 649 650 plot=new((/no_time*no_layer*no_var/),graphic) 651 652 page = 0 653 n=0 654 655 print("plots sorted by '"+sort+"'") 656 print(" ") 657 658 ; *************************************************** 647 659 ; create plots 648 660 ; *************************************************** … … 650 662 check = True 651 663 652 do varn= 0,dim1664 do varn=dim1,0,1 653 665 654 666 if (vector .EQ. 1) then 655 check_vecp = isStrSubset( plotvec, vNam(varn)+",")667 check_vecp = isStrSubset( plotvec,","+vNam(varn)+",") 656 668 end if 657 669 658 if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" ) then 659 check = False 660 end if 661 if ( vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi") then 662 check = False 663 end if 670 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 671 check = False 672 else 673 check = True 674 end if 664 675 if ( isvar("var") ) then 665 check = isStrSubset( var, vNam(varn)+",")676 check = isStrSubset( var,","+vNam(varn)+",") 666 677 end if 667 678 if (parameter(21) .NE. "variables") then 668 679 var = parameter(21) 669 check = isStrSubset( var, vNam(varn)+"," )680 check = isStrSubset( var,","+vNam(varn)+"," ) 670 681 end if 671 682 672 683 if(check) then 673 684 674 685 ; **************************************************** 675 686 ; loops over time and layer 676 687 ; **************************************************** 677 688 678 do lo = los, loe ; lo: loop outer 679 do li = lis, lie, no_lines*no_columns ; li: loop inner 680 681 if ( sort .eq. "time" ) then 682 ta = li 683 tb = min( (/li + no_lines*no_columns  1, end_time_step/) ) 684 if ( xyc .eq. 1 ) then 685 xa = xs 686 xb = xe 687 ya = ys 688 yb = ye 689 za = lo 690 zb = lo 691 end if 692 if ( xzc .eq. 1 ) then 693 xa = xs 694 xb = xe 695 ya = lo 696 yb = lo 697 za = zs 698 zb = ze 699 end if 700 if ( yzc .eq. 1 ) then 701 xa = lo 702 xb = lo 703 ya = ys 704 yb = ye 705 za = zs 706 zb = ze 707 end if 708 end if 709 710 if ( sort .eq. "layer" ) then 711 ta = lo 712 tb = lo 713 if ( xyc .eq. 1 ) then 714 xa = xs 715 xb = xe 716 ya = ys 717 yb = ye 718 za = li 719 zb = min( (/li + no_lines*no_columns  1, ze/) ) 720 end if 721 if ( xzc .eq. 1 ) then 722 xa = xs 723 xb = xe 724 ya = li 725 yb = min( (/li + no_lines*no_columns  1, ye/) ) 726 za = zs 727 zb = ze 728 end if 729 if ( yzc .eq. 1 ) then 730 xa = li 731 xb = min( (/li + no_lines*no_columns  1, xe/) ) 732 ya = ys 733 yb = ye 734 za = zs 735 zb = ze 736 end if 737 end if 738 689 do lo = los, loe 690 do li = lis, lie 691 739 692 ; **************************************************** 740 693 ; xy cross section … … 743 696 if ( xyc .eq. 1 ) then 744 697 745 cs_res@tiXAxisString 746 cs_res@tiYAxisString 698 cs_res@tiXAxisString = "x [m]" 699 cs_res@tiYAxisString = "y [m]" 747 700 cs_res@gsnLeftString = "Plot of "+vNam(varn) 748 701 749 702 if ( sort .eq. "time" ) then 750 703 if ( data&z(lo) .eq. 1 ) then … … 753 706 level = "=" + data&z(lo) + "m" 754 707 end if 755 do n = 0,tbta756 cs_res@gsnCenterString = "time=" + data&t(li+n1) +"s z"+level757 plot1 = gsn_csm_contour(wks_ps,data(varn,li+n1,lo,:,:),cs_res)708 cs_res@gsnCenterString = "time=" + data&t(li) +"s z"+level 709 plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo,:,:),cs_res) 710 if (vector .EQ. 1) then 758 711 if (check_vecp) 759 712 vecres = True ; vector only resources 760 713 vecres@gsnDraw = False ; don't draw 761 762 763 764 714 vecres@gsnFrame = False ; don't advance frame 715 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 716 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 717 vecres@vcRefLengthF = 0.05 ; define length of vec ref 765 718 vecres@gsnRightString = " " ; turn off right string 766 719 vecres@gsnLeftString = " " ; turn off left string 767 720 vecres@tiXAxisString = " " 768 plot_vec=gsn_csm_vector(wks_ps,vect1(li+n1,lo,:,:),vect2(li+n1,lo,:,:),vecres) 769 overlay(plot1, plot_vec) 770 end if 771 plot(n) = plot1 772 end do 721 plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) 722 overlay(plot(n), plot_vec) 723 else 724 vecres = True ; vector only resources 725 vecres@gsnDraw = False ; don't draw 726 vecres@gsnFrame = False ; don't advance frame 727 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 728 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 729 vecres@vcRefLengthF = 0.05 ; define length of vec ref 730 vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 731 vecres@gsnLeftString = " " ; turn off left string 732 vecres@tiXAxisString = " " 733 plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) 734 plot(n) = plot_vec 735 end if 736 end if 773 737 end if 774 738 775 739 if ( sort .eq. "layer" ) then 776 do n = 0, zbza 777 if ( data&z(li+n) .eq. 1 ) then 778 level = "average" 779 else 780 level = "=" + data&z(li+n) + "m" 740 if ( data&z(li) .eq. 1 ) then 741 level = "average" 742 else 743 level = "=" + data&z(li) + "m" 744 end if 745 cs_res@gsnCenterString = "t=" + data&t(lo) + "s z"+ level 746 plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li,:,:),cs_res) 747 if (vector .EQ. 1) then 748 if (check_vecp) 749 vecres = True ; vector only resources 750 vecres@gsnDraw = False ; don't draw 751 vecres@gsnFrame = False ; don't advance frame 752 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 753 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 754 vecres@vcRefLengthF = 0.05 ; define length of vec ref 755 vecres@gsnRightString = " " ; turn off right string 756 vecres@gsnLeftString = " " ; turn off left string 757 vecres@tiXAxisString = " " 758 plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) 759 overlay(plot(n), plot_vec) 760 else 761 vecres = True ; vector only resources 762 vecres@gsnDraw = False ; don't draw 763 vecres@gsnFrame = False ; don't advance frame 764 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 765 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 766 vecres@vcRefLengthF = 0.05 ; define length of vec ref 767 vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 768 vecres@gsnLeftString = " " ; turn off left string 769 vecres@tiXAxisString = " " 770 plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) 771 plot(n) = plot_vec 781 772 end if 782 cs_res@gsnCenterString = "t=" + data&t(lo1) + "s z"+ level 783 plot1 = gsn_csm_contour(wks_ps,data(varn,lo1,li+n,:,:),cs_res) 784 if (check_vecp) 785 vecres = True ; vector only resources 786 vecres@gsnDraw = False ; don't draw 787 vecres@gsnFrame = False ; don't advance frame 788 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 789 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 790 vecres@vcRefLengthF = 0.05 ; define length of vec ref 791 vecres@gsnRightString = " " ; turn off right string 792 vecres@gsnLeftString = " " ; turn off left string 793 vecres@tiXAxisString = " " 794 plot_vec=gsn_csm_vector(wks_ps,vect1(lo1,li+n,:,:),vect2(lo1,li+n,:,:),vecres) 795 overlay(plot1, plot_vec) 796 end if 797 plot(n) = plot1 798 end do 773 end if 799 774 end if 800 801 775 end if 802 776 … … 817 791 level = "=" + data&y(lo) + "m" 818 792 end if 819 do n = 0, tbta820 cs_res@gsnCenterString = "t=" + data&t(li+n1) + "s y"+ level821 plot1 = gsn_csm_contour(wks_ps,data(varn,li+n1,:,lo,:),cs_res)793 cs_res@gsnCenterString = "t=" + data&t(li) + "s y"+ level 794 plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res) 795 if (vector .EQ. 1) then 822 796 if (check_vecp) 823 797 vecres = True ; vector only resources … … 830 804 vecres@gsnLeftString = " " ; turn off left string 831 805 vecres@tiXAxisString = " " 832 plot_vec=gsn_csm_vector(wks_ps,vect1(li+n1,lo,:,:),vect2(li+n1,lo,:,:),vecres) 833 overlay(plot1, plot_vec) 806 plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) 807 overlay(plot(n), plot_vec) 808 else 809 vecres = True ; vector only resources 810 vecres@gsnDraw = False ; don't draw 811 vecres@gsnFrame = False ; don't advance frame 812 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 813 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 814 vecres@vcRefLengthF = 0.05 ; define length of vec ref 815 vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 816 vecres@gsnLeftString = " " ; turn off left string 817 vecres@tiXAxisString = " " 818 plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) 819 plot(n) = plot_vec 834 820 end if 835 plot(n) = plot1 836 end do 821 end if 837 822 end if 838 823 839 824 if ( sort .eq. "layer" ) then 840 do n = 0, ybya 841 if ( data&z(li+n) .eq. 1 ) then 842 level = "average" 843 else 844 level = "=" + data&y(li+n) + "m" 825 if ( data&z(li) .eq. 1 ) then 826 level = "average" 827 else 828 level = "=" + data&y(li) + "m" 829 end if 830 cs_res@gsnCenterString = "t=" + data&t(lo) + "s y"+ level 831 plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res) 832 if (vector .EQ. 1) then 833 if (check_vecp) 834 vecres = True ; vector only resources 835 vecres@gsnDraw = False ; don't draw 836 vecres@gsnFrame = False ; don't advance frame 837 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 838 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 839 vecres@vcRefLengthF = 0.05 ; define length of vec ref 840 vecres@gsnRightString = " " ; turn off right string 841 vecres@gsnLeftString = " " ; turn off left string 842 vecres@tiXAxisString = " " 843 plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) 844 overlay(plot(n), plot_vec) 845 else 846 vecres = True ; vector only resources 847 vecres@gsnDraw = False ; don't draw 848 vecres@gsnFrame = False ; don't advance frame 849 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 850 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 851 vecres@vcRefLengthF = 0.05 ; define length of vec ref 852 vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 853 vecres@gsnLeftString = " " ; turn off left string 854 vecres@tiXAxisString = " " 855 plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) 856 plot(n) = plot_vec 845 857 end if 846 cs_res@gsnCenterString = "t=" + data&t(lo1) + "s y"+ level 847 plot1 = gsn_csm_contour(wks_ps,data(varn,lo1,:,li+n,:),cs_res) 848 if (check_vecp) 849 vecres = True ; vector only resources 850 vecres@gsnDraw = False ; don't draw 851 vecres@gsnFrame = False ; don't advance frame 852 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 853 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 854 vecres@vcRefLengthF = 0.05 ; define length of vec ref 855 vecres@gsnRightString = " " ; turn off right string 856 vecres@gsnLeftString = " " ; turn off left string 857 vecres@tiXAxisString = " " 858 plot_vec=gsn_csm_vector(wks_ps,vect1(li+n1,lo,:,:),vect2(li+n1,lo,:,:),vecres) 859 overlay(plot1, plot_vec) 860 end if 861 plot(n) = plot1 862 end do 858 end if 863 859 end if 864 865 860 end if 866 861 … … 881 876 level = "=" + data&z(lo) + "m" 882 877 end if 883 do n = 0, tbta884 cs_res@gsnCenterString = "t=" + data&t(li+n1) + "s x"+ level885 plot1 = gsn_csm_contour(wks_ps,data(varn,li+n1,:,:,lo),cs_res)878 cs_res@gsnCenterString = "t=" + data&t(li) + "s x"+ level 879 plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res) 880 if (vector .EQ. 1) then 886 881 if (check_vecp) 887 882 vecres = True ; vector only resources … … 894 889 vecres@gsnLeftString = " " ; turn off left string 895 890 vecres@tiXAxisString = " " 896 plot_vec=gsn_csm_vector(wks_ps,vect1(li+n1,lo,:,:),vect2(li+n1,lo,:,:),vecres) 897 overlay(plot1, plot_vec) 891 plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) 892 overlay(plot(n), plot_vec) 893 else 894 vecres = True ; vector only resources 895 vecres@gsnDraw = False ; don't draw 896 vecres@gsnFrame = False ; don't advance frame 897 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 898 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 899 vecres@vcRefLengthF = 0.05 ; define length of vec ref 900 vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 901 vecres@gsnLeftString = " " ; turn off left string 902 vecres@tiXAxisString = " " 903 plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) 904 plot(n) = plot_vec 898 905 end if 899 plot(n) = plot1 900 end do 906 end if 901 907 end if 902 908 903 909 if ( sort .eq. "layer" ) then 904 do n = 0, xbxa 905 if ( data&z(li+n) .eq. 1 ) then 906 level = "average" 907 else 908 level = "=" + data&z(li+n) + "m" 910 if ( data&z(li) .eq. 1 ) then 911 level = "average" 912 else 913 level = "=" + data&z(li) + "m" 914 end if 915 cs_res@gsnCenterString = "t=" + data&t(lo) + "s x"+ level 916 plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res) 917 if (vector .EQ. 1) then 918 if (check_vecp) 919 vecres = True ; vector only resources 920 vecres@gsnDraw = False ; don't draw 921 vecres@gsnFrame = False ; don't advance frame 922 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 923 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 924 vecres@vcRefLengthF = 0.05 ; define length of vec ref 925 vecres@gsnRightString = " " ; turn off right string 926 vecres@gsnLeftString = " " ; turn off left string 927 vecres@tiXAxisString = " " 928 plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) 929 overlay(plot(n), plot_vec) 930 else 931 vecres = True ; vector only resources 932 vecres@gsnDraw = False ; don't draw 933 vecres@gsnFrame = False ; don't advance frame 934 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 935 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 936 vecres@vcRefLengthF = 0.05 ; define length of vec ref 937 vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 938 vecres@gsnLeftString = " " ; turn off left string 939 vecres@tiXAxisString = " " 940 plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) 941 plot(n) = plot_vec 909 942 end if 910 cs_res@gsnCenterString = "t=" + data&t(lo1) + "s x"+ level 911 plot1 = gsn_csm_contour(wks_ps,data(varn,lo1,:,:,li+n),cs_res) 912 if (check_vecp) 913 vecres = True ; vector only resources 914 vecres@gsnDraw = False ; don't draw 915 vecres@gsnFrame = False ; don't advance frame 916 vecres@vcGlyphStyle = "CurlyVector" ; curly vectors 917 vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag 918 vecres@vcRefLengthF = 0.05 ; define length of vec ref 919 vecres@gsnRightString = " " ; turn off right string 920 vecres@gsnLeftString = " " ; turn off left string 921 vecres@tiXAxisString = " " 922 plot_vec=gsn_csm_vector(wks_ps,vect1(li+n1,lo,:,:),vect2(li+n1,lo,:,:),vecres) 923 overlay(plot1, plot_vec) 924 end if 925 plot(n) = plot1 926 end do 943 end if 927 944 end if 928 929 end if 930 931 ; *************************************************** 932 ; merge plots onto one page 933 ; *************************************************** 934 935 gsn_panel(wks_ps, plot(0:n1),(/no_lines,no_columns/),cs_resP) 936 937 ; To hold no_lines and no_columns constant, it must be defined again: 938 939 no_lines = nl1 940 no_columns = nc1 941 945 end if 946 n=n+1 942 947 end do 943 948 end do 944 949 end if 945 end do 950 end do 951 952 ; *************************************************** 953 ; merge plots onto one page 954 ; *************************************************** 955 956 if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then 957 gsn_panel(wks_ps,plot(0:(no_time*no_layer*no_var)1),(/no_var,no_layer*no_time/),cs_resP) 958 print(" ") 959 print("Outputs to .eps or .epsi have only one frame") 960 print(" ") 961 else 962 do np = 0,no_layer*no_time*no_var1,no_lines*no_columns 963 if ( np + no_lines*no_columns .gt. (no_layer*no_time*no_var)1) then 964 gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)1),(/no_lines,no_columns/),cs_resP) 965 else 966 gsn_panel(wks_ps, plot(np:np+no_lines*no_columns1),(/no_lines,no_columns/),cs_resP) 967 end if 968 end do 969 end if 946 970 947 971 print(" ")
Note: See TracChangeset
for help on using the changeset viewer.