There ***is*** something wrong with the FORMAT statement. Always the best way to debug a FORMAT statement is to do it in the IDL Output Log with PRINT (rather than in an output file with PRINTF) and start by getting just one element correct. Thus, if you were to debug this one problem:
PRINT, SatVP[4,0], FORMAT='(F8.3)'
then you would see why your output file is getting all asterisks after the first 4 elements on each line. I made an example from just the first 4 lines of your file (1 header + 3 data lines), and discovered this issue with your SatVP data: It all has values in this neighborhood: "4.36364e+017". For the 'F' format to work, then, there must be a column width of at least 19 characters, as you see below:
IDL> print, SatVP[4,0], FORMAT='(F18.0)' ; not enough total character width
******************
IDL> print, SatVP[4,0], FORMAT='(F19.0)'
436364382306304000.
That, of course, is not a very reader-friendly format for such a large number, so the 'E' exponential scientific notation format offers a better alternative:
IDL> PRINT, SATVP[4,0], FORMAT='(E9.3)' ; Not enough total character width
*********
IDL> PRINT, SATVP[4,0], FORMAT='(E10.3)'
4.364E+017
Notice how the full character width of the format must be at least 7 characters greater than the decimal precision of the output number in order to have enough room for the "E+..." substring. It must be 8 characters greater '(E11.3)', if you want a space between each number on a row.
Thus, I think if you change your format statement to read:
printf, 2, tem[0:3,j], satVP[4:27,j], FORMAT='(4I6,2X,24E11.3,2X)'
you will have the output you are looking for.
James Jones
P.S. In the code lines that you pasted in your original message I see several lines that appear to be executing in the wrong place, but I assume that that is just a pasting error on your part. As it is, the example you pasted would not work unless several of the lines were moved around to different locations.
|