NOAA-GFDL / fre-cli

Python-based command line interface for FRE (FMS Runtime Environment) to compile and run FMS-based models and post-process their output.
GNU Lesser General Public License v3.0
3 stars 7 forks source link

Expand experiment, platform, target in pp.yaml definitions #99

Closed ceblanton closed 1 month ago

ceblanton commented 3 months ago

Currently, we specify directories simply, e.g.

  directories:
    history_dir: "/archive/c2b/am5/2022.01/c96L65_am5f1a0r0_amip/gfdl.ncrc5-intel22-classic-prod-openmp/history"
    pp_dir: "/archive/$USER/canopy/am5/c96L65_amip/gfdl.ncrc5-deploy-prod-openmp/pp"
    ptmp_dir: "/xtmp/$USER/ptmp"
    analysis_dir: "/nbhome/$USER/canopy/analysis/am5_c96L65_amip"

Bronx FRE directories allow specification in terms of the experiment, platform, target, stem, and others: see

https://sites.google.com/noaa.gov/oar-gfdl-msd-docs/fre-documentation/fre-documentation/xml-files?authuser=0#h.mmnsmti49ogn

e.g. the above directories could be specified more generically:

<directory>
    <archive>/archive/c2b/$(stem)/$(name)/$(platform)-$(target)/history</archive>
    <postProcess>/archive/$USER/canopy/$(stem)/$(name)/($platform)-$(target)/pp</postProcess>
    <ptmp>/xtmp/$USER/ptmp</ptmp>
    <analysis>/nbhome/$USER/canopy/analysis/$(name)</analysis>
</directory>

We want a similar "FRE-defined" variable expansion capability for the pp.yamls. e.g. how about?

  directories:
    history_dir: "/archive/c2b/am5/2022.01/$(expname)/$(platform)-$(target)/history"
    pp_dir: "/archive/$USER/canopy/am5/$(expname)/$(platform)-$(target)/pp"
    ptmp_dir: "/xtmp/$USER/ptmp"
    analysis_dir: "/nbhome/$USER/canopy/analysis/$(expname)"

So that users can then use the -e/-p/-t options to fre pp configure-yaml to have the same effect, e.g.

fre pp configure-yaml --yaml=path/to/pp.yaml --experiment=c96L65_am5f1a0r0_amip --platform=gfdl.ncrc5-intel22-classic --target=prod-openmp

ceblanton commented 3 months ago

@singhd789 this is what we discussed this morning. I still think it makes sense but we may have to code it to discover if it doesn't work for some reason. Making the "stem" also be a user variable will be desired at some point, too. e.g. in the above example users will want to have "am5/2022.01" be a part of the directories.

singhd789 commented 3 months ago

Thanks for opening this up @ceblanton. I agree. I think it might work but definitely need to see it in action

singhd789 commented 2 months ago

TO-DO: update schema.json