Changeset 532 for palm/trunk/SCRIPTS/NCL/spectra.ncl
- Timestamp:
- Apr 21, 2010 1:33:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/NCL/spectra.ncl
r526 r532 34 34 35 35 ;*************************************************** 36 ; Retrieving the NCL version used 37 ;*************************************************** 38 39 ncl_version_ch = systemfunc("ncl -V") 40 ncl_version = stringtofloat(ncl_version_ch) 41 42 ;*************************************************** 36 43 ; Retrieving the double quote character 37 44 ;*************************************************** … … 52 59 end if 53 60 54 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" )then61 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 55 62 print(" ") 56 63 print("'format_out = "+format_out+"' is invalid and set to'x11'") … … 58 65 format_out="x11" 59 66 end if 67 68 if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then 69 print(" ") 70 print("Output of png files not available") 71 print("png output is avaiable with NCL version 5.2.0 and higher ") 72 print("NCL version used: " + ncl_version_ch) 73 print(" ") 74 exit 75 end if 60 76 61 77 if (log_x .NE. 0 .AND. log_x .NE. 1)then … … 340 356 res@gsnDraw = False 341 357 res@gsnFrame = False 342 res@gsnPaperOrientation = "portrait"343 res@gsnPaperWidth = 8.27344 res@gsnPaperHeight = 11.69345 res@gsnPaperMargin = 0.79346 358 res@txFont = "helvetica" 347 359 res@tiMainFont = "helvetica" … … 417 429 if ( dash .eq. 0 ) then 418 430 res@xyMonoDashPattern = True 431 end if 432 433 if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then 434 format_out@wkPaperSize = "A4" 435 end if 436 if ( format_out .EQ. "png" ) then 437 format_out@wkWidth = 1000 438 format_out@wkHeight = 1000 419 439 end if 420 440 … … 664 684 end if 665 685 666 print(" ") 667 print("Output to: " + file_out +"."+ format_out) 668 print(" ") 686 if (format_out .EQ. "png" ) then 687 png_output = new((/no_frames/), string) 688 j = 0 689 do i=0, no_frames-1 690 j = i + 1 691 if (j .LE. 9) then 692 png_output(i) = file_out+".00000"+j+".png" 693 end if 694 if (j .GT. 9 .AND. j .LE. 99) then 695 png_output(i) = file_out+".0000"+j+".png" 696 end if 697 if (j .GT. 99 .AND. j .LE. 999) then 698 png_output(i) = file_out+".000"+j+".png" 699 end if 700 if (j .GT. 999) then 701 png_output(i) = file_out+".00"+j+".png" 702 end if 703 704 ;using imagemagick's convert for reducing the white 705 ;space around the plot 706 cmd = "convert -geometry 1000x1000 -density 300 -trim " + \ 707 png_output(i) + " " + png_output(i) 708 system(cmd) 709 end do 710 711 print(" ") 712 print("Output to: "+ png_output) 713 print(" ") 714 else 715 print(" ") 716 print("Output to: " + file_out +"."+ format_out) 717 print(" ") 718 end if 669 719 670 720 end
Note: See TracChangeset
for help on using the changeset viewer.