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_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`. (It has also been suggested that the zero initialization of the intent(out) `values` array should be removed, even when it has halos that would not be set here. However, this was deemed beyond the scope of this bug-fix PR, so this commit was edited during merging to restore the initialization of `values` to exactly what was there on the dev/gfdl branch before this PR, leaving this particular change to be addressed with a later PR as necessary. - R. Hallberg) 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