-
Notifications
You must be signed in to change notification settings - Fork 15
Enable land only ilamb and global time-series (for J case spin up) #765
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
Changes from all commits
1eb3e8e
e220cdc
1198b06
3826427
2d45316
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,25 @@ results_dir_absolute_path={{ scriptDir }}/${results_dir} | |
| ################################################################################ | ||
| case={{ case }} | ||
| www={{ www }} | ||
| case_dir={{ output }} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this makes sense because we had |
||
|
|
||
| # Copy ocean results to case directory | ||
| echo | ||
| echo ===== COPY OCEAN RESULTS TO CASE DIRECTORY ===== | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Part 1 of fix for "For global time-series tasks: copy ocean results to case_dir and clean up results dir"
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As described in the "Path explanation, part 1:" comment, both of these paths are actually in |
||
| echo | ||
|
|
||
| if [ -d "${results_dir_absolute_path}/ocn" ]; then | ||
| mkdir -p ${case_dir}/post/ocn | ||
| rsync -av ${results_dir_absolute_path}/ocn/ ${case_dir}/post/ocn/ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path explanation, part 1: So, So, we're syncing |
||
| if [ $? != 0 ]; then | ||
| cd {{ scriptDir }} | ||
| echo 'ERROR (6)' > {{ prefix }}.status | ||
| exit 6 | ||
| fi | ||
| echo "Ocean results copied to ${case_dir}/post/ocn/" | ||
| else | ||
| echo "No ocean results directory found at ${results_dir_absolute_path}/ocn" | ||
| fi | ||
|
|
||
| # Copy output to web server | ||
| echo | ||
|
|
@@ -49,8 +68,8 @@ do | |
| done | ||
| {% endif %} | ||
|
|
||
| # Copy files | ||
| rsync -a --delete ${results_dir_absolute_path} ${top_level} | ||
| # Copy files (excluding ocn directory) | ||
| rsync -a --delete --exclude='ocn' ${results_dir_absolute_path} ${top_level} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path explanation, part 2: So, we're syncing Furthermore, the |
||
| if [ $? != 0 ]; then | ||
| cd {{ scriptDir }} | ||
| echo 'ERROR (8)' > {{ prefix }}.status | ||
|
|
@@ -72,6 +91,17 @@ chmod -R go+rX,go-w ${results_dir} | |
| popd | ||
| {% endif %} | ||
|
|
||
| # Clean up temporary results directory | ||
| echo | ||
| echo ===== CLEANUP TEMPORARY RESULTS DIRECTORY ===== | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Part 2 of fix for "For global time-series tasks: copy ocean results to case_dir and clean up results dir" |
||
| echo | ||
| rm -rf ${results_dir_absolute_path} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path explanation, part 3: We can now remove Putting all that together we get: |
||
| if [ $? = 0 ]; then | ||
| echo "Successfully cleaned up ${results_dir_absolute_path}" | ||
| else | ||
| echo "Warning: Failed to clean up ${results_dir_absolute_path}" | ||
| fi | ||
|
|
||
| ################################################################################ | ||
| # Update status file and exit | ||
| {% raw %} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,9 @@ echo | |
| # Create output directory | ||
| # Create local links to input cmip time-series files | ||
| lnd_ts_for_ilamb={{ output }}/post/lnd/{{ ts_land_grid }}/cmip_ts/monthly/ | ||
| {% if not land_only %} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Part 1 of fix for "Enable land only ilamb when no atm data present." |
||
| atm_ts_for_ilamb={{ output }}/post/atm/{{ ts_atm_grid }}/cmip_ts/monthly/ | ||
| {% endif %} | ||
| # Go through the time series files for between year1 and year2, | ||
| # using a step size equal to the number of years per time series file | ||
| start_year=$(echo $Y1 | sed 's/^0*//') | ||
|
|
@@ -56,12 +58,14 @@ do | |
| echo 'ERROR (1)' > {{ prefix }}.status | ||
| exit 1 | ||
| fi | ||
| {% if not land_only %} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Part 2 of fix for "Enable land only ilamb when no atm data present." |
||
| cp -s ${atm_ts_for_ilamb}/*_*_*_*_*_*_${start_year}??-${end_year}??.nc . | ||
| if [ $? != 0 ]; then | ||
| cd {{ scriptDir }} | ||
| echo 'ERROR (2)' > {{ prefix }}.status | ||
| exit 2 | ||
| fi | ||
| {% endif %} | ||
| done | ||
| cd ../.. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -220,6 +220,7 @@ def set_component_and_prc_typ(c: Dict[str, Any]) -> None: | |
| prc_typ = tmp | ||
| elif tmp in ("mosart",): | ||
| component = "rof" | ||
| prc_typ = tmp | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Fix for "Fix a bug in climo task for enabling generating mosart climatology using ncclimo." |
||
| else: | ||
| raise ValueError( | ||
| f"Cannot extract output component name from {c['input_component']} or {c['input_files']}." | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Fix for "Enable global time-series when no atm data present."