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

UFS-dev PR#184 #482

Merged
merged 16 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
mkavulich marked this conversation as resolved.
Show resolved Hide resolved
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
mkavulich marked this conversation as resolved.
Show resolved Hide resolved
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@v3
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
24 changes: 15 additions & 9 deletions .github/workflows/ci_run_scm_rts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,18 @@ jobs:
#######################################################################################
# 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
mkavulich marked this conversation as resolved.
Show resolved Hide resolved
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 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
2 changes: 1 addition & 1 deletion ccpp/physics
Submodule physics updated 34 files
+8 −1 CMakeLists.txt
+1 −8 physics/GWD/cires_tauamf_data.F90
+2 −2 physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90
+2 −9 physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90
+3 −3 physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90
+7 −0 physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta
+3 −15 physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.F90
+3 −15 physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.F90
+22 −29 physics/Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90
+13 −2 physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90
+3 −3 physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta
+13 −67 physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F
+2 −1 physics/MP/Ferrier_Aligo/mp_fer_hires.F90
+1 −1 physics/MP/Ferrier_Aligo/mp_fer_hires.meta
+6 −23 physics/MP/Morrison_Gettelman/aerinterp.F90
+2 −2 physics/MP/NSSL/mp_nssl.F90
+1 −1 physics/MP/NSSL/mp_nssl.meta
+5 −4 physics/MP/Thompson/module_mp_thompson.F90
+3 −2 physics/MP/Thompson/mp_thompson.F90
+2 −2 physics/MP/Thompson/mp_thompson.meta
+2 −1 physics/MP/Thompson/mp_thompson_post.F90
+1 −1 physics/MP/Thompson/mp_thompson_post.meta
+3 −2 physics/Radiation/RRTMGP/rrtmgp_lw_cloud_optics.F90
+3 −2 physics/Radiation/RRTMGP/rrtmgp_lw_gas_optics.F90
+3 −1 physics/Radiation/RRTMGP/rrtmgp_lw_main.F90
+1 −1 physics/Radiation/RRTMGP/rrtmgp_lw_main.meta
+3 −2 physics/Radiation/RRTMGP/rrtmgp_sw_cloud_optics.F90
+3 −2 physics/Radiation/RRTMGP/rrtmgp_sw_gas_optics.F90
+3 −1 physics/Radiation/RRTMGP/rrtmgp_sw_main.F90
+1 −1 physics/Radiation/RRTMGP/rrtmgp_sw_main.meta
+30 −8 physics/Radiation/radiation_clouds.f
+3 −11 physics/photochem/h2ointerp.f90
+2 −1 physics/smoke_dust/rrfs_smoke_wrapper.F90
+1 −1 physics/smoke_dust/rrfs_smoke_wrapper.meta
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
14 changes: 10 additions & 4 deletions scm/src/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -3346,7 +3346,7 @@
long_name = MPI communicator
units = index
dimensions = ()
type = integer
type = MPI_Comm
[ntasks]
standard_name = number_of_mpi_tasks
long_name = number of MPI tasks in communicator
Expand Down Expand Up @@ -5424,6 +5424,12 @@
units = flag
dimensions = ()
type = logical
[xr_cnvcld]
standard_name = flag_for_suspended_convective_clouds_in_Xu_Randall
long_name = flag for using suspended convective clouds in Xu Randall
units = flag
dimensions = ()
type = logical
[shal_cnv]
standard_name = flag_for_simplified_arakawa_schubert_shallow_convection
long_name = flag for calling shallow convection
Expand Down Expand Up @@ -10047,7 +10053,7 @@
[ltg1_max]
standard_name = lightning_threat_index_1
long_name = lightning threat index 1
units = flashes 5 min-1
units = flashes min-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
Expand All @@ -10056,7 +10062,7 @@
[ltg2_max]
standard_name = lightning_threat_index_2
long_name = lightning threat index 2
units = flashes 5 min-1
units = flashes min-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
Expand All @@ -10065,7 +10071,7 @@
[ltg3_max]
standard_name = lightning_threat_index_3
long_name = lightning threat index 3
units = flashes 5 min-1
units = flashes min-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
Expand Down
2 changes: 1 addition & 1 deletion scm/src/run_scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def launch_executable(use_gdb, gdb, ignore_error = False):
if use_gdb:
cmd = '(cd {scm_run} && {gdb} {executable})'.format(scm_run=SCM_RUN, gdb=gdb, executable=EXECUTABLE)
else:
cmd = '(cd {scm_run} && time {executable})'.format(scm_run=SCM_RUN, executable=EXECUTABLE)
cmd = '(cd {scm_run} && time mpirun -n 1 {executable})'.format(scm_run=SCM_RUN, executable=EXECUTABLE)
logging.info('Passing control to "{0}"'.format(cmd))
time.sleep(1)
# This will abort in 'execute' in the event of an error if ignore_error = False
Expand Down
Loading
Loading