Skip to content
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

replace use of master with main #336

Merged
merged 19 commits into from
Jan 10, 2023
Merged
2 changes: 1 addition & 1 deletion .github/workflows/bumpversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bump version
on:
push:
branches:
- master
- main
jobs:
build:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/extbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
name: extbuild

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
# events but only for the main branch
on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
134 changes: 77 additions & 57 deletions .github/workflows/srt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
name: scripts regression tests

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
# events but only for the main branch
on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -23,26 +23,37 @@ jobs:
CC: mpicc
FC: mpifort
CXX: mpicxx
CPPFLAGS: "-I/usr/include -I/usr/local/include"
CPPFLAGS: "-I/usr/include -I/usr/local/include "
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu -lnetcdf -lnetcdff -lpnetcdf"
# Versions of all dependencies can be updated here
PNETCDF_VERSION: checkpoint.1.12.3
NETCDF_FORTRAN_VERSION: v4.6.0
ESMF_VERSION: v8.4.0
PARALLELIO_VERSION: pio2_5_10
NETCDF_C_PATH: /usr
NETCDF_FORTRAN_PATH: ${HOME}/netcdf-fortran
PNETCDF_PATH: ${HOME}/pnetcdf
CIME_MODEL: cesm
CIME_DRIVER: nuopc
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it

- id: load-env
- name: Setup Ubuntu Environment
id: load-env
run: |
sudo apt-get update
sudo apt-get install libxml2-utils pylint wget gfortran openmpi-bin netcdf-bin libopenmpi-dev cmake libnetcdf-dev autotools-dev autoconf
set -x
sudo apt-get update
sudo apt-get install libxml2-utils
sudo apt-get install netcdf-bin
sudo apt-get install libnetcdf-dev
sudo apt-get install libnetcdff-dev
sudo apt-get install pnetcdf-bin
sudo apt-get install libpnetcdf-dev
sudo apt-get install doxygen
sudo apt-get install graphviz
sudo apt-get install wget
sudo apt-get install gfortran
sudo apt-get install libjpeg-dev
sudo apt-get install libz-dev
sudo apt-get install openmpi-bin
sudo apt-get install libopenmpi-dev

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -51,7 +62,7 @@ jobs:
- run: echo "PyYAML" > requirements.txt
- name: Install PyYAML
run: pip install -r requirements.txt
# use the latest cesm master
# use the latest cesm main
- name: cesm checkout
uses: actions/checkout@v3
with:
Expand All @@ -75,84 +86,93 @@ jobs:
uses: actions/cache@v3
with:
path: ~/ESMF
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF
- name: cache pnetcdf
id: cache-pnetcdf
uses: actions/cache@v3
with:
path: ~/pnetcdf
key: ${{ runner.os }}-${{ env.PNETCDF_VERSION}}-pnetcdf
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF1
# - name: cache pnetcdf
# id: cache-pnetcdf
# uses: actions/cache@v3
# with:
# path: ~/pnetcdf
# key: ${{ runner.os }}-${{ env.PNETCDF_VERSION}}-pnetcdf

