output of netcdf

From: nlcheng <cnl88_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 03 2011 - 20:21:12 MDT

My script is below.Each time I extract a varible that is a constant ,because I make its dimensions constant.
I have to use the double circle "do " command because there is much count that I have omitted in this script below that it takes so much time to read.
 
but my idea is clear . when the constant vaible is extracted I have to write it in the netcdf file one by one!
On This Premise thatdo not change the the double circle "do " structure ,how can i
write the command ¡£hope for your help!
 
 
My idea:
first:
 
I have to define the avgSO2 and avgNOx. After thedouble circle ,printVarSummary(SO2) or printVarSummary(NOx)
that both SO2 and NOx are one dimensional .i do not want to lose the grid (m,n) that they have before i extract.
i have to use the the double circle .how can i write the script below .i try many times but ..
 
 
my script is below:
 ;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "/usr/local/ncl/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
load "/usr/local/ncl/lib/ncarg/nclscripts/csm/contributed.ncl"
;************************************************
begin
   fn = "/storage/sdd1/Model_Out_Data/CMAQ/2010/domain1/ln/"+"20101230.nc";
   a = addfile(fn,"r")
    fon = "API20101230.nc"
 system("rm -f "+fon)
 fo = addfile(fon,"c")
time =12
do m =0,159
do n=0,199
NO2=a->NO2(time,0,m,n)
NO=a->NO(time,0,m,n)
SO2=a->SO2(time,0,m,n)
NOx =NO2+NO

         fo->avgSO2 = SO2
        avgSO2!0 = "ROW"
        avgSO2!1 = "COL"
        avgSO2&ROW = m
        avgSO2&COL = n
       avgSO2@units = "mg/m^3"
      
      fo->avgNOx = NOx
        avgNOx!0 = "ROW"
        avgNOx!1 = "COL"
        avgNOx&ROW = m
        avgNOx&COL = n
        avgNOx@units = "mg/m^3"

end do
end do
end

 
 
 

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 3 20:21:28 2011

This archive was generated by hypermail 2.1.8 : Fri Nov 04 2011 - 08:43:41 MDT