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
output_files are based on template_files, not old_files, and then filled in with data from old_files only for fields of shape (1, 75, 2700, 3600), so there are many fields it should fix but doesn't, e.g.
eta_t with shape (1, 2700, 3600)
t_surf with shape (1, 2700, 3600)
advectionu with shape (2, 75, 2700, 3600)
dswt with shape (1, 76, 2700, 3600)
etc
Since output_files are based on template_files these variables would then contain values from template_files, not old_files, and so would be inconsistent with fields with shape (1, 75, 2700, 3600) that were replaced with values from old_files.
something like out_fp.variables[var][..., level, :, :] = out_data needs to be added to actually write the changes to the file.
I've made a variant of this script called fix_ocean_restarts_cpumask.py which could be used as a starting point, but is designed for cpu mask changes rather than topography changes. fix_ocean_restarts_cpumask.py has different logic:
output_files is based on old_files, not template_files
all >1-d fields are processed
replaces output_files cpu mask with that from template_files
replaces newly-unmasked values with values from template_files (this should be fine, since we assume the topography has not changed so the newly-unmasked values will still be in the land mask)
leaves old_files data intact everywhere else in output_files
Something different will be needed for fix_ocean_restarts.py, since this is for topography changes rather than cpu mask changes. I think what we want here is to locate the points that are wet with the new bathymetry but were dry with the old one, and replace their values with a nearest-neighbour horizontal extrapolation from old_files, like what we do with initial conditions.
The text was updated successfully, but these errors were encountered:
There are some bugs in fix_ocean_restarts.py:
output_files
are based ontemplate_files
, notold_files
, and then filled in with data fromold_files
only for fields of shape (1, 75, 2700, 3600), so there are many fields it should fix but doesn't, e.g.Since
output_files
are based ontemplate_files
these variables would then contain values fromtemplate_files
, notold_files
, and so would be inconsistent with fields with shape (1, 75, 2700, 3600) that were replaced with values fromold_files
.out_fp.variables[var][..., level, :, :] = out_data
needs to be added to actually write the changes to the file.I've made a variant of this script called fix_ocean_restarts_cpumask.py which could be used as a starting point, but is designed for cpu mask changes rather than topography changes.
fix_ocean_restarts_cpumask.py
has different logic:output_files
is based onold_files
, nottemplate_files
output_files
cpu mask with that fromtemplate_files
template_files
(this should be fine, since we assume the topography has not changed so the newly-unmasked values will still be in the land mask)old_files
data intact everywhere else inoutput_files
Something different will be needed for
fix_ocean_restarts.py
, since this is for topography changes rather than cpu mask changes. I think what we want here is to locate the points that are wet with the new bathymetry but were dry with the old one, and replace their values with a nearest-neighbour horizontal extrapolation fromold_files
, like what we do with initial conditions.The text was updated successfully, but these errors were encountered: