Dear Rashed<div>Thank you very much for your time. I have used this script for my analysis properly . My problem was to use " if else " command.</div><div><br></div><div>Anyway thanks. </div><div><br></div><div>Cheers</div><div>Abdus <br><br>On Friday, November 6, 2015, Rashed Mahmood <<a href="mailto:rashidcomsis@gmail.com">rashidcomsis@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Well...There are a number of potential issues in your script. i am have not used grads for a long period so may be i won't be able help much.<br></div>However, here are some of the things that looked odd to me.<br><div><br><div>"reinit"</div><div>"sdfopen \Users\mq43879691\documents\<a href="http://sst5014.mnmean.v4.nc" target="_blank">sst5014.mnmean.v4.nc</a>"</div><div><br>"set t 1 12" <b>* i do not know why you keep on changing this time settings.</b><br></div><div> <br><br>"define avesst=ave(sst2,t+0,t=780,12)"</div><div>"modify avesst seasonal"</div><div><br>"set t 1 780" <b> * again, i am not sure how would this work as your avesst is now seasonal mean? </b> <br></div><div>"define sstanom=sst2-avesst"</div><div><br></div><div><div>"define N4=aave(sstanom,lon=160,lon=210,lat=-5,lat=5)"</div><div>"define N3=aave(sstanom,lon=210,lon=270,lat=-5,lat=5)"<br></div></div><div><div>"define prod = N3*N4"</div><span><div><br></div><div>if ( prod > 0)</div><div> alpha = 0.4 </div><div> else</div><div> alpha = 0</div><div>endif</div><div> </div></span><div>"define Nct = N3-alpha*N4"</div><div>"define Nwp = N4-alpha*N3"</div></div><div><br></div><div><div>"set lev 0" <b>* why are these settings needed? should'nt it be something like 'set x 1 and set y 1'?</b><br></div><div>"set lon 210" <b>* you have already done area average so where would this come from? </b><br></div><div>"set lat -5" <b>* same as above</b><br></div><div>"set timelab off"</div><div>"set Grads off"</div><div>"set cmark 0"<br></div><div>"set t 1 780" <b>*oh well...same as above</b><br></div><div>"d Nct"</div></div><br></div><div>Perhaps there are other issues for example the defining of 'sstanom=sst2-avesst'.<br><br></div><div><br><br><br><br><br><br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 4, 2015 at 5:34 PM, MD ABDUS SATTAR <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','md-abdus.sattar@students.mq.edu.au');" target="_blank">md-abdus.sattar@students.mq.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear Rashed</div><div>Thank you very much for your cooperation. I am still in trouble to calculate this. See my script my as follow: </div><div><br></div><div>"reinit"</div><div>"sdfopen \Users\mq43879691\documents\<a href="http://sst5014.mnmean.v4.nc" target="_blank">sst5014.mnmean.v4.nc</a>"</div><div>"set t 1 12"</div><div>"define avesst=ave(sst2,t+0,t=780,12)"</div><div>"modify avesst seasonal"</div><div>"set t 1 780"</div><div>"define sstanom=sst2-avesst"</div><div><br></div><div><div>"define N4=aave(sstanom,lon=160,lon=210,lat=-5,lat=5)"</div><div>"define N3=aave(sstanom,lon=210,lon=270,lat=-5,lat=5)"<br></div></div><div><div>"define prod = N3*N4"</div><span><div><br></div><div>if ( prod > 0)</div><div> alpha = 0.4 </div><div> else</div><div> alpha = 0</div><div>endif</div><div> </div></span><div>"define Nct = N3-alpha*N4"</div><div>"define Nwp = N4-alpha*N3"</div></div><div><br></div><div><div>"set lev 0"</div><div>"set lon 210"</div><div>"set lat -5"</div><div>"set timelab off"</div><div>"set Grads off"</div><div>"set cmark 0"<br></div><div>"set t 1 780"</div><div>"d Nct"</div></div><div><br></div><div>>From the above script I was trying to calculate time series of Nct and Nwp during 1950-2014. Nct and Nwp have single values for each month (January to December). If i can use this command for yearly time series then I can use it for monthly time series as well. </div><div><br></div><div>Please suggest me where I did mistake again.</div><span><div><br></div><div>I look forward to your message </div><div><br></div></span><div>Regards</div><span><font color="#888888"><div>Abdus</div><div><br></div><div><br></div><div><br></div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 4, 2015 at 8:28 AM, Rashed Mahmood <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','rashidcomsis@gmail.com');" target="_blank">rashidcomsis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>The way you wrote it, won't work because this is not how "if else endif" statements are used .<br></div>Please see the following page for a detailed information on statements:<br><br><a href="http://iges.org/grads/gadoc/script.html#statement" target="_blank">http://iges.org/grads/gadoc/script.html#statement</a><br><br></div>Assuming that your N3 and N4 are defined (have a single value each) before the following:<br></div>Try this:<br><div><div><br><br>'prod = N3*N4'<span><br><br><div>if ( prod > 0)<br></div> alpha = 0.4 <br> else<br> alpha = 0<br>endif<br> <br>'Nct = N3-alpha*N4'<br></span><div>'Nwp = N4-alpha*N3'</div><br><br></div><div>And you can use it inside a loop to calculate for a time series.<br></div><div><br><br><br><br><div><br><br><br><br><br></div></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 2, 2015 at 7:57 PM, MD ABDUS SATTAR <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','md-abdus.sattar@students.mq.edu.au');" target="_blank">md-abdus.sattar@students.mq.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Rashed<div>I wrote my script as:</div><div><br></div><div><div>"define prod=N3*N4"</div><div>"define alpha=0.4,if(prod>0)"</div><div>"define alpha=0, if (prod<0)"</div><div>"endif"</div><div>"define Nct=N3-alpha*N4"</div><div>"define Nwp=N4-alpha*N3"</div><div><br></div><div>However, it does not work and I do not know my mistake here. I am using NOAA Extended Reconstructed Sea Surface Temperature (SST) V4 data (<a href="http://www.esrl.noaa.gov/psd/data/gridded/data.noaa.ersst.v4.html" target="_blank">http://www.esrl.noaa.gov/psd/data/gridded/data.noaa.ersst.v4.html</a>).</div><div><br></div><div>Could please tell me where I did mistake?</div><span><div><br></div><div>I look forward to your message.</div><div><br></div></span><div>Cheers</div><span><font color="#888888"><div>Abdus Sattar</div><h1 style="padding:0px;margin:10px 0px 0.5em;font-size:x-large;color:rgb(55,47,98);font-family:Helvetica,Verdana,sans-serif"><br></h1></font></span></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 3, 2015 at 12:27 PM, Rashed Mahmood <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','rashidcomsis@gmail.com');" target="_blank">rashidcomsis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>It should be simple using if else statement.<br></div><div>Untested:<br></div><div><br></div>prod = N3*N4<br><br></div><div>if ( prod > 0)<br></div> alpha = 0.4 <br></div> else<br></div> alpha = 0<br></div>endif<br> <br></div>Nct = N3-alpha*N4<br><div><div><div><div><div><div>Nwp = N4-alpha*N3</div><div><br></div><div>hope that helps<br></div><div><br><div><br></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Nov 2, 2015 at 4:52 PM, MD ABDUS SATTAR <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','md-abdus.sattar@students.mq.edu.au');" target="_blank">md-abdus.sattar@students.mq.edu.au</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Dear Team<div>I was trying to calculate year by year time series from monthly mean SST data by using following formula:</div><div><br></div><div><img src="cid:ii_150cacc04df7cd67" alt="Inline image 1" height="56" width="292"></div><div>Where, N3 and N4 denote Nino3 and Nino4 indices respectively. I would like to calculate NCT and NWP for a specific year, for instance, 1997 (January to December). My question is how can I define "α<p class="MsoNormal"></p><div>value" in GrADS so that it can use the value of 2/5 or 0 automatically? If anybody could help me, it would be great.</div><div><br></div><div>I look forward to your message.</div><div><br></div><div>Best regards</div><div>Abdus</div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Md. Abdus Sattar<div>PhD Student</div><div>Department of Environmental Sciences</div><div><span style="font-family:arial,helvetica,sans-serif;font-size:12px;line-height:15px">Level 2, Australian Hearing Hub Building</span><br style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Faculty of Science and Engineering<br>Macquarie University<br></span><span style="font-size:12.8px">NSW 2109 Australia</span><br></div><div><br></div><div><br></div><div>Cell: <a href="tel:%2B61404400401" value="+61404400401" target="_blank">+61404400401</a></div><div>Email: <a href="javascript:_e(%7B%7D,'cvml','md-abdus.sattar@students.mq.edu.au');" target="_blank">md-abdus.sattar@students.mq.edu.au</a></div><div><br></div><div><b>AND</b></div><div><br></div><div><div style="font-size:12.8px">Assistant Professor</div><div style="font-size:12.8px">Department of Disaster Risk Management (DRM)</div></div><div><span style="background-color:rgb(243,243,243)">Faculty of Disaster Management</span></div><div>Patuakhali Science and Technology University, Dumki, Patuakhali, Bangladesh</div><div><br></div><div>Cell: <a href="tel:%2B8801716851612" value="+8801716851612" target="_blank">+8801716851612</a></div><div>Email: <a href="javascript:_e(%7B%7D,'cvml','abdus.sattar@pstu.ac.bd');" target="_blank">abdus.sattar@pstu.ac.bd</a></div></div></div></div></div></div></div></div></div></div>
</div></div>
<br></div></div>_______________________________________________<br>
gradsusr mailing list<br>
<a href="javascript:_e(%7B%7D,'cvml','gradsusr@gradsusr.org');" target="_blank">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></blockquote></div><br></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="javascript:_e(%7B%7D,'cvml','gradsusr@gradsusr.org');" target="_blank">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></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Md. Abdus Sattar<div>PhD Student</div><div>Department of Environmental Sciences</div><div><span style="font-family:arial,helvetica,sans-serif;font-size:12px;line-height:15px">Level 2, Australian Hearing Hub Building</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Faculty of Science and Engineering<br>Macquarie University<br></span><span style="font-size:12.8000001907349px">NSW 2109 Australia</span><br></div><div><br></div><div><br></div><div>Cell: <a href="tel:%2B61404400401" value="+61404400401" target="_blank">+61404400401</a></div><div>Email: <a href="javascript:_e(%7B%7D,'cvml','md-abdus.sattar@students.mq.edu.au');" target="_blank">md-abdus.sattar@students.mq.edu.au</a></div><div><br></div><div><b>AND</b></div><div><br></div><div><div style="font-size:12.8000001907349px">Assistant Professor</div><div style="font-size:12.8000001907349px">Department of Disaster Risk Management (DRM)</div></div><div><span style="background-color:rgb(243,243,243)">Faculty of Disaster Management</span></div><div>Patuakhali Science and Technology University, Dumki, Patuakhali, Bangladesh</div><div><br></div><div>Cell: <a href="tel:%2B8801716851612" value="+8801716851612" target="_blank">+8801716851612</a></div><div>Email: <a href="javascript:_e(%7B%7D,'cvml','abdus.sattar@pstu.ac.bd');" target="_blank">abdus.sattar@pstu.ac.bd</a></div></div></div></div></div></div></div></div></div></div>
</div>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="javascript:_e(%7B%7D,'cvml','gradsusr@gradsusr.org');" target="_blank">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></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="javascript:_e(%7B%7D,'cvml','gradsusr@gradsusr.org');" target="_blank">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></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Md. Abdus Sattar<div>PhD Student</div><div>Department of Environmental Sciences</div><div><span style="font-family:arial,helvetica,sans-serif;font-size:12px;line-height:15px">Level 2, Australian Hearing Hub Building</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Faculty of Science and Engineering<br>Macquarie University<br></span><span style="font-size:12.8000001907349px">NSW 2109 Australia</span><br></div><div><br></div><div><br></div><div>Cell: <a href="tel:%2B61404400401" value="+61404400401" target="_blank">+61404400401</a></div><div>Email: <a href="javascript:_e(%7B%7D,'cvml','md-abdus.sattar@students.mq.edu.au');" target="_blank">md-abdus.sattar@students.mq.edu.au</a></div><div><br></div><div><b>AND</b></div><div><br></div><div><div style="font-size:12.8000001907349px">Assistant Professor</div><div style="font-size:12.8000001907349px">Department of Disaster Risk Management (DRM)</div></div><div><span style="background-color:rgb(243,243,243)">Faculty of Disaster Management</span></div><div>Patuakhali Science and Technology University, Dumki, Patuakhali, Bangladesh</div><div><br></div><div>Cell: <a href="tel:%2B8801716851612" value="+8801716851612" target="_blank">+8801716851612</a></div><div>Email: <a href="javascript:_e(%7B%7D,'cvml','abdus.sattar@pstu.ac.bd');" target="_blank">abdus.sattar@pstu.ac.bd</a></div></div></div></div></div></div></div></div></div></div>
</div>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="javascript:_e(%7B%7D,'cvml','gradsusr@gradsusr.org');" target="_blank">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></blockquote></div><br></div>
</blockquote></div><br><br>-- <br><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Md. Abdus Sattar<div>PhD Student</div><div>Department of Environmental Sciences</div><div><span style="font-family:arial,helvetica,sans-serif;font-size:12px;line-height:15px">Level 2, Australian Hearing Hub Building</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Faculty of Science and Engineering<br>Macquarie University<br></span><span style="font-size:12.8000001907349px">NSW 2109 Australia</span><br></div><div><br></div><div><br></div><div>Cell: +61404400401</div><div>Email: <a href="mailto:md-abdus.sattar@students.mq.edu.au" target="_blank">md-abdus.sattar@students.mq.edu.au</a></div><div><br></div><div><b>AND</b></div><div><br></div><div><div style="font-size:12.8000001907349px">Assistant Professor</div><div style="font-size:12.8000001907349px">Department of Disaster Risk Management (DRM)</div></div><div><span style="background-color:rgb(243,243,243)">Faculty of Disaster Management</span></div><div>Patuakhali Science and Technology University, Dumki, Patuakhali, Bangladesh</div><div><br></div><div>Cell: +8801716851612</div><div>Email: <a href="mailto:abdus.sattar@pstu.ac.bd" target="_blank">abdus.sattar@pstu.ac.bd</a></div></div></div></div></div></div></div></div></div><br>