<div dir="ltr"><div><div><div><div>As noted in the documentation, NCL's WRAPIT <br><br>[1] <br>recognizes *only* f77 syntax. The fortran syntax parser used by NCL's WRAPIT was created before the f90 standard was created.<br>.<br></div>[2] <br>f90 files require a 'stub' file which uses f77 syntax to define the variables being passed back-and-forrth.<br><br>===<br></div>See Attached<br><br></div>%> WRAPIT ChangLiu.stub ChangLiu.f90<br></div>%> ncl tst_WRPAIT.ChangLiu.ncl<br><div><div><div><br><br><br>Variable: day<br>Type: integer<br>Total Size: 16 bytes<br> 4 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [4]<br>Coordinates: <br>Number Of Attributes: 1<br> _FillValue : -999<br>(0) 1<br>(1) 2<br>(2) 3<br>(3) 4<br><br> 1 2 3 4<br>(0) ======================<br> 1 2 3 4<br> 1 4 9 16<br>(0) ======================<br><br><br><br><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 11, 2016 at 8:08 PM, Chang Liu <span dir="ltr"><<a href="mailto:changliu@uark.edu" target="_blank">changliu@uark.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="#0563C1" vlink="#954F72" lang="EN-US">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I try to use WRAPIT to call <span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">
a Fortran function<span>, The problem is the input data change its value.<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">For example ,input data: 1,2,3,4,5<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">But when use it in the Fortran ,the value is 1103626240 1104150528 1104674816 1105199104 1105723392
<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white"><u></u> <u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">The code is very simple
<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white"><u></u> <u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">Ncl :<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl"<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">external AWSSI "./awssi.so"<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">f=addfile("/data/cliu/<a href="http://noram_v04_1960_2009.grid.nc" target="_blank">noram_<wbr>v04_1960_2009.grid.nc</a>","r")<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">time= cd_calendar(f&time,0)
<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">day=time(:,2)<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">print(day) <wbr> ;output is 1,2,3,4<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">AWSSI::awssi(day)<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white"><u></u> <u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">Fortran 90:<u></u><u></u></span></span></p>
<p class="MsoNormal">SUBROUTINE awssi(day)<u></u><u></u></p>
<p class="MsoNormal">integer,intent(in) ::day(18263)<u></u><u></u></p>
<p class="MsoNormal">print*,day <wbr> ;output is
<span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">1103626240 1104150528 1104674816 1105199104 1105723392
</span></span><u></u><u></u></p>
<p class="MsoNormal">end<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I don’t know what happens, could you give me some advices?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Best,<u></u><u></u></p>
<p class="MsoNormal">Chang<u></u><u></u></p>
<p class="MsoNormal"><u></u><u></u></p>
</div>
</div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>