Skip to content

Commit dd7f9b3

Browse files
authored
Merge pull request #482 from grantfirl/ufs-dev-PR184
UFS-dev PR#184
2 parents 567b8a3 + 5dee89c commit dd7f9b3

File tree

13 files changed

+116
-80
lines changed

13 files changed

+116
-80
lines changed

.github/workflows/ci_build_scm_ubuntu_22.04.yml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
sp_ROOT: /home/runner/NCEPLIBS-sp
2222
w3emc_ROOT: /home/runner/myw3emc
2323
SCM_ROOT: /home/runner/work/ccpp-scm/ccpp-scm
24-
intel_ROOT: /home/runner/intel
2524
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
2625

2726
# Workflow steps
@@ -57,33 +56,17 @@ jobs:
5756
#######################################################################################
5857
# Install FORTRAN dependencies
5958
#######################################################################################
60-
- name: Environment for ifort compiler
61-
if: contains(matrix.fortran-compiler, 'ifort')
59+
- name: Install openmpi
6260
run: |
63-
echo "CC=icx" >> $GITHUB_ENV
64-
echo "FC=ifort" >> $GITHUB_ENV
65-
echo "NFVERSION=v4.4.4" >> $GITHUB_ENV
66-
67-
- name: Cache Intel compilers
68-
id: cache-intel-compilers
69-
if: contains(matrix.fortran-compiler, 'ifort')
70-
uses: actions/cache@v2
71-
with:
72-
path: /home/runner/intel
73-
key: intel-${{ runner.os }}-compilers-b
74-
75-
# https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html
76-
# List of packages from Docker file at
77-
# https://github.com/intel/oneapi-containers/blob/master/images/docker/hpckit-devel-ubuntu18.04/Dockerfile
78-
- name: Install Intel compilers and libraries
79-
if: contains(matrix.fortran-compiler, 'ifort') && steps.cache-intel-compilers.outputs.cache-hit != 'true'
80-
run: |
81-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
82-
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
83-
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
84-
sudo apt-get update
85-
sudo apt-get install intel-hpckit-getting-started intel-oneapi-clck intel-oneapi-common-licensing intel-oneapi-common-vars
86-
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran intel-oneapi-itac
61+
wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz
62+
tar -xvf v4.1.6.tar.gz
63+
cd ompi-4.1.6
64+
./autogen.pl
65+
./configure --prefix=/home/runner/ompi-4.1.6
66+
make -j4
67+
make install
68+
echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
69+
echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV
8770
8871
- name: Cache bacio library v2.4.1
8972
id: cache-bacio-fortran
@@ -158,6 +141,11 @@ jobs:
158141
sudo make install
159142
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NFHOME}/lib
160143
144+
- name: Environment for openmpi compiler
145+
run: |
146+
echo "FC=mpif90" >> $GITHUB_ENV
147+
echo "CC=mpicc" >> $GITHUB_ENV
148+
161149
#######################################################################################
162150
# Build SCM.
163151
#######################################################################################

.github/workflows/ci_run_scm_DEPHY.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ jobs:
5454
#######################################################################################
5555
# Install FORTRAN dependencies
5656
#######################################################################################
57+
- name: Install openmpi
58+
run: |
59+
wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz
60+
tar -xvf v4.1.6.tar.gz
61+
cd ompi-4.1.6
62+
./autogen.pl
63+
./configure --prefix=/home/runner/ompi-4.1.6
64+
make -j4
65+
make install
66+
echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
67+
echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV
68+
5769
- name: Cache bacio library v2.4.1
5870
id: cache-bacio-fortran
5971
uses: actions/cache@v3
@@ -128,6 +140,11 @@ jobs:
128140
#######################################################################################
129141
# Build SCM. Run DEPHYv1 case.
130142
#######################################################################################
143+
- name: Environment for openmpi compiler
144+
run: |
145+
echo "FC=mpif90" >> $GITHUB_ENV
146+
echo "CC=mpicc" >> $GITHUB_ENV
147+
131148
- name: Download data for SCM
132149
run: |
133150
cd ${SCM_ROOT}

