Bug: segmentation fault with 4D sea ice outputs

,

Requesting either or both of the following outputs causes an otherwise functional configuration to crash with a seg. fault:

  • icesalt_lay
  • icetemp_lay

These are in the field group SBC_4D in field_def_nemo-ice.xml. They are functions of ice thickness category and layer (i.e., 4D fields; not counting time). I am using ORCA2_ICE-based configurations, but I doubt this matters.

I guess this is something to do with subroutine iom_duplicate_grid in src/IOM/iom.F90, called from iom_init in the same module, when the input cdaxe is present and/or contains more than one new axis, but not sure. There is no specific error pointing towards those routines, but I am working on a development branch that adds a new 4D group in a similar way and I get the same problem with my new outputs. This also happens in a release branch without modification (5.0.2; #dcc7fb8c).

There seems to be no point pasting the error messages as it’s just random memory addresses. Deactivating those 4D outputs makes this go away and the simulation runs as expected.

Resolved by #3435df95 (main) / #e3251b31 (branch_5.0). Thanks!