User Tools

Site Tools


dev:reference_counting

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
dev:reference_counting [2014/02/08 21:39]
oschuett remove broken links
dev:reference_counting [2014/02/08 22:47] (current)
oschuett
Line 1: Line 1:
  
-<note warning>​This text is probably out of date it need to be revised.</​note>​+<note warning>​This text is probably out of date and needs to be revised.</​note>​
  
  
Line 29: Line 29:
 ===== Sample code =====  ===== Sample code ===== 
 Some sample code to get a feeling of how it works... Some sample code to get a feeling of how it works...
-<​code>​+<​code ​Fortran>
 ! create the matrix structure ! create the matrix structure
-call cp_fmstruct_create(my_struct,​...)+  ​call cp_fmstruct_create(my_struct,​...)
  
 ! create some matrixes ! create some matrixes
-call cp_fm_create(new_matrix_1,​matrix_struct=my_struct) +  ​call cp_fm_create(new_matrix_1,​matrix_struct=my_struct) 
-call cp_fm_create(new_matrix_2,​matrix_struct=my_struct) +  call cp_fm_create(new_matrix_2,​matrix_struct=my_struct) 
-call cp_fm_create(new_matrix_3,​matrix_struct=my_struct)+  call cp_fm_create(new_matrix_3,​matrix_struct=my_struct)
  
 ! get rid of the matrix struct as we do not need it anymore ! get rid of the matrix struct as we do not need it anymore
 ! (the matrix do, but they should look after themselves) ! (the matrix do, but they should look after themselves)
-call cp_fm_release(my_struct)+  ​call cp_fm_release(my_struct)
  
 ! work with the matrices ! work with the matrices
Line 46: Line 46:
  
 ! get rid of the matrixes ! get rid of the matrixes
-call cp_fm_release(new_matrix_1) +  ​call cp_fm_release(new_matrix_1) 
-call cp_fm_release(new_matrix_2) +  call cp_fm_release(new_matrix_2) 
-call cp_fm_release(new_matrix_3) ! my_struct gets deallocated only here+  call cp_fm_release(new_matrix_3) ! my_struct gets deallocated only here
 </​code>​ </​code>​
  
-<​code>​+<​code ​Fortran>
 subroutine my_env_set_matrix(my_env,​matrix) ​ subroutine my_env_set_matrix(my_env,​matrix) ​
   type(my_env_type),​ pointer :: my_env   type(my_env_type),​ pointer :: my_env
dev/reference_counting.1391895553.txt.gz · Last modified: 2014/02/08 21:39 by oschuett