<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Type mismatch in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882168#M75591</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/425507"&gt;Alessandro&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hi,&lt;BR /&gt;I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:&lt;BR /&gt;&lt;BR /&gt;complex(kind=kvar) G_fft&lt;BR /&gt;...&lt;BR /&gt;if (kvar.eq.dbl) then&lt;BR /&gt; ! do nothing&lt;BR /&gt;elseif (kvar.eq.sgl) then&lt;BR /&gt; call transfer_c(G_fft,dv_Gfft,.true.)&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;When I try to compile it with kvar set to dbl it gives me the following error:&lt;BR /&gt;&lt;BR /&gt;Error	1	 error #6633: The type of the actual argument differs from the type of the dummy argument.   [G_FFT]	E:CodiceIterSolver_v14x1MGM.F90	902	&lt;BR /&gt;&lt;BR /&gt;Is there anything I can do? &lt;BR /&gt;&lt;BR /&gt;Alessandro&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
I dont know what transfer_c does but if it similar to the Fortran transfer function then it would not be suitable. Why not try: dv_Gfft = G_fft&lt;BR /&gt;</description>
    <pubDate>Fri, 12 Jun 2009 12:23:13 GMT</pubDate>
    <dc:creator>Andrew_Smith</dc:creator>
    <dc:date>2009-06-12T12:23:13Z</dc:date>
    <item>
      <title>Type mismatch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882167#M75590</link>
      <description>Hi,&lt;BR /&gt;I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:&lt;BR /&gt;&lt;BR /&gt;complex(kind=kvar) G_fft&lt;BR /&gt;...&lt;BR /&gt;if (kvar.eq.dbl) then&lt;BR /&gt; ! do nothing&lt;BR /&gt;elseif (kvar.eq.sgl) then&lt;BR /&gt; call transfer_c(G_fft,dv_Gfft,.true.)&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;When I try to compile it with kvar set to dbl it gives me the following error:&lt;BR /&gt;&lt;BR /&gt;Error	1	 error #6633: The type of the actual argument differs from the type of the dummy argument.   [G_FFT]	E:\Codice\IterSolver_v14x1\MGM.F90	902	&lt;BR /&gt;&lt;BR /&gt;Is there anything I can do? &lt;BR /&gt;&lt;BR /&gt;Alessandro&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jun 2009 11:14:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882167#M75590</guid>
      <dc:creator>Alessandro</dc:creator>
      <dc:date>2009-06-12T11:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Type mismatch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882168#M75591</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/425507"&gt;Alessandro&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hi,&lt;BR /&gt;I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:&lt;BR /&gt;&lt;BR /&gt;complex(kind=kvar) G_fft&lt;BR /&gt;...&lt;BR /&gt;if (kvar.eq.dbl) then&lt;BR /&gt; ! do nothing&lt;BR /&gt;elseif (kvar.eq.sgl) then&lt;BR /&gt; call transfer_c(G_fft,dv_Gfft,.true.)&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;When I try to compile it with kvar set to dbl it gives me the following error:&lt;BR /&gt;&lt;BR /&gt;Error	1	 error #6633: The type of the actual argument differs from the type of the dummy argument.   [G_FFT]	E:CodiceIterSolver_v14x1MGM.F90	902	&lt;BR /&gt;&lt;BR /&gt;Is there anything I can do? &lt;BR /&gt;&lt;BR /&gt;Alessandro&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
I dont know what transfer_c does but if it similar to the Fortran transfer function then it would not be suitable. Why not try: dv_Gfft = G_fft&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jun 2009 12:23:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882168#M75591</guid>
      <dc:creator>Andrew_Smith</dc:creator>
      <dc:date>2009-06-12T12:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Type mismatch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882169#M75592</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/99034"&gt;Andrew Smith&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
I dont know what transfer_c does but if it similar to the Fortran transfer function then it would not be suitable. Why not try: dv_Gfft = G_fft&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;It's a wrapper for CUDA, dv_Gfft is more like a struct, and transfer_c deals with the transfer of the data into the variable of the device. &lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jun 2009 13:12:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882169#M75592</guid>
      <dc:creator>Alessandro</dc:creator>
      <dc:date>2009-06-12T13:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Type mismatch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882170#M75593</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/425507"&gt;Alessandro&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;It's a wrapper for CUDA, dv_Gfft is more like a struct, and transfer_c deals with the transfer of the data into the variable of the device. &lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Then it seems you should make your own function to copy from your version of the struct with non-compliant types to the one required by CUDA. If you were using C, you could depend on prototypes to make implicit conversions of simple variables, but not for a struct.&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jun 2009 13:18:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882170#M75593</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-06-12T13:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Type mismatch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882171#M75594</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;If I understand you correctly, the code compiles if kvar ist set to sgl. As the value of kvar has to be known at compile time anyway, the simplest solution seems to be to use conditional compilation:&lt;BR /&gt;&lt;BR /&gt;#ifdef SGLPREC&lt;BR /&gt; call transfer_c(G_fft,dv_Gfft,.true.)&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;You could define your parameter kvar like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
#ifdef SGLPREC&lt;BR /&gt; integer, parameter :: kvar = sgl&lt;BR /&gt;#else&lt;BR /&gt; integer, parameter :: kvar = dbl&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;To compile the program with single precision:&lt;BR /&gt; ifort -fpp -DSGLPREC [...]&lt;BR /&gt;and with double precision:&lt;BR /&gt; ifort -fpp [...]&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jun 2009 14:35:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Type-mismatch/m-p/882171#M75594</guid>
      <dc:creator>tom_p</dc:creator>
      <dc:date>2009-06-12T14:35:04Z</dc:date>
    </item>
  </channel>
</rss>

