<div><div dir="auto">Dear Mahakur</div></div><div dir="auto">You solved my problem. Thank you once again. </div><div dir="auto"><br></div><div dir="auto">Still one small doubt. I used “cdo merge <a href="http://u.nc">u.nc</a> <a href="http://t2.nc">t2.nc</a> <a href="http://out.nc">out.nc</a>”</div><div dir="auto"><br></div><div dir="auto">After opening <a href="http://out.nc">out.nc</a> in grads, “q file” command shows:</div><div dir="auto">u   11  t,z,y,x  u</div><div dir="auto">t2   0  t,y,x     t2</div><div dir="auto"><br></div><div dir="auto">Here t2 has only one level. Let’s say 1000. But t2 is showing same values at all 11 levels. I should show undefined values at other 10 levels. </div><div dir="auto"><br></div><div dir="auto">Do you have any comment on this?</div><div dir="auto"><br></div><div dir="auto">Mano</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 25, 2019 at 11:49 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"><br>
<br>
not possible with grads.. each variables' netcdf you can later merge using cdo..<br>
<br>
----- Original Message -----<br>
From: lpasmanoranjan <<a href="mailto:lpasmanoranjan@gmail.com" target="_blank">lpasmanoranjan@gmail.com</a>><br>
To: GrADS Users Forum <<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>><br>
Sent: Mon, 25 Nov 2019 07:05:37 +0530 (IST)<br>
Subject: Re: [gradsusr] write in netcdf format<br>
<br>
Hello Mahakur,<br>
Many thanks. It worked perfectly fine. I have one more question. Can’t I<br>
extend it to more than one variable, e.g. u, v, t2 in one netcdf file?<br>
<br>
Mano<br>
<br>
On Sat, Nov 23, 2019 at 16:37 M.Mahakur <<a href="mailto:mmahakur@tropmet.res.in" target="_blank">mmahakur@tropmet.res.in</a>> wrote:<br>
<br>
> You can set sdfwrite with option -3dz, if your grads is 2.1.a2+<br>
> Please see the online doc, I have pasted the relevant lines here..<br>
><br>
><br>
> The -3dz,-3dt,-rt and -re options are available in version 2.1.a2+.<br>
><br>
> set sdfwrite <-3dz or -3dt or -4d or -5d> <-rt or -re> <-flt or -dbl><br>
> <-nc3 or -nc4> <-chunk> <-zip> *fname*<br>
><br>
> where<br>
><br>
> *fname*    output filename (required)<br>
><br>
> The following six optional arguments are not enabled by default; each new<br>
> call to set sdfwrite<br>
> <<a href="http://cola.gmu.edu/grads/gadoc/gradcomdsetsdfwrite.html" rel="noreferrer" target="_blank">http://cola.gmu.edu/grads/gadoc/gradcomdsetsdfwrite.html</a>> will turn them<br>
> off if they are not included. The default behavior is to write out a<br>
> variable with the same number of varying dimensions as the defined variable<br>
> and with no record (unlimited) dimension.<br>
> -3dt<br>
><br>
>    forces the output data file to have at least 3 coordinate dimensions<br>
>       (lon, lat, and time)<br>
><br>
><br>
> -3dz<br>
><br>
>    forces the output data file to have at least 3 coordinate dimensions<br>
>       (lon, lat, and lev)<br>
><br>
><br>
> -4d<br>
><br>
>    forces the output data file to have at least 4 coordinate dimensions<br>
>       (lon, lat, lev, and time)<br>
><br>
><br>
> -4e<br>
><br>
>    forces the output data file to have at least 4 coordinate dimensions<br>
>       (lon, lat, time, and ens)<br>
><br>
><br>
> -5d<br>
><br>
>    forces the output data file to have 5 coordinate dimensions (lon, lat,<br>
>       lev, time, and ens)<br>
><br>
><br>
> -rt<br>
><br>
>    sets the T axis as the record (unlimited) dimension<br>
><br>
><br>
> -re<br>
><br>
>    sets the E axis as the record (unlimited) dimension<br>
><br>
><br>
> ------------------------------<br>
> *From: *"lpasmanoranjan" <<a href="mailto:lpasmanoranjan@gmail.com" target="_blank">lpasmanoranjan@gmail.com</a>><br>
> *To: *"GrADS Users Forum" <<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>><br>
> *Sent: *Saturday, November 23, 2019 11:49:48 AM<br>
><br>
> *Subject: *Re: [gradsusr] write in netcdf format<br>
><br>
> 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" rel="noreferrer" 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<br>
> and y varying. How about varying the Z-dimension?<br>
><br>
> Thank you Jha, Dash and Mahakur for your prompt suggestions.<br>
><br>
><br>
> 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>
><br>
>> replace newvars=vars<br>
>> with<br>
>> newvars=u (for example)<br>
>><br>
>> you can write only one variable in a single netCDF.<br>
>><br>
>> ------------------------------<br>
>> *From: *"Itesh Dash" <<a href="mailto:itesh.dash@gmail.com" target="_blank">itesh.dash@gmail.com</a>><br>
>> *To: *"GrADS Users Forum" <<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>><br>
>> *Sent: *Saturday, November 23, 2019 10:58:53 AM<br>
>> *Subject: *Re: [gradsusr] write in netcdf format<br>
>><br>
>> Use cdo to convert. Simple and easy. Follow the link below.<br>
>><br>
>> <a href="https://code.mpimet.mpg.de/boards/1/topics/213" rel="noreferrer" target="_blank">https://code.mpimet.mpg.de/boards/1/topics/213</a><br>
>><br>
>><br>
>><br>
>><br>
>> On Sat, Nov 23, 2019, 11:02 AM lpasmanoranjan <<a href="mailto:lpasmanoranjan@gmail.com" target="_blank">lpasmanoranjan@gmail.com</a>><br>
>> wrote:<br>
>><br>
>>> Dear Users,<br>
>>> I have a dataset (.DAT format with a .ctl file). I would like to write<br>
>>> it in netcdf format. My dataset have multiple variables with various level.<br>
>>> 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>
>>> 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'<br>
>>><br>
>>> This script is not working.<br>
>>> Any help please??<br>
>>><br>
>>> Thank you in advance.<br>
>>> Kind Regards,<br>
>>> Mano<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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>>><br>
>><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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>><br>
><br>
><br>
> --<br>
> Kind Regards,<br>
> Mano<br>
><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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
><br>
-- <br>
Kind Regards,<br>
Mano<br>
<br>
<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" 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>