Changeset 357


Ignore:
Timestamp:
Jul 24, 2009 2:30:53 PM (15 years ago)
Author:
heinze
Message:

Bugs concerning plotting of data with zu_xy1 as vertical coordinate fixed

File:
1 edited

Legend:

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

    r329 r357  
    529529               delta_z = -1.d
    530530            end if
     531         end if
     532         if (vNam(varn) .eq. "zu1_xy") then
     533            zu1    = f_att->$vNam(varn)$
    531534         end if
    532535      end do
     
    12751278   no_var=0
    12761279   n=0
     1280   no_zu1=0
    12771281
    12781282   do varn=dim-1,0,1       
     
    12891293      end if 
    12901294
     1295      if (var .NE. "all") then
     1296         check = isStrSubset( var,","+vNam(varn)+"," )
     1297      end if
     1298
    12911299      if(check) then
    12921300     
     
    13061314            data_att = f_att->$vNam(varn)$
    13071315            if(vNam(varn) .eq. "ts_xy" .or. vNam(varn) .eq. "us_xy" .or. vNam(varn) .eq. "z0s_xy")
    1308               ;these variables depend von zu1_xy and that's why they have only one z-layer
     1316              ;these variables depend zu1_xy and that's why they have only one z-layer
    13091317              data(varn,:,0,:,:)=temp(:,0,ys:ye,xs:xe)
     1318              no_zu1=no_zu1+1
    13101319            else
    13111320              data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe)
     
    13171326            data_att = f_att->$vNam(varn)$
    13181327            data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe)
     1328            delete(temp)
    13191329         end if
    13201330         if ( yzc .eq. 1) then
     
    13221332            data_att = f_att->$vNam(varn)$
    13231333            data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe)
     1334            delete(temp)
    13241335         end if
    13251336         if (check_vec1) then
     
    13451356
    13461357   end do
     1358
     1359   if (no_var .EQ. 0) then
     1360      print(" ")
     1361      print("The variables var='"+var+"' do not exist on your input file;")
     1362      print("be sure to have one comma before and after each variable")
     1363      print(" ")
     1364      exit
     1365   end if
    13471366
    13481367   var_input=new(no_var,string)
     
    13631382      end if 
    13641383
     1384      if (var .NE. "all") then
     1385         check = isStrSubset( var,","+vNam(varn)+"," )
     1386      end if
     1387
    13651388      if(check) then     
    13661389         var_input(numb)=vNam(varn)
    13671390         numb=numb+1     
    13681391      end if
    1369                  
    1370       if (var .NE. "all") then
    1371          check = isStrSubset( var,","+vNam(varn)+"," )
    1372       end if
    13731392     
    13741393      if (check) then
     
    13811400      print(" ")
    13821401      print("The variables var='"+var+"' do not exist on your input file;")
    1383       print("be sure to have one comma berfore and after each variable")
     1402      print("be sure to have one comma before and after each variable")
    13841403      print(" ")
    13851404      exit
     
    13911410         print("Component 1 for the vector-plot ('vec1') must be one of the varibles on the input file:")
    13921411         print("- "+var_input)
    1393          print("be sure to have one comma berfore and after the variable")
     1412         print("be sure to have one comma before and after the variable")
    13941413         print(" ")
    13951414         exit
     
    14001419         print("Component 2 for the vector-plot ('vec2') must be one of the varibles on the input file:")
    14011420         print("- "+var_input)
    1402          print("be sure to have one comma berfore and after the variable")
     1421         print("be sure to have one comma before and after the variable")
    14031422         print(" ")
    14041423         exit
     
    14141433
    14151434   if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then
    1416       plot=new((/no_time*no_layer*no_var+no_time*no_layer/),graphic)
     1435      plot=new((/no_time*no_layer*no_var - no_time*(no_layer-1)*no_zu1 \
     1436                                         + no_time*no_layer/),graphic)
    14171437   else
    1418       plot=new((/no_time*no_layer*no_var/),graphic)
    1419    end if
     1438      plot=new((/no_time*no_layer*no_var - no_time*(no_layer-1)*no_zu1/),graphic)
     1439   end if
     1440   dim_plot=dimsizes(plot)
    14201441
    14211442   page = 0
     
    14281449   ; create plots
    14291450   ; ***************************************************
     1451
    14301452
    14311453   if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then
     
    15481570                        level = "=" + z_d(zs+lo) + "m"
    15491571                     end if
    1550                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level             
     1572
     1573                     if(vNam(varn) .eq. "ts_xy" .or. vNam(varn) .eq. "us_xy" .or. vNam(varn) .eq. "z0s_xy")then
     1574                         loe = 0
     1575                         level = "=" + zu1(0) + "m"
     1576                     end if
     1577                   
     1578                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level                               
    15511579                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo,:,:),cs_res)
    15521580                     if (vector .EQ. 1 .AND. check_vecp) then
     
    15751603                        level = "=" + z_d(zs+li) + "m"
    15761604                     end if
    1577                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  z"+ level               
     1605       
     1606                     if(vNam(varn) .eq. "ts_xy" .or. vNam(varn) .eq. "us_xy" .or. vNam(varn) .eq. "z0s_xy")then
     1607                         lie = 0
     1608                         level = "=" + zu1(0) + "m"
     1609                     end if
     1610               
     1611                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  z"+ level
     1612                     
    15781613                     plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li,:,:),cs_res)
    15791614                     if (vector .EQ. 1 .AND. check_vecp) then
     
    17101745   ; ***************************************************
    17111746   ; merge plots onto one page
    1712    ; ***************************************************
    1713    
     1747   ; ***************************************************   
    17141748   if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec")then
    17151749      if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
     
    17191753         print(" ")
    17201754      else
    1721          do np = 0,no_layer*no_time*(no_var+1)-1,no_rows*no_columns   
    1722             if ( np + no_rows*no_columns .gt. (no_layer*no_time*(no_var+1))-1) then
    1723                gsn_panel(wks_ps, plot(np:(no_layer*no_time*(no_var+1))-1),(/no_rows,no_columns/),cs_resP)
     1755         do np = 0,dim_plot-1,no_rows*no_columns   
     1756            if ( np + no_rows*no_columns .gt. dim_plot-1) then
     1757               gsn_panel(wks_ps, plot(np:dim_plot-1),(/no_rows,no_columns/),cs_resP)
    17241758            else
    17251759               gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
     
    17291763   else       
    17301764      if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
    1731          gsn_panel(wks_ps,plot(0:(no_time*no_layer*no_var)-1),(/no_var,no_layer*no_time/),cs_resP)
     1765         gsn_panel(wks_ps,plot(0:dim_plot-1),(/dim_plot,1/),cs_resP)
    17321766         print(" ")
    17331767         print("Outputs to .eps or .epsi have only one frame")
    17341768         print(" ")
    17351769      else
    1736          do np = 0,no_layer*no_time*no_var-1,no_rows*no_columns 
    1737             if ( np + no_rows*no_columns .gt. (no_layer*no_time*no_var)-1) then
    1738                gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_rows,no_columns/),cs_resP)
     1770         do np = 0,dim_plot-1,no_rows*no_columns 
     1771            if ( np + no_rows*no_columns .gt. dim_plot-1) then
     1772               gsn_panel(wks_ps, plot(np:dim_plot-1),(/no_rows,no_columns/),cs_resP)
    17391773            else
    17401774               gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
Note: See TracChangeset for help on using the changeset viewer.