.github/workflows/ci_run_scm_rts.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,18 @@ jobs:
5959
#######################################################################################
6060
# Install FORTRAN dependencies
6161
#######################################################################################
62-
- name: Environment for gfortran compiler
63-
if: contains(matrix.fortran-compiler, 'gnu')
64-
run: |
65-
echo "FC=gfortran-11" >> $GITHUB_ENV
66-
echo "CC=gcc-11" >> $GITHUB_ENV
6762

68-
- name: Environment for ifort compiler
69-
if: contains(matrix.fortran-compiler, 'intel')
63+
- name: Install openmpi
7064
run: |
71-
echo "CC=icx" >> $GITHUB_ENV
72-
echo "FC=ifort" >> $GITHUB_ENV
65+
wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz
66+
tar -xvf v4.1.6.tar.gz
67+
cd ompi-4.1.6
68+
./autogen.pl
69+
./configure --prefix=/home/runner/ompi-4.1.6
70+
make -j4
71+
make install
72+
echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
73+
echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV
7374
7475
- name: Cache bacio library v2.4.1
7576
id: cache-bacio-fortran
@@ -142,6 +143,11 @@ jobs:
142143
sudo make install
143144
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NFHOME}/lib
144145
146+
- name: Environment for openmpi compiler
147+
run: |
148+
echo "FC=mpif90" >> $GITHUB_ENV
149+
echo "CC=mpicc" >> $GITHUB_ENV
150+
145151
#######################################################################################
146152
# Build SCM. Run regression tests.
147153
#######################################################################################

ccpp/config/ccpp_prebuild_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
TYPEDEFS_NEW_METADATA = {
3434
'ccpp_types' : {
3535
'ccpp_types' : '',
36+
'MPI_Comm' : '',
3637
'ccpp_t' : 'cdata',
3738
},
3839
'machine' : {

ccpp/framework

Submodule framework updated 102 files

ccpp/physics

Submodule physics updated 34 files

scm/src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ ADD_DEFINITIONS(-DCCPP)
105105
# Add host-model specific preprocessor flag (needed for some physics schemes)
106106
ADD_DEFINITIONS(-DSCM)
107107

108+
ADD_DEFINITIONS(-DMPI)
109+
110+
108111
#------------------------------------------------------------------------------
109112
# Add model-specific flags for C/C++/Fortran preprocessor
110113
ADD_DEFINITIONS(-DMOIST_CAPPA -DUSE_COND -DNEMS_GSM)
@@ -257,6 +260,7 @@ endif()
257260
# How about using proper compile targets etc?
258261
#------------------------------------------------------------------------------
259262
# Configure sources
263+
260264
ADD_SUBDIRECTORY(${CCPP_FRAMEWORK_SRC} ${CMAKE_BINARY_DIR}/ccpp/framework)
261265
ADD_SUBDIRECTORY(${CCPP_PHYSICS_SRC} ${CMAKE_BINARY_DIR}/ccpp/physics)
262266
ADD_DEPENDENCIES(ccpp_physics ccpp_framework)

scm/src/GFS_typedefs.F90

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module GFS_typedefs
22

3+
use mpi_f08
34
use machine, only: kind_phys, kind_dbl_prec, kind_sngl_prec
45

56
use module_radsw_parameters, only: topfsw_type, sfcfsw_type
@@ -85,7 +86,7 @@ module GFS_typedefs
8586
type GFS_init_type
8687
integer :: me !< my MPI-rank
8788
integer :: master !< master MPI-rank
88-
integer :: fcst_mpi_comm !< forecast tasks mpi communicator
89+
type(MPI_Comm) :: fcst_mpi_comm !< forecast tasks mpi communicator
8990
integer :: fcst_ntasks !< total number of forecast tasks
9091
integer :: tile_num !< tile number for this MPI rank
9192
integer :: isc !< starting i-index for this MPI-domain
@@ -693,7 +694,7 @@ module GFS_typedefs
693694

694695
integer :: me !< MPI rank designator
695696
integer :: master !< MPI rank of master atmosphere processor
696-
integer :: communicator !< MPI communicator
697+
type(MPI_Comm) :: communicator !< MPI communicator
697698
integer :: ntasks !< MPI size in communicator
698699
integer :: nthreads !< OpenMP threads available for physics
699700
integer :: nlunit !< unit for namelist
@@ -1153,6 +1154,7 @@ module GFS_typedefs
11531154
logical :: lheatstrg !< flag for canopy heat storage parameterization
11541155
logical :: lseaspray !< flag for sea spray parameterization
11551156
logical :: cnvcld
1157+
logical :: xr_cnvcld !< flag for adding suspended convective clouds to Xu-Randall cloud fraction
11561158
logical :: random_clds !< flag controls whether clouds are random
11571159
logical :: shal_cnv !< flag for calling shallow convection
11581160
logical :: do_deep !< whether to do deep convection
@@ -2582,7 +2584,6 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
25822584
allocate(Sfcprop%iceprv (IM))
25832585
allocate(Sfcprop%snowprv (IM))
25842586
allocate(Sfcprop%graupelprv(IM))
2585-
25862587
Sfcprop%iceprv = clear_val
25872588
Sfcprop%snowprv = clear_val
25882589
Sfcprop%graupelprv = clear_val
@@ -3297,7 +3298,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
32973298
real(kind=kind_phys), dimension(:), intent(in) :: bk
32983299
logical, intent(in) :: restart
32993300
logical, intent(in) :: hydrostatic
3300-
integer, intent(in) :: communicator
3301+
type(MPI_Comm), intent(in) :: communicator
33013302
integer, intent(in) :: ntasks
33023303
integer, intent(in) :: nthreads
33033304

@@ -3307,9 +3308,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
33073308
integer :: seed0
33083309
logical :: exists
33093310
real(kind=kind_phys) :: tem
3310-
real(kind=kind_phys) :: rinc(5)
3311-
real(kind=kind_sngl_prec) :: rinc4(5)
3312-
real(kind=kind_dbl_prec) :: rinc8(5)
3311+
real(kind=kind_dbl_prec) :: rinc(5)
33133312
real(kind=kind_phys) :: wrk(1)
33143313
real(kind=kind_phys), parameter :: con_hr = 3600.
33153314

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

39803980
real(kind=kind_phys) :: radar_tten_limits(2) = (/ limit_unspecified, limit_unspecified /)
39813981
integer :: itime
3982-
integer :: w3kindreal,w3kindint
39833982

39843983
!--- END NAMELIST VARIABLES
39853984

@@ -4069,8 +4068,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
40694068
hwrf_samfdeep, hwrf_samfshal,progsigma,betascu,betamcu, &
40704069
betadcu,h2o_phys, pdfcld, shcnvcw, redrag, hybedmf, satmedmf,&
40714070
shinhong, do_ysu, dspheat, lheatstrg, lseaspray, cnvcld, &
4072-
random_clds, shal_cnv, imfshalcnv, imfdeepcnv, isatmedmf, &
4073-
do_deep, jcap, &
4071+
xr_cnvcld, random_clds, shal_cnv, imfshalcnv, imfdeepcnv, &
4072+
isatmedmf, do_deep, jcap, &
40744073
cs_parm, flgmin, cgwf, ccwf, cdmbgwd, sup, ctei_rm, crtrh, &
40754074
dlqf, rbcr, shoc_parm, psauras, prauras, wminras, &
40764075
do_sppt, do_shum, do_skeb, &
@@ -4949,6 +4948,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
49494948
Model%lheatstrg = lheatstrg
49504949
Model%lseaspray = lseaspray
49514950
Model%cnvcld = cnvcld
4951+
Model%xr_cnvcld = xr_cnvcld
49524952
Model%random_clds = random_clds
49534953
Model%shal_cnv = shal_cnv
49544954
Model%imfshalcnv = imfshalcnv
@@ -5664,19 +5664,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
56645664
Model%cdec = -9999.
56655665
Model%clstp = -9999
56665666
rinc(1:5) = 0
5667-
call w3kind(w3kindreal,w3kindint)
5668-
if (w3kindreal == 8) then
5669-
rinc8(1:5) = 0
5670-
call w3difdat(jdat,idat,4,rinc8)
5671-
rinc = rinc8
5672-
else if (w3kindreal == 4) then
5673-
rinc4(1:5) = 0
5674-
call w3difdat(jdat,idat,4,rinc4)
5675-
rinc = rinc4
5676-
else
5677-
write(0,*)' FATAL ERROR: Invalid w3kindreal'
5678-
call abort
5679-
endif
5667+
call w3difdat(jdat,idat,4,rinc)
56805668
Model%phour = rinc(4)/con_hr
56815669
Model%fhour = (rinc(4) + Model%dtp)/con_hr
56825670
Model%zhour = mod(Model%phour,Model%fhzero)
@@ -6251,7 +6239,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
62516239
' do_shoc=', Model%do_shoc, ' nshoc3d=', Model%nshoc_3d, &
62526240
' nshoc_2d=', Model%nshoc_2d, ' shoc_cld=', Model%shoc_cld, &
62536241
' nkbfshoc=', Model%nkbfshoc, ' nahdshoc=', Model%nahdshoc, &
6254-
' nscfshoc=', Model%nscfshoc, &
6242+
' nscfshoc=', Model%nscfshoc, ' xr_cnvcld=',Model%xr_cnvcld, &
62556243
' uni_cld=', Model%uni_cld, &
62566244
' ntot3d=', Model%ntot3d, ' ntot2d=', Model%ntot2d, &
62576245
' shocaftcnv=',Model%shocaftcnv,' indcld=', Model%indcld, &
@@ -6474,7 +6462,7 @@ subroutine control_print(Model)
64746462
print *, 'basic control parameters'
64756463
print *, ' me : ', Model%me
64766464
print *, ' master : ', Model%master
6477-
print *, ' communicator : ', Model%communicator
6465+
print *, ' communicator : ', Model%communicator%mpi_val
64786466
print *, ' nlunit : ', Model%nlunit
64796467
print *, ' fn_nml : ', trim(Model%fn_nml)
64806468
print *, ' fhzero : ', Model%fhzero
@@ -7192,7 +7180,6 @@ subroutine tbd_create (Tbd, IM, Model)
71927180
allocate (Tbd%h2opl (IM,levh2o,h2o_coeff))
71937181
Tbd%h2opl = clear_val
71947182
Tbd%ozpl = clear_val
7195-
71967183

71977184
!--- ccn and in needs
71987185
! DH* allocate only for MG? *DH

scm/src/GFS_typedefs.meta

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,7 +3346,7 @@
33463346
long_name = MPI communicator
33473347
units = index
33483348
dimensions = ()
3349-
type = integer
3349+
type = MPI_Comm
33503350
[ntasks]
33513351
standard_name = number_of_mpi_tasks
33523352
long_name = number of MPI tasks in communicator
@@ -5424,6 +5424,12 @@
54245424
units = flag
54255425
dimensions = ()
54265426
type = logical
5427+
[xr_cnvcld]
5428+
standard_name = flag_for_suspended_convective_clouds_in_Xu_Randall
5429+
long_name = flag for using suspended convective clouds in Xu Randall
5430+
units = flag
5431+
dimensions = ()
5432+
type = logical
54275433
[shal_cnv]
54285434
standard_name = flag_for_simplified_arakawa_schubert_shallow_convection
54295435
long_name = flag for calling shallow convection
@@ -10047,7 +10053,7 @@
1004710053
[ltg1_max]
1004810054
standard_name = lightning_threat_index_1
1004910055
long_name = lightning threat index 1
10050-
units = flashes 5 min-1
10056+
units = flashes min-1
1005110057
dimensions = (horizontal_loop_extent)
1005210058
type = real
1005310059
kind = kind_phys
@@ -10056,7 +10062,7 @@
1005610062
[ltg2_max]
1005710063
standard_name = lightning_threat_index_2
1005810064
long_name = lightning threat index 2
10059-
units = flashes 5 min-1
10065+
units = flashes min-1
1006010066
dimensions = (horizontal_loop_extent)
1006110067
type = real
1006210068
kind = kind_phys
@@ -10065,7 +10071,7 @@
1006510071
[ltg3_max]
1006610072
standard_name = lightning_threat_index_3
1006710073
long_name = lightning threat index 3
10068-
units = flashes 5 min-1
10074+
units = flashes min-1
1006910075
dimensions = (horizontal_loop_extent)
1007010076
type = real
1007110077
kind = kind_phys

0 commit comments

Comments
 (0)