Aquileo | Recent changes to support-requestshttps://sourceforge.net/p/nco/support-requests/2024-07-19T15:00:09.845000ZRecent changes to support-requestsAquileo | #30 ncap2 on shell gives error2024-07-19T15:00:09.845000Z2024-07-19T15:00:09.845000Zhenry Butowskyhttps://sourceforge.net/u/hmb/https://sourceforge.neta78e7a950f563dc70b46f55cc1869f0698adb1d2<div class="markdown_content"><p>Either the dim <strong>ens_member</strong> is already defined as 0 (UNLIMITED) in the input file or your shell script is setting it to 0.</p></div>Aquileo | #30 ncap2 on shell gives error2024-07-19T13:47:25.760000Z2024-07-19T13:47:25.760000ZHusain Najafihttps://sourceforge.net/u/hnajafi/https://sourceforge.netdec5fb44ef5d8446263a0a6da50f85921999aa73<div class="markdown_content"><p>Thanks Henry, <br/>
Now ens_member = UNLIMITED ; // (0 currently))<br/>
is there any way to define this dimension as fixes size?</p></div>Aquileo | #30 ncap2 on shell gives error2024-07-19T13:06:58.573000Z2024-07-19T13:06:58.573000Zhenry Butowskyhttps://sourceforge.net/u/hmb/https://sourceforge.net30cd5c7a761a5a010aaf7e95cc27dbc31d535a19<div class="markdown_content"><p>its a bit tricky because you are redefining the variable "pre" that is already in input. try something like.</p>
<div class="codehilite"><pre><span></span><code>defdim("ens",40 );
pre_new[$time,$latitude,$longitude,$ens]=pre;
</code></pre></div>
<p>...Henry</p></div>Aquileo | #30 ncap2 on shell gives error2024-07-19T12:47:37.455000Z2024-07-19T12:47:37.455000ZHusain Najafihttps://sourceforge.net/u/hnajafi/https://sourceforge.net07bc4b42a4460b7f197e1cb7a5b206491d8f2442<div class="markdown_content"><p>Dear Henry,</p>
<p>Thanks for the tip. I used the follwoing script</p>
<p>cat << EOF > test.nco<br/>
defdim("ens_member", $ens);<br/>
pre<span>[\$time, \$latitude, \$longitude, \$ens_member]</span> = pre;<br/>
EOF </p>
<p>($ens is expanded from bash as a variable as it changes from 00 to 20) .</p>
<p>With this, ncap2 passed without any error from the bash script. But then when I look into the output file, no displayable variables found. I also tried defdim("ens",40 ), but it also does did not work out.</p></div>Aquileo | #30 ncap2 on shell gives error2024-07-18T15:33:31.516000Z2024-07-18T15:33:31.516000Zhenry Butowskyhttps://sourceforge.net/u/hmb/https://sourceforge.net3303b5f1d7f00aee879fc3bdccd9fde1351bd4d7<div class="markdown_content"><p>I suggest you get the command working in a script first then once its working move it to the command line. eg </p>
<p>test.nco </p>
<div class="codehilite"><pre><span></span><code>defdim("ens",40 );
pre[$time,$latitude,$longitude,$ens]=pre
</code></pre></div>
<p>then run the above script with the command</p>
<blockquote>
<p>ncap2 -S test.nco in.nc out.nc</p>
</blockquote>
<p>...Henry</p></div>Aquileo | ncap2 on shell gives error2024-07-18T15:24:16.385000Z2024-07-18T15:24:16.385000ZHusain Najafihttps://sourceforge.net/u/hnajafi/https://sourceforge.netf4e06ffe34ee9e3c01755c014ff4d309e4eac1e2<div class="markdown_content"><p>I want to use ncap 2 on a shell script and followed examples from other tickets. However, I am still getting an error. Could you please correct this script? <strong>ncap2 -s "defdim('ens_member',${ensemble});pre<span><span>[\$time, \$latitude,\$longitude, \$ens_member]</span></span> = pre;" "$in" "$out"</strong> Many thanks,</p></div>Aquileo | #28 How to add time variable in the NETCDF file2023-04-07T16:10:22.899000Z2023-04-07T16:10:22.899000ZCharlie Zenderhttps://sourceforge.net/u/zender/https://sourceforge.net1fa4c8327a0eedb19f5d357a5cac721f4174a2d2<div class="markdown_content"><p>Please read the manual on <a class="" href="https://nco.sf.net/nco.html" rel="nofollow">ncap2</a>. You can use <code>ncap2</code> to define a <code>time</code> dimension of the right size (or rename, with <code>ncrename</code>, the existing dimension to <code>time</code>), then create a <code>time</code> variable with that dimension, a <code>units</code> attribute, then populate it with values in the appropriate units, and add a <code>calendar</code> attribute so that the final results looks something like:</p>
<div class="codehilite"><pre><span></span><code><span class="w"> </span><span class="n">double</span><span class="w"> </span><span class="kt">time</span><span class="p">(</span><span class="kt">time</span><span class="p">)</span><span class="w"> </span><span class="p">;</span>
<span class="w"> </span><span class="kt">time</span><span class="o">:</span><span class="n">units</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"days since 1850-01-01 00:00:00"</span><span class="w"> </span><span class="p">;</span>
<span class="w"> </span><span class="kt">time</span><span class="o">:</span><span class="n">long_name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"time"</span><span class="w"> </span><span class="p">;</span>
<span class="w"> </span><span class="kt">time</span><span class="o">:</span><span class="n">calendar</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"gregorian"</span><span class="w"> </span><span class="p">;</span>
</code></pre></div>
<p>It might be easier to just append (<code>with ncks -A -v time in.nc out.nc</code>) <code>time</code> from file that already has one. </p></div>Aquileo | How to create correct time dimension in the concatenated netcdf file2023-04-06T18:05:11Z2023-04-06T18:05:11ZMubasharhttps://sourceforge.net/u/mubashardogar/https://sourceforge.netaca4523b7bee7a7c6b781adfcda024dbc66ec3dd<div class="markdown_content"><p>Dear NCO Support Team,</p>
<p>I have a netcdf file containing monthly data of several variables from Jan1850 to Dec2020. I want to concatenate this file twice and then want to correct the time dimension of this concatenated file to be continuous (i.e., the total time will be Jan1850 to Dec2191). Please note that the time dimension of this netcdf file is in Julian calendar and I want to keep this same Julian calendar. Please advise how can I get this time record in the new concatenated netcdf file?</p>
<p>Best regards,<br/>
Mubashar </p></div>Aquileo | How to add time variable in the NETCDF file2023-04-06T14:46:12.193000Z2023-04-06T14:46:12.193000ZMubasharhttps://sourceforge.net/u/mubashardogar/https://sourceforge.net16e733c95105c3ce885a1d49b0cdcc7169971a82<div class="markdown_content"><p>Dear NCO support team,</p>
<p>I have a netcdf file containing monthly data for several variables over the period 1850-01-17 till 2051-12-17. The time variable/dimension has been removed somehow and doesn't exist anymore in this netcdf file. I want to add this monthly time dimension starting from 1850-01-17 till 2051-12-17. How can I add this time using NCO? Moreover, can I add this time in Julian calendar format?</p></div>Aquileo | #27 how to calculate median2022-06-17T20:29:32.780000Z2022-06-17T20:29:32.780000ZCharlie Zenderhttps://sourceforge.net/u/zender/https://sourceforge.net1ea814510fbb9f2d5539aa203e0f34676257c068<div class="markdown_content"><ul>
<li><strong>status</strong>: open --> closed</li>
<li><strong>Group</strong>: --> </li>
</ul></div>