<p style="font-family:Arial;">
<span style="font-family:Arial;font-size:16px;">Dear NCL users,</span>
</p>
<p style="font-family:Arial;">
<br>
</p>
<p style="font-family:Arial;">
<span style="font-family:Arial;font-size:16px;">I am really appreciate if you can show me what I is wrong with my script. As you know the southern ocean density is around 26-27</span><span style="font-family:Arial;font-size:16px;"> as follows at each depth level.</span>
</p>
<p style="font-family:Arial;">
</p><p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;"><br>
</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(0) 26.34497</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(1) 26.3656</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(2) 26.40527</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(3) 26.45532</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(4) 26.5199</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(5) 26.58557</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(6) 26.65369</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(7) 26.71924</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(8) 26.77869</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(9) 26.83704</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(10) 26.89197</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(11) 26.94214</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(12) 26.99036</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(13) 27.0343</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(14) 27.0769</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(15) 27.11511</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(16) 27.15247</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(17) 27.18738</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(18) 27.22571</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(19) 27.26978</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(20) 27.32153</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(21) 27.39014</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(22) 27.46655</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(23) 27.52747</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(24) 27.57336</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(25) 27.61084</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(26) 27.65247</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(27) 27.6958</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(28) 27.73132</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(29) 27.75598</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(30) 27.77417</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(31) 27.78784</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(32) 27.79846</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(33) 27.80762</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(34) 27.81592</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(35) 27.82202</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(36) 27.82605</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(37) 27.82739</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(38) 27.82776</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(39) 27.8324</span>
</p>
<span style="font-family:Arial;font-size:16px;"></span>
<p></p>
<p style="font-family:Arial;">
<br>
</p>
<p style="font-family:Arial;">
<span style="font-family:Arial;font-size:16px;">However, when I calculate the density at each depth levels using </span><span style="font-family:Arial;font-size:16px;">rho_mwjf </span><span style="font-family:Arial;font-size:16px;">(script is attached below), It calculate density which is not reasonable, shows;</span>
</p>
<p style="font-family:Arial;">
<br>
</p>
<p style="font-family:Arial;">
</p><p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(0) 26.3907</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(1) 26.4604</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(2) 26.54432</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(3) 26.6379</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(4) 26.74557</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(5) 26.85472</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(6) 26.97386</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(7) 27.10243</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(8) 27.24155</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(9) 27.40277</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(10) 27.58386</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(11) 27.78384</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(12) 28.00518</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(13) 28.24571</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(14) 28.5084</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(15) 28.79022</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(16) 29.09488</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(17) 29.43268</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(18) 29.82106</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(19) 30.26328</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(20) 30.76077</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(21) 31.32516</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(22) 31.94666</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(23) 32.59835</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(24) 33.27908</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(25) 33.99501</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(26) 34.78358</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(27) 35.64154</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(28) 36.53573</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(29) 37.46336</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(30) 38.45152</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(31) 39.54657</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(32) 40.74771</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(33) 42.0564</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(34) 43.53943</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(35) 45.23687</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(36) 47.14139</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(37) 49.24323</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(38) 51.43494</span>
</p>
<p class="p1" style="margin-bottom:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;white-space:normal;">
<span class="s1" style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">(39) 53.81633</span>
</p>
<p style="font-family:Arial;">
<br>
</p>
<span style="font-family:Arial;font-size:16px;">depth from 6 m to </span><span style="font-variant-ligatures:no-common-ligatures;font-family:Arial;font-size:16px;">5720 m, 40 levels</span><br>
<span style="font-family:Arial;font-size:16px;"></span>
<p></p>
<p style="font-family:Arial;">
<br>
</p>
<p style="font-family:Arial;">
<span style="font-family:Arial;font-size:16px;">Could please anyone say what am I doing here wrong? if this is not the right way to calculate density using temperature and salinity what will be the other way?</span><span style="font-family:Arial;font-size:16px;"> Many many thanks. Please be kind to reply me.</span>
</p>
<p style="font-family:Arial;">
<br>
</p>
<p style="font-family:Arial;">
<span style="font-family:Arial;font-size:16px;">The script: </span>
</p>
<p style="font-family:Arial;">
<br>
</p>
<p style="font-family:Arial;">
<span style="font-family:Arial;"><span style="font-family:Arial;font-size:16px;">diri="...</span><span style="font-family:Arial;font-size:16px;">/salinity/hist/"</span></span><br>
<span style="font-family:Arial;"><span style="font-family:Arial;font-size:16px;">sfile = "salinity</span><span style="font-family:Arial;font-size:16px;">.nc" </span></span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">f = addfile(diri+sfile,"r")</span><br>
<span style="font-family:Arial;font-size:16px;">vname=getfilevarnames(f)</span><br>
<span style="font-family:Arial;font-size:16px;">print(vname)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;"> salt = f->so(:,:,{-25:-70},:)</span><br>
<span style="font-family:Arial;font-size:16px;"> printVarSummary(salt)</span><br>
<span style="font-family:Arial;font-size:16px;"> printMinMax(salt, False)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;"> s_range = dim_avg_n_Wrap(salt, 0)</span><br>
<span style="font-family:Arial;font-size:16px;"> printVarSummary(s_range)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;"> delete(salt)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;"><span style="font-family:Arial;font-size:16px;">diri="...</span><span style="font-family:Arial;font-size:16px;">/temperature/hist/"</span></span><br>
<span style="font-family:Arial;"><span style="font-family:Arial;font-size:16px;">sfile = "temperature</span><span style="font-family:Arial;font-size:16px;">.nc" </span></span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">f = addfile(diri+sfile,"r")</span><br>
<span style="font-family:Arial;font-size:16px;">vname=getfilevarnames(f)</span><br>
<span style="font-family:Arial;font-size:16px;">print(vname)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;"> temp = f->thetao(:,:,{-25:-70},:)</span><br>
<span style="font-family:Arial;font-size:16px;"> printVarSummary(temp)</span><br>
<span style="font-family:Arial;font-size:16px;"> printMinMax(temp, False)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;"> t_range = dim_avg_n_Wrap(temp, 0)</span><br>
<span style="font-family:Arial;font-size:16px;"> printVarSummary(t_range)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;"> delete(temp)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">depth = (/6, 17,27,37,47,57,68.5,82.5,100,122.5,150,182.5,220\</span><br>
<span style="font-family:Arial;font-size:16px;"> ,262.5,310,362.5,420,485,560,645,740,845,960,1085,1220,1365\</span><br>
<span style="font-family:Arial;font-size:16px;"> ,1525,1700,1885,2080,2290,2525,2785,3070,3395,3770,4195,4670,5170,5720/) </span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">ndim = dimsizes(t_range)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">nlev = ndim(0)</span><br>
<span style="font-family:Arial;font-size:16px;">nlat = ndim(1)</span><br>
<span style="font-family:Arial;font-size:16px;">nlon = ndim(2)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">rho = new((/nlev,nlat,nlon/), typeof(t_range))</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">do i = 0, nlev-1</span><br>
<span style="font-family:Arial;font-size:16px;"> rho(i,:,:) = rho_mwjf(t_range(i,:,:),s_range(i,:,:),depth(i))</span><br>
<span style="font-family:Arial;font-size:16px;"> </span><br>
<span style="font-family:Arial;font-size:16px;">end do</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">copy_VarCoords(t_range, rho)</span><br>
<span style="font-family:Arial;font-size:16px;">rho = 1000.*(rho-1.) </span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">printVarSummary(rho)</span><br>
<span style="font-family:Arial;font-size:16px;">printMinMax(rho, True)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">abc = dim_avg_n_Wrap(rho, (/1,2/))</span><br>
<span style="font-family:Arial;font-size:16px;">printVarSummary(abc)</span><br>
<span style="font-family:Arial;"><br>
</span><br>
<span style="font-family:Arial;font-size:16px;">print(abc)</span><br>
<span style="font-family:Arial;font-size:16px;"></span>
</p>
<br>
<p>
Thank you and best regards,
</p>
<p>
Chathu
</p>
<span style="font-family:Arial;" class="spnEditorSign">
<hr class="signature-separator" align="left" style="margin:0.5em 0;width:10em;height:1px;background-color:#999;border:none;">
<blockquote style="margin:0px 0px 0px 40px;padding:0px;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:small;font-variant-ligatures:normal;orphans:2;widows:2;border:none;">
<span style="font-style:italic;font-size:medium;"><br>
</span>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;padding:0px;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:small;font-variant-ligatures:normal;orphans:2;widows:2;border:none;">
<span style="font-style:italic;font-size:medium;"><br>
</span>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;padding:0px;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-variant-ligatures:normal;orphans:2;widows:2;border:none;">
<span style="font-style:italic;"><span style="font-size:x-small;">Wickramage Chathurika Hemamali</span></span>
<div>
<span style="font-style:italic;"><span style="font-size:x-small;">Msc in Physical Oceanography</span></span>
</div>
<div>
<div id="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2251">
<br>
</div>
</div>
</blockquote>
</span>