[ncl-talk] Running the NCL code becomes slower
Zhifeng Yang
yangzf01 at gmail.com
Fri Jun 26 10:23:25 MDT 2015
Hi
I am trying to read SEVIRI data with a lot of variables and the dimension
of each variable is 3712*3712. I know the data are pretty large. But the
computer should read them smoothly. Since the memory that I specified is
about 50GB. Unfortunately, the code is becoming slower and slower while it
do the time loop. Here is a sample of my code.
; SET UP THE START TIME AND END TIME
start_year = 2008
end_year = 2008
start_month= 6
end_month = 6
start_day = 1
start_hour = 0
end_hour = 23
start_min = 0
end_min = 45
min_stride = 15
start_ind_lat = 1400
end_ind_lat = 3000
start_ind_lon = 1100
end_ind_lon = 2600
; DO YEAR LOOP
do iyear = start_year, end_year
; DO MONTH LOOP
do imonth = start_month, end_month
; CALCULATE THE NUMBER OF DAYS IN THIS MONTH
nday_month = days_in_month(iyear, imonth)
; DO DAY LOOP
do iday = start_day, 10;nday_month
; DO HOUR LOOP
do ihour = start_hour, end_hour
; DO MINUTE LOOP
do imin = start_min, end_min, min_stride
; READ VARIABLES FROM HDF FILE
a = addfile(dir + siyear + "/" + symd1 + "/" +
filename, "r")
lat = (/a->MSG_Latitude(start_ind_lat:end_ind_lat,
start_ind_lon:end_ind_lon)/)
lon = (/a->MSG_Longitude(start_ind_lat:end_ind_lat,
start_ind_lon:end_ind_lon)/)
Cloud_Optical_Thickness_16 =
a->Cloud_Optical_Thickness_16(start_ind_lat:end_ind_lat,
start_ind_lon:end_ind_lon)
end do ;imin
end do ;ihour
end do ;iday
end do ;imonth
end do ;iyear
Thank you
Zhifeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150626/b3610312/attachment.html
More information about the ncl-talk
mailing list