Generalize the mosiac file name that chgres_cube can read in.#15
Merged
LarissaReames merged 1 commit intoSep 10, 2020
Merged
Conversation
…t just an underscore) as the separator between the $CRES and the string "mosaic". In particular, for consistency with the naming convention that the sfc_climo_gen code uses for the climatology files, this allows the use of a "." instead of a "_" as the separator. For example, can use C768.mosaic.halo4.nc instead of C768_mosaic.halo4.nc.
|
Hey @gsketefian, what does the "- 1" do at the end of the line you changed? |
Author
|
@JeffBeck-NOAA It sets ie to the index of the character immediately before the "m" in "mosaic" in the file name. That's what the original line does, but I have to put in the -1 in order to make up for the fact that I removed the underscore from "_mosaic" in the original line (in order to allow the character before the "m" to be anything, e.g. a "."). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows chgres_cube to read in a mosaic file with a name that has any separator character (not just an underscore) between the starting $CRES and the string "mosaic" that follows $CRES. For example, this will allow the mosaic file to be named C768.mosaic.halo4.nc instead of C768_mosaic.halo4.nc (note the "." instead of the "_" after "C768").
This is to allow the regional_workflow to use fixed file names for the grid and orography files that have the same naming convention as the fixed surface climo files that the sfc_climo_gen code generates. That convention is to use a "." between the $CRES and the string "mosaic" instead of an underscore.
This was tested in the regional_workflow and works both for the case of an "_" and a "." as the separator character in the mosaic file name.