Changeset 532 for palm/trunk/SCRIPTS/NCL/timeseries.ncl
- Timestamp:
- Apr 21, 2010 1:33:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/NCL/timeseries.ncl
r526 r532 35 35 36 36 ;*************************************************** 37 ; Retrieving the NCL version used 38 ;*************************************************** 39 40 ncl_version_ch = systemfunc("ncl -V") 41 ncl_version = stringtofloat(ncl_version_ch) 42 43 ;*************************************************** 37 44 ; Retrieving the double quote character 38 45 ;*************************************************** … … 53 60 end if 54 61 55 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" )then62 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 56 63 print(" ") 57 64 print("'format_out = "+format_out+"' is invalid and set to'x11'") … … 59 66 format_out="x11" 60 67 end if 68 69 if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then 70 print(" ") 71 print("Output of png files not available") 72 print("png output is avaiable with NCL version 5.2.0 and higher ") 73 print("NCL version used: " + ncl_version_ch) 74 print(" ") 75 exit 76 end if 61 77 62 78 if (over .NE. 0 .AND. over .NE. 1) then … … 275 291 res@gsnDraw = False 276 292 res@gsnFrame = False 277 res@gsnPaperOrientation = "portrait"278 res@gsnPaperWidth = 8.27279 res@gsnPaperHeight = 11.69280 res@gsnPaperMargin = 0.79281 293 res@tmXBMode = True 282 294 res@tmYLMode = True … … 308 320 ; *************************************************** 309 321 322 if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then 323 format_out@wkPaperSize = "A4" 324 end if 325 if ( format_out .EQ. "png" ) then 326 format_out@wkWidth = 1000 327 format_out@wkHeight = 1000 328 end if 329 310 330 wks_ps = gsn_open_wks(format_out,file_out) 311 331 gsn_define_colormap(wks_ps,"rainbow+white") … … 1207 1227 ; merge plots onto one page 1208 1228 ; *************************************************** 1229 1230 no_frames = 0 1209 1231 1210 1232 if ((format_out .EQ. "eps" .OR. format_out .EQ. "epsi") .AND. n .gt. no_rows*no_columns) then … … 1217 1239 if ( np + no_rows*no_columns .gt. n) then 1218 1240 gsn_panel(wks_ps, plot_ps(np:n),(/no_rows,no_columns/),resP) 1241 no_frames = no_frames + 1 1219 1242 else 1220 1243 gsn_panel(wks_ps, plot_ps(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),resP) 1244 no_frames = no_frames + 1 1221 1245 end if 1222 1246 end do 1223 1247 end if 1224 1248 1225 print(" ") 1226 print("Output to: " + file_out +"."+ format_out) 1227 print(" ") 1249 if (format_out .EQ. "png" ) then 1250 png_output = new((/no_frames/), string) 1251 j = 0 1252 do i=0, no_frames-1 1253 j = i + 1 1254 if (j .LE. 9) then 1255 png_output(i) = file_out+".00000"+j+".png" 1256 end if 1257 if (j .GT. 9 .AND. j .LE. 99) then 1258 png_output(i) = file_out+".0000"+j+".png" 1259 end if 1260 if (j .GT. 99 .AND. j .LE. 999) then 1261 png_output(i) = file_out+".000"+j+".png" 1262 end if 1263 if (j .GT. 999) then 1264 png_output(i) = file_out+".00"+j+".png" 1265 end if 1266 1267 ;using imagemagick's convert for reducing the white 1268 ;space around the plot 1269 cmd = "convert -geometry 1000x1000 -density 300 -trim " + \ 1270 png_output(i) + " " + png_output(i) 1271 system(cmd) 1272 end do 1273 1274 print(" ") 1275 print("Output to: "+ png_output) 1276 print(" ") 1277 else 1278 print(" ") 1279 print("Output to: " + file_out +"."+ format_out) 1280 print(" ") 1281 end if 1282 1228 1283 1229 1284 end
Note: See TracChangeset
for help on using the changeset viewer.