Skip to content

Commit

Permalink
Merge branch 'main' into update/github-action-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
grantfirl committed Jun 4, 2024
2 parents fdeba64 + dd7f9b3 commit c9de89a
Show file tree
Hide file tree
Showing 18 changed files with 480 additions and 145 deletions.
42 changes: 15 additions & 27 deletions .github/workflows/ci_build_scm_ubuntu_22.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
sp_ROOT: /home/runner/NCEPLIBS-sp
w3emc_ROOT: /home/runner/myw3emc
SCM_ROOT: /home/runner/work/ccpp-scm/ccpp-scm
intel_ROOT: /home/runner/intel
suites: SCM_GFS_v15p2,SCM_GFS_v16,SCM_GFS_v17_p8,SCM_HRRR,SCM_RRFS_v1beta,SCM_RAP,SCM_WoFS_v0,SCM_GFS_v15p2_ps,SCM_GFS_v16_ps,SCM_GFS_v17_p8_ps,SCM_HRRR_ps,SCM_RRFS_v1beta_ps,SCM_RAP_ps,SCM_WoFS_v0_ps

# Workflow steps
Expand Down Expand Up @@ -57,33 +56,17 @@ jobs:
#######################################################################################
# Install FORTRAN dependencies
#######################################################################################
- name: Environment for ifort compiler
if: contains(matrix.fortran-compiler, 'ifort')
- name: Install openmpi
run: |
echo "CC=icx" >> $GITHUB_ENV
echo "FC=ifort" >> $GITHUB_ENV
echo "NFVERSION=v4.4.4" >> $GITHUB_ENV
- name: Cache Intel compilers
id: cache-intel-compilers
if: contains(matrix.fortran-compiler, 'ifort')
uses: actions/cache@v2
with:
path: /home/runner/intel
key: intel-${{ runner.os }}-compilers-b

# https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html
# List of packages from Docker file at
# https://github.com/intel/oneapi-containers/blob/master/images/docker/hpckit-devel-ubuntu18.04/Dockerfile
- name: Install Intel compilers and libraries
if: contains(matrix.fortran-compiler, 'ifort') && steps.cache-intel-compilers.outputs.cache-hit != 'true'
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install intel-hpckit-getting-started intel-oneapi-clck intel-oneapi-common-licensing intel-oneapi-common-vars
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran intel-oneapi-itac
wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz
tar -xvf v4.1.6.tar.gz
cd ompi-4.1.6
./autogen.pl
./configure --prefix=/home/runner/ompi-4.1.6
make -j4
make install
echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
Expand Down Expand Up @@ -158,6 +141,11 @@ jobs:
sudo make install
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NFHOME}/lib
- name: Environment for openmpi compiler
run: |
echo "FC=mpif90" >> $GITHUB_ENV
echo "CC=mpicc" >> $GITHUB_ENV
#######################################################################################
# Build SCM.
#######################################################################################
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci_run_scm_DEPHY.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ jobs:
#######################################################################################
# Install FORTRAN dependencies
#######################################################################################
- name: Install openmpi
run: |
wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz
tar -xvf v4.1.6.tar.gz
cd ompi-4.1.6
./autogen.pl
./configure --prefix=/home/runner/ompi-4.1.6
make -j4
make install
echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
uses: actions/cache@v4
Expand Down Expand Up @@ -128,6 +140,11 @@ jobs:
#######################################################################################
# Build SCM. Run DEPHYv1 case.
#######################################################################################
- name: Environment for openmpi compiler
run: |
echo "FC=mpif90" >> $GITHUB_ENV
echo "CC=mpicc" >> $GITHUB_ENV
- name: Download data for SCM
run: |
cd ${SCM_ROOT}
Expand Down
41 changes: 27 additions & 14 deletions .github/workflows/ci_run_scm_rts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
sp_ROOT: /home/runner/NCEPLIBS-sp
w3emc_ROOT: /home/runner/myw3emc
SCM_ROOT: /home/runner/work/ccpp-scm/ccpp-scm
suites: SCM_GFS_v15p2,SCM_GFS_v16,SCM_GFS_v17_p8,SCM_HRRR,SCM_RRFS_v1beta,SCM_RAP,SCM_WoFS_v0
suites_ps: SCM_GFS_v15p2_ps,SCM_GFS_v16_ps,SCM_GFS_v17_p8_ps,SCM_HRRR_ps,SCM_RRFS_v1beta_ps,SCM_RAP_ps,SCM_WoFS_v0_ps
suites: SCM_GFS_v15p2,SCM_GFS_v16,SCM_GFS_v17_p8,SCM_HRRR,SCM_RRFS_v1beta,SCM_RAP,SCM_WoFS_v0,SCM_RRFS_v1,SCM_GFS_v17_HR3,SCM_GFS_v17_HR3_RRTMGP
suites_ps: SCM_GFS_v15p2_ps,SCM_GFS_v16_ps,SCM_GFS_v17_p8_ps,SCM_HRRR_ps,SCM_RRFS_v1beta_ps,SCM_RAP_ps,SCM_WoFS_v0_ps,SCM_RRFS_v1_ps,SCM_GFS_v17_HR3_ps,SCM_GFS_v17_HR3_RRTMGP_ps
dir_rt: /home/runner/work/ccpp-scm/ccpp-scm/test/artifact-${{matrix.build-type}}
dir_bl: /home/runner/work/ccpp-scm/ccpp-scm/test/BL-${{matrix.build-type}}

Expand Down Expand Up @@ -51,25 +51,26 @@ jobs:
- name: Install NetCDF Python libraries
run: |
conda install --yes -c conda-forge h5py>=3.4 netCDF4 f90nml
conda install --yes -c conda-forge h5py>=3.4 netCDF4 f90nml matplotlib
- name: Update system packages
run: sudo apt-get update

#######################################################################################
# Install FORTRAN dependencies
#######################################################################################
- name: Environment for gfortran compiler
if: contains(matrix.fortran-compiler, 'gnu')
run: |
echo "FC=gfortran-11" >> $GITHUB_ENV
echo "CC=gcc-11" >> $GITHUB_ENV

- name: Environment for ifort compiler
if: contains(matrix.fortran-compiler, 'intel')
- name: Install openmpi
run: |
echo "CC=icx" >> $GITHUB_ENV
echo "FC=ifort" >> $GITHUB_ENV
wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz
tar -xvf v4.1.6.tar.gz
cd ompi-4.1.6
./autogen.pl
./configure --prefix=/home/runner/ompi-4.1.6
make -j4
make install
echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
Expand Down Expand Up @@ -142,6 +143,11 @@ jobs:
sudo make install
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NFHOME}/lib
- name: Environment for openmpi compiler
run: |
echo "FC=mpif90" >> $GITHUB_ENV
echo "CC=mpicc" >> $GITHUB_ENV
#######################################################################################
# Build SCM. Run regression tests.
#######################################################################################
Expand All @@ -150,6 +156,7 @@ jobs:
cd ${SCM_ROOT}
./contrib/get_all_static_data.sh
./contrib/get_thompson_tables.sh
./contrib/get_aerosol_climo.sh
- name: Configure build with CMake (Release)
if: contains(matrix.build-type, 'Release')
Expand Down Expand Up @@ -187,13 +194,19 @@ jobs:
- name: Download SCM RT baselines
run: |
cd ${dir_bl}
wget ftp://ftp.rap.ucar.edu:/pub/ccpp-scm/rt-baselines-${{matrix.build-type}}.zip
wget https://dtcenter.ucar.edu/ccpp/users/rt/rt-baselines-${{matrix.build-type}}.zip
unzip rt-baselines-${{matrix.build-type}}.zip
- name: Compare SCM RT output to baselines
run: |
cd ${SCM_ROOT}/test
./cmp_rt2bl.py --build_type ${{matrix.build-type}} --dir_rt ${dir_rt} --dir_bl ${dir_bl}
./cmp_rt2bl.py --dir_rt ${dir_rt} --dir_bl ${dir_bl}
- name: Upload plots of SCM Baselines/RTs as GitHub Artifact.
uses: actions/upload-artifact@v2
with:
name: rt-plots-${{matrix.build-type}}
path: /home/runner/work/ccpp-scm/ccpp-scm/test/scm_rt_out

- name: Upload SCM RTs as GitHub Artifact
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
TYPEDEFS_NEW_METADATA = {
'ccpp_types' : {
'ccpp_types' : '',
'MPI_Comm' : '',
'ccpp_t' : 'cdata',
},
'machine' : {
Expand Down
2 changes: 1 addition & 1 deletion ccpp/framework
Submodule framework updated 102 files
4 changes: 4 additions & 0 deletions scm/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ ADD_DEFINITIONS(-DCCPP)
# Add host-model specific preprocessor flag (needed for some physics schemes)
ADD_DEFINITIONS(-DSCM)

ADD_DEFINITIONS(-DMPI)


#------------------------------------------------------------------------------
# Add model-specific flags for C/C++/Fortran preprocessor
ADD_DEFINITIONS(-DMOIST_CAPPA -DUSE_COND -DNEMS_GSM)
Expand Down Expand Up @@ -257,6 +260,7 @@ endif()
# How about using proper compile targets etc?
#------------------------------------------------------------------------------
# Configure sources

ADD_SUBDIRECTORY(${CCPP_FRAMEWORK_SRC} ${CMAKE_BINARY_DIR}/ccpp/framework)
ADD_SUBDIRECTORY(${CCPP_PHYSICS_SRC} ${CMAKE_BINARY_DIR}/ccpp/physics)
ADD_DEPENDENCIES(ccpp_physics ccpp_framework)
Expand Down
39 changes: 13 additions & 26 deletions scm/src/GFS_typedefs.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module GFS_typedefs

use mpi_f08
use machine, only: kind_phys, kind_dbl_prec, kind_sngl_prec

use module_radsw_parameters, only: topfsw_type, sfcfsw_type
Expand Down Expand Up @@ -85,7 +86,7 @@ module GFS_typedefs
type GFS_init_type
integer :: me !< my MPI-rank
integer :: master !< master MPI-rank
integer :: fcst_mpi_comm !< forecast tasks mpi communicator
type(MPI_Comm) :: fcst_mpi_comm !< forecast tasks mpi communicator
integer :: fcst_ntasks !< total number of forecast tasks
integer :: tile_num !< tile number for this MPI rank
integer :: isc !< starting i-index for this MPI-domain
Expand Down Expand Up @@ -693,7 +694,7 @@ module GFS_typedefs

integer :: me !< MPI rank designator
integer :: master !< MPI rank of master atmosphere processor
integer :: communicator !< MPI communicator
type(MPI_Comm) :: communicator !< MPI communicator
integer :: ntasks !< MPI size in communicator
integer :: nthreads !< OpenMP threads available for physics
integer :: nlunit !< unit for namelist
Expand Down Expand Up @@ -1153,6 +1154,7 @@ module GFS_typedefs
logical :: lheatstrg !< flag for canopy heat storage parameterization
logical :: lseaspray !< flag for sea spray parameterization
logical :: cnvcld
logical :: xr_cnvcld !< flag for adding suspended convective clouds to Xu-Randall cloud fraction
logical :: random_clds !< flag controls whether clouds are random
logical :: shal_cnv !< flag for calling shallow convection
logical :: do_deep !< whether to do deep convection
Expand Down Expand Up @@ -2582,7 +2584,6 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
allocate(Sfcprop%iceprv (IM))
allocate(Sfcprop%snowprv (IM))
allocate(Sfcprop%graupelprv(IM))

Sfcprop%iceprv = clear_val
Sfcprop%snowprv = clear_val
Sfcprop%graupelprv = clear_val
Expand Down Expand Up @@ -3297,7 +3298,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
real(kind=kind_phys), dimension(:), intent(in) :: bk
logical, intent(in) :: restart
logical, intent(in) :: hydrostatic
integer, intent(in) :: communicator
type(MPI_Comm), intent(in) :: communicator
integer, intent(in) :: ntasks
integer, intent(in) :: nthreads

Expand All @@ -3307,9 +3308,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
integer :: seed0
logical :: exists
real(kind=kind_phys) :: tem
real(kind=kind_phys) :: rinc(5)
real(kind=kind_sngl_prec) :: rinc4(5)
real(kind=kind_dbl_prec) :: rinc8(5)
real(kind=kind_dbl_prec) :: rinc(5)
real(kind=kind_phys) :: wrk(1)
real(kind=kind_phys), parameter :: con_hr = 3600.

Expand Down Expand Up @@ -3673,6 +3672,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: lheatstrg = .false. !< flag for canopy heat storage parameterization
logical :: lseaspray = .false. !< flag for sea spray parameterization
logical :: cnvcld = .false.
logical :: xr_cnvcld = .true. !< flag for including suspended convective clouds in Xu-Randall cloud fraction
logical :: random_clds = .false. !< flag controls whether clouds are random
logical :: shal_cnv = .false. !< flag for calling shallow convection
integer :: imfshalcnv = 1 !< flag for mass-flux shallow convection scheme
Expand Down Expand Up @@ -3979,7 +3979,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

real(kind=kind_phys) :: radar_tten_limits(2) = (/ limit_unspecified, limit_unspecified /)
integer :: itime
integer :: w3kindreal,w3kindint

!--- END NAMELIST VARIABLES

Expand Down Expand Up @@ -4069,8 +4068,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
hwrf_samfdeep, hwrf_samfshal,progsigma,betascu,betamcu, &
betadcu,h2o_phys, pdfcld, shcnvcw, redrag, hybedmf, satmedmf,&
shinhong, do_ysu, dspheat, lheatstrg, lseaspray, cnvcld, &
random_clds, shal_cnv, imfshalcnv, imfdeepcnv, isatmedmf, &
do_deep, jcap, &
xr_cnvcld, random_clds, shal_cnv, imfshalcnv, imfdeepcnv, &
isatmedmf, do_deep, jcap, &
cs_parm, flgmin, cgwf, ccwf, cdmbgwd, sup, ctei_rm, crtrh, &
dlqf, rbcr, shoc_parm, psauras, prauras, wminras, &
do_sppt, do_shum, do_skeb, &
Expand Down Expand Up @@ -4949,6 +4948,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%lheatstrg = lheatstrg
Model%lseaspray = lseaspray
Model%cnvcld = cnvcld
Model%xr_cnvcld = xr_cnvcld
Model%random_clds = random_clds
Model%shal_cnv = shal_cnv
Model%imfshalcnv = imfshalcnv
Expand Down Expand Up @@ -5664,19 +5664,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%cdec = -9999.
Model%clstp = -9999
rinc(1:5) = 0
call w3kind(w3kindreal,w3kindint)
if (w3kindreal == 8) then
rinc8(1:5) = 0
call w3difdat(jdat,idat,4,rinc8)
rinc = rinc8
else if (w3kindreal == 4) then
rinc4(1:5) = 0
call w3difdat(jdat,idat,4,rinc4)
rinc = rinc4
else
write(0,*)' FATAL ERROR: Invalid w3kindreal'
call abort
endif
call w3difdat(jdat,idat,4,rinc)
Model%phour = rinc(4)/con_hr
Model%fhour = (rinc(4) + Model%dtp)/con_hr
Model%zhour = mod(Model%phour,Model%fhzero)
Expand Down Expand Up @@ -6251,7 +6239,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
' do_shoc=', Model%do_shoc, ' nshoc3d=', Model%nshoc_3d, &
' nshoc_2d=', Model%nshoc_2d, ' shoc_cld=', Model%shoc_cld, &
' nkbfshoc=', Model%nkbfshoc, ' nahdshoc=', Model%nahdshoc, &
' nscfshoc=', Model%nscfshoc, &
' nscfshoc=', Model%nscfshoc, ' xr_cnvcld=',Model%xr_cnvcld, &
' uni_cld=', Model%uni_cld, &
' ntot3d=', Model%ntot3d, ' ntot2d=', Model%ntot2d, &
' shocaftcnv=',Model%shocaftcnv,' indcld=', Model%indcld, &
Expand Down Expand Up @@ -6474,7 +6462,7 @@ subroutine control_print(Model)
print *, 'basic control parameters'
print *, ' me : ', Model%me
print *, ' master : ', Model%master
print *, ' communicator : ', Model%communicator
print *, ' communicator : ', Model%communicator%mpi_val
print *, ' nlunit : ', Model%nlunit
print *, ' fn_nml : ', trim(Model%fn_nml)
print *, ' fhzero : ', Model%fhzero
Expand Down Expand Up @@ -7192,7 +7180,6 @@ subroutine tbd_create (Tbd, IM, Model)
allocate (Tbd%h2opl (IM,levh2o,h2o_coeff))
Tbd%h2opl = clear_val
Tbd%ozpl = clear_val


!--- ccn and in needs
! DH* allocate only for MG? *DH
Expand Down
Loading

0 comments on commit c9de89a

Please sign in to comment.