You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the variable SHELFMASK is not allocated, hamocc_step fails at call hamocc4bcm(..., shelfmask) as it tries to pass SHELFMASK as an argument. This fails when running in DEBUG mode.
I suggest not to pass allocatable variables as arguments. Instead, I would opt for passing this directly from the mo_read_shelfmask.F90 module.
Actually, I would prefer to only have one module shelfsea.F90 containing both the ini_read_shelfmask and the shelfsea_residence_time subroutines, and make the SHELFMASK private to this module.
The reason to separate the two routines is, is to keep the "core HAMOCC" and and the interface between the ocean model and HAMOCC separated. Reading the shelf-mask depends on the ocean model grid and has therefore to happen outside core HAMOCC.
I would suggest to just make SHELFMASK a non allocatable variable as omask. From my perspective, one could also just calculate the shelf residence time as a default and remove the logical switch (it's just a 2d field and negligible cost to calculate the residence time).
OK, I just re-arrange the ini_read_shelfmask so that the shelfmask array will be allocated before the first return statement.
TomasTorsvik
changed the title
Run with DEBUG flag fails due to unalocated SHELFMASK
Run with DEBUG flag fails due to unallocated SHELFMASK
Dec 3, 2024
If the variable SHELFMASK is not allocated,
hamocc_step
fails atcall hamocc4bcm(..., shelfmask)
as it tries to pass SHELFMASK as an argument. This fails when running in DEBUG mode.I suggest not to pass allocatable variables as arguments. Instead, I would opt for passing this directly from the
mo_read_shelfmask.F90
module.Actually, I would prefer to only have one module
shelfsea.F90
containing both theini_read_shelfmask
and theshelfsea_residence_time
subroutines, and make the SHELFMASK private to this module.@jmaerz - If you agree, I can implement this.
The text was updated successfully, but these errors were encountered: