Skip to content

revised RESTART options; fix string matching for EASE tile file #160

Merged
gmao-rreichle merged 16 commits intodevelopfrom
feature/wjiang/exclude_pfaf_nc4
Mar 20, 2026
Merged

revised RESTART options; fix string matching for EASE tile file #160
gmao-rreichle merged 16 commits intodevelopfrom
feature/wjiang/exclude_pfaf_nc4

Conversation

@weiyuan-jiang
Copy link
Contributor

@weiyuan-jiang weiyuan-jiang commented Feb 11, 2026

Revised and cleaned up GEOSldas RESTART options:

  • Clarified scope and constraints of RESTART=1 and RESTART=2.
  • For RESTART=1, the tile file and bcs files are now pulled from the GEOSldas experiment in RESTART_PATH, with a basic check for bcs consistency between the restart experiment and the new experiment.
  • Introduced RESTART=3 for restarting from restarts produced by the GCM.
  • Cleaned up stray code from RESTART=G, which had been removed some time ago.

Fixed string matching for EASE tile file to accommodate "EASE*-Pfafstetter" tile file that is added into bcs directory for the benefit of runoff routing (GEOS-ESM/GEOSgcm_GridComp#1143)

Testing:

@gmao-rreichle
Copy link
Collaborator

@weiyuan-jiang : Thanks for adding this bug fix. One question: Do we also need the same protection here (for 'RESTART'==2)?

in_tilefiles_ = glob.glob(inpdir+'/*.nc4')

It's a bit unclear to me why we handle the TILING_FILE for 'RESTART'==1 in a different place in the code from where we handle the TILING_FILE for 'RESTART'==2. In both cases, we have restart files (and thus a tiling file) from an existing GEOSldas experiment. Shouldn't the logic for obtaining the TILING_FILE (from the ./rc_out directory) be the same (or nearly the same) in both cases? (For 'RESTART'==2, I think we perface the tiling file name with 'MAPL_', but that could be done with an if-condition that applies to just the file name within the larger logic of assembling the path and deciding if we use the txt or nc4 file.

Also, I wonder if the code involved in the bug fix here also is related to the bug that Devon reported. It may make sense to fix both bugs in this PR (if Devon's problem is in fact a bug in GEOSldas setup).

Removed redundant glob call for nc4_tile.
@weiyuan-jiang weiyuan-jiang marked this pull request as ready for review February 11, 2026 19:12
@weiyuan-jiang weiyuan-jiang requested a review from a team as a code owner February 11, 2026 19:12
@weiyuan-jiang
Copy link
Contributor Author

weiyuan-jiang commented Feb 11, 2026

@weiyuan-jiang : Thanks for adding this bug fix. One question: Do we also need the same protection here (for 'RESTART'==2)?

in_tilefiles_ = glob.glob(inpdir+'/*.nc4')

It's a bit unclear to me why we handle the TILING_FILE for 'RESTART'==1 in a different place in the code from where we handle the TILING_FILE for 'RESTART'==2. In both cases, we have restart files (and thus a tiling file) from an existing GEOSldas experiment. Shouldn't the logic for obtaining the TILING_FILE (from the ./rc_out directory) be the same (or nearly the same) in both cases? (For 'RESTART'==2, I think we perface the tiling file name with 'MAPL_', but that could be done with an if-condition that applies to just the file name within the larger logic of assembling the path and deciding if we use the txt or nc4 file.

Also, I wonder if the code involved in the bug fix here also is related to the bug that Devon reported. It may make sense to fix both bugs in this PR (if Devon's problem is in fact a bug in GEOSldas setup).

This is not a bug for Devon because she did not setup run on EASE grid. I will make changes on the route PR when we need the tile2pfaf file in the rc_out directory. But I agree it is quite messy here. I will do some cleanup in the other PR

@gmao-rreichle
Copy link
Collaborator

This is not a bug for Devon because she did not setup run on EASE grid. I will make changes on the route PR when we need the tile2pfaf file in the rc_out directory. But I agree it is quite messy here. I will do some cleanup in the other PR

My comment wasn't meant to be specific to the EASE grid. I think the code in question executes independent of the grid/tile space. Is there a reason for the separation of what seems to be (nearly) the same action into a block for RESTART==1 and another block elsewhere for RESTART==2?

Re. Devon, I was just wondering if the TILING file is processed correctly. The bug fix here touches the lines that are dealing with the nc4 tiling file, and we suspected that Devon's problem may have to do with a mismatched TILING file.

In any case, the bug fix that the PR intends to fix is for EASE and touches LDAS setup. My suggestion was to add the bug fix for Devon (if there is indeed a bug) into this PR -- assuming the fix also touches LDAS setup. (We can rename the PR to something like "LDAS setup bug fixes...")

@weiyuan-jiang
Copy link
Contributor Author

In the first Restart == 1, it actually tries to figure out where are the BC files for the outputs. It there is no 'domain', all BC files are from BC. In the second Restart == 2, it gets input tile file for remapping later on

Copy link
Collaborator

@gmao-rreichle gmao-rreichle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiyuan-jiang : I added a couple of commits and the following comments. Please take a look and let me know if you see anything wrong or have any questions, thanks

@gmao-rreichle gmao-rreichle changed the title exclude tile2pfaf nc4 file which is not a tile file revised RESTART options; fix string matching for EASE tile file Mar 12, 2026
Copy link
Collaborator

@gmao-rreichle gmao-rreichle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiyuan-jiang : See comments below. After we address them, the PR would be ready for testing by @biljanaorescanin

@biljanaorescanin
Copy link
Collaborator

Testing summary:

  1. Nightly tests pass.
  2. Option RESTART2 works.
  3. Option RESTART3 works
  4. Option M doesn't work because M2 is not on archive it changed path.

@gmao-rreichle gmao-rreichle merged commit 5f9283f into develop Mar 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants