<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
        {font-family:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
@font-face
        {font-family:"Helvetica Neue";
        panose-1:2 0 5 3 0 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
p.p1, li.p1, div.p1
        {mso-style-name:p1;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.s1
        {mso-style-name:s1;}
span.spneditorsign
        {mso-style-name:spneditorsign;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-AU" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Chathu<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">The function rho_mwjf() should really be deprecated, it’s only applicable to the Equation of State for the CESM3 version of POP and NOT for observations (I would guess that POP has moved on now as
 well).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">If you’re working with observational data that you should really be using TEOS-10 (<a href="https://www.teos-10.org">https://www.teos-10.org</a>) and if you’re working with a model then strictly
 speaking you should track down the EoS for that model (which is likely a simplified version of TEOS-19).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">If you’re really wedded to using rho_mwjf(), then double-check that you have the correct salinity units. Also, you have to accept that the EoS probably doesn’t work that for extreme conditions (for
 example supercooled water near ice shelves), which may explain the erroneous density.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I did start a few years ago with Dennis on implementing NCL wrappers for the fortran TEOS-10 library, but life/work got in the way, and with the deprecation of NCL it became a low priority. I’ve
 attached an NCL library of some of the (now obsolete) UNESCO EoS functions – you’re welcome to use but AT YOUR OWN RISK.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Will<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">ncl-talk <ncl-talk-bounces@mailman.ucar.edu> on behalf of Chathurika via ncl-talk <ncl-talk@mailman.ucar.edu><br>
<b>Reply to: </b>Chathurika <chatu@scsio.ac.cn><br>
<b>Date: </b>Sunday, 16 January 2022 at 12:52 am<br>
<b>To: </b>ncl-talk <ncl-talk@ucar.edu><br>
<b>Subject: </b>[ncl-talk] rho_mwjf<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p><span style="font-size:12.0pt;font-family:"Arial",sans-serif">Dear NCL users,</span><span style="font-family:"Arial",sans-serif">
<o:p></o:p></span></p>
<p><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;font-family:"Arial",sans-serif">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 as follows at each depth level.</span><span style="font-family:"Arial",sans-serif">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span style="font-size:11.5pt;font-family:Menlo"><br>
<br>
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(0) 26.34497</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(1) 26.3656</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(2) 26.40527</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(3) 26.45532</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(4) 26.5199</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(5) 26.58557</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(6) 26.65369</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(7) 26.71924</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(8) 26.77869</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(9) 26.83704</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(10) 26.89197</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(11) 26.94214</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(12) 26.99036</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(13) 27.0343</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(14) 27.0769</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(15) 27.11511</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(16) 27.15247</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(17) 27.18738</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(18) 27.22571</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(19) 27.26978</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(20) 27.32153</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(21) 27.39014</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(22) 27.46655</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(23) 27.52747</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(24) 27.57336</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(25) 27.61084</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(26) 27.65247</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(27) 27.6958</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(28) 27.73132</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(29) 27.75598</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(30) 27.77417</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(31) 27.78784</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(32) 27.79846</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(33) 27.80762</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(34) 27.81592</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(35) 27.82202</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(36) 27.82605</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(37) 27.82739</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(38) 27.82776</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(39) 27.8324</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;font-family:"Arial",sans-serif">However, when I calculate the density at each depth levels using rho_mwjf (script is attached below), It calculate density which is not reasonable, shows;</span><span style="font-family:"Arial",sans-serif">
<o:p></o:p></span></p>
<p><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(0) 26.3907</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(1) 26.4604</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(2) 26.54432</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(3) 26.6379</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(4) 26.74557</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(5) 26.85472</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(6) 26.97386</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(7) 27.10243</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(8) 27.24155</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(9) 27.40277</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(10) 27.58386</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(11) 27.78384</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(12) 28.00518</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(13) 28.24571</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(14) 28.5084</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(15) 28.79022</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(16) 29.09488</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(17) 29.43268</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(18) 29.82106</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(19) 30.26328</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(20) 30.76077</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(21) 31.32516</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(22) 31.94666</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(23) 32.59835</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(24) 33.27908</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(25) 33.99501</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(26) 34.78358</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(27) 35.64154</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(28) 36.53573</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(29) 37.46336</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(30) 38.45152</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(31) 39.54657</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(32) 40.74771</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(33) 42.0564</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(34) 43.53943</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(35) 45.23687</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(36) 47.14139</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(37) 49.24323</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(38) 51.43494</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p class="p1" style="margin-bottom:0cm;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="s1"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">(39) 53.81633</span></span><span style="font-size:11.5pt;font-family:Menlo">
<o:p></o:p></span></p>
<p><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif">depth from 6 m to 5720 m, 40 levels</span><o:p></o:p></p>
<p><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;font-family:"Arial",sans-serif">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? Many many thanks. Please be kind
 to reply me.</span><span style="font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
<p><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;font-family:"Arial",sans-serif">The script: </span><span style="font-family:"Arial",sans-serif">
<o:p></o:p></span></p>
<p><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;font-family:"Arial",sans-serif">diri=".../salinity/hist/"</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">sfile = "salinity.nc" </span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">f = addfile(diri+sfile,"r")</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">vname=getfilevarnames(f)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">print(vname)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">  salt           = f->so(:,:,{-25:-70},:)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">  printVarSummary(salt)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">  printMinMax(salt, False)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif"> s_range = dim_avg_n_Wrap(salt, 0)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif"> printVarSummary(s_range)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif"> delete(salt)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">diri=".../temperature/hist/"</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">sfile = "temperature.nc" </span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">f = addfile(diri+sfile,"r")</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">vname=getfilevarnames(f)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">print(vname)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">  temp           = f->thetao(:,:,{-25:-70},:)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">  printVarSummary(temp)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">  printMinMax(temp, False)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif"> t_range = dim_avg_n_Wrap(temp, 0)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif"> printVarSummary(t_range)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif"> delete(temp)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">depth = (/6, 17,27,37,47,57,68.5,82.5,100,122.5,150,182.5,220\</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">   ,262.5,310,362.5,420,485,560,645,740,845,960,1085,1220,1365\</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">   ,1525,1700,1885,2080,2290,2525,2785,3070,3395,3770,4195,4670,5170,5720/) </span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">ndim = dimsizes(t_range)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">nlev = ndim(0)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">nlat = ndim(1)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">nlon = ndim(2)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">rho = new((/nlev,nlat,nlon/), typeof(t_range))</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">do i = 0, nlev-1</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">    rho(i,:,:) = rho_mwjf(t_range(i,:,:),s_range(i,:,:),depth(i))</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">   </span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">end do</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">copy_VarCoords(t_range, rho)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">rho = 1000.*(rho-1.) </span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">printVarSummary(rho)</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">printMinMax(rho, True)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">abc = dim_avg_n_Wrap(rho, (/1,2/))</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">printVarSummary(abc)</span><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif">print(abc)</span><span style="font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Thank you and best regards, <o:p></o:p></p>
<p>Chathu <o:p></o:p></p>
<div class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<span class="spneditorsign"><span style="font-family:"Arial",sans-serif">
<hr size="1" width="160" style="width:120.0pt" align="left">
</span></span></div>
<blockquote style="margin-left:30.0pt;margin-right:0cm;font-variant-ligatures:normal;orphans:2;widows:2">
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<span style="font-size:12.0pt;font-family:"Helvetica Neue""><o:p> </o:p></span></p>
</blockquote>
<blockquote style="margin-left:30.0pt;margin-right:0cm;font-variant-ligatures:normal;orphans:2;widows:2">
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<span style="font-size:12.0pt;font-family:"Helvetica Neue""><o:p> </o:p></span></p>
</blockquote>
<blockquote style="margin-left:30.0pt;margin-right:0cm;font-variant-ligatures:normal;orphans:2;widows:2">
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<i><span style="font-size:10.0pt;font-family:"Helvetica Neue"">Wickramage Chathurika Hemamali</span></i><span style="font-family:"Helvetica Neue"">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<i><span style="font-size:10.0pt;font-family:"Helvetica Neue"">Msc in Physical Oceanography</span></i><span style="font-family:"Helvetica Neue"">
<o:p></o:p></span></p>
</div>
<div>
<div id="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2251">
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<span style="font-family:"Helvetica Neue""><o:p> </o:p></span></p>
</div>
</div>
</blockquote>
</div>
<p style="font-size:10pt; line-height:10pt; font-family: Calibri,sans-serif;"><br>
<br>
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained
 in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.</p>
</body>
</html>