Changeset 532 for palm/trunk/SCRIPTS/NCL/cross_sections.ncl
- Timestamp:
- Apr 21, 2010 1:33:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/NCL/cross_sections.ncl
r529 r532 35 35 begin 36 36 37 ;*************************************************** 38 ; Retrieving the NCL version used 39 ;*************************************************** 40 41 ncl_version_ch = systemfunc("ncl -V") 42 ncl_version = stringtofloat(ncl_version_ch) 43 37 44 ; *************************************************** 38 45 ; Retrieving the double quote character … … 54 61 end if 55 62 56 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" )then63 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" .AND. format_out .NE. "png")then 57 64 print(" ") 58 65 print("'format_out = "+format_out+"' is invalid and set to'x11'") 59 66 print(" ") 60 67 format_out="x11" 68 end if 69 70 if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then 71 print(" ") 72 print("Output of png files not available") 73 print("png output is avaiable with NCL version 5.2.0 and higher ") 74 print("NCL version used: " + ncl_version_ch) 75 print(" ") 76 exit 61 77 end if 62 78 … … 336 352 cs_res@gsnDraw = False 337 353 cs_res@gsnFrame = False 338 cs_res@gsnMaximize = True354 cs_res@gsnMaximize = True 339 355 340 356 cs_res@tmXBLabelFontHeightF = font_size … … 1446 1462 ; open workstation(s) 1447 1463 ; *************************************************** 1464 1465 if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then 1466 format_out@wkPaperSize = "A4" 1467 end if 1468 if ( format_out .EQ. "png" ) then 1469 format_out@wkWidth = 1000 1470 format_out@wkHeight = 1000 1471 end if 1448 1472 1449 1473 wks_ps = gsn_open_wks(format_out,file_out) … … 1807 1831 ; merge plots onto one page 1808 1832 ; *************************************************** 1833 1834 no_frames = 0 1835 1809 1836 if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then 1810 1837 if ((format_out .EQ. "eps" .OR. format_out .EQ. "epsi") .AND. no_time*no_layer*(no_var+1) .gt. no_rows*no_columns) then … … 1817 1844 if ( np + no_rows*no_columns .gt. dim_plot-1) then 1818 1845 gsn_panel(wks_ps, plot(np:dim_plot-1),(/no_rows,no_columns/),cs_resP) 1846 no_frames = no_frames + 1 1819 1847 else 1820 1848 gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP) 1849 no_frames = no_frames + 1 1821 1850 end if 1822 1851 end do … … 1832 1861 if ( np + no_rows*no_columns .gt. dim_plot-1) then 1833 1862 gsn_panel(wks_ps, plot(np:dim_plot-1),(/no_rows,no_columns/),cs_resP) 1863 no_frames = no_frames + 1 1834 1864 else 1835 1865 gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP) 1866 no_frames = no_frames + 1 1836 1867 end if 1837 1868 end do … … 1839 1870 end if 1840 1871 1841 print(" ") 1842 print("Output to: " + file_out +"."+ format_out) 1843 print(" ") 1872 if (format_out .EQ. "png" ) then 1873 png_output = new((/no_frames/), string) 1874 j = 0 1875 do i=0, no_frames-1 1876 j = i + 1 1877 if (j .LE. 9) then 1878 png_output(i) = file_out+".00000"+j+".png" 1879 end if 1880 if (j .GT. 9 .AND. j .LE. 99) then 1881 png_output(i) = file_out+".0000"+j+".png" 1882 end if 1883 if (j .GT. 99 .AND. j .LE. 999) then 1884 png_output(i) = file_out+".000"+j+".png" 1885 end if 1886 if (j .GT. 999) then 1887 png_output(i) = file_out+".00"+j+".png" 1888 end if 1889 1890 ;using imagemagick's convert for reducing the white 1891 ;space around the plot 1892 cmd = "convert -geometry 1000x1000 -density 300 -trim " + \ 1893 png_output(i) + " " + png_output(i) 1894 system(cmd) 1895 end do 1896 1897 print(" ") 1898 print("Output to: "+ png_output) 1899 print(" ") 1900 else 1901 print(" ") 1902 print("Output to: " + file_out +"."+ format_out) 1903 print(" ") 1904 end if 1844 1905 1845 1906 end
Note: See TracChangeset
for help on using the changeset viewer.