[gradsusr] Help with fwrite
eaw24 at nc.rr.com
eaw24 at nc.rr.com
Mon Feb 24 09:37:07 EST 2014
Hi all,
I'm trying to use fwrite to save PV values to their own ctl file. I've looped through the levels and have calculated PV for each level (minus the first and last since the formula involves a central difference). I'm running into problems when I'm looping through *all* levels to create my .dat and new ctl file. At this time, I'm only interested in one time so I'm setting my time to the first in the file even though I am looping through it in my code. My ctl file has all the levels listed in it; however, when I go to plot PV, it's only plotting the last level for each level. In other words, it seems that it's only saving the final level in my .dat file. I know the PV formula is correct because I have already calculated and plotted PV for other levels and it changes as expected. Right now, my code is in flux, but I can copy pertinent sections to this email to see if anyone knows what may be going on.
Thanks!
Elizabeth
'set fwrite test.dat'
'set gxout fwrite'
levs=''
i=1
while(i<2)
'set t 'i
z=1
while(z<=29)
'set z 'z
'set z 1.00002 1111'
'set y 1 247'
'q dims'
level=sublin(result,4)
lev=subwrd(result,6)
levs=levs' 'lev''
'd pv'
z=z+1
endwhile
i=i+1
endwhile
More information about the gradsusr
mailing list