Hi Peter, What about the values of var15, var202 and annrf? The ambiguous coordinates warning message could mean that there is a problem. It means that Ferret may be attempting to do something that you don't intend it to do. However, the main problem with this loop is that you appear to be trying to write eager evaluation code in a Fortran/C/matlab (imperative) style rather than trying to use Ferret's strengths and its lazy evaluation. It's much easier to see where your intermediate variables may be missing. In this case you are trying to do some sort of forward Euler stepping which suggests that this could all be written much more clearly outside a loop using @RSUM or possibly @SUM transformations along with the @SHF operator. Here's an example ------------- ! Integrate a times series forward assuming time step of 1 let tseries =l[l=1:20] ! What we want is tseries_int(l) = sum(tseries(1:l-1)) for l=2:20. tseries_int(1) will be zero ! Shift the original time series and pad its first value with zero (will also make other missing values zero) let tseries_shf = missing(tseries[l=@shf:-1],0) ! The first value will be some initial values. I will just assume zero at the moment let tseries_int = tseries_shf[l=@rsum] list tseries,tseries_shf,tseries_int ------------ In your case you are trying to evaluate let dkbdi_shf = missing(dkbdi[l=@shf:-1],0) let kbdi=dkbdi_shf[l=@rsum] I'll let you sort out the other definitions but you definitely don't need a loop with all those messy references to "l=`l`". The explicit use of k=1 probably isn't needed in the definitions either until the final evaluation. Cheers, Russ On 19/08/14 18:02, Peter Szabo wrote:
|