BISMG:GCMcoupling

This is a bug that we're encountering in the coupled UM/GCL system.

This is part of a derived type definition in GLIMMER-CISM-LANL (GCL):

type(global_grid) :: g_grid     !*FD The main global grid, used for !*FD input and most outputs type(global_grid) :: g_grid_ocn !*FD Global grid used for ocean !*FD inputs type(global_grid) :: g_grid_orog !*FD Global grid used for orography output.

...define some arrays...

At run time a memory fault occurs at the following line:

if (associated(grid%lats))     deallocate(grid%lats)

It seems that grid%lats is associated but cannot be deallocated.

If we change the type definition to the following then the error does not occur:

type(global_grid) :: g_grid     !*FD The main global grid, used for !*FD input and most outputs type(global_grid) :: g_grid_orog !*FD Global grid used for orography output.

... define some arrays ...

type(global_grid) :: g_grid_ocn !*FD Global grid used for ocean !*FD inputs

We think that a part of an instance of the above derived type is being overwritten at run time, probably by code in the UM.