<p>
<br>
</p>
<p>
Dear Dennis,
</p>
<p>
<br>
</p>
<p>
Many thanks for your reply.
</p>
<p>
<br>
</p>
<p>
I wonder how one can remap this density layers to depth level. If you have any idea, please share it with me.
</p>
<p>
<br>
</p>
<p>
Many thanks again and best regards,
</p>
<p>
Chathu
</p>
<br>
<br>
<blockquote name="replyContent" class="ReferenceQuote" style="padding-left:5px;margin-left:5px;border-left:#b6b6b6 2px solid;margin-right:0;">
-----Original Messages-----<br>
<b>From:</b><span id="rc_from">"Dennis Shea" <shea@ucar.edu></span><br>
<b>Sent Time:</b><span id="rc_senttime">2021-12-31 22:18:17 (Friday)</span><br>
<b>To:</b> Chathurika <chatu@scsio.ac.cn><br>
<b>Cc:</b> ncl-talk <ncl-talk@ucar.edu><br>
<b>Subject:</b> Re: [ncl-talk] int2p_n_Wrap<br>
<br>
<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 #CCCCCC;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:#222222;font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:#FFFFFF;"><span style="font-family:Georgia;font-size:16px;">on isopycnal surfaces</span><span style="color:#222222;font-family:Georgia;font-size:16px;white-space:normal;background-color:#FFFFFF;">, 26 ≤ </span><i style="box-sizing:inherit;color:#222222;font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:#FFFFFF;"><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:#222222;font-family:Georgia;white-space:normal;background-color:#FFFFFF;"><i style="box-sizing:inherit;">θ</i></span><span style="color:#222222;font-family:Georgia;font-size:16px;white-space:normal;background-color:#FFFFFF;"> ≤ 27.75 (</span><i style="box-sizing:inherit;color:#222222;font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:#FFFFFF;"><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:#222222;font-family:Georgia;white-space:normal;background-color:#FFFFFF;"><i style="box-sizing:inherit;">θ</i></span><span style="color:#222222;font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:#FFFFFF;"><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:#222222;font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:#FFFFFF;"><br>
</span>
</p>
<p style="font-family:Arial;">
<span style="color:#222222;font-family:Georgia;font-size:16px;white-space:normal;background-color:#FFFFFF;">The script;</span>
</p>
<p style="font-family:Arial;">
<span style="color:#222222;font-family:Harding,Palatino,serif;font-size:18px;white-space:normal;background-color:#FFFFFF;"><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:#999999;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>
</blockquote>
<br>
<br>
<br>
<span 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">
<span style="font-style:italic;"><span style="font-size:x-small;">State Key Laboratory of Tropical Oceanography</span></span>
</div>
</div>
<div>
<div id="ydpc6aa4ef1yui_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="ydpc6aa4ef1yui_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="ydpc6aa4ef1yui_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="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264" style="font-size:small;">
<span style="font-style:italic;font-size:medium;"><br>
</span>
</div>
<div id="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264" style="font-size:small;">
<i><span style="font-size:xx-small;">Specialized in Oceanography and Marine Geology (Bachelor)</span></i>
</div>
<div id="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264" style="font-size:small;">
<i><span style="font-size:xx-small;">University of Ruhuna</span></i>
</div>
<div id="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264" style="font-size:small;">
<i><span style="font-size:xx-small;">Matara</span></i>
</div>
<div id="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264" style="font-size:small;">
<i><span style="font-size:xx-small;">Sri Lanka</span></i>
</div>
<div id="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264" style="font-size:small;">
<span style="font-style:italic;font-size:medium;"><br>
</span>
</div>
<div id="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264" style="font-size:small;">
<span style="font-style:italic;font-size:medium;">Email : <a target="_blank">wickramagechathurika@rocketmail.com</a></span>
</div>
<div id="ydpc6aa4ef1yui_3_16_0_ym19_1_1496286059659_2264" style="font-size:small;">
<span style="font-style:italic;font-size:medium;"><a target="_blank">chatu@scsio.ac.cn</a></span>
</div>
</blockquote>
</span>