[gradsusr] Average with time varying

iri iri at irizone.net
Sun Apr 14 12:51:50 EDT 2019


Hi,

I've a set of datas with 4 recors by day. For each atmospheric parameter
and for each record, i want to calculate the average between day-5 and
day+5.
For example, if parameter is the temperature (TMP) and the day is 60 and
hour 06Z, then :
AVE_TMP60_06Z = average between TMP55_06Z and TMP65_06Z (only the 06Z / day)
After, i need to write this result in a grib file.

So, i wrote this :

(...)
'define average = 0'
timeCurrent = timeStart
'set t = timeCurrent'
while (timeCurrent < timeEnd)
  'average = ave('param', t = 'timeCurrent-20', t = 'timeCurrent+20', 4)'
  'g2grb average +'outputGrib' d='timemetaCurrent':'param':'level'
mb:'heureFcst' hour fcst'
  timeCurrent = timeCurrent + 1
  'set t = timeCurrent'
endwhile

My idea was :

timeCurrent-20 / timeCurrent+20 : 5 days with 4 records / day => 20
the time increment is 4 because 06Z day+1 is 4 records after one.

If the first results seem corrects until ~10 days, after, they become
wrongs and the result seems like a jamming.

I tryed, without writing to a grib file, with tloop but i obtain the
same result.

Any help would be much appreciated
Thanks

-- Stephane


More information about the gradsusr mailing list