<div><div dir="auto">Hello Mahakur,</div></div><div dir="auto">Many thanks. It worked perfectly fine. I have one more question. Can’t I extend it to more than one variable, e.g. u, v, t2 in one netcdf file?</div><div dir="auto"><br></div><div dir="auto">Mano</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 23, 2019 at 16:37 M.Mahakur <<a href="mailto:mmahakur@tropmet.res.in">mmahakur@tropmet.res.in</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><div><span style="background-color:rgb(51,102,255)">You can set sdfwrite with option -3dz, if your grads is 2.1.a2+</span></div><div><span style="background-color:rgb(51,102,255)">Please see the online doc, I have pasted the relevant lines here..</span><br></div><div><br></div><div><br></div><div>The <code>-3dz,</code><code>-3dt,-rt</code> and <code>-re</code> options are available in version <span>2.1.a2+</span>. </div><div><br></div><div><p style="margin:0px"><code>set sdfwrite <-3dz or -3dt or -4d or -5d> <-rt or -re> <-flt or -dbl> <-nc3 or -nc4> <-chunk> <-zip> <i>fname</i></code></p><p style="margin:0px">where</p><p style="margin:0px"><code><i>fname</i>    </code>output filename (required)</p><p style="margin:0px">The following six optional arguments are not enabled by default; each new call to <code><a href="http://cola.gmu.edu/grads/gadoc/gradcomdsetsdfwrite.html" target="_blank">set sdfwrite</a></code> will turn them off if they are not included. The default behavior is to write out a variable with the same number of varying dimensions as the defined variable and with no record (unlimited) dimension.</p><code>-3dt     </code><ul><ul>forces the output data file to have at least 3 coordinate dimensions (lon, lat, and time)</ul></ul><br><code>-3dz     </code><ul><ul>forces the output data file to have at least 3 coordinate dimensions (lon, lat, and lev)</ul></ul><br><code>-4d      </code><ul><ul>forces the output data file to have at least 4 coordinate dimensions (lon, lat, lev, and time)</ul></ul><br><code>-4e      </code><ul><ul>forces the output data file to have at least 4 coordinate dimensions (lon, lat, time, and ens)</ul></ul><br><code>-5d      </code><ul><ul>forces the output data file to have 5 coordinate dimensions (lon, lat, lev, time, and ens)</ul></ul><br><code>-rt      </code><ul><ul>sets the T axis as the record (unlimited) dimension</ul></ul><br><code>-re      </code><ul>sets the E axis as the record (unlimited) dimension</ul> <br></div><hr id="m_3952834206383562379zwchr"><div><b>From: </b>"lpasmanoranjan" <<a href="mailto:lpasmanoranjan@gmail.com" target="_blank">lpasmanoranjan@gmail.com</a>><br><b>To: </b>"GrADS Users Forum" <<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>><br><b>Sent: </b>Saturday, November 23, 2019 11:49:48 AM</div></div></div><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><div><br><b>Subject: </b>Re: [gradsusr] write in netcdf format<br></div><div><br></div><div><div dir="ltr"><div dir="ltr">Dear Jha and Dash,<br>CDO does not work!! I am getting the following error:<br><br>$> cdo -f nc import_binary data.ctl <a href="http://data.nc" target="_blank">data.nc</a><br>Open Error: Unknown keyword in description file<br>--> The invalid description file record is:<br>--> pdef 38 28 lcc 46.00 5.00 19.00 14.00 30.00 60.00 5.00 60000. 60000.<br>The data file was not opened.<br>cdo import_binary (Abort): Open failed!<br><br><br>Dear Mahakud,<br>As per your suggestion, I can save only one variable at one level with x and y varying. How about varying the Z-dimension?<br><br><div>Thank you Jha, Dash and Mahakur for your prompt suggestions.<br><div><p style="color:rgb(51,51,51);font-family:Verdana,sans-serif;font-size:12px"></p></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 23 Nov 2019 at 15:02, M.Mahakur <<a href="mailto:mmahakur@tropmet.res.in" target="_blank">mmahakur@tropmet.res.in</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div>replace newvars=vars<br></div><div>with<br></div><div>newvars=u (for example)<br></div><br><div>you can write only one variable in a single netCDF.<br></div><br><hr id="m_3952834206383562379gmail-m_-1573158503068755524zwchr"><div><b>From: </b>"Itesh Dash" <<a href="mailto:itesh.dash@gmail.com" target="_blank">itesh.dash@gmail.com</a>><br><b>To: </b>"GrADS Users Forum" <<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>><br><b>Sent: </b>Saturday, November 23, 2019 10:58:53 AM<br><b>Subject: </b>Re: [gradsusr] write in netcdf format<br></div><br><div><div dir="auto"><div>Use cdo to convert. Simple and easy. Follow the link below.<div dir="auto"><br></div><div dir="auto"><a href="https://code.mpimet.mpg.de/boards/1/topics/213" target="_blank">https://code.mpimet.mpg.de/boards/1/topics/213</a><br><div dir="auto"><br></div><div dir="auto"><br></div></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 23, 2019, 11:02 AM lpasmanoranjan <<a href="mailto:lpasmanoranjan@gmail.com" target="_blank">lpasmanoranjan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear Users,<br>I have a dataset 

(.DAT format with a .ctl file). I would like to write it in netcdf format. My dataset have multiple variables with various level. Following are the details in my .ctl file:<br><br>xdef  100 linear 55   0.2<br>ydef  200 linear 60   0.2<br>zdef   11 levels 1000 925 900 850 700 500 300 200 150 100 50<br>tdef  120 linear 00Z15May2012     1hr<br>VARS   5<br>U             11 0  x-wind component (m s-1)<br>V             11 0  y-wind component (m s-1)<br>W             11  0  z-wind component (m s-1)<br>Q2             1  0  QV at 2 M (kg kg-1)<br>T2             1  0  TEMP at 2 M (K)<br><div>My grads script to write my data in netcdf format is:<br><br>'open data.ctl'<br>'set time 00z15May2012 23z20May2012'<br>'set gxout fwrite'<br>'define newvars=vars'<br>'set sdfwrite <a href="http://data.nc" rel="noreferrer" target="_blank">data.nc</a>'<br>'sdfwrite newvars<br>'quit'</div><br><div>This script is not working.</div><div>Any help please??</div><br><div>Thank you in advance.<br>Kind Regards,<br>Mano</div></div>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" rel="noreferrer" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div></div></div>
<br>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br></div></div></div>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div>Kind Regards,<br></div>Mano<br></div></div></div>
<br>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br></div></div></div>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Kind Regards,<br></div>Mano<br></div></div>