Outputting Multiple NARR files to ascii text

From: DJ Rasmussen <dj.rasmussen_at_nyahnyahspammersnyahnyah>
Date: Thu, 09 Jul 2009 11:35:58 -0500

>
> NCL support team,
>
> I am struggling to be able to read in only one grid point and one
> level from several NARR .grb files with u and v wind data, have
> NCL(version 5.1.1) compute the magnitude of the wind, then output the
> wind magnitude for each file to a 1-D matrix in a single ascii text
> file. I have played with the/ addfiles_GetVar/ function, but it does
> not seem to help solve my situation. I think my problem might be how
> I am calling in one specific grid point and level from all the files.
> I apologize, but I have very little NCL and coding experience as I am
> an undergrad doing research for a professor.
>
> The errors I get is:
>
> fatal:Number of subscripts on rhs do not match number of dimensions of
> segregated cat type variable, (2) subscripts used, (3) Subscripts
> expected
> fatal:Execute: Error occurred at or near line 28 in file grib_ascii.ncl
>
> Any help from the NCL community would be greatly appreciated
>
> Regards,
>
> DMR
>
>
>
> ;*************************************************
> ; grib_ascii.ncl
> ;************************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> ;************************************************
> begin
>
> ;************************************************
> ; read in grib files
> ;************************************************
> diri = "/home/rasmussen/NARCCAP/NARR/grib/" ; directory where files
> reside
> fils = systemfunc("ls "+diri+"*.grb") ; call in all .grb files in
> the folder
> print("opening input "+fils)
> f = addfiles(fils,"r") ; read all files
>
> ListSetType(f, "cat")
>
> ;For u component:
>
> invar=f[:]->U_GRD_221_HTGL_113(0:130,144); take in only this grid
> point and level from all files
>
> invar!0="lv_HTGL3" ; output the data from grid points and place in 1-D
> matrix
>
> ;For v component:
>
> invar2=f[:]->V_GRD_221_HTGL_113(0:130,144)
>
> invar2!0="lv_HTGL3"
>
>
> wspd=sqrt(invar*invar+invar2*invar2) ; compute wind speeds from each
> u,v component in the NARR files
>
>
> ;************************************************
> ; output ascii
> ;************************************************
> fName = "narr_wspd.txt"
>
> asciiwrite (fName , wspd) ; write wind speeds to text file in a list
> form/ 1-D matrix
>
> end
>
>

-- 
DJ Rasmussen
Antarctic Meteorological Research Center
University of Wisconsin - Madison Space Science and Engineering Center
1225 W. Dayton St., Rm 947, Madison, WI 53706
Email: dj.rasmussen_at_ssec.wisc.edu
http://amrc.ssec.wisc.edu
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 09 2009 - 10:35:58 MDT

This archive was generated by hypermail 2.2.0 : Fri Jul 17 2009 - 15:27:02 MDT