title: Type-bound function overloading in Fortran 2003
body: <p>I have a Fortran derived type T that contains data arrays of (many) different ranks and types. These arrays are hidden inside a complicated data structure and I would like to have a getter function of that does the following:</p>
  
  <pre><code>a =&gt; T%get(data_id)
  </code></pre>
  
  <p>where "a" is an array pointer of given type, and data_id is an integer that is used to find the data inside the data structure. I do that by overloading many "get_thistype()" functions under a generic name.</p>
  
  <pre><code>TYPE T
     PROCEDURE :: get_real
     PROCEDURE :: get_integer
     GENERIC   :: get =&gt; get_real,get_integer
  END TYPE
  </code></pre>
  
  <p>This works if the get_thistype() routines are subroutines, but not if they are written as functions. This means my code looks like:</p>
  
  <pre><code>CALL T%get(a,data_id)
  </code></pre>
  
  <p>which I find much less readable. Is there a way to overload functions that have the same argument list but different return types? or do I have to use subroutines for that?</p>