Re: Read 4 times daily observation data

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 27 2012 - 09:35:22 MST

Yes ... that should work.

If you are not greating plots tou do not need to load
the two graphics libraries: gsn_code.ncl, gsn_csm.ncl

On 2/26/12 10:43 PM, juki juki wrote:
> Dear all;
>
> I would like to confirm the following matter. I want to cut the 4 times
> daily observation data
> (http://www.esrl.noaa.gov/psd/cgi-bin/db_search/DBSearch.pl?&Dataset=NCEP/DOE+AMIP-II+Reanalysis+%28Reanalysis-2%29&Dataset=NCEP/DOE+AMIP-II+Reanalysis+%28Reanalysis-2%29+&Variable=U-wind).
> I want to take only the data between 80E-160E and 10N-10S. The purpose
> in only to reduce the file size for next processing. Thus, I want
> confirm whether the following code is correct or not in term of NCL code:
>
> ------------------
>
> ; Read and cut the 4 times daily data
> ; take only data between 10N-10S and 80E-160E
>
> 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
>
> print( "Here we go! " + systemfunc( "date" ) )
>
> ; mis = -999
> ; mis@_FillValue = -999
>
> ; open the file
>
> fileName = "uwnd.2001.nc"
> inFile = addfile( fileName, "r" )
> obsPerDay = 4
>
>
>
> latN = 10
> latS = -latN
>
> lonW = 80
> lonE = 160
> ; read the data
> print( "Reading the data..." )
> dataShort = inFile->uwnd (:,:,{latS:latN},{lonW:lonE})
>
> data = short2flt( dataShort )
>
>
> ; open the file to write to
>
> fileName = "uwndnew.2001.nc"
> system( "rm " + fileName )
> setfileoption( "nc", "Format", "LargeFile" )
> outFile = addfile( fileName, "c" )
>
> print( "Writing data... " + systemfunc( "date" ) )
> outFile->uwnd = data
>
>
> print( "Thank you, come again." + systemfunc( "date" ) )
> end
>
> -------------------
>
> Thanks for best help..
>
>
> JukY
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 27 09:35:37 2012

This archive was generated by hypermail 2.1.8 : Mon Mar 05 2012 - 14:12:07 MST