<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Tom,<br>
<br>
I think you'll need to add attributes to your variables,
specifically the units. For lat and lon these<br>
should be "degrees_north" and "degrees_east". <br>
<br>
Jim<br>
<br>
<div class="moz-cite-prefix">On 1/15/15 11:38 AM, Thomas Robinson
wrote:<br>
</div>
<blockquote
cite="mid:CABa1TPip5Q+6SchmmptBu=SmdGmHPM+ZQOPxo_VDUPA821=qCA@mail.gmail.com"
type="cite">
<div dir="ltr">Aloha Grads Users,
<div><br>
</div>
<div>I am bringing in some data and running calculations using
fortran 90. I want to output the data as a netCDF file, and I
would like it to be readable by grads. I have no problem
creating a file called <a moz-do-not-send="true"
href="http://foo.nc">foo.nc</a> and putting my lat, lon, and
ref variables in the file. The problem is if I go to grads
and type 'sdfopen <a moz-do-not-send="true"
href="http://foo.nc">foo.nc</a>', it says </div>
<div>
<div>ga-> sdfopen <a moz-do-not-send="true"
href="http://foo.nc">foo.nc</a> </div>
<div>Scanning self-describing file: <a moz-do-not-send="true"
href="http://foo.nc">foo.nc</a></div>
<div>gadsdf: SDF file has no discernable X coordinate.</div>
<div> To open this file with GrADS, use a descriptor file
with an XDEF entry.</div>
<div> Documentation is at <a moz-do-not-send="true"
href="http://iges.org/grads/gadoc/SDFdescriptorfile.html">http://iges.org/grads/gadoc/SDFdescriptorfile.html</a></div>
</div>
<div>What do I need to add to make the file self describing?</div>
<div> I'm not sure what I need to add to get this to work.
Here is what I have so far:</div>
<div><br>
</div>
<div>
<div>istatus = nf90_create(path = "<a moz-do-not-send="true"
href="http://foo.nc">foo.nc</a>", cmode = nf90_noclobber,
ncid = ncid)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div><br>
</div>
<div>istatus =nf90_def_dim(ncid,'latitude',ny,ila)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div>istatus =nf90_def_dim(ncid,'longitude',nx,ilo)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div>istatus =nf90_def_dim(ncid,'time',1,itt)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div><br>
</div>
<div>iids = (/ilo,ila,itt/)</div>
<div><br>
</div>
<div>istatus = nf90_def_var(ncid,"ref", nf90_float, iids, iref
)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div>istatus = nf90_def_var(ncid,"lat", nf90_float, ila, ilat
)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div>istatus = nf90_def_var(ncid,"lon", nf90_float, ilo, ilon
)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div>istatus = nf90_enddef(ncid)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div><br>
</div>
<div>istatus = nf90_put_var(ncid,iref,ref)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div>istatus = nf90_put_var(ncid,ilat,latrad)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
<div>istatus = nf90_put_var(ncid,ilon,lonref)</div>
<div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
</div>
<div>
<div><br>
</div>
<div>istatus = nf90_close(ncid)</div>
<div> write (6,*) trim(nf90_strerror(istatus))</div>
</div>
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">Tom Robinson<br>
Treasurer - Graduate Student Organization <br>
Secretary - Student Athletic Fee Committee <br>
Graduate Student - Department of Atmospheric Science <br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
<br>
</body>
</html>