diff --git a/.github/workflows/GCC.yml b/.github/workflows/GCC.yml index 86d0bf668..4f8bbf7b5 100644 --- a/.github/workflows/GCC.yml +++ b/.github/workflows/GCC.yml @@ -74,8 +74,8 @@ jobs: steps: - # Only do Doxygen and gcovr build for one job - - name: decide-doc-gcovr-build + # Only do gcovr build for one job + - name: decide-gcovr-build run: | if [[ "${{ matrix.cmake_opts }}" == "-D32BIT=ON" && "${{ matrix.gcc_ver }}" == 12 && "${{ matrix.mpi }}" == mpich ]]; then echo 'devbuild=ON' | tee -a ${GITHUB_ENV} @@ -86,7 +86,6 @@ jobs: - name: install-utilities run: | - sudo apt-get install doxygen graphviz python3 -m pip install gcovr - name: install-cmake @@ -121,7 +120,7 @@ jobs: export CC=mpicc export CXX=mpicxx export FC=mpif90 - cmake ${GITHUB_WORKSPACE}/fv3atm -DBUILD_TESTING=ON ${{ matrix.cmake_opts }} -DENABLE_DOCS=ON ${{ env.gcov_cmake }} + cmake ${GITHUB_WORKSPACE}/fv3atm -DBUILD_TESTING=ON ${{ matrix.cmake_opts }} ${{ env.gcov_cmake }} make -j2 - name: run-tests @@ -144,14 +143,6 @@ jobs: ${{ github.workspace }}/build/*.html ${{ github.workspace }}/build/*.css - - name: upload-docs - uses: actions/upload-artifact@v4 - if: ${{ env.devbuild == 'ON' }} - with: - name: docs-fv3atm - path: | - build/docs/html - - name: debug-artifacts uses: actions/upload-artifact@v4 if: ${{ failure() }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..fbc145e65 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,138 @@ +# This is a CI workflow for the fv3atm project. +# +# This workflow builds the fv3atm doxygen documentation. +# +# Ed Hartnett, 1/9/25 + +name: docs +on: + push: + branches: + - develop + pull_request: + branches: + - develop + +jobs: + build_spack: + runs-on: ubuntu-latest + + strategy: + matrix: + gcc_ver: ["12"] + mpi: ["mpich"] + + steps: + + - name: checkout-fv3atm + uses: actions/checkout@v4 + with: + path: ${{ github.workspace }}/fv3atm + submodules: recursive + + - name: install-cmake + run: | + cd ${{ github.workspace }} + curl -f -s -S -R -L https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-Linux-x86_64.tar.gz | tar -zx + echo "${{ github.workspace }}/cmake-3.29.2-linux-x86_64/bin" >> $GITHUB_PATH + + - name: cache-spack + id: cache-spack + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/spack-develop + key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-${{ matrix.mpi }} + + # Building dependencies takes 40+ min + - name: spack-install + if: steps.cache-spack.outputs.cache-hit != 'true' + run: | + wget --no-verbose https://github.com/spack/spack/archive/refs/heads/develop.zip + unzip develop.zip -d ${GITHUB_WORKSPACE}/ &> unzip.out + . ${GITHUB_WORKSPACE}/spack-develop/share/spack/setup-env.sh + spack env create gcc${{ matrix.gcc_ver }} ${GITHUB_WORKSPACE}/fv3atm/ci/spack.yaml + spack env activate gcc${{ matrix.gcc_ver }} + spack compiler find | grep gcc@${{ matrix.gcc_ver }} + spack external find gmake cmake git git-lfs perl python ${{ matrix.mpi }} + spack config add "packages:all:require:['%gcc@${{ matrix.gcc_ver }}']" + 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_docs: + needs: build_spack + runs-on: ubuntu-latest + + strategy: + matrix: + cmake_opts: ["-D32BIT=ON"] + gcc_ver: ["12"] + mpi: ["mpich"] + + steps: + + # 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 + + - name: install-cmake + run: | + cd ${{ github.workspace }} + curl -f -s -S -R -L https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-Linux-x86_64.tar.gz | tar -zx + echo "${{ github.workspace }}/cmake-3.29.2-linux-x86_64/bin" >> $GITHUB_PATH + + - name: checkout-fv3atm + uses: actions/checkout@v4 + with: + path: ${{ github.workspace }}/fv3atm + submodules: recursive + + - name: cache-spack + id: cache-spack + uses: actions/cache/restore@v4 + with: + path: ${{ github.workspace }}/spack-develop + key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-${{ matrix.mpi }} + + - name: docs-build + run: | + . ${GITHUB_WORKSPACE}/spack-develop/share/spack/setup-env.sh + spack env activate gcc${{ matrix.gcc_ver }} + spack load $(spack find --format "{name}") + cd ${GITHUB_WORKSPACE}/fv3atm + git clone https://github.com/NOAA-EMC/CMakeModules + git clone --recurse-submodules https://github.com/NOAA-PSL/stochastic_physics stochastic_physics_repo + mkdir ${GITHUB_WORKSPACE}/build + cd ${GITHUB_WORKSPACE}/build + export CC=mpicc + export CXX=mpicxx + export FC=mpif90 + cmake ${GITHUB_WORKSPACE}/fv3atm -DBUILD_TESTING=ON ${{ matrix.cmake_opts }} -DENABLE_FV3ATM_DOCS=ON ${{ env.gcov_cmake }} + make doxygen_doc + + - name: upload-docs + uses: actions/upload-artifact@v4 + if: ${{ env.devbuild == 'ON' }} + with: + name: docs-fv3atm + path: | + build/docs/html + + - name: debug-artifacts + uses: actions/upload-artifact@v4 + if: ${{ failure() }} + with: + name: ccpp_prebuild_logs-gcc${{ matrix.gcc_ver }}-${{ matrix.mpi }}-${{ matrix.cmake_opts }} + path: ${{ github.workspace }}/build/ccpp/ccpp_prebuild.* diff --git a/CMakeLists.txt b/CMakeLists.txt index cdf597df2..cef00a251 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,10 +4,11 @@ cmake_minimum_required(VERSION 3.19) # Handle user build options. -option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF) +option(ENABLE_FV3ATM_DOCS "Enable generation of doxygen-based documentation." OFF) # Determine whether or not to generate documentation. -if(ENABLE_DOCS) +if(ENABLE_FV3ATM_DOCS) + message(STATUS "We will build the fv3atm doxygen documentation.") find_package(Doxygen REQUIRED) add_subdirectory(docs) endif() diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 691d099d0..68c753313 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -807,6 +807,8 @@ module GFS_typedefs !< (yr, mon, day, t-zone, hr, min, sec, mil-sec) integer :: idate(4) !< initial date with different size and ordering !< (hr, mon, day, yr) + logical :: gfs_phys_time_vary_is_init=.false. !< GFS_phys_time_vary interstitial initialization flag + !--- radiation control parameters real(kind=kind_phys) :: fhswr !< frequency for shortwave radiation (secs) real(kind=kind_phys) :: fhlwr !< frequency for longwave radiation (secs) @@ -1033,7 +1035,7 @@ module GFS_typedefs real(kind=kind_phys) :: dt_inner !< time step for the inner loop in s logical :: sedi_semi !< flag for semi Lagrangian sedi of rain integer :: decfl !< deformed CFL factor - logical :: thpsnmp_is_init !< Local scheme initialization flag + logical :: thompson_mp_is_init=.false. !< Local scheme initialization flag !--- GFDL microphysical paramters logical :: lgfdlmprad !< flag for GFDL mp scheme and radiation consistency @@ -1222,6 +1224,7 @@ module GFS_typedefs integer :: ichoice = 0 !< flag for closure of C3/GF deep convection integer :: ichoicem = 13!< flag for closure of C3/GF mid convection integer :: ichoice_s = 3 !< flag for closure of C3/GF shallow convection + logical :: gf_coldstart !< flag for cold start GF integer :: conv_cf_opt !< option for convection scheme cloud fraction computation !< 0: Chaboureau-Bechtold !< 1: Xu-Randall @@ -3595,7 +3598,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: dt_inner = -999.0 !< time step for the inner loop logical :: sedi_semi = .false. !< flag for semi Lagrangian sedi of rain integer :: decfl = 8 !< deformed CFL factor - logical :: thpsnmp_is_init = .false. !< Local scheme initialization flag !--- GFDL microphysical parameters logical :: lgfdlmprad = .false. !< flag for GFDLMP radiation interaction @@ -3989,6 +3991,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & integer :: ichoice = 0 !< flag for closure of C3/GF deep convection integer :: ichoicem = 13!< flag for closure of C3/GF mid convection integer :: ichoice_s = 3 !< flag for closure of C3/GF shallow convection + logical :: gf_coldstart = .false. !< flag for cold start GF !-- chem nml variables for RRFS-SD real(kind=kind_phys) :: dust_drylimit_factor = 1.0 @@ -4205,7 +4208,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & do_smoke_transport,smoke_conv_wet_coef,n_dbg_lines, & add_fire_moist_flux, sc_factor, & !--- C3/GF closures - ichoice,ichoicem,ichoice_s, & + ichoice,ichoicem,ichoice_s,gf_coldstart, & !--- (DFI) time ranges with radar-prescribed microphysics tendencies ! and (maybe) convection suppression fh_dfi_radar, radar_tten_limits, do_cap_suppress, & @@ -4480,6 +4483,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%ichoice_s = ichoice_s Model%ichoicem = ichoicem Model%ichoice = ichoice + Model%gf_coldstart = gf_coldstart !--- integrated dynamics through earth's atmosphere Model%lsidea = lsidea @@ -6592,6 +6596,7 @@ subroutine control_print(Model) print*,'ichoice_s : ', Model%ichoice_s print*,'ichoicem : ', Model%ichoicem print*,'ichoice : ', Model%ichoice + print*,'gf_coldstart : ', Model%gf_coldstart endif if(model%rrfs_sd) then print *, ' ' diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index bf212ca6e..1232c04c9 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4911,12 +4911,18 @@ units = count dimensions = () type = integer -[thpsnmp_is_init] +[thompson_mp_is_init] standard_name = flag_for_thompson_mp_scheme_initialization long_name = flag carrying scheme initialization status units = flag dimensions = () type = logical +[gfs_phys_time_vary_is_init] + standard_name = flag_for_gfs_phys_time_vary_interstitial_initialization + long_name = flag carrying interstitial initialization status + units = flag + dimensions = () + type = logical [lgfdlmprad] standard_name = flag_for_GFDL_microphysics_radiation_interaction long_name = flag for GFDL microphysics-radiation interaction @@ -5623,6 +5629,12 @@ units = flag dimensions = () type = integer +[gf_coldstart] + standard_name = flag_for_cold_start_gf + long_name = flag to cold start G-F + units = flag + dimensions = () + type = logical [hwrf_samfdeep] standard_name = flag_for_hurricane_specific_code_in_scale_aware_mass_flux_deep_convection long_name = flag for hwrf samfdeepcnv scheme diff --git a/ccpp/suites/suite_FV3_GFS_v17_coupled_p8.xml b/ccpp/suites/suite_FV3_GFS_v17_coupled_p8.xml index 0cf5f40af..7d97c67b1 100644 --- a/ccpp/suites/suite_FV3_GFS_v17_coupled_p8.xml +++ b/ccpp/suites/suite_FV3_GFS_v17_coupled_p8.xml @@ -43,6 +43,7 @@ sfc_nst sfc_nst_post noahmpdrv + sfc_land sfc_cice sfc_sice GFS_surface_loop_control_part2 diff --git a/ccpp/suites/suite_FV3_GFS_v17_coupled_p8_ugwpv1.xml b/ccpp/suites/suite_FV3_GFS_v17_coupled_p8_ugwpv1.xml index e7bb03710..134fe7b9d 100644 --- a/ccpp/suites/suite_FV3_GFS_v17_coupled_p8_ugwpv1.xml +++ b/ccpp/suites/suite_FV3_GFS_v17_coupled_p8_ugwpv1.xml @@ -43,6 +43,7 @@ sfc_nst sfc_nst_post noahmpdrv + sfc_land sfc_cice sfc_sice GFS_surface_loop_control_part2 diff --git a/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1.xml b/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1.xml index c94396454..5ceab7c64 100644 --- a/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1.xml +++ b/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1.xml @@ -43,6 +43,7 @@ sfc_nst sfc_nst_post noahmpdrv + sfc_land sfc_sice GFS_surface_loop_control_part2 diff --git a/ccpp/suites/suite_RRFS_sas.xml b/ccpp/suites/suite_RRFS_sas.xml new file mode 100644 index 000000000..6ca272c54 --- /dev/null +++ b/ccpp/suites/suite_RRFS_sas.xml @@ -0,0 +1,84 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + lsm_ruc + clm_lake + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + rrfs_smoke_wrapper + mynnedmf_wrapper + rrfs_smoke_postpbl + GFS_GWD_generic_pre + drag_suite + GFS_GWD_generic_post + GFS_suite_stateout_update + GFS_photochemistry + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_RRFS_sas_nogwd.xml b/ccpp/suites/suite_RRFS_sas_nogwd.xml new file mode 100644 index 000000000..a68c1de3e --- /dev/null +++ b/ccpp/suites/suite_RRFS_sas_nogwd.xml @@ -0,0 +1,81 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + lsm_ruc + clm_lake + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + rrfs_smoke_wrapper + mynnedmf_wrapper + rrfs_smoke_postpbl + GFS_suite_stateout_update + GFS_photochemistry + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 6273869d8..17ed6c084 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -2,16 +2,12 @@ # # Ed Hartnett 12/28/23 -IF(ENABLE_DOCS) - - # Create doxyfile. - SET(abs_top_srcdir "${CMAKE_SOURCE_DIR}") - SET(abs_top_builddir "${CMAKE_BINARY_DIR}") - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) - ADD_CUSTOM_TARGET(doxygen_doc ALL - ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating API Documentation with Doxygen" VERBATIM) - -ENDIF(ENABLE_DOCS) +# Create doxyfile. +SET(abs_top_srcdir "${CMAKE_SOURCE_DIR}") +SET(abs_top_builddir "${CMAKE_BINARY_DIR}") +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) +ADD_CUSTOM_TARGET(doxygen_doc ALL + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API Documentation with Doxygen" VERBATIM) diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index d89e7145e..5c4a8b8f4 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -864,8 +864,11 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. +# Note EJH: Add @abs_top_srcdir@ after doxygenating those code +# files. The comments in one of them are activating a bug in doxygen +# and need to be cleaned up to get a doxygen build working. + INPUT = @abs_top_srcdir@/docs/user_guide.md \ - @abs_top_srcdir@ \ @abs_top_srcdir@/ccpp \ @abs_top_srcdir@/cpl \ @abs_top_srcdir@/io \