<div dir="ltr">Chuck- I printed out the data like you suggested, and almost all the values from the tmax(i,j) array are missing while the tmax_all(i,j) array has realistic values. I decided to read the whole line in first and then write it out by x,y and it seems to be working!<div><br></div><div>Jim- I double checked the file sizes and they are correct. Thanks for that useful tip!</div><div><br></div><div>Here is the final script I used and it is giving me realistic data in the correct grid box!<br></div><div><p style="margin:0px;line-height:normal;font-family:Menlo"><span style="color:rgb(52,189,38)">integer</span> irec,i,j,t,days</p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style="color:rgb(52,189,38)">character</span><span style="">(</span><span style="color:rgb(52,189,38)">len</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">100</span><span style="">) infile,outfile</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style="color:rgb(52,189,38)">real</span><span style=""> tmax_all(</span><span style="color:rgb(195,55,32)">464</span><span style="">,</span><span style="color:rgb(195,55,32)">224</span><span style="">), tmin_all(</span><span style="color:rgb(195,55,32)">464</span><span style="">,</span><span style="color:rgb(195,55,32)">224</span><span style="">),prcp_all(</span><span style="color:rgb(195,55,32)">464</span><span style="">,</span><span style="color:rgb(195,55,32)">224</span><span style="">),srad_all(</span><span style="color:rgb(195,55,32)">464</span><span style="">,</span><span style="color:rgb(195,55,32)">224</span><span style="">)</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo;color:rgb(195,55,32)"><span style="color:rgb(0,0,0)">infile</span><span style="color:rgb(206,121,36)">=</span><span style="">'/Volumes/WebData/NLDAS2/DailyNLDAS/daily.bin'</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo;color:rgb(195,55,32)"><span style="color:rgb(0,0,0)">outfile</span><span style="color:rgb(206,121,36)">=</span><span style="">'/Volumes/WebData/NLDAS2/Fortran/testdaily.bin'</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo;color:rgb(206,121,36)"><span style="">open</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(195,55,32)">17</span><span style="color:rgb(0,0,0)">,</span><span style="">file=</span><span style="color:rgb(0,0,0)">infile,</span><span style="">form=</span><span style="color:rgb(195,55,32)">"unformatted"</span><span style="color:rgb(0,0,0)">,</span><span style="">access=</span><span style="color:rgb(195,55,32)">"direct"</span><span style="color:rgb(0,0,0)">,</span><span style="">recl=</span><span style="color:rgb(195,55,32)">464</span><span style="">*</span><span style="color:rgb(195,55,32)">224</span><span style="">*</span><span style="color:rgb(195,55,32)">4</span><span style="color:rgb(0,0,0)">,</span><span style="">status=</span><span style="color:rgb(195,55,32)">"old"</span><span style="color:rgb(0,0,0)">)</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo;color:rgb(195,55,32)"><span style="color:rgb(206,121,36)">open</span><span style="color:rgb(0,0,0)">(</span><span style="">18</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(206,121,36)">file=</span><span style="color:rgb(0,0,0)">outfile,</span><span style="color:rgb(206,121,36)">form=</span><span style="">"unformatted"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(206,121,36)">access=</span><span style="">"direct"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(206,121,36)">recl=</span><span style="">32</span><span style="color:rgb(206,121,36)">*</span><span style="">32</span><span style="color:rgb(206,121,36)">*</span><span style="">4</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(206,121,36)">status=</span><span style="">"unknown"</span><span style="color:rgb(0,0,0)">)</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></span><br></p>
<p style="margin:0px;line-height:normal;font-family:Menlo;color:rgb(195,55,32)"><span style="color:rgb(0,0,0)">days</span><span style="color:rgb(206,121,36)">=</span><span style="">10</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style="">irec</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">1</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style="color:rgb(206,121,36)">do</span><span style=""> t</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">1</span><span style="">,days</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style=""> </span><span style="color:rgb(206,121,36)">read</span><span style="">(</span><span style="color:rgb(195,55,32)">17</span><span style="">,</span><span style="color:rgb(206,121,36)">REC=</span><span style="">irec) tmax_all</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style=""> </span><span style="color:rgb(206,121,36)">read</span><span style="">(</span><span style="color:rgb(195,55,32)">17</span><span style="">,</span><span style="color:rgb(206,121,36)">REC=</span><span style="">irec</span><span style="color:rgb(206,121,36)">+</span><span style="color:rgb(195,55,32)">1</span><span style="">) tmin_all</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style=""> </span><span style="color:rgb(206,121,36)">read</span><span style="">(</span><span style="color:rgb(195,55,32)">17</span><span style="">,</span><span style="color:rgb(206,121,36)">REC=</span><span style="">irec</span><span style="color:rgb(206,121,36)">+</span><span style="color:rgb(195,55,32)">2</span><span style="">) prcp_all</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style=""> </span><span style="color:rgb(206,121,36)">read</span><span style="">(</span><span style="color:rgb(195,55,32)">17</span><span style="">,</span><span style="color:rgb(206,121,36)">REC=</span><span style="">irec</span><span style="color:rgb(206,121,36)">+</span><span style="color:rgb(195,55,32)">3</span><span style="">) srad_all</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style=""> </span><span style="color:rgb(206,121,36)">write</span><span style="">(</span><span style="color:rgb(195,55,32)">18</span><span style="">,</span><span style="color:rgb(206,121,36)">REC=</span><span style="">irec) ((tmax_all(i,j),i</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">129</span><span style="">,</span><span style="color:rgb(195,55,32)">160</span><span style="">),j</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">129</span><span style="">,</span><span style="color:rgb(195,55,32)">160</span><span style="">)</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style=""> </span><span style="color:rgb(206,121,36)">write</span><span style="">(</span><span style="color:rgb(195,55,32)">18</span><span style="">,</span><span style="color:rgb(206,121,36)">REC=</span><span style="">irec</span><span style="color:rgb(206,121,36)">+</span><span style="color:rgb(195,55,32)">1</span><span style="">) ((tmin_all(i,j),i</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">129</span><span style="">,</span><span style="color:rgb(195,55,32)">160</span><span style="">),j</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">129</span><span style="">,</span><span style="color:rgb(195,55,32)">160</span><span style="">)</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style=""> </span><span style="color:rgb(206,121,36)">write</span><span style="">(</span><span style="color:rgb(195,55,32)">18</span><span style="">,</span><span style="color:rgb(206,121,36)">REC=</span><span style="">irec</span><span style="color:rgb(206,121,36)">+</span><span style="color:rgb(195,55,32)">2</span><span style="">) ((prcp_all(i,j),i</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">129</span><span style="">,</span><span style="color:rgb(195,55,32)">160</span><span style="">),j</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">129</span><span style="">,</span><span style="color:rgb(195,55,32)">160</span><span style="">)</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style=""> </span><span style="color:rgb(206,121,36)">write</span><span style="">(</span><span style="color:rgb(195,55,32)">18</span><span style="">,</span><span style="color:rgb(206,121,36)">REC=</span><span style="">irec</span><span style="color:rgb(206,121,36)">+</span><span style="color:rgb(195,55,32)">3</span><span style="">) ((srad_all(i,j),i</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">129</span><span style="">,</span><span style="color:rgb(195,55,32)">160</span><span style="">),j</span><span style="color:rgb(206,121,36)">=</span><span style="color:rgb(195,55,32)">129</span><span style="">,</span><span style="color:rgb(195,55,32)">160</span><span style="">)</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo"><span style=""> irec</span><span style="color:rgb(206,121,36)">=</span><span style="">irec</span><span style="color:rgb(206,121,36)">+</span><span style="color:rgb(195,55,32)">4</span></p>
<p style="margin:0px;line-height:normal;font-family:Menlo;color:rgb(206,121,36)">enddo</p></div><div><br></div><div>Thank you all for your help! I really appreciate it.</div><div><br></div><div>Lydia</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 5, 2016 at 3:57 PM, Charles Seman - NOAA Federal <span dir="ltr"><<a href="mailto:charles.seman@noaa.gov" target="_blank">charles.seman@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Lydia,<br>
<br>
It may be better to put the tmax_all and tmax printout on the same line:<br>
<br>
print *, 't, i, j, tmax_all(i,j), tmax(i,j) : ',t, i, j, tmax_all(i,j),<br>
tmax(i,j)<br>
<br>
this should make it easier to compare the values...<br>
<br>
you could also try printing the difference: tmax_all(i,j) - tmax(i,j)<br>
<br>
Chuck<br>
<div class="HOEnZb"><div class="h5"><br>
On 07/05/2016 03:36 PM, Charles Seman - NOAA Federal wrote:<br>
> Lydia,<br>
><br>
> I would print directly in your Fortran program, within the "t" do-loop.<br>
> Try something like:<br>
> ...<br>
> real tmax_all(464,224)<br>
> ...<br>
> do t=1,days<br>
> read(17,REC=irec) ((tmax(i,j),i=129,160),j=129,160)<br>
> read(17,REC=irec) tmax_all ! to keep things simple, read in the<br>
> entire array<br>
> i=129<br>
> do j=129,160<br>
> print *, 't, i, j, tmax_all(i,j) : ',t, i, j, tmax_all(i,j)<br>
> print *, 't, i, j, tmax(i,j) : ',t, i, j, tmax(i,j)<br>
> enddo<br>
> j=129<br>
> do i=129,160<br>
> print *, 't, i, j, tmax_all(i,j) : ',t, i, j, tmax_all(i,j)<br>
> print *, 't, i, j, tmax(i,j) : ',t, i, j, tmax(i,j)<br>
> enddo<br>
> i=160<br>
> do j=129,160<br>
> print *, 't, i, j, tmax_all(i,j) : ',t, i, j, tmax_all(i,j)<br>
> print *, 't, i, j, tmax(i,j) : ',t, i, j, tmax(i,j)<br>
> enddo<br>
> j=160<br>
> do i=129,160<br>
> print *, 't, i, j, tmax_all(i,j) : ',t, i, j, tmax_all(i,j)<br>
> print *, 't, i, j, tmax(i,j) : ',t, i, j, tmax(i,j)<br>
> enddo<br>
> stop<br>
> ...<br>
> enddo<br>
><br>
> The above printouts are designed to print the 4 edges of the desired<br>
> 32x32 array of data, and may reveal something. You could also try<br>
> printing across the middle of the array (horizontally and vertically).<br>
><br>
> If nothing is amiss, then try reading and writing just one variable to a<br>
> GrADS binary file, and adjust ctl file... see if this looks OK... if so,<br>
> then try another variable...<br>
><br>
> Hope this helps,<br>
> Chuck<br>
><br>
> On 07/05/2016 02:56 PM, Lydia Rill wrote:<br>
>> Hi Chuck,<br>
>><br>
>> This is my first time using GrADS so I'm still pretty fuzzy on the<br>
>> specifics in the control file. My understanding is the 1st number is the<br>
>> vertical level, and the 2nd value is an ID label. The 3rd value I am not<br>
>> sure, and the 4th value is the height at which the variable was<br>
>> measured. I took these values directly from a control file created using<br>
>> the grib2ctl function when processing the raw data which were grib<br>
>> files. (I processed them by aggregating hourly to daily data).<br>
>><br>
>> When you say print out a row and column, am I able to print the data as<br>
>> text in Fortran? Or should I use GrADS?<br>
>><br>
>> Thanks,<br>
>><br>
>> Lydia<br>
>><br>
>><br>
>><br>
>> On Tue, Jul 5, 2016 at 2:31 PM, Charles Seman - NOAA Federal<br>
>> <<a href="mailto:charles.seman@noaa.gov">charles.seman@noaa.gov</a> <mailto:<a href="mailto:charles.seman@noaa.gov">charles.seman@noaa.gov</a>>> wrote:<br>
>><br>
>> Lydia,<br>
>><br>
>> Another thing: I don't understand the characters like "12,105,2<br>
>> **" in<br>
>> the vars records in your ctl file:<br>
>><br>
>> TMAX 0 12,105,2 ** maximum temperature at 2m above surface [C]<br>
>><br>
>> TMIN 0 11,105,2 ** minimum temperature at 2m above surface [C]<br>
>><br>
>> PRCP 0 61,1,0 ** total precipitation backward accumulated [kg/m^2<br>
>> or mm]<br>
>><br>
>> SRAD 0 204,1,0 ** total surface downward shortwave radiation flux<br>
>> [mJ/m^2]<br>
>><br>
>> How are these characters used by GrADS? I would expect something<br>
>> like<br>
>> "0,y,x"<br>
>><br>
>> Chuck<br>
>><br>
>> On 07/05/2016 02:21 PM, Charles Seman - NOAA Federal wrote:<br>
>> > Lydia,<br>
>> ><br>
>> > I would try to verify some of the values in your arrays... To<br>
>> start,<br>
>> > define a tmax_all(464,224), and read one record into it:<br>
>> > read(17,REC=irec) tmax_all. Then, print out a common row and a<br>
>> column<br>
>> > from it and from tmax to verify you get the same values. Do<br>
>> this for<br>
>> > just one time level, and stop. This is slow and tedious work.<br>
>> Unless<br>
>> > you have access to TotalView or some other visual debugger, then<br>
>> you can<br>
>> > step through your code line by line and should be able to find it.<br>
>> ><br>
>> > Hope this helps,<br>
>> > Chuck<br>
>> ><br>
>> > On 07/05/2016 01:41 PM, Lydia Rill wrote:<br>
>> >> Thanks Chuck! I double checked the record length and it is<br>
>> indeed 4.<br>
>> >><br>
>> >> Thank you Jim! Sorry my code was a little messy, I have tried many<br>
>> >> different methods.<br>
>> >> Good point about the lower left hand corner, that was one of the<br>
>> issues<br>
>> >> here.<br>
>> >><br>
>> >> When I use 32 x steps, 32 y steps, and 10 time steps I use a<br>
>> record<br>
>> >> length of 4096 for the output file and I get a file size of 160K,<br>
>> which<br>
>> >> roughly matches 32*32*10*4*4 = 16385<br>
>> >><br>
>> >> I am now getting realistic numbers for my output! However, when I<br>
>> >> display the data in GrADS for one time I get only parts of the 4x4<br>
>> >> degree box, by latitude, for each variable, instead of getting<br>
>> the data<br>
>> >> for each variable for the whole box. For example in the middle<br>
>> of the<br>
>> >> box I get tmax for 43.5-44N, tmin for 43-43.5N, prcp around<br>
>> 43N, and<br>
>> >> srad around 42.5N. Any ideas on why this is happening?<br>
>> >><br>
>> >> Here is the updated code:<br>
>> >><br>
>> >> integer irec,i,j,t,days<br>
>> >><br>
>> >> character(len=100) infile,outfile<br>
>> >><br>
>> >> real tmin(464,224),tmax(464,224),prcp(464,224),srad(464,224)<br>
>> >><br>
>> >> infile='/Volumes/WebData/NLDAS2/DailyNLDAS/daily.bin'<br>
>> >><br>
>> >> outfile='/Volumes/WebData/NLDAS2/Fortran/testdaily.bin'<br>
>> >><br>
>> >><br>
>><br>
>> open(17,file=infile,form="unformatted",access="direct",recl=32*32*4,status="old")<br>
>><br>
>> >><br>
>> >><br>
>> >><br>
>><br>
>> open(18,file=outfile,form="unformatted",access="direct",recl=32*32*4,status="unknown")<br>
>><br>
>> >><br>
>> >><br>
>> >><br>
>> >> days=10<br>
>> >><br>
>> >> irec=1<br>
>> >><br>
>> >> do t=1,days<br>
>> >><br>
>> >> read(17,REC=irec) ((tmax(i,j),i=129,160),j=129,160)<br>
>> >><br>
>> >> read(17,REC=irec+1) ((tmin(i,j),i=129,160),j=129,160)<br>
>> >><br>
>> >> read(17,REC=irec+2) ((prcp(i,j),i=129,160),j=129,160)<br>
>> >><br>
>> >> read(17,REC=irec+3) ((srad(i,j),i=129,160),j=129,160)<br>
>> >><br>
>> >> write(18,REC=irec) ((tmax(i,j),i=129,160),j=129,160)<br>
>> >><br>
>> >> write(18,REC=irec+1) ((tmin(i,j),i=129,160),j=129,160)<br>
>> >><br>
>> >> write(18,REC=irec+2) ((prcp(i,j),i=129,160),j=129,160)<br>
>> >><br>
>> >> write(18,REC=irec+3) ((srad(i,j),i=129,160),j=129,160)<br>
>> >><br>
>> >> irec=irec+4<br>
>> >><br>
>> >> enddo<br>
>> >><br>
>> >><br>
>> >> Here is the updated control file:<br>
>> >><br>
>> >> dset ^testdaily.bin<br>
>> >><br>
>> >> undef 9.999E+20<br>
>> >><br>
>> >> title Daily NLDAS2 Data for 04Z through 03Z<br>
>> >><br>
>> >> xdef 32 linear -108.9375 0.125<br>
>> >><br>
>> >> ydef 32 linear 41.0625 0.125<br>
>> >><br>
>> >> tdef 10 linear 00Z02Jan1979 1dy<br>
>> >><br>
>> >> zdef 1 linear 1 1<br>
>> >><br>
>> >> vars 4<br>
>> >><br>
>> >> TMAX 0 12,105,2 ** maximum temperature at 2m above surface [C]<br>
>> >><br>
>> >> TMIN 0 11,105,2 ** minimum temperature at 2m above surface [C]<br>
>> >><br>
>> >> PRCP 0 61,1,0 ** total precipitation backward accumulated [kg/m^2<br>
>> or mm]<br>
>> >><br>
>> >> SRAD 0 204,1,0 ** total surface downward shortwave radiation flux<br>
>> >> [mJ/m^2]<br>
>> >><br>
>> >> ENDVARS<br>
>> >><br>
>> >><br>
>> >> Thank you both so much for your help,<br>
>> >><br>
>> >> Lydia<br>
>> >><br>
>> >> On Tue, Jul 5, 2016 at 12:44 PM, James T. Potemra<br>
>> <<a href="mailto:jimp@hawaii.edu">jimp@hawaii.edu</a> <mailto:<a href="mailto:jimp@hawaii.edu">jimp@hawaii.edu</a>><br>
>> >> <mailto:<a href="mailto:jimp@hawaii.edu">jimp@hawaii.edu</a> <mailto:<a href="mailto:jimp@hawaii.edu">jimp@hawaii.edu</a>>>> wrote:<br>
>> >><br>
>> >> Hi Lydia,<br>
>> >><br>
>> >> You have a couple problems. First, you are reading in tmax,<br>
>> tmin,<br>
>> >> prcp then srad, but then you write out tmin, tmin prcp and<br>
>> srad<br>
>> >> (tmin twice). Second, your program is reading and writing<br>
>> to the<br>
>> >> same variables, and then only the first 8x8 (lower left<br>
>> "corner" of<br>
>> >> the data sets). Perhaps these are all missing ?<br>
>> >><br>
>> >> Finally, the record length is defined to be 464 by 224,<br>
>> then you<br>
>> >> only define (via read) and write the first 8 by 8, which<br>
>> should work<br>
>> >> ok, but recognize that the rest of the 464x224 array has<br>
>> not been<br>
>> >> defined. So, if you want to use your control file with "xdef<br>
>> 8" and<br>
>> >> "ydef 8" you'll need to change your "open" statement for the<br>
>> output<br>
>> >> file to be 8*8*4 and not 464*224*4. Alternately you could<br>
>> change<br>
>> >> the xdef/ydef lines.<br>
>> >><br>
>> >> Note as a quick check, your output file should be 8*8*10*4*4<br>
>> >> (x*y*t*4) bytes large for that control file.<br>
>> >><br>
>> >> Jim<br>
>> >><br>
>> >> On 7/5/16 3:57 AM, Lydia Rill wrote:<br>
>> >>> Hi all,<br>
>> >>><br>
>> >>> I am a new grads user and I have never worked with binary<br>
>> files<br>
>> >>> before. I have a large binary file I created in grads (code<br>
>> shown<br>
>> >>> below). I want to split up the binary file by latitude and<br>
>> >>> longitude degree into smaller binary files. While this is<br>
>> possible<br>
>> >>> in GrADS, it is too slow for my needs, so I am trying to do<br>
>> it in<br>
>> >>> Fortran 90.<br>
>> >>><br>
>> >>> However, I am having problems reading the GrADS binary<br>
>> file in<br>
>> >>> Fortran. It gives me the missing value for each of my<br>
>> variables at<br>
>> >>> every time step and every location.<br>
>> >>><br>
>> >>> The binary file contains NLDAS 2 forcing data, with 464 x<br>
>> steps,<br>
>> >>> 224 y steps, and 13688 daily time steps for 4 variables<br>
>> (only 1 Z<br>
>> >>> level). It is a large file at 22GB, and I can successfully<br>
>> display<br>
>> >>> the variables in GrADS from this binary file. This binary<br>
>> file was<br>
>> >>> created from data in Grib files.<br>
>> >>><br>
>> >>> I have tried many various ways of reading in the binary data,<br>
>> >>> using x and y loops, or time loops, or looping through the 4<br>
>> >>> variables, but nothing has been successful.<br>
>> >>><br>
>> >>> I am working on a Mac (El Capitan).<br>
>> >>><br>
>> >>> Here is the GrADS script I used to create the binary file:<br>
>> >>><br>
>> >>> functionmain(args)<br>
>> >>><br>
>> >>> counthr=subwrd(args,1)<br>
>> >>><br>
>> >>> 'reinit'<br>
>> >>><br>
>> >>> 'open /Volumes/WebData/NLDAS2/ProcessingFiles/24hours.ctl'<br>
>> >>><br>
>> >>> 'set undef 9.999e20'<br>
>> >>><br>
>> >>> 'set gxout fwrite'<br>
>> >>><br>
>> >>> 'set fwrite -ap /Volumes/WebData/NLDAS2/DailyNLDAS/daily.bin'<br>
>> >>><br>
>> >>><br>
>> >>> 'set t 1'<br>
>> >>><br>
>> >>> t1=1+4<br>
>> >>><br>
>> >>> t1p=1+5<br>
>> >>><br>
>> >>> while(t1<=counthr+5-23)<br>
>> >>><br>
>> >>> t2=t1+23<br>
>> >>><br>
>> >>> t2p=t1p+23<br>
>> >>><br>
>> >>> 'd (max(TMP2m,t='t1',t='t2')-273.15)'<br>
>> >>><br>
>> >>> 'd (min(TMP2m,t='t1',t='t2')-273.15)'<br>
>> >>><br>
>> >>> 'd sum(APCPsfc,t='t1p',t='t2p')'<br>
>> >>><br>
>> >>> 'd (ave(DSWRFsfc,t='t1',t='t2')*24*3600/1000000)'<br>
>> >>><br>
>> >>> t1=t1+24<br>
>> >>><br>
>> >>> t1p=t1p+24<br>
>> >>><br>
>> >>> endwhile<br>
>> >>><br>
>> >>> 'quit'<br>
>> >>><br>
>> >>><br>
>> >>> Here is the Fortran script to read the binary file<br>
>> >>><br>
>> >>> ProgramReadbin<br>
>> >>><br>
>> >>> implicitnone<br>
>> >>><br>
>> >>> integer irec,i,j,t,days<br>
>> >>><br>
>> >>> real tmin(464,224),tmax(464,224),prcp(464,224),srad(464,224)<br>
>> >>><br>
>> >>> OPEN(17,file='/Volumes/WebData/NLDAS2/DailyNLDAS/daily.bin',&<br>
>> >>><br>
>> >>><br>
>> &STATUS='Old',FORM='UNFORMATTED',ACCESS='DIRECT',RECL=464*224*4)<br>
>> >>><br>
>> >>><br>
>> >>><br>
>> OPEN(18,file='/Volumes/WebData/NLDAS2/DailyNLDAS/testdaily.bin',&<br>
>> >>><br>
>> >>><br>
>> &STATUS='UNKNOWN',FORM='UNFORMATTED',ACCESS='DIRECT',RECL=464*224*4)<br>
>> >>><br>
>> >>> days=10<br>
>> >>><br>
>> >>> irec=1<br>
>> >>><br>
>> >>> do t=1,days<br>
>> >>><br>
>> >>> read(17,REC=irec) ((tmax(i,j),i=1,8),j=1,8)<br>
>> >>><br>
>> >>> read(17,REC=irec+1) ((tmin(i,j),i=1,8),j=1,8)<br>
>> >>><br>
>> >>> read(17,REC=irec+2) ((prcp(i,j),i=1,8),j=1,8)<br>
>> >>><br>
>> >>> read(17,REC=irec+3) ((srad(i,j),i=1,8),j=1,8)<br>
>> >>><br>
>> >>> write(18,REC=irec) ((tmin(i,j),i=1,8),j=1,8)<br>
>> >>><br>
>> >>> write(18,REC=irec+1) ((tmin(i,j),i=1,8),j=1,8)<br>
>> >>><br>
>> >>> write(18,REC=irec+2) ((prcp(i,j),i=1,8),j=1,8)<br>
>> >>><br>
>> >>> write(18,REC=irec+3) ((srad(i,j),i=1,8),j=1,8)<br>
>> >>><br>
>> >>> irec=irec+4<br>
>> >>><br>
>> >>> enddo<br>
>> >>><br>
>> >>> end program<br>
>> >>><br>
>> >>><br>
>> >>> The corresponding control file is:<br>
>> >>><br>
>> >>> set ^testdaily.bin<br>
>> >>><br>
>> >>> undef 9.999E+20<br>
>> >>><br>
>> >>> title Daily NLDAS2 Data for00Z through 23Z<br>
>> >>><br>
>> >>> xdef 8linear -124.93750.125<br>
>> >>><br>
>> >>> ydef 8linear 25.06250.125<br>
>> >>><br>
>> >>> tdef 10linear 00Z02Jan1979 1dy<br>
>> >>><br>
>> >>> zdef 1linear 11<br>
>> >>><br>
>> >>> vars 4<br>
>> >>><br>
>> >>> TMAX 012,105,2**maximum temperature at 2m above surface [C]<br>
>> >>><br>
>> >>> TMIN 011,105,2**minimum temperature at 2m above surface [C]<br>
>> >>><br>
>> >>> PRCP 061,1,0**total precipitation backward accumulated<br>
>> [kg/m^2ormm]<br>
>> >>><br>
>> >>> SRAD 0204,1,0**total surface downward shortwave radiation<br>
>> flux<br>
>> >>> [mJ/m^2]<br>
>> >>><br>
>> >>> ENDVARS<br>
>> >>><br>
>> >>><br>
>> >>><br>
>> >>> Thanks,<br>
>> >>><br>
>> >>> Lydia<br>
>> >>><br>
>> >>> --<br>
>> >>> Lydia D. Rill<br>
>> >>> M.S., Michigan State University 2016<br>
>> >>> B.S., Valparaiso University 2014<br>
>> >>> (224) 406-5130<br>
>> >>> <a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a> <mailto:<a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a>><br>
>> <mailto:<a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a> <mailto:<a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a>>><br>
>> >>><br>
>> >>><br>
>> >>> _______________________________________________<br>
>> >>> gradsusr mailing list<br>
>> >>> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <mailto:<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>
>> <mailto:<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <mailto:<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>>><br>
>> >>> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>> >><br>
>> >><br>
>> >> _______________________________________________<br>
>> >> gradsusr mailing list<br>
>> >> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <mailto:<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>
>> <mailto:<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <mailto:<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>>><br>
>> >> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>> >><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Lydia D. Rill<br>
>> >> M.S., Michigan State University 2016<br>
>> >> B.S., Valparaiso University 2014<br>
>> >> <a href="tel:%28224%29%20406-5130" value="+12244065130">(224) 406-5130</a> <tel:%28224%29%20406-5130><br>
>> >> <a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a> <mailto:<a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a>><br>
>> <mailto:<a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a> <mailto:<a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a>>><br>
>> >><br>
>> >><br>
>> >> _______________________________________________<br>
>> >> gradsusr mailing list<br>
>> >> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <mailto:<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>
>> >> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>> >><br>
>> ><br>
>><br>
>> --<br>
>><br>
>> Please note that <a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a><br>
>> <mailto:<a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a>> should be considered my NOAA<br>
>> email address, not <a href="mailto:cjs@gfdl.noaa.gov">cjs@gfdl.noaa.gov</a> <mailto:<a href="mailto:cjs@gfdl.noaa.gov">cjs@gfdl.noaa.gov</a>>.<br>
>><br>
>> ********************************************************************<br>
>> Charles Seman<br>
>> <a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a> <mailto:<a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a>><br>
>> U.S. Department of Commerce / NOAA / OAR<br>
>> Geophysical Fluid Dynamics Laboratory voice: (609)<br>
>> 452-6547 <tel:%28609%29%20452-6547><br>
>> 201 Forrestal Road fax: (609)<br>
>> 987-5063 <tel:%28609%29%20987-5063><br>
>> Princeton, NJ 08540-6649 <a href="http://www.gfdl.noaa.gov/~cjs/" rel="noreferrer" target="_blank">http://www.gfdl.noaa.gov/~cjs/</a><br>
>> ********************************************************************<br>
>><br>
>> "The contents of this message are mine personally and do not<br>
>> reflect any<br>
>> official or unofficial position of the United States Federal<br>
>> Government,<br>
>> the United States Department of Commerce, or NOAA."<br>
>> _______________________________________________<br>
>> gradsusr mailing list<br>
>> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <mailto:<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>
>> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Lydia D. Rill<br>
>> M.S., Michigan State University 2016<br>
>> B.S., Valparaiso University 2014<br>
>> <a href="tel:%28224%29%20406-5130" value="+12244065130">(224) 406-5130</a><br>
>> <a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a> <mailto:<a href="mailto:Lydia.D.Rill@gmail.com">Lydia.D.Rill@gmail.com</a>><br>
>><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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>><br>
><br>
<br>
--<br>
<br>
Please note that <a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a> should be considered my NOAA<br>
email address, not <a href="mailto:cjs@gfdl.noaa.gov">cjs@gfdl.noaa.gov</a>.<br>
<br>
********************************************************************<br>
Charles Seman <a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a><br>
U.S. Department of Commerce / NOAA / OAR<br>
Geophysical Fluid Dynamics Laboratory voice: <a href="tel:%28609%29%20452-6547" value="+16094526547">(609) 452-6547</a><br>
201 Forrestal Road fax: <a href="tel:%28609%29%20987-5063" value="+16099875063">(609) 987-5063</a><br>
Princeton, NJ 08540-6649 <a href="http://www.gfdl.noaa.gov/~cjs/" rel="noreferrer" target="_blank">http://www.gfdl.noaa.gov/~cjs/</a><br>
********************************************************************<br>
<br>
"The contents of this message are mine personally and do not reflect any<br>
official or unofficial position of the United States Federal Government,<br>
the United States Department of Commerce, or NOAA."<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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr" style="font-size:12.8000001907349px"><font color="#999999">Lydia D. Rill</font></div><div style="font-size:12.8000001907349px"><font color="#999999">M.S., Michigan State University 2016 </font></div><div dir="ltr" style="font-size:12.8000001907349px"><font color="#999999">B.S., Valparaiso University 2014</font><br style="color:rgb(136,136,136)"><span title="Call with Google Voice" style="color:rgb(136,136,136)"><font color="#999999"><a value="+12244065130" style="color:rgb(17,85,204)">(224) 406-5130</a></font></span><br style="color:rgb(136,136,136)"><font color="#000000"><a href="mailto:Lydia.D.Rill@gmail.com" style="color:rgb(17,85,204)" target="_blank">Lydia.D.Rill@gmail.com</a></font></div></div></div>
</div>