[ncl-talk] Problems about output netCDF

Dennis Shea shea at ucar.edu
Mon Aug 25 07:24:46 MDT 2014


The following script works just fine on our local systems.
Did you remove the file before creating it. On some systems, an environment
variable  "NC_CLOBBER" is set. If this is the case, tou can not over write
ans existing netCDF file.

====

  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin
  in = addfile("wrfout_d01_000000.nc","r")

  diro = "./"
  filo = "eth850_1.nc"
  system("/bin.rm -f "+diro+filo)  ; rm any preexisting file
  out  = addfile(diro+filo,"c")

; First get the variables we will need

  it = 1
  lat = wrf_user_getvar(in,"lat",it) ; Equivalent PotentialTtemperature [K]
  lon = wrf_user_getvar(in, "lon",it) ; total pressure
  printVarSummary(lat)
  printVarSummary(lon)


  eth = wrf_user_getvar(in,"eth",it) ; Equivalent PotentialTtemperature [K]
  p   = wrf_user_getvar(in, "pressure",it) ; total pressure

  ; Horizontally interpolate to pressure coordinates ("p")
  pressure = 850.   ; 850 hPa
  eth_plane = wrf_user_intrp3d(eth,p,"h",pressure,0.,False)
  printVarSummary(eth_plane)



  out->lon = lon
  out->lat = lat
  out->eth850 = eth_plane
end



On Sun, Aug 24, 2014 at 9:39 PM, Mary Haley <haley at ucar.edu> wrote:

> You need to be more specific about what the problem is.
>
> Are you getting an error/warning, or a bad NetCDF file, or something else?
>
> If you are getting an error/warning, please include the exact message.
>
> --Mary
>
>
>
>
>
> On Sat, Aug 23, 2014 at 7:21 PM, Li Qi <liqi123sh at qq.com> wrote:
>
>> Dear all,
>>
>> I'd like to create a netCDF file with the selected variables read off WRF
>> output data, but I can't make it.
>>
>> Here's my code:
>>
>>   load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>   load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>>
>> begin
>> in = addfile("wrfout_d03_2011-06-13_18_00_00.nc","r")
>>  out = addfile("eth850_1.nc","c")
>>
>> ; First get the variables we will need
>>
>>   it = 1
>>   lat = wrf_user_getvar(in,"lat",it) ; Equivalent PotentialTtemperature
>> [K]
>>   lon = wrf_user_getvar(in, "lon",it) ; total pressure
>>
>>
>>   eth = wrf_user_getvar(in,"eth",it) ; Equivalent PotentialTtemperature
>> [K]
>>   p = wrf_user_getvar(in, "pressure",it) ; total pressure
>>
>>   ; Horizontally interpolate to pressure coordinates ("p")
>>   pressure = 850.   ; 850 hPa
>>   eth_plane = wrf_user_intrp3d(eth,p,"h",pressure,0.,False)
>>
>>
>>
>> out->lon = lon
>>  out->lat = lat
>> out->eth850 = eth_plane
>> end‍
>>
>>
>>
>> _______________________________________________
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140825/e21b377b/attachment.html 


More information about the ncl-talk mailing list