Skip to content

Commit

Permalink
Merge branch 'NOAA-EMC:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen authored Dec 3, 2024
2 parents 542af9c + b769849 commit 48a723f
Show file tree
Hide file tree
Showing 80 changed files with 4,436 additions and 3,699 deletions.
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ Do PRs in upstream repositories need to be merged first?
If so add the "waiting for other repos" label and list the upstream PRs
- waiting on noaa-emc/nems/pull/<pr_number>
- waiting on noaa-emc/fv3atm/pull/<pr_number>

# Requirements before merging
- [ ] All new code in this PR is tested by at least one unit test
- [ ] All new code in this PR includes Doxygen documentation
- [ ] All new code in this PR does not add new compilation warnings (check CI output)
47 changes: 39 additions & 8 deletions .github/workflows/GCC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
mpi: ["mpich", "openmpi"]

steps:

- name: checkout-fv3atm
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -59,6 +59,7 @@ jobs:
spack config add "packages:mpi:require:'${{ matrix.mpi }}'"
spack concretize |& tee ${SPACK_ENV}/log.concretize
spack install -j2 --fail-fast
echo "spackrc=$?" >> ${GITHUB_ENV}
spack clean --all
build_fv3atm:
Expand All @@ -73,9 +74,20 @@ jobs:

steps:

