Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor of get_field_nc index fixes (#8)
This patch addresses some of the proposed changes to `get_field_nc`. * `WARNING` is removed from `use MOM_error_handler` since it is unused. * Zero initialization of `values` has been removed I find no evidence that `MOM_read_data` or its principal function call, `mpp_read`, apply any initialization to the halo data. Also, there is no reason why the user should expect a `read()`-like function to populate these fields, so this has been removed. If a field needs these initialized, then it should be done outside of the `read()` call. * Zero initialization of `values_c` by `source=` has been removed. This initialization serves no purpose, since every value will be filled by the netCDF read statement. * `values_c` indexing is now 1-based `values` has ambiguous shape, so it can follow no natural indexing. Although `values_c` always resides on the compute domain, the transfer to `values` may feel unintuitive. Allocating from the 1 index identifies this as an explicit transfer of 1-based indices. * Computation of the data domain indices were moved to the actual transfer of `values_c` to `values`. * A comment was added to explain the initial "magic value" of `unlim_index`. Stylistic changes consistent with the existing file have also been imposed: * `values_nc` renamed to `values_c` Previous suffix indicated some special netCDF property of this field, when it's just the compute subdomain of the field's values. * Comments have been truncated for readability * Column width is restricted to 80 * Composite statements (semicolons) have been removed
- Loading branch information