<div dir="ltr"><div>The script looks good. [Quick look]</div><div><br></div><div>See: Examples 1, 3, 4<br></div><div><a href="http://www.ncl.ucar.edu/Applications/iso.shtml"><b>http://www.ncl.ucar.edu/Applications/iso.shtml</b></a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 31, 2021 at 4:19 AM Chathurika via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.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"><p style="font-family:Arial">
        <span style="font-family:Georgia;font-size:16px">Dear All,</span>
</p>
<p style="font-family:Arial">
        <br>
</p>
<p style="font-family:Arial">
        <span style="font-family:Georgia;font-size:16px">I want to calculate the salinity </span><span style="color:rgb(34,34,34);font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:rgb(255,255,255)"><span style="font-family:Georgia;font-size:16px">on isopycnal surfaces</span><span style="color:rgb(34,34,34);font-family:Georgia;font-size:16px;white-space:normal;background-color:rgb(255,255,255)">, 26 ≤ </span><i style="box-sizing:inherit;color:rgb(34,34,34);font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:rgb(255,255,255)"><span style="font-family:Georgia;font-size:16px">σ</span></i><span style="box-sizing:inherit;vertical-align:baseline;font-size:16px;line-height:0;color:rgb(34,34,34);font-family:Georgia;white-space:normal;background-color:rgb(255,255,255)"><i style="box-sizing:inherit">θ</i></span><span style="color:rgb(34,34,34);font-family:Georgia;font-size:16px;white-space:normal;background-color:rgb(255,255,255)"> ≤ 27.75 (</span><i style="box-sizing:inherit;color:rgb(34,34,34);font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:rgb(255,255,255)"><span style="font-family:Georgia;font-size:16px">σ</span></i><span style="box-sizing:inherit;vertical-align:baseline;font-size:16px;line-height:0;color:rgb(34,34,34);font-family:Georgia;white-space:normal;background-color:rgb(255,255,255)"><i style="box-sizing:inherit">θ</i></span><span style="color:rgb(34,34,34);font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:rgb(255,255,255)"><span style="font-family:Georgia;font-size:16px"> is the potential density). So I calculated it as follows. Could you please tell me what I do here right or wrong. Script works. I just want to know whether the calculation</span><span style="font-family:Georgia;font-size:16px"> makes sense or not. Thank you so so much. Looking forward to hearing from you.</span></span></span>
</p>
<p style="font-family:Arial">
        <span style="color:rgb(34,34,34);font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:rgb(255,255,255)"><br>
</span>
</p>
<p style="font-family:Arial">
        <span style="color:rgb(34,34,34);font-family:Georgia;font-size:16px;white-space:normal;background-color:rgb(255,255,255)">The script;</span>
</p>
<p style="font-family:Arial">
        <span style="color:rgb(34,34,34);font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:rgb(255,255,255)"><span style="font-family:Georgia;font-size:16px">P0 = 1000</span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Arial"><span style="font-family:Georgia;font-size:16px">diri="/....</span><span style="font-family:Georgia;font-size:16px">/"</span></span><br>
