-
Notifications
You must be signed in to change notification settings - Fork 17
Add "dash" options to the bash scripts, and some additional refactoring #12
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
Open
mpaiao
wants to merge
11
commits into
monanadmin:main
Choose a base branch
from
mpaiao:use_dash-options
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…to specify which settings to use (resolution, input). This provides a more intuitive (albeit more verbose) method to configure the runs. Script 0.run_all.bash was rewritten such that all settings can go through it, and a new "step" argument can be passed to specify which step to run (as opposed to commenting or uncommenting each step).
… to increase the visibility of variable VARTABLE.
…alculation to refer to OUTPUT_DIAG_INTERVAL 2. A few minor typo fixes that I had inadvertently introduced in the helper function as I was deciding which flags to use. I also removed some forgotten references to OUTPUT_DIAG_INT, which I had originally used by replaced with OUTPUT_DIAG_INTERVAL for clarity.
…setting the input path for data in setenv.bash. If "-i" is not provided, the default path is used.
…ng properly retrieved.
…(with dash) to avoid hardcoded variables (especially VARTABLE and OUTPUT_DIAG_INTERVAL). 2. Fixed some of the code in 4.run_post.bash, which was still assuming results every 3 hours. 3. Renamed NLEV in the post-processing to avoid ambiguities 4. Fixed inconsistent configurations for grid resolutions.
…tput/log files from the path. It is not a complete reset because it does not revert files in the scripts directory.
…he output to a regular longitude/latitude grid. It now accounts for the number of grid cells and the average resolution across the Earth's surface (4*pi steradians).
Author
|
I tested these updates quite a bit, and I think these are good for review. |
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.
Multiple edits to the CD-CT scripts, mostly minor.
scripts_CD-CT/scriptsnow use dash-based flags to specify the settings. For example, when the previous configuration for script3.run_model.bashused to be:./3.run_model.bash GFS 1024002 2024010100 48./3.run_model.bash -e GFS -r 1024002 -i 2024010100 -f 48 [...]The main advantage of the proposed is that it is more transparent, and also does not require any specific order for the arguments.
-d OUTPUT_DIAG_INTERVAL: this specifies how frequently output variables should be generated.-i INPUT_PATH: if provided, this replaces the default input data path with specific paths insetenv.bash. This can be useful when testing new datasets.-l NLEV: the number of vertical levels-v VARTABLE: if provided, the suffix for specific variable tables (e.g., OPER, GFS)-z: this deletes all paths containing compiled code and output paths (sources,execs,datain,dataoutandrun.*)Script
0.run_all.bashwas rewritten such that all settings can be specified by editing the beginning of the script (as it used to be), or through the dash-based flags. This is the only script that has default settings. In addition, a new flag step (-s [0-4]) can be used to specify which step to run. Options are 1-4 for the numbered scripts, and 0 to run all steps. This change eliminates the need for commenting/uncommenting steps. Ultimately, the idea is for most users to call0.run_all.bashonly and use the step argument to control the steps, and let0.run_all.bashparse arguments to the other numbered scripts.Script
2.pre_processing.bashnow accepts an optionial flag for overwriting the static file (-o). If this flag is provided, the step will generate the static file again even if the file already exists. This option is relevant for when testing MONAN developments that change the contents of the static file (e.g., soil colour maps).All scripts were revised so all the standard resolutions (10, 15, 24, 120 km) were consistent and supported in all steps. In addition, the number of grid cells when reprojecting MONAN's output to regular longitude/latitude grids was slightly revised in scripts
4.run_post.bashandmake_template.bash. The original calculation assumed 1 degree ~ 100 km, which makes the reprojected grid a bit coarser than it needs to be. The new calculation uses the Earth's total surface area and the number of grid cells as follows: