<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Dear Arlindo and All Grads Users,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>As directed, I have developed below Script, defined a global grid u4x4 and calculated Amax and used ‘set defval’ command. When I exported the defined grid to netcdf file. The output was vertical straight lines. Can anyone please point out what is wrong while defining ‘<b>set defval’ </b>in script? <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Any help please.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b>'reinit'<o:p></o:p></b></p><p class=MsoNormal><b>'open D:\WeatherGribFiles\2014\06\11\rtofs_glo_2ds_f048_daily_prog.ctl'<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b>* original grid dimensions<o:p></o:p></b></p><p class=MsoNormal><b>xmin = 74.16<o:p></o:p></b></p><p class=MsoNormal><b>xmax = 434.0<o:p></o:p></b></p><p class=MsoNormal><b>ymin = -90<o:p></o:p></b></p><p class=MsoNormal><b>ymax = 90<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b>* defining "u4x4" global grid for u<o:p></o:p></b></p><p class=MsoNormal><b>'define u4x4 = re(u_velocity,2)'<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b>* defining var for further use<o:p></o:p></b></p><p class=MsoNormal><b>'define var = u_velocity'<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b>xinc = 2<o:p></o:p></b></p><p class=MsoNormal><b>yinc = 1<o:p></o:p></b></p><p class=MsoNormal><b>xnow = xmin<o:p></o:p></b></p><p class=MsoNormal><b>ynow = ymin<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b>******* jj and jj_max are the latitude of Global grid u4x4 ****************<o:p></o:p></b></p><p class=MsoNormal><b>jj = 1<o:p></o:p></b></p><p class=MsoNormal><b>jj_max = 90<o:p></o:p></b></p><p class=MsoNormal><b>count = 1<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b>while (xnow < xmax)<o:p></o:p></b></p><p class=MsoNormal><b>xtempMax = xnow+xinc;ytempMax = ynow+yinc<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b>'d amax(var,lon='xnow',lon='xtempMax',lat='ynow',lat='ytempMax')'<o:p></o:p></b></p><p class=MsoNormal><b>maxval=subwrd(result,4)<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b> jj = 1<o:p></o:p></b></p><p class=MsoNormal><b> while (jj <= jj_max)<o:p></o:p></b></p><p class=MsoNormal><b> <span style='background:yellow;mso-highlight:yellow'>'set defval u4x4 'count' 'jj' 'maxval</span><o:p></o:p></b></p><p class=MsoNormal><b> jj = jj + 1<o:p></o:p></b></p><p class=MsoNormal><b> endwhile<o:p></o:p></b></p><p class=MsoNormal><b>xnow = xnow+xinc;ynow = ynow+yinc<o:p></o:p></b></p><p class=MsoNormal><b>count=count+1<o:p></o:p></b></p><p class=MsoNormal><b>endwhile<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b>*************** Write a netcdf file ****************<o:p></o:p></b></p><p class=MsoNormal><b>'set sdfwrite a_grid.nc'<o:p></o:p></b></p><p class=MsoNormal><b>'sdfwrite u4x4'<o:p></o:p></b></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>Thanks & Regards<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>Anil Kumar <o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>----------------------------------------</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>---------- Forwarded message ----------<br>From: <b>Arlindo da Silva</b> <<a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a>><br>Date: Thu, Jul 10, 2014 at 7:48 PM<br>Subject: Re: [gradsusr] Help on calculating Area Maximum from NetCDF file using Grads<br>To: Anil Kumar <<a href="mailto:anilku@oceanmanager.com">anilku@oceanmanager.com</a>>, GrADS Users Forum <<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br><br><o:p></o:p></p><div><p class=MsoNormal>On Thu, Jul 10, 2014 at 5:40 AM, Anil Kumar <<a href="mailto:anilku@oceanmanager.com" target="_blank">anilku@oceanmanager.com</a>> wrote:<o:p></o:p></p><div><div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Dear Arlindo,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks for your detailed reply. I have a few queries regarding the task I need to accomplish.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>1)</span><span style='font-size:7.0pt;color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>If Grads is not the best tool to accomplish my task, can you please suggest me the another tool, if you know, to accomplish the job ?</span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Probably C or Fortran. You could also accomplish some of that with python with pygrads. All depends on how much programming experience you have.<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>2)</span><span style='font-size:7.0pt;color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Secondly, the approach which you have already shared with me as below</span><o:p></o:p></p><div><div><p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p>1) define a 2x2 global grid (say, use lterp with linear interpolation),<o:p></o:p></p><p>2) loop over every 2x2 region in the 0.25x0.5 deg grid, compute the 2 x2 area max with amax(), and use "set defval" to replace the corresponding value in the previous defined variable in 1). As I said, this is very inefficient.<o:p></o:p></p><p> <o:p></o:p></p></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:.5in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Should I need to create 2x2 global grid first physically first and then need to replace its values. If so, I don’t find any hint on google, </span><a href="http://gradsuser.org" target="_blank"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>gradsuser.org</span></a><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> to create a new grid. What is the procedure to create grid ?</span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>What I said was to define a 2x2 grid, for example<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>define u2x2 = re(u,2)<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> I really don't have the time to walk you thru the details as it would require me to actually write the code for you. If you can program in C or fortran I'd go that route. If you follow the UDF approach that I outlined you can still do grads for your plotting. And please do not write directly to me, I cannot afford to provide individualized grads support.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> Good Luck,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> Arlindo<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:.5in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:.5in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks again for your help.</span><o:p></o:p></p><div><div><p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>Thanks & Regards</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>Anil Kumar </span></b><o:p></o:p></p></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#00A1DA'>OceanManager</span></b><b><i><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'> </span></i></b><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#00A1DA'>Inc.</span></b><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#009BD2'> </span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>| </span><a href="http://www.oceanmanager.com/" target="_blank"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>www.oceanmanager.com</span></a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#00A1DA'>OceanManager - Marine Software</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span><a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>gradsusr-bounces@gradsusr.org</span></a><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> [mailto:</span><a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>gradsusr-bounces@gradsusr.org</span></a><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>] <b>On Behalf Of </b>Arlindo da Silva<br><b>Sent:</b> Tuesday, July 01, 2014 7:12 AM<br><b>To:</b> GrADS Users Forum</span><o:p></o:p></p><div><div><div><div><p class=MsoNormal><br><b>Subject:</b> Re: [gradsusr] Help on calculating Area Maximum from NetCDF file using Grads<o:p></o:p></p></div></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Mon, Jun 30, 2014 at 9:37 AM, Anil Kumar <<a href="mailto:anilku@oceanmanager.com" target="_blank">anilku@oceanmanager.com</a>> wrote:<o:p></o:p></p><div><div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Grads users,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I am awaiting an useful comments or direction on the below case. Please lead me, to get all the maximum values from the small – small areas of every 2 degree in Lat and lon say for example. Below is my complete query.</span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>My Requirement</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> : I have a larger dataset (.NC file) 1440*720 points. I want a new destination grid with linear interpolation having all the all area maximum values using amax() of small-small regions. And ultimately, need to query the destination grid for output.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p></div></div></div></div></blockquote><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I am afraid the regridding method you are looking for is not implemented by lterp() or re(). This is a good example of when GrADS is not the best tool for the job at hand. But if you insist, a very inefficient approach would be<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>1) define a 2x2 global grid (say, use lterp with linear interpolation),<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>2) loop over every 2x2 region in the 0.25x0.5 deg grid, compute the 2 x2 area max with amax(), and use "set defval" to replace the corresponding value in the previous defined variable in 1). As I said, this is very inefficient.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>If you are up for some C/Fortran programming, you can use the opengrads IPC extension (which is available with your Windows build):<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <a href="http://opengrads.org/doc/udxt/libipc/" target="_blank">http://opengrads.org/doc/udxt/libipc/</a><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>to write your variables to disk,<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>ga-> ipc_save u_velocity u.bin<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>ga-> ipc_save v_velocity v.bin<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Then write a C/Fortran program that read these files (u.bin,v.bin) and compute the amax at the 2x2 grid you require, writing output files (u2x2.bin.v2x2.bin). <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>ga-> ! my_amaxregrid <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Consult the IPC documentation for the description of the transfer file format (very similar to the old GrADS 1.x UDF.) You can finally read these back with ipc_load() extension:<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>ga-> d ipc_load("u2x2.bin");ipc_load("v2x2.bin")<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Notice that this is a poor-man version of the file-based UDF that existed in GrADS 1.x. Of course, you can accomplish the same more efficiently by writing a genuine OpenGrADS extension with no transfer files involved.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> Good Luck,<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> Arlindo<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>What Am doing so far : </span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have a NetCDF file having below CTL Info.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>dset D:\WeatherGribFiles\2014\06\22\</span><a href="http://rtofs_glo_2ds_f024_daily_prog.nc" target="_blank"><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>rtofs_glo_2ds_f024_daily_prog.nc</span></a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>title 2D Sfc Daily Prognostic 00Z22jun2014: Forecast, downloaded Jun 22 15:20 UTC</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>undef 1.26765e+30</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>dtype netcdf</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>xdef 1440 linear 74.16 0.24999</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>ydef 720 linear -90 0.24999</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>zdef 1 linear 1 1</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>tdef 1 linear 00Z23JUN2014 1mn</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>vars 2</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>u_velocity=>u_velocity 1 t,z,y,x eastward_sea_water_velocity (m/s)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>v_velocity=>v_velocity 1 t,z,y,x northward_sea_water_velocity (m/s)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>endvars</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I want a new destination grid ; which would contain the area maximum values as points. Destination grid should contain maximum value from every 8 points in x-axis and y axis. For this, I have created below, CTL file named as <b>rtofs_glo_2ds_f024_daily_prog.ctl</b>:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>dset D:\WeatherGribFiles\2014\06\22\</span><a href="http://rtofs_glo_2ds_f024_daily_prog.nc" target="_blank"><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>rtofs_glo_2ds_f024_daily_prog.nc</span></a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>index D:\WeatherGribFiles\2014\06\22\<span style='color:red'>rtofs_glo_2ds_f024_daily_prog_DUMMY.nc </span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>title 2D Sfc Daily Prognostic 00Z22jun2014: Forecast, downloaded Jun 22 15:20 UTC </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>undef 1.26765e+30 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>dtype netcdf </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";background:yellow'>xdef 180 linear 74.16 2.0 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";background:yellow'>ydef 90 linear -90 2.0</span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>zdef 1 linear 1 1 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>tdef 1 linear 00Z23JUN2014 1mn</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>options template </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>vars 2 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>u_velocity=>u_velocity 1 t,z,y,x eastward_sea_water_velocity (m/s) </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>v_velocity=>v_velocity 1 t,z,y,x northward_sea_water_velocity (m/s) </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>endvars</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Below is the command I use to display the data from destination grid <b>rtofs_glo_2ds_f024_daily_prog_DUMMY.nc </b>defined in above CTL file. Below is the command set using.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>reinit</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>sdfopen D:/WeatherGribFiles/2014/06/22/</span><a href="http://rtofs_glo_2ds_f024_daily_prog.nc" target="_blank"><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>rtofs_glo_2ds_f024_daily_prog.nc</span></a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>open D:/WeatherGribFiles/2014/06/22/rtofs_glo_2ds_f024_daily_prog2.ctl</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set parea 0 11 0 8.5</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set vpage 0 11 0 8.5</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set lon -74.16 434</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set lat -90 90</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set cthick 6</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set arrscl 0.10 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>define val = mag(lterp(u_velocity.1*1.95,lat.2,amax),lterp(v_velocity.1*1.95,lat.2,amax))</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>d lterp(u_velocity.1*1.95,lat.2,amax);lterp(v_velocity.1*1.95,lat.2,amax);val</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>When I change the destination grid dimensions slightly in <b>rtofs_glo_2ds_f024_daily_prog.ctl </b>file</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";background:yellow'>xdef 135 linear 74.16 2.5 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";background:yellow'>ydef 68 linear -90 2.5</span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>and checks for the output, It varies at the same point i.e. if I look at certain point before changing and after changing grid dimensions, the result comes of different magnitude.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>What I want is, When I increase or decrease the destination grid points in “<b>rtofs_glo_2ds_f024_daily_prog.ctl”, </b>and the maximum value should be at its place. </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>How can I achieve this ????? </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p></div></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>Thanks & Regards</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>Anil Kumar – </span></b><b><span style='font-size:11.0pt;color:#215868'>Sr. </span></b><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>Software Developer</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#00A1DA'>OceanManager</span></b><b><i><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'> </span></i></b><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#00A1DA'>Inc.</span></b><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#009BD2'> </span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>| </span><a href="http://www.oceanmanager.com/" target="_blank"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>www.oceanmanager.com</span></a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#ED7D31'>Tel: </span><a href="tel:%2B%2091-172-5026090" target="_blank"><span style='font-size:11.0pt'>+ 91-172-5026090</span></a><span style='font-size:11.0pt;color:#ED7D31'>, 5026091, 4646070</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#00A1DA'>OceanManager- Marine Software</span></b><o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span><a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>gradsusr-bounces@gradsusr.org</span></a><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> [mailto:</span><a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>gradsusr-bounces@gradsusr.org</span></a><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>] <b>On Behalf Of </b>Anil Kumar<br><b>Sent:</b> Friday, June 27, 2014 12:55 PM<br><b>To:</b> </span><a href="mailto:jma@cola.iges.org" target="_blank"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>jma@cola.iges.org</span></a><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>; 'GrADS Users Forum'<br><b>Subject:</b> Re: [gradsusr] Help on calculating Area Maximum from NetCDF file using Grads</span><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Jennifer and All,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Am seeking help on calculating area maximum with linear interpolation using Grads. Earlier I was using below methodology to calculate area average over small areas defined. It was working good but now I need to calculate amax using lterp in grads </span><a href="http://www.iges.org/grads/gadoc/gradfunclterp.html" target="_blank"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>but in documentation I cannot find that ltrep uses amax as argument</span></a><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> ; neither it is giving correct result nor giving error.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>My Requirement</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> : I have a larger dataset (.NC file) 1440*720 points. I want a new destination grid with linear interpolation having all the all area maximum values using amax() of small-small regions. And ultimately, need to query the destination grid for output.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>What Am doing so far : </span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have a NetCDF file having below CTL Info.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>dset D:\WeatherGribFiles\2014\06\22\</span><a href="http://rtofs_glo_2ds_f024_daily_prog.nc" target="_blank"><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>rtofs_glo_2ds_f024_daily_prog.nc</span></a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>title 2D Sfc Daily Prognostic 00Z22jun2014: Forecast, downloaded Jun 22 15:20 UTC</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>undef 1.26765e+30</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>dtype netcdf</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>xdef 1440 linear 74.16 0.24999</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>ydef 720 linear -90 0.24999</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>zdef 1 linear 1 1</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>tdef 1 linear 00Z23JUN2014 1mn</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>vars 2</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>u_velocity=>u_velocity 1 t,z,y,x eastward_sea_water_velocity (m/s)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>v_velocity=>v_velocity 1 t,z,y,x northward_sea_water_velocity (m/s)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>endvars</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I want a new destination grid ; which would contain the area maximum values as points. Destination grid should contain maximum value from every 8 points in x-axis and y axis. For this, I have created below, CTL file named as <b>rtofs_glo_2ds_f024_daily_prog.ctl</b>:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>dset D:\WeatherGribFiles\2014\06\22\</span><a href="http://rtofs_glo_2ds_f024_daily_prog.nc" target="_blank"><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>rtofs_glo_2ds_f024_daily_prog.nc</span></a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>index D:\WeatherGribFiles\2014\06\22\<span style='color:red'>rtofs_glo_2ds_f024_daily_prog_DUMMY.nc </span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>title 2D Sfc Daily Prognostic 00Z22jun2014: Forecast, downloaded Jun 22 15:20 UTC </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>undef 1.26765e+30 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>dtype netcdf </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";background:yellow'>xdef 180 linear 74.16 2.0 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";background:yellow'>ydef 90 linear -90 2.0</span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>zdef 1 linear 1 1 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>tdef 1 linear 00Z23JUN2014 1mn</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>options template </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>vars 2 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>u_velocity=>u_velocity 1 t,z,y,x eastward_sea_water_velocity (m/s) </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>v_velocity=>v_velocity 1 t,z,y,x northward_sea_water_velocity (m/s) </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>endvars</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Below is the command I use to display the data from destination grid <b>rtofs_glo_2ds_f024_daily_prog_DUMMY.nc </b>defined in above CTL file. Below is the command set using.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>reinit</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>sdfopen D:/WeatherGribFiles/2014/06/22/</span><a href="http://rtofs_glo_2ds_f024_daily_prog.nc" target="_blank"><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>rtofs_glo_2ds_f024_daily_prog.nc</span></a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>open D:/WeatherGribFiles/2014/06/22/rtofs_glo_2ds_f024_daily_prog2.ctl</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set parea 0 11 0 8.5</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set vpage 0 11 0 8.5</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set lon -74.16 434</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set lat -90 90</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set cthick 6</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>set arrscl 0.10 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>define val = mag(lterp(u_velocity.1*1.95,lat.2,amax),lterp(v_velocity.1*1.95,lat.2,amax))</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'>d lterp(u_velocity.1*1.95,lat.2,amax);lterp(v_velocity.1*1.95,lat.2,amax);val</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>*****************************************************************</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>When I change the destination grid dimensions slightly in <b>rtofs_glo_2ds_f024_daily_prog.ctl </b>file</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";background:yellow'>xdef 135 linear 74.16 2.5 </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";background:yellow'>ydef 68 linear -90 2.5</span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>and checks for the output, It varies at the same point i.e. if I look at certain point before changing and after changing grid dimensions, the result comes of different magnitude.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>What I want is, When I increase or decrease the destination grid points in “<b>rtofs_glo_2ds_f024_daily_prog.ctl”, </b>and the maximum value should be at its place. </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>How can I achieve this ????? </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks for any guidance.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>Thanks & Regards</span></b><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#215868'>Anil Kumar</span></b><o:p></o:p></p></div></div></div></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><br>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><o:p></o:p></p></blockquote></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>-- <br><span style='font-size:24.0pt;font-family:"Arial","sans-serif";color:#006600'>Arlindo da Silva</span><br><a href="mailto:dasilva@alum.mit.edu" target="_blank"><i><span style='font-size:13.5pt'>dasilva@alum.mit.edu</span></i></a> <o:p></o:p></p></div></div></div></div></div></div></div></div></blockquote></div><div><div><p class=MsoNormal><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>-- <br><span style='font-size:24.0pt;font-family:"Arial","sans-serif";color:#006600'>Arlindo da Silva</span><br><a href="mailto:dasilva@alum.mit.edu" target="_blank"><i><span style='font-size:13.5pt'>dasilva@alum.mit.edu</span></i></a> <o:p></o:p></p></div></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><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" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>