# Changeset 358

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

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

File:
1 edited

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

 r357 print("You cannot choose a start value for z, there are preseted layers for z") print(" ") zs = 0 else if (zs .LT. 0) then lis = start_time_step lie = end_time_step los = 0 loe = laye-lays los = lays loe = laye else lis = 0 lie = laye-lays lis = lays lie = laye los = start_time_step loe = end_time_step if (xyc .EQ. 1)then if (sort .EQ. "time")then level = "z=" + z_d(lo) + "m" if(z_d(lo) .eq. -1.d) then level = "z-average" else level = "z=" + z_d(lo) + "m" end if else level = "z=" + z_d(li) + "m" if(z_d(li) .eq. -1.d) then level = "z-average" else level = "z=" + z_d(li) + "m" end if end if end if if (xzc .EQ. 1)then if (sort .EQ. "time")then level = "y=" + y_d(lo) + "m" if(y_d(lo) .eq. -1.d) then level = "y-average" else level = "y=" + y_d(lo) + "m" end if else level = "y=" + y_d(li) + "m" if(y_d(li) .eq. -1.d) then level = "y-average" else level = "y=" + y_d(li) + "m" end if end if end if if (yzc .EQ. 1)then if (sort .EQ. "time")then level = "x=" + x_d(lo) + "m" if(x_d(lo) .eq. -1.d) then level = "x-average" else level = "x=" + x_d(lo) + "m" end if else level = "x=" + x_d(li) + "m" if(x_d(li) .eq. -1.d) then level = "x-average" else level = "x=" + x_d(li) + "m" end if end if end if if (xyc .EQ. 1)then if (sort .EQ. "time")then plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo-los,:,:),vect2(li,lo-los,:,:),vecres) else plot(n) = gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) plot(n) = gsn_csm_vector(wks_ps,vect1(lo,li-lis,:,:),vect2(lo,li-lis,:,:),vecres) end if end if if (xzc .EQ. 1) then if (sort .EQ. "time")then plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres) plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,lo-los,:),vect2(li,:,lo-los,:),vecres) else plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres) plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,li-lis,:),vect2(lo,:,li-lis,:),vecres) end if end if if (yzc .EQ. 1) then if (sort .EQ. "time")then plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres) plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,:,lo-los),vect2(li,:,:,lo-los),vecres) else plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres) plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,:,li-lis),vect2(lo,:,:,li-lis),vecres) end if end if check_vecp = isStrSubset( plotvec,","+vNam(varn)+",") end if 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 check = False if ( sort .eq. "time" ) then if ( z_d(zs+lo) .eq. -1)then if ( z_d(lo) .eq. -1)then if (delta_z .EQ. -1) then level = "-average" else level = "=" + z_d(zs+lo) + "m" level = "=" + z_d(lo) + "m" end if else level = "=" + z_d(zs+lo) + "m" level = "=" + z_d(lo) + "m" end if cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo,:,:),cs_res) plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo-los,:,:),cs_res) if (vector .EQ. 1 .AND. check_vecp) then vecres                  = True            ; vector only resources vecres@gsnLeftString    = " " vecres@tiXAxisString    = " " plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo-los,:,:),vect2(li,lo-los,:,:),vecres) overlay(plot(n), plot_vec) end if level = "-average" else level = "=" + z_d(zs+li) + "m" level = "=" + z_d(li) + "m" end if else level = "=" + z_d(zs+li) + "m" level = "=" + z_d(li) + "m" end if cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  z"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li,:,:),cs_res) plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li-lis,:,:),cs_res) if (vector .EQ. 1 .AND. check_vecp) then vecres                  = True            ; vector only resources if ( sort .eq. "time" ) then if ( y_d(ys+lo) .eq. -1 ) then if ( y_d(lo) .eq. -1 ) then level = "-average" else level = "=" + y_d(ys+lo) + "m" level = "=" + y_d(lo) + "m" end if cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  y"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res) plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo-los,:),cs_res) if (vector .EQ. 1 .AND. check_vecp) then vecres                  = True            ; vector only resources vecres@gsnLeftString    = " "             ; turn off left string vecres@tiXAxisString    = " " plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres) plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,lo-los,:),vect2(li,:,lo-los,:),vecres) overlay(plot(n), plot_vec) end if if ( sort .eq. "layer" ) then if ( y_d(ys+li) .eq. -1 ) then if ( y_d(li) .eq. -1 ) then level = "-average" else level = "=" + y_d(ys+li) + "m" level = "=" + y_d(li) + "m" end if cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  y"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res) plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li-lis,:),cs_res) if (vector .EQ. 1 .AND. check_vecp) then vecres                  = True            ; vector only resources vecres@gsnLeftString    = " "             ; turn off left string vecres@tiXAxisString    = " " plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres) plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,li-lis,:),vect2(lo,:,li-lis,:),vecres) overlay(plot(n), plot_vec) end if level = "-average" else level = "=" + x_d(xs+lo) + "m" level = "=" + x_d(lo) + "m" end if cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  x"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res) plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo-los),cs_res) if (vector .EQ. 1 .AND. check_vecp) then vecres                  = True            ; vector only resources vecres@gsnLeftString    = " "             ; turn off left string vecres@tiXAxisString    = " " plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres) plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,:,lo-los),vect2(li,:,:,lo-los),vecres) overlay(plot(n), plot_vec) end if level = "-average" else level = "=" + x_d(xs+li) + "m" level = "=" + x_d(li) + "m" end if cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  x"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res) plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li-lis),cs_res) if (vector .EQ. 1 .AND. check_vecp)then vecres                  = True            ; vector only resources vecres@gsnLeftString    = " "             ; turn off left string vecres@tiXAxisString    = " " plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres) plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,:,li-lis),vect2(lo,:,:,li-lis),vecres) overlay(plot(n), plot_vec) end if
Note: See TracChangeset for help on using the changeset viewer.