<div dir="ltr">Dear GRADS Users,<div><br></div><div>I&#39;m trying to use the &quot;write&quot; intrinsic function to write on a file (.txt or dat) the daily mean precipitation for every day derived from a precipitation dataset (e.g. 2013 CMORPH daily precipitation estimates, see below).</div><div>At this stage, I&#39;m just trying to create the output file, which is a result I&#39;m not able to get yet.</div><div>I don&#39;t know for which reason, this function in one case works and in another doesn&#39;t.</div><div> </div><div><b>Case 1</b>: I can run the script with no errors but the .txt file is not generated within the defined current directory.</div><div><br></div><div><div>&#39;sdfopen <a href="http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NCEP/.CPC/.CMORPH/.daily/.mean/.morphed/.cmorph/T/%2801%20Jan%202013%29%2831%20Dec%202013%29RANGEEDGES/dods">http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NCEP/.CPC/.CMORPH/.daily/.mean/.morphed/.cmorph/T/%2801%20Jan%202013%29%2831%20Dec%202013%29RANGEEDGES/dods</a>&#39;</div><div>outfile=&#39;C:/OpenGrADS/Contents/Resources/SampleDatasets/CMORPH.txt&#39;</div><div>&#39;set gxout print&#39;</div><div>&#39;set prnopts %0.3f 5 1&#39;</div><div>rc=write(outfile, &#39;LON    LAT    PREC&#39;)</div></div><div><br></div><div><b>Case 2</b>: Take an example I found on the web and in this case I can actually get the NCEP.txt file in my current directory.</div><div><br></div><div>&#39;sdfopen <a href="http://monsoondata.org:9090/dods/rean2d">http://monsoondata.org:9090/dods/rean2d</a>&#39;</div><div>outfile=&#39;C:/OpenGrADS/Contents/Resources/SampleDatasets/NCEP.txt&#39;</div><div>&#39;set gxout print&#39;</div><div>&#39;set prnopts %6.2f 5 1&#39;</div><div>rc=write(outfile, &#39;LON    LAT    PREC&#39;) </div><div><br></div><div>The first example is related to a precipitation dataset which I&#39;m interested into, the second is an excerpt from a script I found on the web.</div><div><br></div><div>Could explain me why this happens?</div><div>Could you also provide me with some tested working scripts, which use this function within a while loop (which is what I would need to extract the mean daily precipitation from a given dataset)?</div><div><br></div><div>Thank you very much!</div><div><br></div><div>Kindest regards</div><div><br></div><div>Annibale</div><div><br></div></div>