Dear NCL users
I try to modify some grid points in the wrf_input file.
I got the error message that I could not write the file
fatal:FileWriteVar: file (wrfinput_d01_ihop) was opened for reading only, can not write
fatal:Execute: Error occurred at or near line 26 in file modifync.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/wrf/WRFUserARW.ncl"
begin
a=addfile("wrfinput_d01_ihop.nc","r")
lat = a->XLAT(0,:,:)
lon = a->XLONG(0,:,:)
dimll = dimsizes(lat)
nlat = dimll(0)
nlon = dimll(1)
wks = gsn_open_wks("x11","plt_wrfinput")^M
gsn_define_colormap(wks,"gui_default") ; choose colormap^M
dimS = filevardimsizes(a,"VEGFRA")
print(dimS)
;veg = wrf_user_getvar(a,"VEGFRA",it)
;print(dimsizes(veg))
;print(veg)
fld = a->VEGFRA !! This line caused the problem how can I rewrite data to the file
; print(fld)
do i = 0,199
do j = 0,120
fld = fld * 0.5
end do
end do
a->VEGFRA=(/fld/)
res = True
res_at_gsnAddCyclic = False ; false since data does not cover globe
res_at_tfDoNDCOverlay = True ; faster for native projection
res_at_mpProjection = "LambertConformal"
res_at_mpLambertParallel1F = a_at_TRUELAT1
res_at_mpLambertParallel2F = a_at_TRUELAT2
res_at_mpLambertMeridianF = a_at_STAND_LON
res_at_mpLimitMode = "Corners"
res_at_mpLeftCornerLatF = lat(0,0)
res_at_mpLeftCornerLonF = lon(0,0)
res_at_mpRightCornerLatF = lat(nlat-1,nlon-1)
res_at_mpRightCornerLonF = lon(nlat-1,nlon-1)
res_at_mpOutlineDrawOrder = "PostDraw" ; draw continental outline last
res_at_mpOutlineBoundarySets = "GeophysicalAndUSStates"
res_at_mpFillOn = False ; turn off map fill
res_at_pmTickMarkDisplayMode = "Always"
res_at_cnFillOn = True ; turn on color fill
res_at_cnLinesOn = False ; turn off the contour lines
res_at_cnLineLabelsOn = False ; turn the line labels off
res_at_cnFillMode = "RasterFill"
plot = gsn_csm_contour_map(wks,fld(0,:,:),res)
end
_________________________________________________________________
Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail you.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_3:092010
--_9e79814a-4dd5-41f7-ba0a-b91a9c4fa29d_
Content-Type: text/html; charset="windows-1256"
Content-Transfer-Encoding: 8bit
<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Dear NCL users<br>I try to modify some grid points in the wrf_input file.<br>I got the error message that I could not write the file<br><br>fatal:FileWriteVar: file (wrfinput_d01_ihop) was opened for reading only, can not write<br>fatal:Execute: Error occurred at or near line 26 in file modifync.ncl<br><br><span id="toBoxCc" style="display: block;"><span class="BlockEmailNoName"></span></span>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br><br>begin<br> a=addfile("wrfinput_d01_ihop.nc","r")<br><br> lat = a->XLAT(0,:,:)<br> lon = a->XLONG(0,:,:)<br> dimll = dimsizes(lat)<br> nlat = dimll(0)<br> nlon = dimll(1)<br><br> wks = gsn_open_wks("x11","plt_wrfinput")^M<br> gsn_define_colormap(wks,"gui_default") ; choose colormap^M<br> dimS = filevardimsizes(a,"
VEGFRA")<br>
print(dimS)<br>
;veg = wrf_user_getvar(a,"VEGFRA",it)<br>
;print(dimsizes(veg))<br>
;print(veg)<br>
fld = a->VEGFRA !! <font style="" color="#ff0000">This line caused the problem how can I rewrite data to the file</font><br>
<br>
; print(fld)<br>
do i = 0,199<br>
do j = 0,120<br>
fld = fld * 0.5<br>
end do<br>
end do<br>
a->VEGFRA=(/fld/)<br> <br>res = True<br><br> res_at_gsnAddCyclic = False ; false since data does not cover globe<br> res_at_tfDoNDCOverlay = True ; faster for native projection<br><br> res_at_mpProjection = "LambertConformal"<br> res_at_mpLambertParallel1F = a_at_TRUELAT1 <br> res_at_mpLambertParallel2F = a_at_TRUELAT2 <br> res_at_mpLambertMeridianF = a_at_STAND_LON<br> res_at_mpLimitMode = "Corners"<br> res_at_mpLeftCornerLatF = lat(0,0)<br> res_at_mpLeftCornerLonF = lon(0,0)<br> res_at_mpRightCornerLatF = lat(nlat-1,nlon-1)<br> res_at_mpRightCornerLonF = lon(nlat-1,nlon-1)<br><br> res_at_mpOutlineDrawOrder = "PostDraw" ; draw continental outline last<br> res_at_mpOutlineBoundarySets = "GeophysicalAndUSStates"<br> res_at_mpFillOn = False ; turn off map fill<br><br> res_at_pmTickMarkDisplayMode = "Always"<br><br>
res_at_cnFillOn = True ; turn on color fill<br> res_at_cnLinesOn = False ; turn off the contour lines<br> res_at_cnLineLabelsOn = False ; turn the line labels off<br> res_at_cnFillMode = "RasterFill"<br> <br> plot = gsn_csm_contour_map(wks,fld(0,:,:),res) <br><br>end<br><br>
<br /><hr />Windows Live: <a href='http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_3:092010' target='_new'>Friends get your Flickr, Yelp, and Digg updates when they e-mail you.</a></body>
</html>
--_9e79814a-4dd5-41f7-ba0a-b91a9c4fa29d_--
--===============1924490860==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
--===============1924490860==--
Received on Mon Oct 05 2009 - 17:40:32 MDT
This archive was generated by hypermail 2.2.0 : Fri Oct 09 2009 - 08:29:22 MDT