<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6001.18183" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"
bgColor=#ffffff>
<DIV><FONT face=Arial size=2>All,</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT face=Arial
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2>I can now open and display HYCOM MLD data in GrADS.
My next step is to output a lat,lon,value ASCII file from the open
dataset for a specified region. The script (shown below)
is a cannabalized/modified version of one sent to me by Arlindo some
time ago (any errors in the script are mine not his). While it does work,
it is very slow. It was originally written to work from a local file so, I
imagine the slow speed is because each time it writes a line in the ASCII
file it needs to go out and pull that info from the http source. Is there
a way I can first write the desired data to a NetCDF or binary file on my local
disk and then write the ASCII file pulling from that file? I tried
unsuccesfully to use the frwite command, but perhaps I am using the
command incorrectly.</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT face=Arial
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2>Mark</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>SCRIPT:</FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN lang=EN> </DIV>
<DIV>'reinit'</DIV>
<DIV>'sdfopen
http://hycom.coaps.fsu.edu/opendap/nph-dods/datasets/hycom/global/GLBa0.08_rect/data/2d/rarchv.2009_125_00_2d.nc'</DIV>
<DIV>*</DIV>
<DIV>* find Imax, Jmax</DIV>
<DIV>*</DIV>
<DIV>'q dims'</DIV>
<DIV>rec=sublin(result,2)</DIV>
<DIV>*Imax=subwrd(rec,13)</DIV>
<DIV>Imax=2170</DIV>
<DIV>say 'Imax 'Imax</DIV>
<DIV>rec=sublin(result,3)</DIV>
<DIV>*Jmax=subwrd(rec,13)</DIV>
<DIV>Jmax=2300</DIV>
<DIV>say 'Jmax 'Jmax</DIV>
<DIV>*</DIV>
<DIV>* define scaling environment by displaying any variable (otherwise an
error</DIV>
<DIV>* results...)</DIV>
<DIV>*</DIV>
<DIV>'set gxout shaded'</DIV>
<DIV>'set lev 0'</DIV>
<DIV>'set lon 190 260'</DIV>
<DIV>'set lat 20 48'</DIV>
<DIV>'d mld'</DIV>
<DIV>*</DIV>
<DIV>* open output file and print header...</DIV>
<DIV>*</DIV>
<DIV>rc = write('mld.txt','i j lonval latval var')</DIV>
<DIV>i=1750</DIV>
<DIV>while ( i <= Imax )</DIV>
<DIV>j=1500</DIV>
<DIV>while ( j <= Jmax )</DIV>
<DIV>'q gr2w 'i' 'j</DIV>
<DIV>rec = sublin(result,1)</DIV>
<DIV>lonv = subwrd(rec,3)</DIV>
<DIV>latv = subwrd(rec,6)</DIV>
<DIV>'set x 'i</DIV>
<DIV>'set y 'j</DIV>
<DIV>'d mld'</DIV>
<DIV>var = subwrd(result,4)</DIV>
<DIV>say ''i' 'j' 'lonv' 'latv' 'var</DIV>
<DIV>lonval = math_format('%6.3f',lonv)</DIV>
<DIV>latval = math_format('%6.3f',latv)</DIV>
<DIV>rc = write('mld.txt',''i' 'j' 'lonval' 'latval' 'var'')</DIV>
<DIV>j=j+1</DIV>
<DIV>endwhile</DIV>
<DIV>i=i+1</DIV>
<DIV>endwhile</DIV>
<DIV>rc = close('mld.txt')</DIV>
<DIV>'quit'</DIV>
<DIV></SPAN></FONT> </DIV></BODY></HTML>