Changeset 532 for palm/trunk/SCRIPTS/NCL/profiles.ncl
- Timestamp:
- Apr 21, 2010 1:33:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/NCL/profiles.ncl
r526 r532 33 33 34 34 begin 35 36 ;*************************************************** 37 ; Retrieving the NCL version used 38 ;*************************************************** 39 40 ncl_version_ch = systemfunc("ncl -V") 41 ncl_version = stringtofloat(ncl_version_ch) 35 42 36 43 ;*************************************************** … … 241 248 242 249 243 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" )then250 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 244 251 print(" ") 245 252 print("'format_out = "+format_out+"' is invalid and set to'x11'") … … 247 254 format_out="x11" 248 255 end if 256 257 if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then 258 print(" ") 259 print("Output of png files not available") 260 print("png output is avaiable with NCL version 5.2.0 and higher ") 261 print("NCL version used: " + ncl_version_ch) 262 print(" ") 263 exit 264 end if 249 265 250 266 if (over .NE. 0 .AND. over .NE. 1) then … … 1088 1104 res@gsnDraw = False 1089 1105 res@gsnFrame = False 1090 res@gsnPaperOrientation = "portrait"1091 res@gsnPaperWidth = 8.271092 res@gsnPaperHeight = 11.691093 res@gsnPaperMargin = 0.791094 1106 res@txFont = "helvetica" 1095 1107 res@tiMainFont = "helvetica" … … 1164 1176 end if 1165 1177 1178 if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then 1179 format_out@wkPaperSize = "A4" 1180 end if 1181 if ( format_out .EQ. "png" ) then 1182 format_out@wkWidth = 1000 1183 format_out@wkHeight = 1000 1184 end if 1185 1166 1186 wks=gsn_open_wks(format_out,file_out) 1167 1187 gsn_define_colormap(wks,"rainbow+white") … … 4092 4112 end do 4093 4113 4114 no_frames = 0 4115 4094 4116 if ((format_out .EQ. "eps" .OR. format_out .EQ. "epsi") .AND. n .gt. no_rows*no_columns) then 4095 4117 gsn_panel(wks,plot_,(/n,1/),resP) … … 4101 4123 if( (i+no_rows*no_columns) .gt. (n-1)) then 4102 4124 gsn_panel(wks,plot_(i:n-1),(/no_rows,no_columns/),resP) 4125 no_frames = no_frames + 1 4103 4126 else 4104 4127 gsn_panel(wks,plot_(i:i+no_rows*no_columns-1),(/no_rows,no_columns/),resP) 4128 no_frames = no_frames + 1 4105 4129 end if 4106 4130 end do 4107 4131 end if 4108 4132 4109 print(" ") 4110 print("Output to: " + file_out +"."+ format_out) 4111 print(" ") 4133 if (format_out .EQ. "png" ) then 4134 png_output = new((/no_frames/), string) 4135 j = 0 4136 do i=0, no_frames-1 4137 j = i + 1 4138 if (j .LE. 9) then 4139 png_output(i) = file_out+".00000"+j+".png" 4140 end if 4141 if (j .GT. 9 .AND. j .LE. 99) then 4142 png_output(i) = file_out+".0000"+j+".png" 4143 end if 4144 if (j .GT. 99 .AND. j .LE. 999) then 4145 png_output(i) = file_out+".000"+j+".png" 4146 end if 4147 if (j .GT. 999) then 4148 png_output(i) = file_out+".00"+j+".png" 4149 end if 4150 4151 ;using imagemagick's convert for reducing the white 4152 ;space around the plot 4153 cmd = "convert -geometry 1000x1000 -density 300 -trim " + \ 4154 png_output(i) + " " + png_output(i) 4155 system(cmd) 4156 end do 4157 4158 print(" ") 4159 print("Output to: "+ png_output) 4160 print(" ") 4161 else 4162 print(" ") 4163 print("Output to: " + file_out +"."+ format_out) 4164 print(" ") 4165 end if 4112 4166 4113 4167 end
Note: See TracChangeset
for help on using the changeset viewer.