Changes between Version 10 and Version 11 of 2011WP/2011Stream2/Dynamic Memory_improvments


Ignore:
Timestamp:
2011-03-09T17:23:45+01:00 (10 years ago)
Author:
cetlod
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • 2011WP/2011Stream2/Dynamic Memory_improvments

    v10 v11  
    5656---- 
    5757 
    58 == Portability issues:  gfortran spec == 
    59  
    60 gfortran doesn't compile when defining allocation function like this 
    61 {{{ 
    62    INTEGER FUNCTION work_alloc() 
    63       ALLOCATE( data(jpi,jpj,jpk),  STAT=work_alloc ) 
    64    END FUNCTION work_alloc 
    65 }}} 
    66  
    67 The compilation returns  "Error: STAT expression at (1) must be a variable" 
    68   
    69 A solution should be to write the function in that way 
    70 {{{ 
    71    FUNCTION work_alloc() 
    72       INTEGER :: ierr 
    73       ALLOCATE( data(jpi,jpj,jpk),  STAT=ierr ) 
    74       work_alloc = ierr 
    75    END FUNCTION work_alloc 
    76 }}} 
    7758----