Add python version of mkatmsrffile to replace fortran #2
Workflow file for this run
This file contains 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
name: mkatmsrffile | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
paths: | |
- 'components/eam/tools/mkatmsrffile/mkatmsrffile.py' | |
schedule: | |
- cron: '00 15 * * 2' | |
workflow_dispatch: | |
jobs: | |
mkatmsrffile-test: | |
runs-on: ubuntu-latest | |
outputs: | |
event_name: ${{ github.event_name }} | |
steps: | |
- | |
name: Repository checkout | |
uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
submodules: false | |
- | |
name: Conda setup | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: 3.12 | |
auto-activate-base: true | |
activate-environment: true | |
mamba-version: "*" | |
channels: conda-forge,defaults | |
channel-priority: true | |
- | |
name: Install dependencies | |
shell: bash -el {0} | |
run: mamba install -y nco xarray numba numpy netcdf4 | |
- | |
name: Run tests | |
working-directory: components/eam/tools/mkatmsrffile | |
run: | | |
wget https://web.lcrc.anl.gov/public/e3sm/inputdata/atm/cam/chem/trop_mozart/dvel/clim_soilw.nc | |
wget https://web.lcrc.anl.gov/public/e3sm/inputdata/atm/cam/chem/trop_mozart/dvel/regrid_vegetation.nc | |
wget https://web.lcrc.anl.gov/public/e3sm/inputdata/atm/cam/chem/trop_mozart/dvel/map_1x1_to_ne30pg2_traave_c20240903.nc | |
python mkatmsrffile.py --map_file=map_1x1_to_ne30pg2_traave_c20240903.nc --vegetation_file=regrid_vegetation.nc --soil_water_file=clim_soilw.nc --dst_grid=ne30pg2 | |
mkatmsrffile-notify: | |
needs: mkatmsrffile-test | |
if: ${{ failure() && needs.mkatmsrffile-test.outputs.event_name != 'pull_request' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create issue | |
run: | | |
previous_issue_number=$(gh issue list \ | |
--label "$LABELS" \ | |
--json number \ | |
--jq '.[0].number') | |
if [[ -n $previous_issue_number ]]; then | |
gh issue comment "$previous_issue_number" \ | |
--body "$BODY" | |
else | |
gh issue create \ | |
--title "$TITLE" \ | |
--assignee "$ASSIGNEES" \ | |
--label "$LABELS" \ | |
--body "$BODY" | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_REPO: ${{ github.repository }} | |
TITLE: mkatmsrffile test failure | |
ASSIGNEES: whannah1 | |
LABELS: bug | |
BODY: | | |
Workflow failed! There's likely an issue in the mkatmsrffile tool! For more information, please see: | |
- Workflow URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (number ${{ github.run_number }}, attempt ${{ github.run_attempt }}) | |
- Workflow SHA: ${{ github.sha }} |