exclude tile2pfaf nc4 file which is not a tile file#160
exclude tile2pfaf nc4 file which is not a tile file#160weiyuan-jiang wants to merge 9 commits intodevelopfrom
Conversation
|
@weiyuan-jiang : Thanks for adding this bug fix. One question: Do we also need the same protection here (for 'RESTART'==2)? GEOSldas_GridComp/GEOSldas_App/ldas.py Line 376 in 68d08a1 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.
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...") |
|
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 |
gmao-rreichle
left a comment
There was a problem hiding this comment.
@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
| break | ||
| nc4_tile = glob.glob(inpgeom_ + '*.nc4' + domain_) | ||
| nc4_tmp = glob.glob(inpgeom_ + '*.nc4' + domain_) | ||
| nc4_tile = [ item_ for item_ in nc4_tmp if 'tile2pfaf' not in item_ ] |
There was a problem hiding this comment.
@weiyuan-jiang : If we add an nc4 version of the cube-sphere-like tile file (instead of Yujin's "tile2pfaf" file, this bug fix no longer works. Probably the string 'tile2pfaf' would need to be replaced with 'Pfafstetter'.
| print("Warning: BCS_info.txt not found for restart experiment. User is responsible for ensuring consistency of restart and experiment BCS.") | ||
| elif len(BCS_txt)== 1: | ||
| BCS_tmp = parseInputFile(BCS_txt[0]) | ||
| assert self.ExeInputs['BCS_PATH'] == BCS_tmp['BCS_PATH'], "BCS_PATH does not match path from restart dir (" + BCS_tmp['BCS_PATH'] + ")" |
There was a problem hiding this comment.
@weiyuan-jiang : It's a bit more involved, but can we distinguish the VERSION from the path to the bcs? For offline simulations, the trailing dir name in the path is the bcs VERSION. It would be better to limit the check to just VERSION. This avoids triggering assert.false if the difference is only in the path (e.g., /discover/nobackup/projects vs /gpfsm/dnb05/projects.
The EASEvxx_tile2pfaf.nc4 file is placed in the folder with the nc4 tile file. It should be excluded after 'glob' to find the nc4 tile file