User Tools

Site Tools


prokop_hapala

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
prokop_hapala [2012/05/24 09:42]
prokop
prokop_hapala [2012/10/08 10:20]
prokop
Line 1: Line 1:
 +
 +=== FORTRAN HELP ===
 +Object-Oriented Programming in Fortran 2003 
 +http://​www.pgroup.com/​lit/​articles/​insider/​v3n1a3.htm
 +
 +   ​module myModule
 +    implicit none
 +    ​
 +    type myType
 +     ​integer :: n
 +     real, dimension (:, :), allocatable :: Rs 
 +    contains
 +     ​procedure :: myMethod
 +    end type subSystem
 +    ​
 +    type (myType) :: myInstance
 +    ​
 +    contains ​
 +     
 +     ​subroutine myMethod ( this, myVar)
 +      class (subSystem) :: this
 +      real :: myVar
 +      integer i
 +      allocate (this%Rs(3,​this%n))
 +      do i = 1, this%n
 +       ​this%Rs(:,​i) = myVar
 +      end do
 +     end subroutine myMethod
 +     
 +    end module glob_vars
 +    ​
 +    call myInstance%myMethod(myVar)
  
  
prokop_hapala.txt ยท Last modified: 2012/11/30 13:01 (external edit)