<span style="font-family:Georgia;font-size:16px">sfile = "ER-hist.nc" </span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Georgia;font-size:16px">f = addfile(diri+sfile,"r")</span><br>
<span style="font-family:Georgia;font-size:16px">vname=getfilevarnames(f)</span><br>
<span style="font-family:Georgia;font-size:16px">print(vname)</span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Georgia;font-size:16px">  hist           = f->rhopoto(:,:,{-25:-70},:)</span><br>
<span style="font-family:Georgia;font-size:16px">  P_D = hist - P0</span><br>
<span style="font-family:Georgia;font-size:16px">  copy_VarCoords(hist, P_D)</span><br>
<span style="font-family:Georgia;font-size:16px">  copy_VarMeta(hist, P_D)</span><br>
<span style="font-family:Georgia;font-size:16px">  printVarSummary(P_D)</span><br>
<span style="font-family:Georgia;font-size:16px">  printMinMax(P_D, False)</span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Georgia;font-size:16px">;************************************************</span><br>
<span style="font-family:Georgia;font-size:16px">; Interpolate to specific [constant] TEMP levels</span><br>
<span style="font-family:Georgia;font-size:16px">; The default returned vertical coordinate is Z_T but change to 'tlev'</span><br>
<span style="font-family:Georgia;font-size:16px">;************************************************</span><br>
<span style="font-family:Georgia;font-size:16px">  tlev    = (/ 26.00 , 26.25,26.50,26.75,27.00,27.25,27.50,27.75/)    ; same units [here, C] as TEMP</span><br>
<span style="font-family:Georgia;font-size:16px">  tlev@units = P_D@units</span><br>
<span style="font-family:Georgia;font-size:16px">  tlev!0     = "tlev"</span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Georgia;font-size:16px">delete([/diri,sfile,f,vname,hist/])</span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Arial"><span style="font-family:Georgia;font-size:16px">diri="/...</span><span style="font-family:Georgia;font-size:16px">/hist/"</span></span><br>
<span style="font-family:Georgia;font-size:16px">sfile = "ER-hist.nc" </span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Georgia;font-size:16px">f = addfile(diri+sfile,"r")</span><br>
<span style="font-family:Georgia;font-size:16px">vname=getfilevarnames(f)</span><br>
<span style="font-family:Georgia;font-size:16px">print(vname)</span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Georgia;font-size:16px">  salt           = f->so(:,:,{-25:-70},:)</span><br>
<span style="font-family:Georgia;font-size:16px">  printVarSummary(salt)</span><br>
<span style="font-family:Georgia;font-size:16px">  printMinMax(salt, False)</span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Georgia;font-size:16px">;**********************************************************  </span><br>
<span style="font-family:Georgia;font-size:16px">; use int2p_n to interpolate: </span><br>
<span style="font-family:Georgia;font-size:16px">;*********************************************************</span><br>
<span style="font-family:Georgia;font-size:16px">  ityp = 0</span><br>
<span style="font-family:Georgia;font-size:16px">  pdim = 1</span><br>
<span style="font-family:Georgia;font-size:16px">  </span><br>
<span style="font-family:Georgia;font-size:16px">xlvl = int2p_n_Wrap (P_D, salt, tlev, ityp, pdim) </span><br>
<span style="font-family:Georgia;font-size:16px">printVarSummary(xlvl)</span><br>
<span style="font-family:Georgia;font-size:16px">printMinMax(xlvl, True)</span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Arial"><br>
</span><br>
<span style="font-family:Georgia;font-size:16px">  ER2 = dim_avg_n_Wrap(xlvl, 3)</span><br>
<span style="font-family:Georgia;font-size:16px">  ER = dim_avg_n_Wrap(ER2, 0)</span><br>
<span style="font-family:Georgia;font-size:16px">  printVarSummary(ER)</span><br>
<span style="font-family:Georgia;font-size:16px">  printMinMax(ER, True)</span><br>
<span style="font-family:Georgia;font-size:16px"></span><span style="font-family:Georgia;font-size:16px"></span></span>
</p>
<br>
<p>
        <span style="font-family:Georgia;font-size:16px">Best Regards,</span>
</p>
<p>
        <span style="font-family:Georgia;font-size:16px">Chathu</span>
</p>
<span style="font-family:Arial">
<hr style="margin:0.5em 0px;width:10em;height:1px;background-color:rgb(153,153,153);border:medium none" align="left">
<blockquote style="margin:0px 0px 0px 40px;padding:0px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:small;font-variant-ligatures:normal;border:medium 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;border:medium 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;border:medium 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="gmail-m_6852446311871624283ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2251">
                        <span style="font-style:italic"><span style="font-size:x-small">State Key Laboratory of Tropical Oceanography</span></span>
                </div>
        </div>
        <div>
                <div id="gmail-m_6852446311871624283ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2252">
                        <span style="font-style:italic"><span style="font-size:x-small">South China Sea Institute of Oceanology</span></span>
                </div>
                <div id="gmail-m_6852446311871624283ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2252">
                        <span style="font-style:italic"><span style="font-size:x-small">University of Chinese Academy of Science</span></span>
                </div>
        </div>
        <div>
                <div id="gmail-m_6852446311871624283ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264">
                        <span style="font-style:italic"><span style="font-size:x-small">China</span></span>
                </div>
        </div>
        <div id="gmail-m_6852446311871624283ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264" style="font-size:small">
                <br>
        </div>
</blockquote>
</span>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>