<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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 class="apple-converted-space">, The problem is the input data change its value.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">For example ,input data: 1,2,3,4,5<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><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
<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white"><o:p> </o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">The code is very simple
<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white"><o:p> </o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">Ncl :<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">external AWSSI "./awssi.so"<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">f=addfile("/data/cliu/noram_v04_1960_2009.grid.nc","r")<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">time= cd_calendar(f&time,0)
<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">day=time(:,2)<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">print(day) ;output is 1,2,3,4<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">AWSSI::awssi(day)<o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white"><o:p> </o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">Fortran 90:<o:p></o:p></span></span></p>
<p class="MsoNormal">SUBROUTINE awssi(day)<o:p></o:p></p>
<p class="MsoNormal">integer,intent(in) ::day(18263)<o:p></o:p></p>
<p class="MsoNormal">print*,day ;output is
<span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#333333;background:white">1103626240 1104150528 1104674816 1105199104 1105723392
</span></span><o:p></o:p></p>
<p class="MsoNormal">end<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I don’t know what happens, could you give me some advices?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best,<o:p></o:p></p>
<p class="MsoNormal">Chang<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
</div>
</body>
</html>