Skip to content

Generalize the mosiac file name that chgres_cube can read in.#15

Merged
LarissaReames merged 1 commit into
LarissaReames:feature/regional_releasefrom
gsketefian:feature/mosaic_fn
Sep 10, 2020
Merged

Generalize the mosiac file name that chgres_cube can read in.#15
LarissaReames merged 1 commit into
LarissaReames:feature/regional_releasefrom
gsketefian:feature/mosaic_fn

Conversation

@gsketefian

Copy link
Copy Markdown

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.

…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.
@JeffBeck-NOAA

Copy link
Copy Markdown

Hey @gsketefian, what does the "- 1" do at the end of the line you changed?

@gsketefian

Copy link
Copy Markdown
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 ".").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants