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
This issue is directly related to @timothyas 's PR #359, but I though it would make it easier to reference in a specific issue.
One thing to clarify regarding global-file sections:
Because of the shape of MITgcm slice arrays (i/j,k,bi,bj), there is no issue to read-in global-files into this tiled array: for a slice along X-dir, all bj tiles will get a copy of the value contained in the file.
However, when writing to a global-file, the "bj" dimension (i.e., nSy) needs to collapse or, more precisely, we need to select which "bj" tile holds the correct value to write to the global-file.
This is all taken care of in PR #359, assuming any section is related to an OB section. And this is the reason for adding the argument "slice" to most of the section/slice I/O routines in pkg/mdsio and pkg/rw (and updating the calls).
We could consider an alternative interface:
Keep PR 359 changes in mdsio_read_section.F and mdsio_write_section.F, with additional arguments to these routines to be able to write OB sections to global-files. But also recognize the "empty" slice argument to default back to current tiled files for sections.
Keep the argument list of current pkg/rw section routines unchanged, meaning they will still be able to write only tiled files for sections. But for the general case of a section that is not necessary related to OB this is all what can be done without knowing which section it is.
Add new interface S/R in pkg/rw to deal with section I/O associated with OB section, similar to [READ/WRITE]REC[X/Y]Z_R[L/S] but with additional argument "slice".
My suggestion would be to put these new pkg/rw S/R in 2 new files (since read_rec.F and write_rec.F are already long enough): read_obsec.F and write_obsec.F, each containing 4 S/R: READ_OBSEC_[X/Y]XZ_R[L/S] and WRITE_OBSEC_[X/Y]Z_R[L/S].
The advantage of this alternative interface:
We keep the original interface (i.e., argument list) of current pkg/rw routines, so there is not need to change all the calls right away (e.g., adding the 2 arguments "kLo,kLi" to pkg/mdsio section S/R in PR Update mdsio slice I/O routines #747 only requires modifying 7 files); could pick the most relevant first (e.g., for OBCS pickup files, which are tested when running restart test do_tst_2+2); and once we know it's working well we could make changes (the best would be in a dedicated PR) to S/R calls in the rest of the code.
This does not break user customized code that relies on pkg/rw I/O routines.
If, in the future, a new type of section is introduced (e.g., for diagnostics) that is not related to OB, the old pkg/rw I/O routine could still be used but only to write tiled files.
And writing these new sections to global-file would require providing more informations and changes to mdsio_read_section.F and mdsio_write_section.F.
The text was updated successfully, but these errors were encountered:
This issue is directly related to @timothyas 's PR #359, but I though it would make it easier to reference in a specific issue.
One thing to clarify regarding global-file sections:
Because of the shape of MITgcm slice arrays
(i/j,k,bi,bj)
, there is no issue to read-in global-files into this tiled array: for a slice along X-dir, allbj
tiles will get a copy of the value contained in the file.However, when writing to a global-file, the "bj" dimension (i.e.,
nSy
) needs to collapse or, more precisely, we need to select which "bj" tile holds the correct value to write to the global-file.This is all taken care of in PR #359, assuming any section is related to an OB section. And this is the reason for adding the argument "slice" to most of the section/slice I/O routines in
pkg/mdsio
andpkg/rw
(and updating the calls).We could consider an alternative interface:
mdsio_read_section.F
andmdsio_write_section.F
, with additional arguments to these routines to be able to write OB sections to global-files. But also recognize the "empty" slice argument to default back to current tiled files for sections.pkg/rw
section routines unchanged, meaning they will still be able to write only tiled files for sections. But for the general case of a section that is not necessary related to OB this is all what can be done without knowing which section it is.pkg/rw
to deal with section I/O associated with OB section, similar to [READ/WRITE]REC[X/Y]Z_R[L/S] but with additional argument "slice".My suggestion would be to put these new
pkg/rw
S/R in 2 new files (sinceread_rec.F
andwrite_rec.F
are already long enough):read_obsec.F
andwrite_obsec.F
, each containing 4 S/R: READ_OBSEC_[X/Y]XZ_R[L/S] and WRITE_OBSEC_[X/Y]Z_R[L/S].The advantage of this alternative interface:
pkg/rw
routines, so there is not need to change all the calls right away (e.g., adding the 2 arguments "kLo,kLi" topkg/mdsio
section S/R in PR Update mdsio slice I/O routines #747 only requires modifying 7 files); could pick the most relevant first (e.g., for OBCS pickup files, which are tested when running restart testdo_tst_2+2
); and once we know it's working well we could make changes (the best would be in a dedicated PR) to S/R calls in the rest of the code.pkg/rw
I/O routines.pkg/rw
I/O routine could still be used but only to write tiled files.And writing these new sections to global-file would require providing more informations and changes to
mdsio_read_section.F
andmdsio_write_section.F
.The text was updated successfully, but these errors were encountered: