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/10/08 10:16]
prokop
prokop_hapala [2012/10/08 10:20]
prokop
Line 4: Line 4:
 http://​www.pgroup.com/​lit/​articles/​insider/​v3n1a3.htm http://​www.pgroup.com/​lit/​articles/​insider/​v3n1a3.htm
  
-[code] +   module myModule 
-module myModule +    implicit none 
-implicit none +     
-type myType +    ​type myType 
-integer :: n  +     ​integer :: n  
-real, dimension (:, :), allocatable :: Rs  +     ​real, dimension (:, :), allocatable :: Rs  
-contains +    contains 
-procedure :: myMethod +     ​procedure :: myMethod 
-end type subSystem +    end type subSystem 
-type (myType) :: myInstance +     
-contains  +    ​type (myType) :: myInstance 
- ​subroutine myMethod ( this, myVar) +     
-  class (subSystem) :: this +    ​contains  
-  real :: myVar +      
-  integer i +     subroutine myMethod ( this, myVar) 
- ​allocate (this%Rs(3,​this%n)) +      class (subSystem) :: this 
-  do i = 1, this%n +      real :: myVar 
-   ​this%Rs(:,​i) = myVar +      integer i 
-  end do +      allocate (this%Rs(3,​this%n)) 
- end subroutine myMethod +      do i = 1, this%n 
-end module glob_vars +       ​this%Rs(:,​i) = myVar 
-call myInstance%myMethod(myVar) +      end do 
-[code] +     ​end subroutine myMethod 
 +      
 +    ​end module glob_vars 
 +     
 +    ​call myInstance%myMethod(myVar)
  
  
prokop_hapala.txt · Last modified: 2012/11/30 13:01 (external edit)