<div dir="ltr"><div>Usually, products from operational centers have array (variables) ordered North->South.</div><div><br></div><div>NCL's spherical harmonics require the data to be ordered South->North. <br></div><div>Since you are using products [eg: u*q], the other variables must also be reordered.</div><div>This is easy to address via NCL syntax<br></div><div><br></div><div><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><div><span style="color:rgb(0,0,0)">q=short2flt(f->q) ; units= kg kg-1</span><br>
</div>
<div><span style="color:rgb(0,0,0)">u=short2flt(g->u)</span><br>
</div>
<div><span style="color:rgb(0,0,0)">v=short2flt(h->v)</span><br>
</div>
<div><span style="color:rgb(0,0,0)">sfp=short2flt(i->sp)        ;units=pa, time*lat*lon</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">; Reverse the order</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">q := q(:,:,::-1,:)</span></div><div><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)">u := u(:,:,::-1,:)</span></span></span></div><div><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)">v := v(:,:,::-1,:)</span></span></span></span></span></div><div><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)">sph := sph(:,:,::-1,:)</span></span></span></span></span></span></span></div><div><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><br></span></span></span></span></span></span></span></div><div><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)">etc</span></span></span></span></span></span></span></div><div><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><br></span></span></span></span></span></span></span></div><div><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)"><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0)">A very quick view of the code is that it looks 'ok'<br></span></span></span></span></span></span></span></div></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 16, 2019 at 5:30 AM 최화진(환경공학부) via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Dear all,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="color:rgb(0,0,0)">Hello.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="color:rgb(0,0,0)">I am trying to calculate vertically integrated moisture budget.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="color:rgb(0,0,0)">I used "uv2dvF" and "wgt_vertical_n" functions because these data have regular grid and pressure coordinate.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
</div>
<div><span style="font-family:Calibri,Helvetica,sans-serif;color:rgb(0,0,0)">I am worried about whether the following script is correct or not.</span></div>
<div><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="color:rgb(0,0,0);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)">f=addfile(dir2+"/q/q_day_ERA-20C_V0_r360x181_"+year+"0101-"+year+"<a href="http://1231.nc" target="_blank">1231.nc</a>","r")</span><span style="color:rgb(153,0,153);font-family:"Malgun Gothic";font-size:medium;background-color:rgb(255,255,255)"><br>
<div><span style="color:rgb(0,0,0)">g=addfile(dir2+"/u/u_day_ERA-20C_V0_r360x181_"+year+"0101-"+year+"<a href="http://1231.nc" target="_blank">1231.nc</a>","r")</span><br>
</div>
<div><span style="color:rgb(0,0,0)">h=addfile(dir2+"/v/v_day_ERA-20C_V0_r360x181_"+year+"0101-"+year+"<a href="http://1231.nc" target="_blank">1231.nc</a>","r")</span><br>
</div>
<div><span style="color:rgb(0,0,0)">i=addfile(dir2+"/sp/sp_day_ERA-20C_V0_r360x181_"+year+"0101-"+year+"<a href="http://1231.nc" target="_blank">1231.nc</a>","r")</span><br>
</div>
<div><br>
</div>
<div><span style="color:rgb(0,0,0)">q=short2flt(f->q) ; units= kg kg-1</span><br>
</div>
<div><span style="color:rgb(0,0,0)">u=short2flt(g->u)</span><br>
</div>
<div><span style="color:rgb(0,0,0)">v=short2flt(h->v)</span><br>
</div>
<div><span style="color:rgb(0,0,0)">sfp=short2flt(i->sp) ;units=pa, time*lat*lon</span><br>
</div>
<div><br>
</div>
<div><span style="color:rgb(0,0,0)">lon=f->lon</span><br>
</div>
<div><span style="color:rgb(0,0,0)">lat=f->lat</span><br>
</div>
<div><span style="color:rgb(0,0,0)">time=f->time</span><br>
</div>
<div><span style="color:rgb(0,0,0)">sfp=sfp*0.01</span><br>
</div>
<div><span style="color:rgb(0,0,0)">sfp@units="millibars"</span><br>
</div>
<div><span style="color:rgb(0,0,0)">lev=f->level</span><br>
</div>
<div><span style="color:rgb(0,0,0)">printVarSummary(lev)</span><br>
</div>
<div><br>
</div>
<div><span style="color:rgb(0,0,0)">u_q=u*q</span><br>
</div>
<div><span style="color:rgb(0,0,0)">v_q=v*q</span><br>
</div>
<div><br>
</div>
<div><span style="color:rgb(0,0,0)">CV=uv2dvF_Wrap(u_q,v_q)</span><br>
</div>
<div><br>
</div>
<div><span style="color:rgb(0,0,0)">ptop=10</span><br>
</div>
<div><span style="color:rgb(0,0,0)">grav=9.8</span><br>
</div>
<div><span style="color:rgb(0,0,0)">vopt=1</span><br>
</div>
<div><br>
</div>
<div><span style="color:rgb(0,0,0)">dp=dpres_plevel_Wrap(lev,sfp,ptop,0) ;time*level*lat*lon</span></div>
<div><span style="color:rgb(0,0,0)">cv_integ=wgt_vertical_n(CV,dp,vopt,1)</span><br>
</div>
<div><br>
</div>
<div><span style="color:rgb(0,0,0)">cv=cv_integ*86400 ; for mm/day</span><br>
</div>
<div><span style="color:rgb(0,0,0)">cv=cv/grav</span><br>
</div>
<div><span style="color:rgb(0,0,0)">cv!0="time"</span><br>
</div>
<div><span style="color:rgb(0,0,0)">cv!1="latitude"</span><br>
</div>
<div><span style="color:rgb(0,0,0)">cv!2="longitude"</span><br>
</div>
<div><span style="color:rgb(0,0,0)">cv&latitude=lat</span><br>
</div>
<div><span style="color:rgb(0,0,0)">cv&longitude=lon</span><br>
</div>
<div><span style="color:rgb(0,0,0)">cv&time=time</span><br>
</div>
<div><span style="color:rgb(0,0,0)">cv=-cv</span><br>
</div>
<i><span></span> </i></span><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<div style="margin:0px;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
If you could get back to me, I'd appreciate it.<br>
</div>
<div style="margin:0px;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
Thanks for your time and consideration.  </div>
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<div style="margin:0px;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
Best Regards,<br>
</div>
<div style="margin:0px;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<br>
</div>
<span style="margin:0px;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">Hwa-Jin Cho</span><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div id="gmail-m_3423237359988050653Signature">
<div style="font-size:12pt;color:rgb(0,0,0)">
<div style="margin:0px;text-align:start;background-color:rgb(255,255,255)"><font face="Cambria, Georgia, serif, serif, EmojiFont"><span style="font-family:Sylfaen,Mshtakan,Menlo,serif"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif,serif,EmojiFont;font-size:12px;text-align:justify;background-color:rgb(255,255,255);display:inline">**************************************************************<span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span><span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span><span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span><span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span><span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span></span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif,serif,EmojiFont;font-size:12px;text-align:justify;background-color:rgb(255,255,255)">
</span></font><span style="font-family:Sylfaen,Mshtakan,Menlo,serif">Hwa-Jin Choi</span><font face="Cambria, Georgia, serif, serif, EmojiFont"><span style="font-family:Sylfaen,Mshtakan,Menlo,serif"><br>
</span></font></div>
<span style="margin:0px;font-family:Cambria,Georgia,serif,serif,EmojiFont;text-align:start;background-color:rgb(255,255,255)"></span><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;text-align:start;background-color:rgb(255,255,255);display:inline"></span>
<div style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;margin:0px;text-align:start;background-color:rgb(255,255,255)">
<span style="margin:0px;font-family:Sylfaen,Mshtakan,Menlo,serif">Climate Change Research Lab (CCRL),</span></div>
<span style="margin:0px;font-family:Cambria,Georgia,serif,serif,EmojiFont;text-align:start;background-color:rgb(255,255,255)"></span><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;text-align:start;background-color:rgb(255,255,255);display:inline"></span>
<div style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;margin:0px;text-align:start;background-color:rgb(255,255,255)">
<span style="margin:0px"></span><span style="margin:0px;font-family:Sylfaen,Mshtakan,Menlo,serif">Division of Environmental Science and Engineering,</span><br>
<span style="margin:0px;font-family:Sylfaen,Mshtakan,Menlo,serif">Pohang University of Science and Technology (POSTECH)</span></div>
<span style="margin:0px;font-family:Cambria,Georgia,serif,serif,EmojiFont;text-align:start;background-color:rgb(255,255,255)"></span><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;text-align:start;background-color:rgb(255,255,255);display:inline"></span>
<div style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;margin:0px;text-align:start;background-color:rgb(255,255,255)">
<span style="margin:0px;font-family:Sylfaen,Mshtakan,Menlo,serif"> 77, Cheongam-ro, Nam-gu, Pohang, Kyongbuk, 37673, South Korea</span></div>
<span style="color:rgb(51,51,51);font-family:Arial,sans-serif,serif,EmojiFont;font-size:12px;text-align:justify;background-color:rgb(255,255,255);display:inline">**************************************************************<span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span><span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span><span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span><span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span><span style="font-family:Arial,sans-serif,serif,EmojiFont;background-color:rgb(255,255,255);display:inline">*******</span></span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif,serif,EmojiFont;font-size:12px;text-align:justify;background-color:rgb(255,255,255)">
<br>
</div>
</div>
</div>

_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>