Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cbp helper function and hspf_config #69

Open
rburghol opened this issue Jul 11, 2022 · 0 comments
Open

cbp helper function and hspf_config #69

rburghol opened this issue Jul 11, 2022 · 0 comments

Comments

@rburghol
Copy link
Collaborator

rburghol commented Jul 11, 2022

This function is used to eliminate the necessity of changing directories into various script sub-folders when running any operation in the CBP model suite, for Phase 5.3.2 and Phase 6. The first thing this function does is to load the hspf_config script, to load path variables to search for code and data directories, based on your current directory when you call the cbp script.

hspf_config Basic Algorithm:

  • The . hspf_config function looks for a file named "hspf.config" in the current directory, and if it does not find it, begins to move up the current directory path until it finds hspf.config. If it reaches the root directory "/" without finding hspf.config it then loads the system default config file located in /etc/hspf.config.
  • The variables that are defiend in hspf.config are then exported to any subsequent script that is called, so common locations are available to any programs that are executed from your command, which helps all scripts know where critical data, executables and libraries are.

cbp basic algorithm:

  • Search the various known script directories in the tree defined by CBP_ROOT (loaded by hspf.config) for the script name indicated in the 1st argument to the cbp script.
  • Change to the directory of the first matching file found. Note: the cbp script searches directories in a specific order intended to get the best match in the case of duplicate script names.
  • Execute the script.
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

No branches or pull requests

1 participant