Re: sptial distribution

From: Chao Luo <cluo_at_nyahnyahspammersnyahnyah>
Date: Mon, 24 Jul 2006 18:08:50 -0700

Hi Adam,

Thanks for your detailed information. I changed the script. The min(so4)
and max(so4) are still not correct. It seems the read data from asc file
is not correct. The array in asc file is (72x46x48) write out by FORTRAN
format: write(99,'(8e12.4)') (((data
(ilon,jlat,kspe),ilon=1,72),jlat=1,46),kspe=1,48)

The statement of :
  data = asciiread("./annl_avg_emi95.dat" \
                      , (/lon_nbr,lat_nbr,spe_nbr/),"float")
 should read right thing?

Thanks,

Chao

On Mon, 2006-07-24 at 17:33 -0600, Adam Phillips wrote:
> Hi Chao,
>
> Just so you know, you don't need to do 2 do loops here:
>
> do ilon=0,lon_nbr-1
> do ilat=0,lat_nbr-1
> so4(ilon,ilat)=data(ilon,ilat,34-1)*1.e9*0.0409*96. ;;;;ug SO4/m3
> no3(ilon,ilat)=data(ilon,ilat,33-1)*1.e9*0.0409*62. ;;;;ug No3/m3
> nh4(ilon,ilat)=data(ilon,ilat,32-1)*1.e9*0.0409*18. ;;;;ug nh4/m3
>
> so2(ilon,ilat)=data(ilon,ilat,26-1)*1.e9*0.0409*64. ;;;;ug SO2/m3
> hno3(ilon,ilat)=data(ilon,ilat,6-1)*1.e9*0.0409*63. ;;;;ug hno3/m3
> nh3(ilon,ilat)=data(ilon,ilat,30-1)*1.e9*0.0409*17. ;;;;ug nh4/m3
> end do
> end do
>
> should be
>
> so4 = data(:,:,34-1)*1.e9*0.0409*96. ;;;;ug SO4/m3
>
> and so on. You are also creating a new array complete with attributes
> and coordinate variables by doing this:
> so4 =data(:,:,33)
>
> all of data's attributes and coordinate variables are being transferred
> to so4..thus, so4 does not need to be preallocated, so you can remove
> this line:
> so4 =new((/lon_nbr,lat_nbr/),float)
>
> 1) if the min/max of so4 is not correct while the min/max of the other
> arrays (no3,so2) are then it is likely that you didn't read the file in
> correctly or that your calculation show in the lines above is not correct.
>
> 2) Re: the distribution. NCL expects you to pass arrays dimensioned
> (lat,lon) into the *_map_* plotting functions (ex.
> gsn_csm_contour_map_ce)... You are passing in arrays dimensioned
> (lon,lat), and are likely getting errors related to this. You can fix
> this by dimension reordering:
> plot(0) = gsn_csm_contour_map_ce(wks_id,so2(lat|:,lon:),res1)
>
> 3) NCL will always show 1 color > than the max contour level and 1 color
> < the min contour level. In your case set this for plot(0):
> res1_at_cnMinLevelValF = 2.0 ; instead of 0
> res1_at_cnMaxLevelValF = 18.0 ; instead of 20
>
> Finally, latGlobeFo and lonGlobeFo set up your lat and longitude arrays
> for you. You are overwriting them with:
> lon = -177.5 + ispan(0,lon_nbr-1,1) * 5.
> lat(0)=-89.0
> lat(lat_nbr-1)=89.0
> do ilat=1, lat_nbr-2
> lat(ilat)=-86.00 + 4.*(ilat-1)
> end do
>
> Good luck,
> Adam
>
> Chao Luo wrote:
> > Hi,
> >
> > I am try to make the contour plots by reading asc data of model
> > simulation by previous ncl-talk suggestions. I set 3D variable to couple
> > of 2D variable, and then plot the 2D variable. It seems there are 3
> > types of errors. First, pint out min and max of so4 are not correct.
> > Second, the distribution is not correct, and third one is that there are
> > extra colors less than min and higher than max of levels.
> > I attached script and plot here. Any help and suggestions are very
> > appreciated!
> >
> > Chao
> > http://dust.ess.uci.edu/chaoluo/temp/species_conc_8p_fig1.ncl
> > http://dust.ess.uci.edu/chaoluo/temp/fig1.ps
> >
> >
> >
> >
> >
> > _______________________________________________
> > 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 Mon Jul 24 2006 - 19:08:50 MDT

This archive was generated by hypermail 2.2.0 : Tue Jul 25 2006 - 08:57:03 MDT