-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Truncation Output Issue with FMS2: Fileset Flag and Filename Handling #736
Comments
@ezhilsabareesh8 Thanks for identifying and documenting these issues. As you probably know, FMS has deprecated
So far, I think the I'm not yet sure how to address the parallel writes. APPEND_FILE should ensure that we don't lose any content, but it's obviously not producing consistent output. But maybe we can deal with this after the other two have been fixed. |
Thanks @marshallward for the response and confirming the issue.
This could be happening because when the
However, when I switched to a fixed-length filename (with trimming in the inquire and open calls), this error stopped occurring. This might suggest that the allocatable version was having trouble handling longer filenames, especially when each rank writes a separate file.
I haven't tested after fixing the file unit and setting I suspect the problem with
Passing To append to the file, we may need to use the |
IMO the best solution for the moment is to fix the I believe that the Also note that The more challenging question is whether to produce a coherent single file, or to juggle multiple per-rank files. Truncations are currently written as they happen, which avoids any buffering. But it also causes the concurrency issues described above. But I also think it's not an urgent problem and can be sorted out later. |
PR #739 addresses the |
PR #739 did not fix this issue for CESM3. We are using a customized version based on FMS2. cc'ing @alperaltuntas, @mnlevy1981 |
Please disregard my previous comment. I made a mistake when evaluating PR #739. It does resolve the issue with writing accelerations that lead to velocity truncations in CESM3. |
In the current version of MOM6 with FMS2, truncation outputs are not correctly produced when the
fileset
flag is set toSINGLE_FILE
. This is due to the following:Fileset Flag Behavior: The
mpp_open
routine is no longer used in FMS2 (reference). When writing to an ASCII file, the default FORTRANopen
routine is used. InMOM_PointAccel.F90
, truncation outputs are being overwritten when the fileset flag isSINGLE_FILE
, leading to an empty truncation output. The relevant code is here and here:Setting
fileset=MULTIPLE
resolves the issue, but it opens multiple files with processor-specific filenames (e.g., V_velocity_truncations.1072).Also the file handle check here and here needs to be updated to
if (CS%v_file == -1)
sinceopen(newunit=...)
always returns negative file handles.Filename Handling in
MOM_io_infra.F90
: The declaration of the filename variable inopen_ASCII_file
crashes due to memory handling here. Changing filename to a fixed length of 50 or higher characters prevents the crash. The modifications are:and updating the
inquire
andopen
statements to usetrim(filename)
here and here.These changes resolves issues with file handling across multiple processors.
The text was updated successfully, but these errors were encountered: