Hello, This is my second patch for GFortran. This patch adds a linked list to keep track of the allocated memory of all static coarrays and ensures that at the end of the program the memory is freed. Additionally, I use MPI_Allgather in mpi.c to ensure that all images know the address of the stored memory in the other images. This will be needed when the images start sending data to each other. There is no test case attached because there is no way to automatically test for allocated memory. Here is my ChangeLog to go into libgfortran/ChangeLog: 2011-06-16 Daniel Carrera * caf/single.c (_gfortran_caf_register): Store the address of all static coarrays in a linked list. (_gfortran_caf_finalize): Free memory of staic coarrays. * caf/mpi.c (_gfortran_caf_register): Store the address of all static coarrays in a linked list. Initialize MPI if necessary. (_gfortran_caf_finalize): Free memory of staic coarrays. (_gfortran_caf_init): Check if MPI is already initialized before initializing again. * caf/libcaf.h: Add a type to caf_register_t to distinguish static coarrays and add the type caf_static_t to make the linked list of static coarrays. Cheers, Daniel. -- I'm not overweight, I'm undertall.