<div dir="ltr"><div dir="ltr">Jianghua,<br><br>The write_matrix procedure actually calls fortran to make formatted lines of text.  Therefore the zero before the decimal point depends on which fortran compiler is actually linked to your installed version of NCL.  Fortran standards say that the zero before the decimal point is "optional".  I think this is unfortunate because this choice has been made both ways, resulting in this inconsistent behavior between compilers.  Some programmers, including me, would like to control this behavior precisely.</div><div dir="ltr"><br></div><div dir="ltr">It would be interesting to find out which fortran compiler and version is linked with NCL on your IBM_AIX machine, if you would like to look into this.  Perhaps just ask your computer support department.</div><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 12, 2019 at 4:34 AM Wan Jianghua via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div bgcolor="white" lang="ZH-CN"><div class="gmail-m_8319738312710511818WordSection1"><p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;color:rgb(31,73,125)">Hi Karin,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;color:rgb(31,73,125)">Thank you for your reply. I tried several versions of ncl (6.1.2, 6.2.0, 6.3.0). They all got the same results. <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;color:rgb(31,73,125)">But I run the same script on other two Linux machines with ncl V6.1.2 and V6.2.0, and  the zero appear.  <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;color:rgb(31,73,125)">I guess the problem might be related to the IBM_AIX machine I was using. <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="color:rgb(31,73,125)">Best,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="color:rgb(31,73,125)">Jianghua<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-size:11pt;font-family:微软雅黑,sans-serif;color:windowtext">Karin Meier-Fleischer via ncl-talk<br></span><b><span style="font-size:11pt;font-family:微软雅黑,sans-serif;color:windowtext">发送时间<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11pt;font-family:微软雅黑,sans-serif;color:windowtext"> 2019</span><span style="font-size:11pt;font-family:微软雅黑,sans-serif;color:windowtext">年<span lang="EN-US">9</span>月<span lang="EN-US">12</span>日<span lang="EN-US"> 17:30<br><br></span></span></p><p class="MsoNormal" align="left" style="margin-bottom:12pt;text-align:left"><span lang="EN-US">Hi Jianghua,<br><br>which NCL version are you running? Using version 6.6.2 works quite well:<br><br></span><tt><span lang="EN-US" style="font-size:10pt;color:rgb(51,51,255)">> ncl</span></tt><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(51,51,255)"><br><tt> Copyright (C) 1995-2019 - All Rights Reserved</tt><br><tt> University Corporation for Atmospheric Research</tt><br><tt> NCAR Command Language Version 6.6.2</tt><br><tt> The use of this software is governed by a License Agreement.</tt><br><tt> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.</tt><br><tt>ncl 0> a=new((/2,2/),float,-999.)</tt><br><tt>ncl 1> a=0.1</tt><br><tt>ncl 2> a(0,0)=-0.1</tt><br><tt>ncl 3> write_matrix(a,"2f5.2",True)</tt><br><tt>  </tt><br><tt>-0.10 0.10</tt><br><tt> 0.10 0.10</tt><br><tt>  </tt><br><tt>ncl 4> quit</tt></span><span lang="EN-US"><br><br>-Karin</span><span lang="EN-US" style="font-size:12pt"><u></u><u></u></span></p><div><p class="MsoNormal"><span lang="EN-US">Am 12.09.19 um 10:32 schrieb Wan Jianghua via ncl-talk:<u></u><u></u></span></p></div><blockquote style="margin-top:5pt;margin-bottom:5pt"><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">Hi all,</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">I try to print a nicely formatted text file with “write_matrix” function, but the result is not satisfactory.</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">When the absolute value of the number is less than 1, the zero before the decimal point is omitted. Is there any possible way to print it out? Thanks!</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt"> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">My test script:</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">a=new((/2,2/),float,-999.)</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">a=0.1</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">a(0,0)=-0.1</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">write_matrix(a,"2f5.2",True)</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt"> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">the result:</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-indent:18pt"><span lang="EN-US" style="font-size:12pt">-.10   .10</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-indent:18pt"><span lang="EN-US" style="font-size:12pt">.10   .10</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt"><img border="0" width="128" height="70" id="gmail-m_8319738312710511818图片_x0020_1" src="cid:16d3d0d983c4cff311"></span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt"> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">Sincerely,</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12pt">Jianghua</span></p></blockquote></div></div></blockquote></div></div></div>