New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
2011WP/2011Stream2/DynamicMemory_improvments (diff) – NEMO

Changes between Version 4 and Version 5 of 2011WP/2011Stream2/DynamicMemory_improvments


Ignore:
Timestamp:
2011-03-04T12:29:15+01:00 (12 years ago)
Author:
cetlod
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 2011WP/2011Stream2/DynamicMemory_improvments

    v4 v5  
    5454}}} 
    5555 
     56---- 
     57 
     58== gfortran spec == 
     59 
     60gfortran doesn't compile when defining allocation function like this 
     61{{{ 
     62   INTEGER FUNCTION work_alloc() 
     63 
     64      ALLOCATE( data(jpi,jpj,jpk),  STAT=work_alloc ) 
     65 
     66   END FUNCTION p4z_che_alloc 
     67}}} 
     68 
     69The compilation returns this error : 
    5670  
     71A solution should be to write the function in that way 
     72{{{ 
     73   INTEGER FUNCTION work_alloc() 
     74      INTEGER :: ierr 
     75 
     76      ALLOCATE( data(jpi,jpj,jpk),  STAT=ierr ) 
     77 
     78      work_alloc = ierr 
     79 
     80   END FUNCTION p4z_che_alloc 
     81}}} 
    5782----