Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| all_inst_exist=true | ||
| list_inst="" | ||
| for hr in $((end_of_day_fhr - 24)) $((end_of_day_fhr - 18)) $((end_of_day_fhr - 12)) $((end_of_day_fhr - 6)) $((end_of_day_fhr)); do | ||
| fpath="${COMIN_ATMOS_MASTER}/sfs.t${cyc}z.master.f$(printf "%03d" $hr).grib2" |
| all_inst_exist=true | ||
| list_inst="" | ||
| for hr in $((end_of_day_fhr - 24)) $((end_of_day_fhr - 18)) $((end_of_day_fhr - 12)) $((end_of_day_fhr - 6)) $((end_of_day_fhr)); do | ||
| fpath="${COMIN_ATMOS_MASTER}/sfs.t${cyc}z.master.f$(printf "%03d" $hr).grib2" |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
|
||
| if [ "$all_inst_exist" = true ]; then | ||
| raw_tmp_inst="${tmp_inst_work_dir}/day_${d}_raw.grb" | ||
| ${GMERGE} "${raw_tmp_inst}" ${list_inst} |
| mapfile -t acc_files < <(ls -v "${tmp_acc_work_dir}"/daily_acc*.grb 2>/dev/null) | ||
|
|
||
| if [ ${#acc_files[@]} -gt 0 ]; then | ||
| echo "INFO: Task $i merging ${#acc_files[@]} days for ACC using array expansion." |
| mapfile -t inst_files < <(ls -v "${tmp_inst_work_dir}"/daily_inst*.grb 2>/dev/null) | ||
|
|
||
| if [ ${#inst_files[@]} -gt 0 ]; then | ||
| echo "INFO: Task $i merging ${#inst_files[@]} days for INST using array expansion." |
|
|
||
| if [ "$all_inst_exist" = true ]; then | ||
| raw_tmp_inst="${tmp_inst_work_dir}/day_${d}_raw.grb" | ||
| ${GMERGE} "${raw_tmp_inst}" ${list_inst} |
There was a problem hiding this comment.
[shellcheck (suggestion)] reported by reviewdog 🐶
| ${GMERGE} "${raw_tmp_inst}" ${list_inst} | |
| ${GMERGE} "${raw_tmp_inst}" "${list_inst}" |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| end_of_day_fhr=$(((day_offset + d) * 24)) | ||
|
|
||
| # Skip if we exceed the total available forecast length | ||
| if [[ "$end_of_day_fhr" -gt "$lastfhr" ]]; then |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| if [[ "$end_of_day_fhr" -gt "$lastfhr" ]]; then | |
| if [[ "$end_of_day_fhr" -gt "$lastfhr" ]]; then |
| end_of_day_fhr=$(((day_offset + d) * 24)) | ||
|
|
||
| # Skip if we exceed the total available forecast length | ||
| if [[ "$end_of_day_fhr" -gt "$lastfhr" ]]; then |
| end_of_day_fhr=$(((day_offset + d) * 24)) | ||
|
|
||
| # Skip if we exceed the total available forecast length | ||
| if [[ "$end_of_day_fhr" -gt "$lastfhr" ]]; then |
| list_acc+="${fpath} " | ||
| done | ||
|
|
||
| if [[ "$all_acc_exist" = true ]]; then |
| if [[ "$end_of_day_fhr" -gt "$lastfhr" ]]; then | ||
| echo "DEBUG: Skipping Day $d because $end_of_day_fhr > $lastfhr" |
There was a problem hiding this comment.
[shellcheck (suggestion)] reported by reviewdog 🐶
| if [[ "$end_of_day_fhr" -gt "$lastfhr" ]]; then | |
| echo "DEBUG: Skipping Day $d because $end_of_day_fhr > $lastfhr" | |
| if [[ "${end_of_day_fhr}" -gt "${lastfhr}" ]]; then | |
| echo "DEBUG: Skipping Day ${d} because ${end_of_day_fhr} > ${lastfhr}" |
| list_acc+="${fpath} " | ||
| done | ||
|
|
||
| if [[ "$all_acc_exist" = true ]]; then |
There was a problem hiding this comment.
[shellcheck (suggestion)] reported by reviewdog 🐶
| if [[ "$all_acc_exist" = true ]]; then | |
| if [[ "${all_acc_exist}" = true ]]; then |
| all_inst_exist=true | ||
| list_inst="" | ||
| for hr in $((end_of_day_fhr - 24)) $((end_of_day_fhr - 18)) $((end_of_day_fhr - 12)) $((end_of_day_fhr - 6)) $((end_of_day_fhr)); do | ||
| fpath="${COMIN_ATMOS_MASTER}/sfs.t${cyc}z.master.f$(printf "%03d" $hr).grib2" |
There was a problem hiding this comment.
[shellcheck (suggestion)] reported by reviewdog 🐶
| fpath="${COMIN_ATMOS_MASTER}/sfs.t${cyc}z.master.f$(printf "%03d" $hr).grib2" | |
| fpath="${COMIN_ATMOS_MASTER}/sfs.t${cyc}z.master.f$(printf "%03d" "${hr}").grib2" |
| mapfile -t acc_files < <(ls -v "${tmp_acc_work_dir}"/daily_acc*.grb 2> /dev/null) | ||
|
|
||
| if [[ ${#acc_files[@]} -gt 0 ]]; then | ||
| echo "INFO: Task $i merging ${#acc_files[@]} days for ACC using array expansion." |
There was a problem hiding this comment.
[shellcheck (suggestion)] reported by reviewdog 🐶
| echo "INFO: Task $i merging ${#acc_files[@]} days for ACC using array expansion." | |
| echo "INFO: Task ${i} merging ${#acc_files[@]} days for ACC using array expansion." |
| mapfile -t inst_files < <(ls -v "${tmp_inst_work_dir}"/daily_inst*.grb 2> /dev/null) | ||
|
|
||
| if [[ ${#inst_files[@]} -gt 0 ]]; then | ||
| echo "INFO: Task $i merging ${#inst_files[@]} days for INST using array expansion." |
There was a problem hiding this comment.
[shellcheck (suggestion)] reported by reviewdog 🐶
| echo "INFO: Task $i merging ${#inst_files[@]} days for INST using array expansion." | |
| echo "INFO: Task ${i} merging ${#inst_files[@]} days for INST using array expansion." |
| for ((i = 0; i < exp_months; i++ )); do | ||
|
|
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| for ((i = 0; i < exp_months; i++ )); do | |
| for ((i = 0; i < exp_months; i++)); do | |
| days_left=$(( total_fcst_days - m_start_day )) | ||
|
|
||
| if [[ "${days_left}" -le 0 ]]; then break; fi # No more data |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| days_left=$(( total_fcst_days - m_start_day )) | |
| if [[ "${days_left}" -le 0 ]]; then break; fi # No more data | |
| days_left=$((total_fcst_days - m_start_day)) | |
| if [[ "${days_left}" -le 0 ]]; then break; fi # No more data |
| # 3. Dynamically count tasks and execute | ||
| if [[ -s "${cmdfile_s2}" ]]; then | ||
| n_tasks=$(wc -l < "${cmdfile_s2}") | ||
| echo "INFO: Launching Stage 2 MPMD with ${n_tasks} months." |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| echo "INFO: Launching Stage 2 MPMD with ${n_tasks} months." | |
| echo "INFO: Launching Stage 2 MPMD with ${n_tasks} months." |
| month_days_in_year=("31" "28" "31" "30" "31" "30" "31" "31" "30" "31" "30" "31") | ||
| # Leap Year Check | ||
|
|
||
| if [[ $((yy_init % 4)) -eq 0 ]] && ([[ $((yy_init % 100)) -ne 0 ]] || [[ $((yy_init % 400)) -eq 0 ]]); then |
| fi | ||
|
|
||
| cmdfile_s3="${DATA}/mpmd_s3_monthly.txt" | ||
| > "${cmdfile_s3}" |
| done | ||
|
|
||
| if [[ -s "${cmdfile_s3}" ]]; then | ||
| echo "INFO: Launching $(wc -l < ${cmdfile_s3}) monthly mean tasks in parallel." |
Description
Draft PR to show changes between dev/sfs and develop. dev/sfs is tested bi-weekly(ish) with the CI test and code standards.
Any comments in changes is appreciated with the goal of easing the merge to develop
Major GW-updates include:
Postprocessing for SFS products is dependent on #4733
Type of change
Change characteristics
How has this been tested?
CI tests run on ursa and c6
Checklist