Setup for building GCClassic #114
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: Test suite | |
on: | |
# Trigger the CI whenever a commit is pushed to main or develop, i.e., a PR is merged | |
push: | |
branches: [main, develop] | |
# Trigger the CI whenever a commit is pushed to an open PR | |
pull_request: | |
env: | |
# Environment variables for GISS modelE | |
GISS_HOME: /__w/GISS-GC/GISS-GC | |
ModelE_Support: /__w/GISS-GC/GISS-GC/run | |
DATA: /__w/GISS-GC/GISS-GC/run/prod_input_files | |
# Environment variables for compiler | |
CC: gcc | |
CXX: g++ | |
FC: gfortran | |
F90: gfortran | |
F77: gfortran | |
# Misc. environment variables | |
F_UFMTENDIAN: big | |
KMP_STACKSIZE: 100000000 | |
OMP_NUM_THREADS: 1 | |
jobs: | |
# Test that GISS-GC can be compiled without error | |
compile: | |
runs-on: ubuntu-22.04 | |
container: | |
image: ghcr.io/fetch4/giss-gc-dev-env:latest | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.github_token }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup submodules | |
run: | | |
git config --global --add safe.directory ${GISS_HOME} | |
git submodule init | |
git submodule update | |
- name: Build tools | |
run: | | |
. /opt/spack-environment/activate.sh | |
cd ${GISS_HOME}/model/mk_diags | |
/bin/bash compscr | |
- name: Create fake inputs | |
run: | | |
# Make run directories | |
mkdir -p ${DATA} | |
mkdir -p ${ModelE_Support}/exec | |
mkdir -p ${ModelE_Support}/huge_space | |
mkdir -p ${ModelE_Support}/prod_decks | |
mkdir -p ${ModelE_Support}/prod_runs | |
# Fake input files | |
touch ${DATA}/CD144X90.ext.nc | |
touch ${DATA}/cloud.epsilon4.72x46 | |
touch ${DATA}/CO2profile.Jul16-2017.txt | |
touch ${DATA}/CROPS_and_pastures_Pongratz_to_Hurtt_144X90N_nocasp.nc | |
touch ${DATA}/dH2O_by_CH4_monthly | |
touch ${DATA}/GHG.CMIP6.1-2014.txt | |
touch ${DATA}/GIC.144X90.DEC01.1.ext_1.nc | |
touch ${DATA}/GLMELT_144X90_gas.OCN.nc | |
touch ${DATA}/H2Ocont_MT_CKD | |
touch ${DATA}/Irrig144x90_1848to2100_FixedFuture_v3.nc | |
touch ${DATA}/ISCCP.tautables | |
touch ${DATA}/LWCorrTables33k | |
touch ${DATA}/LWTables33k_lowH2O_CO2_O3_planck_1-800 | |
touch ${DATA}/miescatpar.abcdv2 | |
touch ${DATA}/MSU_SSU_RSS_weights.txt | |
touch ${DATA}/NCARIC.144x90.D7712010_ext.nc | |
touch ${DATA}/o3_2010_shindell_144x90x49_April1850.nc | |
touch ${DATA}/oct2003.relhum.nr.Q633G633.table | |
touch ${DATA}/OST_144x90.1876-1885avg.CMIP6.nc | |
touch ${DATA}/RD_Fd.nc | |
touch ${DATA}/RD_Fd.names.txt | |
touch ${DATA}/REG2X2.5 | |
touch ${DATA}/S144X900098M.ext.nc | |
touch ${DATA}/sgpgxg.table8 | |
touch ${DATA}/SICE_144x90.1876-1885avg.CMIP6.nc | |
touch ${DATA}/soil_textures_top30cm_2x2.5 | |
touch ${DATA}/soilcarb_top30cm_2x2.5.nc | |
touch ${DATA}/solar.CMIP6official.ann1850-2299_with_E3_fastJ.nc | |
touch ${DATA}/STRATAER.VOL.1850-2014_CMIP6_hdr | |
touch ${DATA}/top_index_144x90_a.ij.ext.nc | |
touch ${DATA}/topcld.trscat8 | |
touch ${DATA}/V144x90_EntMM16_height_trimmed_scaled_ext.nc | |
touch ${DATA}/V144x90_EntMM16_lai_max_trimmed_scaled_ext.nc | |
touch ${DATA}/V144x90_EntMM16_lai_trimmed_scaled_ext.nc | |
touch ${DATA}/V144x90_EntMM16_lc_max_trimmed_scaled_nocrops.ext.nc | |
touch ${DATA}/Z2HX2fromZ1QX1N.BS1.nc | |
touch ${DATA}/ZSIfac_144x90.1876-1885avg.CMIP6.nc | |
touch ${DATA}/ZVAR2X25A.nc | |
mkdir -p ${DATA}/cmip6_nint_inputs_E14TomaOCNf10_4av_decadal/BCA | |
mkdir -p ${DATA}/cmip6_nint_inputs_E14TomaOCNf10_4av_decadal/BCB | |
mkdir -p ${DATA}/cmip6_nint_inputs_E14TomaOCNf10_4av_decadal/BCdalbsn | |
mkdir -p ${DATA}/cmip6_nint_inputs_E14TomaOCNf10_4av_decadal/DUST | |
mkdir -p ${DATA}/cmip6_nint_inputs_E14TomaOCNf10_4av_decadal/NIT | |
mkdir -p ${DATA}/cmip6_nint_inputs_E14TomaOCNf10_4av_decadal/O3 | |
mkdir -p ${DATA}/cmip6_nint_inputs_E14TomaOCNf10_4av_decadal/OCA | |
mkdir -p ${DATA}/cmip6_nint_inputs_E14TomaOCNf10_4av_decadal/SSA | |
mkdir -p ${DATA}/cmip6_nint_inputs_E14TomaOCNf10_4av_decadal/SUL | |
mkdir -p ${DATA}/nudging/merra2 | |
touch ${DATA}/nudging/merra2/uwnd.2014.MERRA2onGISSE2.nc4 | |
touch ${DATA}/nudging/merra2/vwnd.2014.MERRA2onGISSE2.nc4 | |
touch ${DATA}/nudging/merra2/uwnd.2015.MERRA2onGISSE2.nc4 | |
touch ${DATA}/nudging/merra2/vwnd.2015.MERRA2onGISSE2.nc4 | |
touch ${DATA}/nudging/merra2/uwnd.2016.MERRA2onGISSE2.nc4 | |
touch ${DATA}/nudging/merra2/vwnd.2016.MERRA2onGISSE2.nc4 | |
mkdir -p ${DATA}/gcclassic/ExtData/GEOSCHEM_RESTARTS/GC_14.3.0 | |
touch ${DATA}/gcclassic/ExtData/GEOSCHEM_RESTARTS/GC_14.3.0/GEOSChem.Restart.fullchem.20190701_0000z.nc4 | |
- name: Build GISS Model E without GEOS-Chem support | |
run: | | |
. /opt/spack-environment/activate.sh | |
# Environment variables for passing NetCDF-C and NetCDF-Fortran | |
export NETCDF_HOME=$(nc-config --prefix) | |
export NETCDF_F_HOME=$(nf-config --prefix) | |
# Environment variable for OpenMPI build | |
MPIF90=$(find /opt/software -name mpif90 | head -n 1) | |
export MPI_ROOT=${MPIF90%/bin/mpif90} | |
# Copy over modelErc | |
cp .github/modelErc ~/.modelErc | |
# Build the model without GEOS-Chem support | |
cp .dev/utils/build.sh . | |
./build.sh --giss-only | |
- name: Build GISS-GC with GEOS-Chem support | |
run: | | |
. /opt/spack-environment/activate.sh | |
# Environment variables for passing NetCDF-C paths to GEOS-Chem | |
export NETCDF_HOME=$(nc-config --prefix) | |
export GC_BIN=${NETCDF_HOME}/bin | |
export GC_INCLUDE=${NETCDF_HOME}/include | |
export GC_LIB=${NETCDF_HOME}/lib | |
# Environment variables for passing NetCDF-Fortran paths to GEOS-Chem | |
export NETCDF_F_HOME=$(nf-config --prefix) | |
export GC_F_BIN=${NETCDF_F_HOME}/bin | |
export GC_F_INCLUDE=${NETCDF_F_HOME}/include | |
export GC_F_LIB=${NETCDF_F_HOME}/lib | |
# Environment variable for OpenMPI build | |
MPIF90=$(find /opt/software -name mpif90 | head -n 1) | |
export MPI_ROOT=${MPIF90%/bin/mpif90} | |
# Copy over modelErc | |
cp .github/modelErc ~/.modelErc | |
# Build the model | |
cp .dev/utils/build.sh . | |
./build.sh | |
- name: Build GISS-GC with GEOS-Chem support in debug mode | |
run: | | |
. /opt/spack-environment/activate.sh | |
# Environment variables for passing NetCDF-C paths to GEOS-Chem | |
export NETCDF_HOME=$(nc-config --prefix) | |
export GC_BIN=${NETCDF_HOME}/bin | |
export GC_INCLUDE=${NETCDF_HOME}/include | |
export GC_LIB=${NETCDF_HOME}/lib | |
# Environment variables for passing NetCDF-Fortran paths to GEOS-Chem | |
export NETCDF_F_HOME=$(nf-config --prefix) | |
export GC_F_BIN=${NETCDF_F_HOME}/bin | |
export GC_F_INCLUDE=${NETCDF_F_HOME}/include | |
export GC_F_LIB=${NETCDF_F_HOME}/lib | |
# Environment variable for OpenMPI build | |
MPIF90=$(find /opt/software -name mpif90 | head -n 1) | |
export MPI_ROOT=${MPIF90%/bin/mpif90} | |
# Copy over modelErc | |
cp .github/modelErc ~/.modelErc | |
# Build the model in debug mode | |
cp .dev/utils/build.sh . | |
./build.sh --debug | |
- name: Build GCClassic | |
run: | | |
. /opt/spack-environment/activate.sh | |
# Environment variables for passing NetCDF-C and NetCDF-Fortran | |
export NETCDF_HOME=$(nc-config --prefix) | |
export NETCDF_F_HOME=$(nf-config --prefix) | |
# Build the model without GEOS-Chem support | |
cp .dev/utils/build.sh . | |
./build.sh --classic | |
- name: Build GCClassic in debug mode | |
run: | | |
. /opt/spack-environment/activate.sh | |
# Environment variables for passing NetCDF-C and NetCDF-Fortran | |
export NETCDF_HOME=$(nc-config --prefix) | |
export NETCDF_F_HOME=$(nf-config --prefix) | |
# Build the model without GEOS-Chem support | |
cp .dev/utils/build.sh . | |
./build.sh --classic --debug |