<div dir="ltr"><div>One approach: direct use of netCDF operators [ NCO ]:<b><br></b></div><div><b><br></b></div><div><b>%></b> ncks -d time,0  <a href="http://z.nc">z.nc</a>  <a href="http://z_0.nc">z_0.nc</a></div><div><b>%></b> ncks -d time,1  <a href="http://z.nc">z.nc</a>  <a href="http://z_1.nc">z_1.nc</a></div><div>etc</div><div>===</div><div>I speculate the Climate Data Operators [CDO] could be used also</div><div>====</div><div><br></div><div>Use (say) an NCL script to invoke the 'ncks' operator</div><div>====</div><div>  diri = "./"         ; source input directory<br>  fili = "<a href="http://z.nc">z.nc</a>"       ; source input file<br>  pthi = diri+fili<br><br>  diro = "./"         ; output directory<br><br>  do nt=0,4<br>     nts  = sprinti("%0.1i", nt)    ; or ... sprinti("%0.2i", nt)<br>     filo = "z_"+nts+".nc"<br>     ptho = diro+filo<br>     nco  = "ncks -O -d time,"+nt+" "+pthi+" "+ptho<br>     print("nt="+nt+": "+nco)                                      ; echo NCO command<br>     system(nco)<br>  end do<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 2, 2019 at 2:13 PM Tripura Yerrapothu via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</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">Hello Team,<br><br>I am currently looking the command that helps me to split the .nc file based on time stamp. Below is the file opened using ncdump<br><br>netcdf rtma_20190501_T_interp_test {<br>dimensions:<br>    time = UNLIMITED ; // (5 currently)<br>    lon = 309 ;<br>    lat = 195 ;<br>variables:<br>    double time(time) ;<br>        time:standard_name = "time" ;<br>        time:long_name = "verification time generated by wgrib2 function verftime()" ;<br>        time:units = "seconds since 1970-01-01 00:00:00.0 0:00" ;<br>        time:calendar = "standard" ;<br>        time:axis = "T" ;<br>    float lon(lon) ;<br>        lon:standard_name = "longitude" ;<br>        lon:long_name = "longitude" ;<br>        lon:units = "degrees_east" ;<br>        lon:axis = "X" ;<br>    float lat(lat) ;<br>        lat:standard_name = "latitude" ;<br>        lat:long_name = "latitude" ;<br>        lat:units = "degrees_north" ;<br>        lat:axis = "Y" ;<br>    float TMP_2maboveground(time, lat, lon) ;<br>        TMP_2maboveground:long_name = "Temperature" ;<br>        TMP_2maboveground:units = "K" ;<br>        TMP_2maboveground:_FillValue = 9.999e+20f ;<br>        TMP_2maboveground:missing_value = 9.999e+20f ;<br>        TMP_2maboveground:short_name = "TMP_2maboveground" ;<br>        TMP_2maboveground:level = "2 m above ground" ;<br><br>// global attributes:<br>        :CDI = "Climate Data Interface version 1.9.3 (<a href="http://mpimet.mpg.de/cdi" target="_blank">http://mpimet.mpg.de/cdi</a>)" ;<br>        :Conventions = "CF-1.0" ;<br>        :history = "Thu Jun 20 15:36:01 2019: cdo intntime,4 rtma_20190501_T_test.nc rtma_20190501_T_interp_test.nc\n",<br>            "Thu Jun 20 15:31:22 2019: ncrcat ../20190501/rtma_2019050123_T_MS.nc rtma_2019050202_T_MS.nc rtma_20190501_T_test.nc\n",<br>            "Mon Jun 10 16:53:02 2019: cdo remapbil,/home/tripura/2019CMA/Concorde-final/data/MS_Sound_Grid_90.13W-87.05W_29N-30.94N <a href="http://tmp.nc" target="_blank">tmp.nc</a> /home/tripura/2019CMA/Concorde-final/download/201905/20190501/rtma_2019050123_T_MS.nc" ;<br>        :History = "created by wgrib2" ;<br>        :GRIB2_grid_template = 30 ;<br>        :NCO = "4.7.2" ;<br>        :nco_openmp_thread_number = 1 ;<br>        :CDO = "Climate Data Operators version 1.9.3 (<a href="http://mpimet.mpg.de/cdo" target="_blank">http://mpimet.mpg.de/cdo</a>)" ;<br>}<br><br><br>Now i want this file to split into 5 files i.e.. i am looking for the command to split the files based on the timestamps.<br><br>Please kindly help me on this.<br><br>Thank you in advance.<br><br>Tripura<br><br><br><br></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>