title: Fortran: How to pass Type variables to Subroutine
body: <p>I want to calculate a derived data type in a subroutine (or function). How would I reference the variable in the subroutine arguments?</p>
  
  <p>So far, I can achieve my objective by referencing the entire object, then referencing the variable inside the subroutine. Is there a way to reference only the variable myObj%var in the subroutine arguments?</p>
  
  <pre><code>PROGRAM test
  
      TYPE obj
          INTEGER :: var
      END TYPE obj
  
      TYPE (obj) :: myObj
      CALL set(myObj)
      PRINT*, myObj%var
  
          CONTAINS
  
      SUBROUTINE set(myObj)
          TYPE (obj) :: myObj
          myObj%var = 5
      END SUBROUTINE set
  
  END PROGRAM test
  </code></pre>