<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">You need to keep "OPTIONS template" in there when you have %ch in the DSET entry. --Jennifer<div><br><div><div>On Mar 11, 2011, at 8:46 PM, Joyce Meyerson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Well, I'm certainly learning as I go along. Prior to this I've only used .ctl files with binary data or simple time defs with .nc and xdfopen.<div><br><div>I put the lines for DSET and CHSUB and have tried a couple variations including just DSET ^%ch and then listing the full path all without success. </div><div>I double checked the filename just to be sure. I'm running v2.0.a8 which seems to be the second to last version.</div><div><br></div><div><div>DSET ^ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_%ch.nc</div><div>CHSUB 1 360 200603010600-200606010000</div><div>TITLE Air Temperature</div><div>DTYPE netcdf</div><div>UNDEF 1.e+20f</div><div>*OPTIONS template</div><div>xdef 192 linear 0 1.875</div><div>ydef 145 linear -90 1.25</div><div>zdef 38 levels 20.000337600708 80.001350402832 179.999114990234 320.00146484375 500.000579833984 720.000366210938 980.000854492188 1279.998046875 1619.99987792969 1999.99841308594 2420.00170898438 2880.00146484375 3379.99829101562 3919.99951171875 4500.00146484375 5120 5779.99951171875 6479.99951171875 7220 8000.00146484375 8820 9679.9990234375 10579.998046875 11519.998046875 12499.9990234375 13520.0009765625 14580.7998046875 15694.6396484375 16875.310546875 18138.626953125 19503.009765625 20990.1875 22626.08203125 24458.28515625 26583.640625 29219.080078125 32908.69140625 39254.83203125</div><div>tdef 1800 linear 6Z1dec2005 6hr</div><div>VARS 3</div><div>b 38 z vertical coordinate formula term (k)</div><div>orog 0 y,x Surface Altitude (m)</div><div>ta 38 t,z,y,x Air Temperature (K)</div><div>ENDVARS</div></div><div><br></div><div><div><div>ga-> open test3.ctl</div><div>Scanning description file: test3.ctl</div><div>Error: nc_open failed to open file ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_%ch.nc</div><div>No such file or directory</div></div><div><br></div><div>or with full path </div><div><div>ga-> open test3.ctl </div><div>Scanning description file: test3.ctl</div><div>Error: nc_open failed to open file %ch</div></div><div><br></div><div><br></div><div><div>On Mar 11, 2011, at 4:39 PM, Jennifer Adams wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hang in there, Joyce. You're paving the way for all the future CMIP5 users out there. Unfortunately, you are going to have to use chsub for the template string substitutions. The file naming convention, although handy because you can know exactly which time steps are contained in each file, is not convenient for GrADS, and the only way you can do the templating is to give GrADS explicit instructions as to which time steps belong in each file (that's what CHSUB is good for). This was true for some CMIP3 data as well... <br>DSET ^ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_%ch.nc<br>CHSUB 1 360 200512010600-200603010000<br>etc. <br>(I think you have already worked out how chsub entries should look)<br><br>Another thing I noticed about your descriptor file -- your variable "orog" does not vary in Z, so you should change the 38 to 0 in the variable declaration. <br>--Jennifer<br><br><br>----- Original Message -----<br>From: "Joyce Meyerson" <<a href="mailto:hobo@atmos.ucla.edu">hobo@atmos.ucla.edu</a>><br>To: "GrADS Users Forum" <<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>Sent: Friday, March 11, 2011 7:15:43 PM<br>Subject: Re: [gradsusr] template for multiple netcdf files<br><br><br>Hi Jennifer, <br><br><br>Thank you for your patient help. <br>I read the SDFdesciptorfile and saw what you were talking about wrt the variable declarations and dtype which I implemented. <br>When I used only a single file it opened fine so I'm assuming the problem now lies with the template time substitution. <br><br><br>I'm attaching the ncdump if that is helpful. <br><br><br>Thanks again. <br>Joyce <br><br><br><br><br><br><br>A subset of the files to be opened (3 month chunks of 6hr data) <br><br>-rw-r--r-- 1 csi csi 1523538404 2010-12-18 08:28 ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_200512010600-200603010000.nc <br>-rw-r--r-- 1 csi csi 1523538404 2010-12-18 08:29 ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_200603010600-200606010000.nc <br>-rw-r--r-- 1 csi csi 1523538404 2010-12-18 08:29 ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_200606010600-200609010000.nc <br>-rw-r--r-- 1 csi csi 1523538404 2010-12-18 08:29 ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_200609010600-200612010000.nc <br>-rw-r--r-- 1 csi csi 1523538404 2010-12-18 08:30 ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_200612010600-200703010000.nc <br><br><br>The new .ctl file is <br><br>DSET ^ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_%y4%m2%d2%h200-%y4%m2%d2%h200.nc <br>TITLE Air Temperature <br>DTYPE netcdf <br>UNDEF 1.e+20f <br>OPTIONS template <br>xdef 192 linear 0 1.875 <br>ydef 145 linear -90 1.25 <br>zdef 38 levels 20.000337600708 80.001350402832 179.999114990234 320.00146484375 500.000579833984 720.000366210938 980.000854492188 1279.998046875 1619.99987792969 1999.99841308594 2420.00170898438 2880.00146484375 3379.99829101562 3919.99951171875 4500.00146484375 5120 5779.99951171875 6479.99951171875 7220 8000.00146484375 8820 9679.9990234375 10579.998046875 11519.998046875 12499.9990234375 13520.0009765625 14580.7998046875 15694.6396484375 16875.310546875 18138.626953125 19503.009765625 20990.1875 22626.08203125 24458.28515625 26583.640625 29219.080078125 32908.69140625 39254.83203125 <br>tdef 1800 linear 6Z1dec2005 6hr <br>VARS 3 <br>b 38 z vertical coordinate formula term (k) <br>orog 38 y,x Surface Altitude (m) <br>ta 38 t,z,y,x Air Temperature (K) <br>ENDVARS <br><br><br><br><br><br>On Mar 11, 2011, at 4:03 AM, Jennifer Adams wrote: <br><br><br><br>Joyce, <br>Please have a look at <a href="http://iges.org/grads/gadoc/SDFdescriptorfile.html">http://iges.org/grads/gadoc/SDFdescriptorfile.html</a> <br>You need 'dtype netcdf' and you need something like "t,z,y,x" instead of 0 in your variable declarations. If it is still not working, please send the output from 'ncdump -h'. <br>--Jennifer <br><br><br><br>On Mar 11, 2011, at 12:04 AM, Joyce Meyerson wrote: <br><br><br><br>Thanks Jennifer. Looks like I'm getting close. <br>After I removed "time" in TDEF it complained and wanted xdef, ydef, etc. I input that info and can now "open" the file with no errors but cannot display anything. "Entire Grid Undefined". <br><br><br>Control file now looks like <br><br><br><br>DSET ^ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_%y4%m2%d2%h200-%y4%m2%d2%h200.nc <br>TITLE Air Temperature <br>UNDEF 1.e+20f <br>OPTIONS template <br>xdef 192 linear 0 1.875 <br>ydef 145 linear -90 1.25 <br>zdef 38 levels 20.000337600708 80.001350402832 179.999114990234 320.00146484375 500.000579833984 720.000366210938 980.000854492188 1279.998046875 1619.99987792969 1999.99841308594 2420.00170898438 2880.00146484375 3379.99829101562 3919.99951171875 4500.00146484375 5120 5779.99951171875 6479.99951171875 7220 8000.00146484375 8820 9679.9990234375 10579.998046875 11519.998046875 12499.9990234375 13520.0009765625 14580.7998046875 15694.6396484375 16875.310546875 18138.626953125 19503.009765625 20990.1875 22626.08203125 24458.28515625 26583.640625 29219.080078125 32908.69140625 39254.83203125 <br>TDEF 1800 linear 6Z1dec2005 6hr <br>VARS 3 <br>b 38 0 vertical coordinate formula term: b(k) <br>orog 38 0 Surface Altitude m <br>ta 38 0 Air Temperature K <br>ENDVARS <br><br><br>??? <br>Joyce <br><br><br><br>On Mar 10, 2011, at 6:30 PM, Jennifer Adams wrote: <br><br><br><br>Joyce, <br>Take the 'time' keyword out of your TDEF statement -- that is for 'xdfopen' style descriptors, and you are using 'open'. <br>--Jennifer <br><br><br><br><br><br>On Mar 10, 2011, at 8:57 PM, Joyce Meyerson wrote: <br><br><br><br>Thanks Jeff, <br><br><br>Unfortunately, when I tried <br><br>DSET ^ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_%y4%m2%d2%h200-%y4%m2%d2%h200.nc <br>OPTIONS template <br>TDEF time 1800 linear 6Z1dec2005 6hr <br><br><br>I get the message <br><br>ga-> open test2.ctl <br>Scanning description file: test2.ctl <br>Open Error: Missing or invalid dimension size. <br>--> The invalid description file record is: <br>--> TDEF time 1800 linear 6Z1dec2005 6hr <br>The data file was not opened. <br><br><br>Joyce <br><br><br><br>On Mar 10, 2011, at 5:19 PM, Jeffrey Duda wrote: <br><br><br>Joyce, <br>You have the general idea of templating down right, but you do have a few template strings that are not right. If the last four digits in the dates of your filenames are just four-digit UTC times, use %h200. If they're forecast hours, use %f30. Also, I think you should only have one file name listed in the DSET entry (i.e., don't double up on the file names, just leave the templated file name string there instead). <br><br>Unfortunately if that change doesn't work, that's as far as I can go to help you, as I don't use sdfopen and it could be an issue related to that. <br><br>Hope this helps. <br><br>Jeff Duda <br><br><br>On Thu, Mar 10, 2011 at 6:58 PM, Joyce Meyerson < <a href="mailto:hobo@atmos.ucla.edu">hobo@atmos.ucla.edu</a> > wrote: <br><br><br><br>Hi All, <br><br><br>I am trying to write a control file to open multiple CMIP5 6hr .nc files. <br><br><br>I am running grads-2.0.a8 on Linux version 2.6.27.45-server-1mnb. <br><br><br>My files are 6h temperature in 3 month bundles and look like <br>ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_200512010600-200603010000.nc <br>ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_200603010600-200606010000.nc <br>ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_200606010600-200609010000.nc <br>... <br><br><br>They open fine individually with sdfopen. <br>All the examples I've seen on the user list and elsewhere more or less have names that are simple sequential (e.g., pr.1998.nc , pr.1999.nc , etc. or month, day, year, that kind of thing). <br><br><br>I'm not sure of the nomenclature with a time interval in the name like the above (xxx_%y4%m2%d2%t4-%y4%m2%d2% t4.nc ) <br><br><br>I tried %ch <br><br>DSET ^ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_% ch.nc <br>CHSUB 1 360 200512010600-200603010000 <br>CHSUB 361 720 200603010600-200606010000 <br>OPTIONS template <br>DTYPE netcdf <br>TDEF time 720 linear 6Z1dec2005 6hr <br>with the error message: <br><br>ga-> open test.ctl <br>Scanning description file: test.ctl <br>Open Error: Missing or invalid dimension size. <br>--> The invalid description file record is: <br>--> TDEF time 720 linear 6Z1dec2005 6hr <br>The data file was not opened. <br><br><br>I tried <br><br>DSET ^ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_200512010600-200603010000.nc ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_%y4%m2%d2%t4-%y4%m2%d2% t4.nc <br>OPTIONS template <br>TDEF time 1800 linear 6Z1dec2005 6hr <br>[opens just the first file] <br><br><br>and I tried <br><br>DSET ^ta_6hrLev_HadGEM2-ES_rcp45_r1i1p1_%y4%m2%d2%t4-%y4%m2%d2% t4.nc <br>OPTIONS template <br>TDEF time 1800 linear 6Z1dec2005 6hr <br>[gives error message: read_metadata: gaopfn failed (rc=-88888) <br>gadsdf: Couldn't ingest SDF metadata. <br>SDF Descriptor file test2.ctl was not successfully opened & parsed.] <br><br><br>I'm not the most adept grads/computer/scripting person. Please help. <br><br><br>Joyce <br><br><br><br><br><br><br><br><br>************************** <br>Joyce Meyerson <br>UCLA <br>Dept. of Oceanic & Atmospheric Sciences <br>7235 Math Science Bld. <br>Los Angeles, CA 90095-1565 <br><a href="mailto:hobo@atmos.ucla.edu">hobo@atmos.ucla.edu</a> <br><br>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>_______________________________________________<br>gradsusr mailing list<br>gradsusr@gradsusr.org<br>http://gradsusr.org/mailman/listinfo/gradsusr<br></div></blockquote></div><br><div apple-content-edited="true"> <div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>**************************</div><div><i>Joyce Meyerson</i></div><div><i>UCLA</i></div><div><i>Dept. of Oceanic & Atmospheric Sciences</i></div><div><span class="Apple-style-span" style="font-family: arial; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><i>7235 Math Science Bld.</i></span></div><div><font class="Apple-style-span" face="arial"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><i>Los Angeles, CA 90095-1565</i></span></font></div><div><i><a href="mailto:hobo@atmos.ucla.edu">hobo@atmos.ucla.edu</a></i></div></div></div></div> </div><br></div></div></div>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></div></span> </div><br></div></body></html>