MOM6
MOM6 copied to clipboard
MOM_shared_initialization.F90: Unintended land mask changes with use of TOPO_EDITS_FILE, positive MASKING_DEPTH value and shallower depth edits
This bug triggered through use of the TOPO_EDITS_FILE
feature. A positive MASKING_DEPTH
with shallower depth edits will cause unintended land mask changes.
if (new_depth(n)/=0.) then
write(stdout,'(a,3i5,f8.2,a,f8.2,2i4)') &
'Ocean topography edit: ', n, ig(n), jg(n), D(i,j)/m_to_Z, '->', abs(new_depth(n)), i, j
D(i,j) = abs(m_to_Z*new_depth(n)) ! Allows for height-file edits (i.e. converts negatives)
else
if (topo_edits_change_mask) then
write(stdout,'(a,3i5,f8.2,a,f8.2,2i4)') &
'Ocean topography edit: ',n,ig(n),jg(n),D(i,j)/m_to_Z,'->',abs(new_depth(n)),i,j
D(i,j) = abs(m_to_Z*new_depth(n)) ! Allows for height-file edits (i.e. converts negatives)
else
call MOM_error(FATAL, ' apply_topography_edits_from_file: '//&
"A zero depth edit would change the land mask and is not allowed in"//trim(topo_edits_file))
endif