- name: Cache netcdf-fortran
id: cache-netcdf-fortran
uses: actions/cache@v3
with:
path: ~/netcdf-fortran
key: ${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran
# - name: Cache netcdf-fortran
# id: cache-netcdf-fortran
# uses: actions/cache@v3
# with:
# path: ~/netcdf-fortran
# key: ${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran

- name: Cache ParallelIO
id: cache-ParallelIO
uses: actions/cache@v3
with:
path: ~/pio
key: ${{ runner.os }}-${{ env.PARALLELIO_VERSION }}.pio
key: ${{ runner.os }}-${{ env.PARALLELIO_VERSION }}.parallelio
- name: Cache inputdata
id: cache-inputdata
uses: actions/cache@v3
with:
path: $HOME/cesm/inputdata
key: inputdata
- name: Build PNetCDF
if: steps.cache-pnetcdf.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/buildpnetcdf@e06246b560d3132170bb1a5443fa3d65dfbd2040
with:
pnetcdf_version: ${{ env.PNETCDF_VERSION }}
install_prefix: $HOME/pnetcdf
- name: Build NetCDF Fortran
if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/buildnetcdff@e06246b560d3132170bb1a5443fa3d65dfbd2040
with:
netcdf_fortran_version: ${{ env.NETCDF_FORTRAN_VERSION }}
install_prefix: $HOME/netcdf-fortran
netcdf_c_path: /usr
# - name: Build PNetCDF
# if: steps.cache-pnetcdf.outputs.cache-hit != 'true'
# uses: ESCOMP/CDEPS/.github/actions/buildpnetcdf@e06246b560d3132170bb1a5443fa3d65dfbd2040
# with:
# pnetcdf_version: ${{ env.PNETCDF_VERSION }}
# install_prefix: $HOME/pnetcdf
# - name: Build NetCDF Fortran
# if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
# uses: ESCOMP/CDEPS/.github/actions/buildnetcdff@e06246b560d3132170bb1a5443fa3d65dfbd2040
# with:
# netcdf_fortran_version: ${{ env.NETCDF_FORTRAN_VERSION }}
# install_prefix: $HOME/netcdf-fortran
# netcdf_c_path: /usr
- name: Build ParallelIO
if: steps.cache-PARALLELIO.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/buildpio@e06246b560d3132170bb1a5443fa3d65dfbd2040
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@05173a6556ea8d80eb34e3881a5014ea8f4b7543
with:
parallelio_version: ${{ env.ParallelIO_VERSION }}
netcdf_c_path: /usr
netcdf_fortran_path: $HOME/netcdf-fortran
pnetcdf_path: $HOME/pnetcdf
install_prefix: $HOME/pio
enable_fortran: True
install_prefix: /home/runner/pio

- name: Build ESMF
if: steps.cache-esmf.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/buildesmf@e06246b560d3132170bb1a5443fa3d65dfbd2040
with:
esmf_version: ${{ env.ESMF_VERSION }}
esmf_bopt: g
esmf_comm: openmpi
install_prefix: $HOME/ESMF
install_prefix: ~/ESMF
netcdf_c_path: /usr
netcdf_fortran_path: $HOME/netcdf-fortran
pnetcdf_path: $HOME/pnetcdf
parallelio_path: $HOME/pio
netcdf_fortran_path: /usr
pnetcdf_path: /usr
parallelio_path: ~/pio

- name: scripts regression tests

- name: PREP for scripts regression test
run: |
mkdir -p $HOME/cesm/scratch
mkdir -p $HOME/cesm/inputdata
cd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
pushd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
export CIME_TEST_PLATFORM=ubuntu-latest
export PIO_INCDIR=$HOME/pio/include
export PIO_LIBDIR=$HOME/pio/lib
export PIO_VERSION_MAJOR=2
export PIO_TYPENAME_VALID_VALUES="netcdf,pnetcdf,netcdf4p,netcdf4c"
export NETCDF=$HOME/netcdf-fortran
export PATH=$NETCDF/bin:$PATH:$HOME/netcdf-fortran/bin
export LD_LIBRARY_PATH=$NETCDF/lib:$HOME/pnetcdf/lib:$LD_LIBRARY_PATH
export PIO_TYPENAME_VALID_VALUES="netcdf,pnetcdf"
export NETCDF_PATH=/usr
export PNETCDF_PATH=/usr
export LD_LIBRARY_PATH=/usr/lib/libx86_64-linux-gnu/:$LD_LIBRARY_PATH
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
./scripts_regression_tests.py --no-fortran-run --compiler gnu --mpilib openmpi --machine ubuntu-latest

cat <<EOF >> $GITHUB_WORKSPACE/cesm/ccs_config/machines/cmake_macros/ubuntu-latest.cmake
set(NetCDF_Fortran_INCLUDE_DIR /usr/include)
set(NetCDF_Fortran_LIBRARY /usr/lib/x86_64-gnu-Linux/libnetcdff.so)
EOF
printenv >> $GITHUB_ENV
popd
- name: scripts regression tests
run: |
pushd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
./scripts_regression_tests.py --no-fortran-run --compiler gnu --mpilib openmpi --machine ubuntu-latest
popd
# the following can be used by developers to login to the github server in case of errors
# see https://github.com/marketplace/actions/debugging-with-tmate for further details
# - name: Setup tmate session
Expand Down
8 changes: 4 additions & 4 deletions cesm/driver/ensemble_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Ensemble_driver

use shr_kind_mod , only : cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_log_mod , only : shr_log_setLogUnit
use esm_utils_mod , only : mastertask, logunit, chkerr
use esm_utils_mod , only : maintask, logunit, chkerr
uturuncoglu marked this conversation as resolved.
Show resolved Hide resolved

implicit none
private
Expand Down Expand Up @@ -250,15 +250,15 @@ subroutine SetModelServices(ensemble_driver, rc)
call NUOPC_CompAttributeGet(driver, name="logfile", value=logfile, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
open (newunit=logunit,file=trim(diro)//"/"//trim(logfile))
mastertask = .true.
maintask = .true.
else
logUnit = 6
mastertask = .false.
maintask = .false.
endif
call shr_log_setLogUnit (logunit)

! Create a clock for each driver instance
call esm_time_clockInit(ensemble_driver, driver, logunit, mastertask, rc)
call esm_time_clockInit(ensemble_driver, driver, logunit, maintask, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

endif
Expand Down
16 changes: 8 additions & 8 deletions cesm/driver/esm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module ESM
use shr_mpi_mod , only : shr_mpi_bcast
use shr_mem_mod , only : shr_mem_init
use shr_log_mod , only : shr_log_setLogunit
use esm_utils_mod, only : logunit, mastertask, dbug_flag, chkerr
use esm_utils_mod, only : logunit, maintask, dbug_flag, chkerr
use perf_mod , only : t_initf, t_setLogUnit

implicit none
Expand Down Expand Up @@ -154,9 +154,9 @@ subroutine SetModelServices(driver, rc)
call ESMF_VMGet(vm, localPet=localPet, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (localPet == 0) then
mastertask=.true.
maintask=.true.
else
mastertask = .false.
maintask = .false.
end if

!-------------------------------------------
Expand Down Expand Up @@ -206,15 +206,15 @@ subroutine SetModelServices(driver, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

! Memory test
if (mastertask) then
if (maintask) then
call shr_mem_init(strbuf=meminitstr)
write(logunit,*) trim(meminitstr)
end if

!-------------------------------------------
! Timer initialization (has to be after pelayouts are determined)
!-------------------------------------------
call t_initf('drv_in', LogPrint=.true., LogUnit=logunit, mpicom=global_comm, mastertask=mastertask, MaxThreads=maxthreads)
call t_initf('drv_in', LogPrint=.true., LogUnit=logunit, mpicom=global_comm, mastertask=maintask, MaxThreads=maxthreads)

call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO)

Expand Down Expand Up @@ -301,7 +301,7 @@ subroutine pretty_print_nuopc_freeformat(ffstuff, label, rc)

rc = ESMF_SUCCESS

if (mastertask .or. dbug_flag > 3) then
if (maintask .or. dbug_flag > 3) then
write(logunit, *) 'BEGIN: ', trim(label)
call NUOPC_FreeFormatGet(ffstuff, linecount=linecnt, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -467,7 +467,7 @@ subroutine InitAttributes(driver, rc)
call NUOPC_CompAttributeGet(driver, name="tfreeze_option", value=tfreeze_option, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

call shr_frz_freezetemp_init(tfreeze_option, mastertask)
call shr_frz_freezetemp_init(tfreeze_option, maintask)

call NUOPC_CompAttributeGet(driver, name='cpl_rootpe', value=cvalue, rc=rc)
read(cvalue, *) rootpe_med
Expand Down Expand Up @@ -1519,7 +1519,7 @@ subroutine esm_finalize(driver, rc)

rc = ESMF_SUCCESS

if (mastertask) then
if (maintask) then
write(logunit,*)' SUCCESSFUL TERMINATION OF CESM'
end if

Expand Down
Loading