Hi Chao,
It looks like you have switched your latitudes and your longitudes. I
suspect that if you change:
do ilon=0,nlon-1
do ilat=0,nlat-1
if (sfmbl(ilon,ilat).ne.0.) then
frc1(ilon,ilat)=sfmblx01(ilon,ilat)/sfmbl(ilon,ilat)
else
frc1(ilon,ilat)=sfmbl@_FillValue
to
do ilat=0,nlat-1
do ilon=0,nlon-1
if (sfmbl(ilat,ilon).ne.0.) then
frc1(ilat,ilon)=sfmblx01(ilat,ilon)/sfmbl(ilat,ilon)
else
frc1(ilat,ilon)=sfmbl@_FillValue
All will work. Good luck,
Adam
Chao Luo wrote:
> Hi,
>
> I am trying to plot fraction of each dust bin emission to total
> emission. Since in many regions the total emissions are zero. So I need
> to set Fill value for zero numbers in these region in case of divided
> by zero. But the error message: Subscript out of range. Is there any
> better ways for this?
>
> Thanks,
>
> Chao
>
> part of my script is like:
>
> diri = "/data3/chaoluo/camdst/cam3019aersombf/"
> fl_mdl_3 = addfile(diri+"cam3019aersombf_annual.nc","r")
> sfmbl = fl_mdl_3->DSTSFMBL(0,:,:)
> sfmblx01 = fl_mdl_3->DSTX01SF(0,:,:)
>
> sfmbl@_FillValue=1.e+36
> nlon=128
> nlat=64
>
> frc1 = new((/nlat,nlon/),float)
> do ilon=0,nlon-1
> do ilat=0,nlat-1
> if (sfmbl(ilon,ilat).ne.0.) then
> frc1(ilon,ilat)=sfmblx01(ilon,ilat)/sfmbl(ilon,ilat)
> else
> frc1(ilon,ilat)=sfmbl@_FillValue
> end if
> end do
> end do
> print (frc1)
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-- -------------------------------------------------------------- Adam Phillips asphilli_at_ucar.edu National Center for Atmospheric Research tel: (303) 497-1726 ESSL/CGD/CAS fax: (303) 497-1333 P.O. Box 3000 Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli _______________________________________________ ncl-talk mailing list ncl-talk_at_ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Tue Jul 11 2006 - 16:11:05 MDT
This archive was generated by hypermail 2.2.0 : Tue Jul 11 2006 - 16:36:05 MDT