- name: install-doxygen
# Only do Doxygen and gcovr build for one job
- name: decide-doc-gcovr-build
run: |
if [[ "${{ matrix.cmake_opts }}" == "-D32BIT=ON" && "${{ matrix.gcc_ver }}" == 12 && "${{ matrix.mpi }}" == mpich ]]; then
echo 'devbuild=ON' | tee -a ${GITHUB_ENV}
echo 'gcov_cmake="-DCMAKE_Fortran_FLAGS=-fprofile-abs-path -fprofile-arcs -ftest-coverage -O0"' | tee -a ${GITHUB_ENV}
else
echo 'devbuild=OFF' | tee -a ${GITHUB_ENV}
fi
- name: install-utilities
run: |
sudo apt-get install doxygen graphviz
python3 -m pip install gcovr
- name: install-cmake
run: |
Expand Down Expand Up @@ -109,14 +121,34 @@ jobs:
export CC=mpicc
export CXX=mpicxx
export FC=mpif90
cat /home/runner/work/fv3atm/fv3atm/spack-develop/opt/spack/linux-ubuntu22.04-zen2/gcc-12.3.0/fms-2023.04-*/lib/cmake/fms/fms-config.cmake
cmake ${GITHUB_WORKSPACE}/fv3atm -DBUILD_TESTING=ON ${{ matrix.cmake_opts }} -DENABLE_DOCS=ON
cmake ${GITHUB_WORKSPACE}/fv3atm -DBUILD_TESTING=ON ${{ matrix.cmake_opts }} -DENABLE_DOCS=ON ${{ env.gcov_cmake }}
make -j2
ls -l /home/runner/work/fv3atm/fv3atm/fv3atm/io
- uses: actions/upload-artifact@v4
- name: run-tests
run: |
cd $GITHUB_WORKSPACE/build
ctest -j2 --output-on-failure --rerun-failed
- name: get-test-coverage
if: ${{ env.devbuild == 'ON' }}
run: |
cd $GITHUB_WORKSPACE/build
gcovr -r .. -v --html-details --gcov-executable gcov-12 --exclude $GITHUB_WORKSPACE/fv3atm/tests --exclude $GITHUB_WORKSPACE/fv3atm/stochastic_physics_repo --exclude $GITHUB_WORKSPACE/fv3atm/build/ccpp --exclude $GITHUB_WORKSPACE/fv3atm/ccpp/physics --exclude $GITHUB_WORKSPACE/fv3atm/ccpp/framework --exclude $GITHUB_WORKSPACE/fv3atm/atmos_cubed_sphere --exclude CMakeFiles --print-summary -o test-coverage.html
- name: upload-test-coverage
uses: actions/upload-artifact@v4
if: ${{ env.devbuild == 'ON' }}
with:
name: test-coverage-fv3atm-${{ github.sha }}
path: |
${{ github.workspace }}/build/*.html
${{ github.workspace }}/build/*.css
- name: upload-docs
uses: actions/upload-artifact@v4
if: ${{ env.devbuild == 'ON' }}
with:
name: docs-gcc${{ matrix.gcc_ver }}-${{ matrix.mpi }}-${{ matrix.cmake_opts }}
name: docs-fv3atm
path: |
build/docs/html
Expand All @@ -126,4 +158,3 @@ jobs:
with:
name: ccpp_prebuild_logs-gcc${{ matrix.gcc_ver }}-${{ matrix.mpi }}-${{ matrix.cmake_opts }}
path: ${{ github.workspace }}/build/ccpp/ccpp_prebuild.*

5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ if(OPENMP)
target_link_libraries(fv3atm PUBLIC OpenMP::OpenMP_Fortran)
endif()

if(BUILD_TESTING)
include(CTest)
add_subdirectory(tests)
endif()

###############################################################################
### Install
###############################################################################
Expand Down
1,078 changes: 585 additions & 493 deletions atmos_model.F90

Large diffs are not rendered by default.

35 changes: 23 additions & 12 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
'physics/physics/hooks/machine.F',
'physics/physics/Radiation/RRTMG/radsw_param.f',
'physics/physics/Radiation/RRTMG/radlw_param.f',
'physics/physics/photochem/h2o_def.f',
'physics/physics/photochem/module_ozphys.F90',
'physics/physics/photochem/module_h2ophys.F90',
'physics/physics/SFC_Models/Land/Noahmp/lnd_iau_mod.F90',
'data/CCPP_typedefs.F90',
'data/GFS_typedefs.F90',
'data/CCPP_data.F90',
Expand All @@ -45,6 +46,16 @@
'module_ozphys' : '',
'ty_ozphys' : '',
},
'module_h2ophys' : {
'module_h2ophys' : '',
'ty_h2ophys' : '',
},
'land_iau_mod' : {
'land_iau_mod' : '',
'land_iau_external_data_type' : '',
'land_iau_state_type' : '',
'land_iau_control_type' : '',
},
'CCPP_typedefs' : {
'GFS_interstitial_type' : 'GFS_Interstitial(cdata%thrd_no)',
'GFDL_interstitial_type' : 'GFDL_interstitial',
Expand All @@ -55,16 +66,15 @@
},
'GFS_typedefs' : {
'GFS_control_type' : 'GFS_Control',
'GFS_data_type' : 'GFS_Data(cdata%blk_no)',
'GFS_diag_type' : 'GFS_Data(cdata%blk_no)%Intdiag',
'GFS_tbd_type' : 'GFS_Data(cdata%blk_no)%Tbd',
'GFS_sfcprop_type' : 'GFS_Data(cdata%blk_no)%Sfcprop',
'GFS_coupling_type' : 'GFS_Data(cdata%blk_no)%Coupling',
'GFS_statein_type' : 'GFS_Data(cdata%blk_no)%Statein',
'GFS_cldprop_type' : 'GFS_Data(cdata%blk_no)%Cldprop',
'GFS_radtend_type' : 'GFS_Data(cdata%blk_no)%Radtend',
'GFS_grid_type' : 'GFS_Data(cdata%blk_no)%Grid',
'GFS_stateout_type' : 'GFS_Data(cdata%blk_no)%Stateout',
'GFS_statein_type' : 'GFS_Statein',
'GFS_stateout_type' : 'GFS_Stateout',
'GFS_grid_type' : 'GFS_Grid',
'GFS_tbd_type' : 'GFS_Tbd',
'GFS_cldprop_type' : 'GFS_Cldprop',
'GFS_sfcprop_type' : 'GFS_Sfcprop',
'GFS_radtend_type' : 'GFS_Radtend',
'GFS_coupling_type' : 'GFS_Coupling',
'GFS_diag_type' : 'GFS_Intdiag',
'GFS_typedefs' : '',
},
}
Expand All @@ -86,6 +96,7 @@
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_photochemistry.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.F90',
Expand Down Expand Up @@ -151,7 +162,7 @@
'physics/physics/GWD/gwdc_post.f',
'physics/physics/GWD/gwdps.f',
'physics/physics/GWD/rayleigh_damp.f',
'physics/physics/photochem/h2ophys.f',
'physics/physics/photochem/module_h2ophys.F90',
'physics/physics/photochem/module_ozphys.F90',
'physics/physics/MP/Ferrier_Aligo/mp_fer_hires.F90',
'physics/physics/MP/GFDL/gfdl_cloud_microphys.F90',
Expand Down
34 changes: 29 additions & 5 deletions ccpp/data/CCPP_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ module CCPP_data
use CCPP_typedefs, only: GFS_interstitial_type, &
GFDL_interstitial_type
use GFS_typedefs, only: GFS_control_type, &
GFS_data_type
GFS_statein_type, &
GFS_stateout_type, &
GFS_grid_type, &
GFS_tbd_type, &
GFS_cldprop_type, &
GFS_sfcprop_type, &
GFS_radtend_type, &
GFS_coupling_type, &
GFS_diag_type

implicit none

Expand All @@ -20,15 +28,31 @@ module CCPP_data
ccpp_suite, &
GFDL_interstitial, &
GFS_control, &
GFS_data, &
GFS_statein, &
GFS_stateout, &
GFS_grid, &
GFS_tbd, &
GFS_cldprop, &
GFS_sfcprop, &
GFS_radtend, &
GFS_coupling, &
GFS_intdiag, &
GFS_interstitial

!-------------------------------------------------------!
! GFS data containers, GFS_Data has dimension nblocks !
! and GFS_Interstitial has dimension nthreads !
! GFS data containers; !
! GFS_Interstitial has dimension nthreads !
!-------------------------------------------------------!
type(GFS_control_type), save, target :: GFS_control
type(GFS_data_type), dimension(:), allocatable, save, target :: GFS_data
type(GFS_statein_type), save, target :: GFS_statein
type(GFS_stateout_type), save, target :: GFS_stateout
type(GFS_grid_type), save, target :: GFS_grid
type(GFS_tbd_type), save, target :: GFS_tbd
type(GFS_cldprop_type), save, target :: GFS_cldprop
type(GFS_sfcprop_type), save, target :: GFS_sfcprop
type(GFS_radtend_type), save, target :: GFS_radtend
type(GFS_coupling_type), save, target :: GFS_coupling
type(GFS_diag_type), save, target :: GFS_intdiag
type(GFS_interstitial_type), dimension(:), allocatable, save, target :: GFS_interstitial

!------------------------------------------------------!
Expand Down
62 changes: 52 additions & 10 deletions ccpp/data/CCPP_data.meta
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,66 @@
units = DDT
dimensions = ()
type = GFS_control_type
[GFS_Data(ccpp_block_number)]
standard_name = GFS_data_type_instance
long_name = instance of derived type GFS_data_type
[GFS_Statein]
standard_name = GFS_statein_type_instance
long_name = prognostic state data in from dycore
units = DDT
dimensions = ()
type = GFS_data_type
type = GFS_statein_type
[GFS_Stateout]
standard_name = GFS_stateout_type_instance
long_name = prognostic state or tendencies return to dycore
units = DDT
dimensions = ()
type = GFS_stateout_type
[GFS_Grid]
standard_name = GFS_grid_type_instance
long_name = instance of derived type GFS_grid_type
units = DDT
dimensions = ()
type = GFS_grid_type
[GFS_Tbd]
standard_name = GFS_tbd_type_instance
long_name = instance of derived type GFS_tbd_type
units = DDT
dimensions = ()
type = GFS_tbd_type
[GFS_Cldprop]
standard_name = GFS_cldprop_type_instance
long_name = instance of derived type GFS_cldprop_type
units = DDT
dimensions = ()
type = GFS_cldprop_type
[GFS_Sfcprop]
standard_name = GFS_sfcprop_type_instance
long_name = instance of derived type GFS_sfcprop_type
units = DDT
dimensions = ()
type = GFS_sfcprop_type
[GFS_Radtend]
standard_name = GFS_radtend_type_instance
long_name = instance of derived type GFS_radtend_type
units = DDT
dimensions = ()
type = GFS_radtend_type
[GFS_Coupling]
standard_name = GFS_coupling_type_instance
long_name = instance of derived type GFS_coupling_type
units = DDT
dimensions = ()
type = GFS_coupling_type
[GFS_Intdiag]
standard_name = GFS_diag_type_instance
long_name = instance of derived type GFS_diag_type
units = DDT
dimensions = ()
type = GFS_diag_type
[GFS_Interstitial(ccpp_thread_number)]
standard_name = GFS_interstitial_type_instance
long_name = instance of derived type GFS_interstitial_type
units = DDT
dimensions = ()
type = GFS_interstitial_type
[GFS_Data]
standard_name = GFS_data_type_instance_all_blocks
long_name = instance of derived type GFS_data_type
units = DDT
dimensions = (ccpp_block_count)
type = GFS_data_type
[GFS_Interstitial]
standard_name = GFS_interstitial_type_instance_all_threads
long_name = instance of derived type GFS_interstitial_type
Expand Down
47 changes: 0 additions & 47 deletions ccpp/data/CCPP_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ module CCPP_typedefs
integer :: nbdlw !<
integer :: nbdsw !<
real (kind=kind_phys), pointer :: ncgl(:,:) => null() !<
real (kind=kind_phys), pointer :: ncpi(:,:) => null() !<
real (kind=kind_phys), pointer :: ncpl(:,:) => null() !<
real (kind=kind_phys), pointer :: ncpr(:,:) => null() !<
real (kind=kind_phys), pointer :: ncps(:,:) => null() !<
integer :: ncstrac !<
Expand Down Expand Up @@ -367,15 +365,6 @@ module CCPP_typedefs
real (kind=kind_phys), pointer :: tracer(:,:,:) => null() !<
real (kind=kind_phys), pointer :: aerosolslw(:,:,:,:) => null() !< Aerosol radiative properties in each LW band.
real (kind=kind_phys), pointer :: aerosolssw(:,:,:,:) => null() !< Aerosol radiative properties in each SW band.
real (kind=kind_phys), pointer :: cld_frac(:,:) => null() !< Total cloud fraction
real (kind=kind_phys), pointer :: cld_lwp(:,:) => null() !< Cloud liquid water path
real (kind=kind_phys), pointer :: cld_reliq(:,:) => null() !< Cloud liquid effective radius
real (kind=kind_phys), pointer :: cld_iwp(:,:) => null() !< Cloud ice water path
real (kind=kind_phys), pointer :: cld_reice(:,:) => null() !< Cloud ice effecive radius
real (kind=kind_phys), pointer :: cld_swp(:,:) => null() !< Cloud snow water path
real (kind=kind_phys), pointer :: cld_resnow(:,:) => null() !< Cloud snow effective radius
real (kind=kind_phys), pointer :: cld_rwp(:,:) => null() !< Cloud rain water path
real (kind=kind_phys), pointer :: cld_rerain(:,:) => null() !< Cloud rain effective radius
real (kind=kind_phys), pointer :: precip_frac(:,:) => null() !< Precipitation fraction
real (kind=kind_phys), pointer :: cld_cnv_frac(:,:) => null() !< SGS convective cloud fraction
real (kind=kind_phys), pointer :: cld_cnv_lwp(:,:) => null() !< SGS convective cloud liquid water path
Expand Down Expand Up @@ -766,15 +755,6 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%fluxswDOWN_clrsky (IM, Model%levs+1))
allocate (Interstitial%aerosolslw (IM, Model%levs, Model%rrtmgp_nBandsLW, NF_AELW))
allocate (Interstitial%aerosolssw (IM, Model%levs, Model%rrtmgp_nBandsSW, NF_AESW))
allocate (Interstitial%cld_frac (IM, Model%levs))
allocate (Interstitial%cld_lwp (IM, Model%levs))
allocate (Interstitial%cld_reliq (IM, Model%levs))
allocate (Interstitial%cld_iwp (IM, Model%levs))
allocate (Interstitial%cld_reice (IM, Model%levs))
allocate (Interstitial%cld_swp (IM, Model%levs))
allocate (Interstitial%cld_resnow (IM, Model%levs))
allocate (Interstitial%cld_rwp (IM, Model%levs))
allocate (Interstitial%cld_rerain (IM, Model%levs))
allocate (Interstitial%precip_frac (IM, Model%levs))
allocate (Interstitial%cld_cnv_frac (IM, Model%levs))
allocate (Interstitial%cnv_cloud_overlap_param(IM, Model%levs))
Expand Down Expand Up @@ -862,15 +842,6 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%cnv_ndrop (IM,Model%levs))
allocate (Interstitial%cnv_nice (IM,Model%levs))
end if
if (Model%do_shoc) then
if (.not. associated(Interstitial%qrn)) allocate (Interstitial%qrn (IM,Model%levs))
if (.not. associated(Interstitial%qsnw)) allocate (Interstitial%qsnw (IM,Model%levs))
! DH* updated version of shoc from May 22 2019 (not yet in CCPP) doesn't use qgl? remove?
if (.not. associated(Interstitial%qgl)) allocate (Interstitial%qgl (IM,Model%levs))
! *DH
allocate (Interstitial%ncpi (IM,Model%levs))
allocate (Interstitial%ncpl (IM,Model%levs))
end if
if (Model%lsm == Model%lsm_noahmp) then
allocate (Interstitial%t2mmp (IM))
allocate (Interstitial%q2mp (IM))
Expand Down Expand Up @@ -1176,15 +1147,6 @@ subroutine gfs_interstitial_rad_reset (Interstitial, Model)
Interstitial%fluxswDOWN_clrsky = clear_val
Interstitial%aerosolslw = clear_val
Interstitial%aerosolssw = clear_val
Interstitial%cld_frac = clear_val
Interstitial%cld_lwp = clear_val
Interstitial%cld_reliq = clear_val
Interstitial%cld_iwp = clear_val
Interstitial%cld_reice = clear_val
Interstitial%cld_swp = clear_val
Interstitial%cld_resnow = clear_val
Interstitial%cld_rwp = clear_val
Interstitial%cld_rerain = clear_val
Interstitial%precip_frac = clear_val
Interstitial%cld_cnv_frac = clear_val
Interstitial%cnv_cloud_overlap_param = clear_val
Expand Down Expand Up @@ -1471,15 +1433,6 @@ subroutine gfs_interstitial_phys_reset (Interstitial, Model)
Interstitial%cnv_ndrop = clear_val
Interstitial%cnv_nice = clear_val
end if
if (Model%do_shoc) then
Interstitial%qrn = clear_val
Interstitial%qsnw = clear_val
! DH* updated version of shoc from May 22 2019 doesn't use qgl? remove?
Interstitial%qgl = clear_val
! *DH
Interstitial%ncpi = clear_val
Interstitial%ncpl = clear_val
end if
if (Model%lsm == Model%lsm_noahmp) then
Interstitial%t2mmp = clear_val
Interstitial%q2mp = clear_val
Expand Down
Loading

0 comments on commit 48a723f

Please sign in to comment.