<div dir="ltr"><div>1. Something does not make sense here. Why "W = f_in->W" rather than "W = ff->W" ??</div><div><br></div><div>2. Instead of addfile(“wrfinput_d01”,”w”), try addfile(“wrfinput_d01.h5”,”w”). It is a long shot.</div><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 13, 2022 at 7:43 PM Michael Toy - NOAA Affiliate via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I want to modify one of the fields of a WRF “wrfinput” file. I have no problem doing this if the file is netCDF, but this one is an HDF5 file (“Hierarchical Data Format (version 5) data”).<br>
<br>
Here’s my script:<br>
<br>
ff = addfile(“wrfinput_d01”,”w”)<br>
W = f_in->W ; read the variable W (vertical velocity)<br>
.<br>
.<br>
“make some changes to W”<br>
.<br>
.<br>
ff->W=W ; write the new values of W back to the file<br>
<br>
These lines execute just fine, but the resulting file is corrupted and unreadable. The problem, I guess, is that I haven’t correctly accounted for the fact that wrfinput_d01 is an HDF5 file. I’ve checked online and it looks like I have to add following line at the top of my script:<br>
setfileoption(“h5”,”FileStructure”,”Advanced”)<br>
However, I tried this, and it didn’t work.<br>
<br>
I would appreciate any assistance with this. Thank you.<br>
<br>
Best regards,<br>
Mike<br></blockquote></div></div>