Re: add two files times in ncl script

From: <asphilli_at_nyahnyahspammersnyahnyah>
Date: Sat, 19 Aug 2006 18:39:39 -0600 (MDT)

Hi Anil,

Welcome to NCL! You can read all of your netCDF files at once using the
addfiles/addfiles_GetVar functions:
http://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml
(see example 4. The time variable is automatically concatenated.)

Once you have the precipitation read in, you can calculate the rainfall
for each day by looping through each day and by using the dim_sum
function:
(http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_sum.shtml)
If WRF is giving you cumulative rainfall for each 3 hour period, then you
need to sum up the rainfall across every 8 timesteps to calculate a daily
cumulative rainfall total.

a quick example script (ppt is dimensioned (time,lat,lon))
;=============================
ntim = dimsizes(ppt&time)
finppt = ppt(:ntim/8-1,:,:) ; preallocate space for new daily ppt array
                              ; metadata information kept
temp = ppt(lat|:,lon|:,time|:) ; reorder array so that time is the
                                ; rightmost dimension. dim_sum will operate
                                ; on the rightmost dimension
delete(ppt)
cntr = 0
do gg = 0,ntim-1,8 ; increment do loop by 8
   finppt(cntr,:,:) = (/ dim_sum(temp(:,:,gg:gg+7)) /)
   cntr = cntr+1
end do
delete(temp)
delete(cntr)
printVarSummary(finppt)

Good luck!
Adam

> dear list,
> I am new to this NCL stuff. i want to calculate the daily
> rainfall from my diffrent files ,i have my 3 hourly files, some 10-20
file for a WRF run , what is the procedure to add all the files in a
single script ,and how time variable will de adjusted accordingly, i
want to calculate 24 hour rainfall for each dar ,but WRF Model is giving
cumulative rainfall. please if anybody is having some script that will
be usefull to me .
>
> thanks in advance
>
>
> --
> ANIL KUMAR ROHILLA
> Meteorologist
> Long Range Forecasting Section
> NATIONAL CLIMATE CENTER
> O/o ADGM(Research)
> India Meteorological Department
> Shivaji Nagar
> PUNE-411005.
> INDIA
> Mobile: 09422023277
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Aug 19 2006 - 18:39:39 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 21 2006 - 11:34:40 MDT