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
It seems there's a mistake in the atparse script. The issue lies in how the while loop is structured within the atparse function. Specifically, the loop termination condition [[ "$__after" == "$__text" ]] may not always work as expected, leading to premature termination of the loop and missing the last line. So the last line in the file of diag_table_aod is always missing in the finale diag_table, which results in the missing of sea salt AOD in the diagnostic output.
Steps to reproduce
In the run directory, you can see that the last line of diag_table is always missing compared to the diag_table_template
Additional information
"gfs_phys", "DU_AOD_550", "du_aod550", "fv3_history2d", "all", .false., "none", 2
"gfs_phys", "SU_AOD_550", "su_aod550", "fv3_history2d", "all", .false., "none", 2
"gfs_phys", "BC_AOD_550", "bc_aod550", "fv3_history2d", "all", .false., "none", 2
"gfs_phys", "OC_AOD_550", "oc_aod550", "fv3_history2d", "all", .false., "none", 2
"gfs_phys", "SS_AOD_550", "ss_aod550", "fv3_history2d", "all", .false., "none", 2
The last line is always missing in the diag_table
Do you have a proposed solution?
In the atparse script, I've changed the while loop condition to while IFS= read -r __text || [ -n "$__text" ], which ensures that the loop continues until the input is fully consumed, even if the last line doesn't end with a newline character. It works well to solve the issue.
The text was updated successfully, but these errors were encountered:
What is wrong?
It seems there's a mistake in the atparse script. The issue lies in how the while loop is structured within the atparse function. Specifically, the loop termination condition [[ "$__after" == "$__text" ]] may not always work as expected, leading to premature termination of the loop and missing the last line. So the last line in the file of diag_table_aod is always missing in the finale diag_table, which results in the missing of sea salt AOD in the diagnostic output.
Steps to reproduce
In the run directory, you can see that the last line of diag_table is always missing compared to the diag_table_template
Additional information
"gfs_phys", "DU_AOD_550", "du_aod550", "fv3_history2d", "all", .false., "none", 2
"gfs_phys", "SU_AOD_550", "su_aod550", "fv3_history2d", "all", .false., "none", 2
"gfs_phys", "BC_AOD_550", "bc_aod550", "fv3_history2d", "all", .false., "none", 2
"gfs_phys", "OC_AOD_550", "oc_aod550", "fv3_history2d", "all", .false., "none", 2
"gfs_phys", "SS_AOD_550", "ss_aod550", "fv3_history2d", "all", .false., "none", 2
The last line is always missing in the diag_table
Do you have a proposed solution?
In the atparse script, I've changed the while loop condition to while IFS= read -r __text || [ -n "$__text" ], which ensures that the loop continues until the input is fully consumed, even if the last line doesn't end with a newline character. It works well to solve the issue.
The text was updated successfully, but these errors were encountered: