<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Mike,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>First, thanks so much for your carter.m matlab routine for accessing Carter's tables. It has been tremendously helpful. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>In the course of my work, I think I found a small bug in the code. In these lines:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" face="Courier">-------snip---------</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier">% now scan through longitudes to find correction area</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><BR class="khtml-block-placeholder"></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier">for i = 1:length(lon_file)-1;</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"> if lon_use >= lon_file(i) & lon_use < lon_file(i+1);</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"> correction_area(ii) = area(i);</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"> elseif lon_use > lon_file(end);</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"> correction_area(ii) = area(end); % if is on last record in group</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"> end;</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier">end;</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier">----------snip---------</FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>...it turns out that if "lon_use", (the longitude for which one would like a correction) happens to be equal to the "lon_file(end)", (the last value in the list of area longitude boundaries), then no area is selected (i.e. area_correction is not set) and subsequent lines of code fail. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>A simple (and I *think* proper) fix is to modify the second elseif statement to the following:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV> <FONT class="Apple-style-span" face="Courier"> elseif lon_use >= lon_file(end);</FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>[Note the added "=".]</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I am not entirely sure this is correct and I defer to your judgement.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The copy of carter.m I have was borrowed from the USGS - SEA-MAT site: </DIV><DIV><A href="http://woodshole.er.usgs.gov/operations/sea-mat/">http://woodshole.er.usgs.gov/operations/sea-mat/</A>. <BR><DIV> <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; "><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><BR class="khtml-block-placeholder"></DIV><DIV>I have cc'd their mailing list.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Cheers,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-Val</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>------------------------------------------------------</DIV><DIV>Val Schmidt</DIV><DIV>CCOM/JHC</DIV><DIV>University of New Hampshire</DIV><DIV>Chase Ocean Engineering Lab</DIV><DIV>24 Colovos Road</DIV><DIV>Durham, NH 03824</DIV><DIV>e: vschmidt [AT] ccom.unh.edu</DIV><DIV>m: 614.286.3726</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN> </DIV><BR></DIV></BODY></HTML>