<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">the FLT package as it is now interpolates all fields using neighboring points, including land points. This is OK for velocities which are indeed zero on the boundaries, but not for T,S, tracers and SSH, which are set to zero on the land points, which is not their true value. So for T, S, tracers and SSH it is better not to interpolate at all and just use the value on the grid at the nearest cell point, i.e. using NINT in all three directions. </div><div class=""><br class=""></div><div class=""><div class="">
Paola<br class=""><span style="font-size: 12px;" class=""><br class="">----------------------------------------------<br class="">Paola Cessi <br class="">Scripps Institution of Oceanography <br class="">9500 Gilman Drive #0213 <br class="">La Jolla, CA 92093-0213<br class="">USA <br class="">Tel: +1 858 534 0622 Fax: +1 858 534 8045<br class="">e-mail: <a href="mailto:pcessi@ucsd.edu" class="">pcessi@ucsd.edu</a> Web: <a href="http://www-pord.ucsd.edu/~pcessi" class="">http://www-pord.ucsd.edu/~pcessi</a><br class=""><br class="">Delivery address (Fed-Ex, DHL, UPS, etc.):<br class="">Paola Cessi<br class="">University of California San Diego<br class="">Keck Center - Room 366<br class="">8851 Shellback Way<br class="">La Jolla, CA 92093-0213<br class="">USA<br class=""></span><br class="">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Mar 29, 2020, at 7:42 AM, 钱钰坤 <<a href="mailto:qianyk@mail3.sysu.edu.cn" class="">qianyk@mail3.sysu.edu.cn</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><font class="">Hi all,</font></div><div class=""><font class=""><br class=""></font></div><div class=""><font class=""><div class="">When I tried to sample the model state using 3D floats (flt pkg), I found that the sampled fields are not smooth (like a step funtion in some way) as I expected (I made a comparison with the offline-sampled results). When I looked into flt_traj.F, there are some codes doing the interpolation of model state by floats. For a 3D type float (not horizontal 2D float), I would expect a trilinear (x, y, z) interpolation of the model state. However, I found the following lines (<a href="https://github.com/MITgcm/MITgcm/blob/master/pkg/flt/flt_traj.F#L134" class="">https://github.com/MITgcm/MITgcm/blob/master/pkg/flt/flt_traj.F#L134</a>):</div></font></div><div class=""><font class=""><br class=""></font></div><div class=""><sign signid="0" class=""><div class=""><font class=""><div class=""><b class=""> CALL FLT_BILINEAR (ix,jy,uu,uVel, kp,1,bi,bj,myThid)</b></div><div class=""><b class=""> CALL FLT_BILINEAR (ix,jy,vv,vVel, kp,2,bi,bj,myThid)</b></div><div class=""><b class=""> CALL FLT_BILINEAR2D(ix,jy,pp,etaN, 0,bi,bj,myThid)</b></div><div class=""><b class=""> CALL FLT_BILINEAR (ix,jy,tt,theta, kp,0,bi,bj,myThid)</b></div><div class=""><b class=""> CALL FLT_BILINEAR (ix,jy,ss,salt, kp,0,bi,bj,myThid)</b></div></font><font class=""><div class=""><font class=""><br class=""></font></div>For a 3D linear interpolation, I think <b class="">FLT_TRILINEAR </b>would be much better, with proper vertical position <b class="">kp</b>. Here <b class="">kp </b>is a roundoff of the vertical position (<a href="https://github.com/MITgcm/MITgcm/blob/master/pkg/flt/flt_traj.F#L106" class="">https://github.com/MITgcm/MITgcm/blob/master/pkg/flt/flt_traj.F#L106</a>):<br class=""></font><font class=""><br class=""></font><font class=""><b class=""> kp = NINT(kpart(ip,bi,bj))</b></font></div><div class=""><font class=""><br class=""></font></div><div class=""><font class=""><div class="">When I change <b class="">FLT_BILINEAR(...)</b> to <b class="">FLT_TRILINEAR(ix,jy,kpart(ip,bi,bj),tt,theta,0,bi,bj,myThid)</b>, I got almost identical results both online and offline. No step-funciton-like behavior.</div><div class=""><br class=""></div><div class="">Shouldn't it be changed to <b class="">FLT_TRILINEAR</b>?</div><br class=""></font><div style="color:#909090;font-family:Arial Narrow;font-size:12px" class="">------------------</div></div><div style="font-size: 14px; font-family: Verdana;" class=""><div class=""> <font size="2" class="">Best regards <br class=""> <br class="">Yu-Kun Qian (钱钰坤) <br class="">Center for Monsoon and Environment Research</font> </div> <font size="2" class="">Department of Atmospheric Sciences<br class="">School of Environmental Science and Engineering<font size="2" class=""> <br class=""> </font>Sun Yat-sen University <br class="">No. 135 Xingang West Road, Haizhu District <br class="">Guangzhou, 510275, P.R. China <br class="">Tel; 020-84115227 <br class="">Email: <a href="mailto:qianyk@mail2.sysu.edu.cn" class="">qianyk@mail3.sysu.edu.cn</a> </font>
<div class=""> <font size="2" class=""> </font> </div></div></sign></div><div class=""> </div><div class=""><includetail class=""><!--<![endif]--></includetail></div>_______________________________________________<br class="">MITgcm-support mailing list<br class=""><a href="mailto:MITgcm-support@mitgcm.org" class="">MITgcm-support@mitgcm.org</a><br class="">http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support<br class=""></div></blockquote></div><br class=""></div></body></html>