Changeset 358 for palm/trunk


Ignore:
Timestamp:
Jul 29, 2009 1:49:07 PM (15 years ago)
Author:
heinze
Message:

Bugfix in cross_sections.ncl concerning plot layers and vector plots fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/NCL/cross_sections.ncl

    r357 r358  
    702702         print("You cannot choose a start value for z, there are preseted layers for z")
    703703         print(" ")
     704         zs = 0
    704705      else
    705706         if (zs .LT. 0) then
     
    12641265      lis = start_time_step
    12651266      lie = end_time_step
    1266       los = 0
    1267       loe = laye-lays
     1267      los = lays
     1268      loe = laye
    12681269   else
    1269       lis = 0
    1270       lie = laye-lays
     1270      lis = lays
     1271      lie = laye
    12711272      los = start_time_step
    12721273      loe = end_time_step
     
    14561457            if (xyc .EQ. 1)then
    14571458               if (sort .EQ. "time")then
    1458                   level = "z=" + z_d(lo) + "m"
     1459                  if(z_d(lo) .eq. -1.d) then
     1460                    level = "z-average"
     1461                  else
     1462                    level = "z=" + z_d(lo) + "m"
     1463                  end if
    14591464               else
    1460                   level = "z=" + z_d(li) + "m"
     1465                  if(z_d(li) .eq. -1.d) then
     1466                    level = "z-average"
     1467                  else
     1468                    level = "z=" + z_d(li) + "m"
     1469                  end if
    14611470               end if
    14621471            end if
    14631472            if (xzc .EQ. 1)then
    14641473               if (sort .EQ. "time")then
    1465                   level = "y=" + y_d(lo) + "m"
     1474                 if(y_d(lo) .eq. -1.d) then
     1475                   level = "y-average"
     1476                 else
     1477                   level = "y=" + y_d(lo) + "m"
     1478                 end if
    14661479               else
    1467                   level = "y=" + y_d(li) + "m"
     1480                  if(y_d(li) .eq. -1.d) then
     1481                    level = "y-average"
     1482                  else
     1483                    level = "y=" + y_d(li) + "m"
     1484                  end if
    14681485               end if
    14691486            end if
    14701487            if (yzc .EQ. 1)then
    14711488               if (sort .EQ. "time")then
    1472                   level = "x=" + x_d(lo) + "m"
     1489                 if(x_d(lo) .eq. -1.d) then
     1490                    level = "x-average"
     1491                 else
     1492                    level = "x=" + x_d(lo) + "m"
     1493                 end if
    14731494               else
    1474                   level = "x=" + x_d(li) + "m"
     1495                 if(x_d(li) .eq. -1.d) then
     1496                    level = "x-average"
     1497                 else
     1498                    level = "x=" + x_d(li) + "m"
     1499                 end if
    14751500               end if
    14761501            end if               
     
    14941519            if (xyc .EQ. 1)then 
    14951520               if (sort .EQ. "time")then                                         
    1496                   plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1521                  plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo-los,:,:),vect2(li,lo-los,:,:),vecres)
    14971522               else
    1498                   plot(n) = gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     1523                  plot(n) = gsn_csm_vector(wks_ps,vect1(lo,li-lis,:,:),vect2(lo,li-lis,:,:),vecres)
    14991524               end if
    15001525            end if
    15011526            if (xzc .EQ. 1) then
    15021527               if (sort .EQ. "time")then
    1503                   plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres)
     1528                  plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,lo-los,:),vect2(li,:,lo-los,:),vecres)
    15041529               else
    1505                   plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres)
     1530                  plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,li-lis,:),vect2(lo,:,li-lis,:),vecres)
    15061531               end if
    15071532            end if
    15081533            if (yzc .EQ. 1) then
    15091534               if (sort .EQ. "time")then
    1510                   plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres)
     1535                  plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,:,lo-los),vect2(li,:,:,lo-los),vecres)
    15111536               else
    1512                   plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres)
     1537                  plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,:,li-lis),vect2(lo,:,:,li-lis),vecres)
    15131538               end if
    15141539            end if
     
    15231548         check_vecp = isStrSubset( plotvec,","+vNam(varn)+",")
    15241549      end if
    1525 
     1550     
    15261551      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
    15271552         check = False
     
    15611586                 
    15621587                  if ( sort .eq. "time" ) then
    1563                      if ( z_d(zs+lo) .eq. -1)then
     1588                     if ( z_d(lo) .eq. -1)then
    15641589                        if (delta_z .EQ. -1) then
    15651590                           level = "-average"
    15661591                        else
    1567                            level = "=" + z_d(zs+lo) + "m"
     1592                           level = "=" + z_d(lo) + "m"
    15681593                        end if
    15691594                     else
    1570                         level = "=" + z_d(zs+lo) + "m"
     1595                        level = "=" + z_d(lo) + "m"
    15711596                     end if
    15721597
     
    15771602                   
    15781603                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level                               
    1579                      plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo,:,:),cs_res)
     1604                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo-los,:,:),cs_res)
    15801605                     if (vector .EQ. 1 .AND. check_vecp) then
    15811606                        vecres                  = True            ; vector only resources
     
    15881613                        vecres@gsnLeftString    = " "
    15891614                        vecres@tiXAxisString    = " "   
    1590                         plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1615                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo-los,:,:),vect2(li,lo-los,:,:),vecres)
    15911616                        overlay(plot(n), plot_vec)
    15921617                     end if                         
     
    15981623                           level = "-average"
    15991624                        else
    1600                            level = "=" + z_d(zs+li) + "m"
     1625                           level = "=" + z_d(li) + "m"
    16011626                        end if
    16021627                     else
    1603                         level = "=" + z_d(zs+li) + "m"
     1628                        level = "=" + z_d(li) + "m"
    16041629                     end if
    16051630       
     
    16111636                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  z"+ level
    16121637                     
    1613                      plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li,:,:),cs_res)
     1638                     plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li-lis,:,:),cs_res)
    16141639                     if (vector .EQ. 1 .AND. check_vecp) then
    16151640                        vecres                  = True            ; vector only resources
     
    16371662               
    16381663                  if ( sort .eq. "time" ) then
    1639                      if ( y_d(ys+lo) .eq. -1 ) then
     1664                     if ( y_d(lo) .eq. -1 ) then
    16401665                        level = "-average"
    16411666                     else
    1642                         level = "=" + y_d(ys+lo) + "m"
     1667                        level = "=" + y_d(lo) + "m"
    16431668                     end if
    16441669                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  y"+ level
    1645                      plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res)
     1670                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo-los,:),cs_res)
    16461671                     if (vector .EQ. 1 .AND. check_vecp) then
    16471672                        vecres                  = True            ; vector only resources
     
    16541679                        vecres@gsnLeftString    = " "             ; turn off left string
    16551680                        vecres@tiXAxisString    = " "   
    1656                         plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres)
     1681                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,lo-los,:),vect2(li,:,lo-los,:),vecres)
    16571682                        overlay(plot(n), plot_vec)
    16581683                     end if
     
    16601685
    16611686                  if ( sort .eq. "layer" ) then
    1662                      if ( y_d(ys+li) .eq. -1 ) then
     1687                     if ( y_d(li) .eq. -1 ) then
    16631688                        level = "-average"
    16641689                     else
    1665                         level = "=" + y_d(ys+li) + "m"
     1690                        level = "=" + y_d(li) + "m"
    16661691                     end if
    16671692                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  y"+ level
    1668                      plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res)
     1693                     plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li-lis,:),cs_res)
    16691694                     if (vector .EQ. 1 .AND. check_vecp) then
    16701695                        vecres                  = True            ; vector only resources
     
    16771702                        vecres@gsnLeftString    = " "             ; turn off left string
    16781703                        vecres@tiXAxisString    = " "   
    1679                         plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres)
     1704                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,li-lis,:),vect2(lo,:,li-lis,:),vecres)
    16801705                        overlay(plot(n), plot_vec)
    16811706                     end if
     
    16951720                        level = "-average"
    16961721                     else
    1697                         level = "=" + x_d(xs+lo) + "m"
     1722                        level = "=" + x_d(lo) + "m"
    16981723                     end if
    16991724                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  x"+ level
    1700                      plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res)
     1725                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo-los),cs_res)
    17011726                     if (vector .EQ. 1 .AND. check_vecp) then
    17021727                        vecres                  = True            ; vector only resources
     
    17091734                        vecres@gsnLeftString    = " "             ; turn off left string
    17101735                        vecres@tiXAxisString    = " "   
    1711                         plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres)
     1736                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,:,lo-los),vect2(li,:,:,lo-los),vecres)
    17121737                        overlay(plot(n), plot_vec)
    17131738                     end if
     
    17181743                        level = "-average"
    17191744                     else
    1720                         level = "=" + x_d(xs+li) + "m"
     1745                        level = "=" + x_d(li) + "m"
    17211746                     end if
    17221747                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  x"+ level
    1723                      plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res)
     1748                     plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li-lis),cs_res)
    17241749                     if (vector .EQ. 1 .AND. check_vecp)then
    17251750                        vecres                  = True            ; vector only resources
     
    17321757                        vecres@gsnLeftString    = " "             ; turn off left string
    17331758                        vecres@tiXAxisString    = " "   
    1734                         plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres)
     1759                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,:,li-lis),vect2(lo,:,:,li-lis),vecres)
    17351760                        overlay(plot(n), plot_vec)
    17361761                     end if
Note: See TracChangeset for help on using the changeset viewer.