Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit da95cc4
Author: WenMeng-NOAA <48260754+WenMeng-NOAA@users.noreply.github.com>
Date:   Fri Apr 19 12:36:43 2024 -0400

    Update upp submodule (NOAA-EMC#811)

    * Update github workflow. Update gcc to 12 and mpi to openmpi

    * Add 'spack clean' to reduce the size of the cache files

    * Split GCC.yml workflow into two jobs, build_spack and build_fv3atm

    * Update github workflow. Add mpich

    * Update github actions to v4

    * Use action/cache/restore in build_fv3atm job

    * update upp revision to 5faac75

    * Update GCC.yml

    ---------

    Co-authored-by: Dusan Jovic <dusan.jovic@noaa.gov>

commit 979bcab
Author: Dusan Jovic <48258889+DusanJovic-NOAA@users.noreply.github.com>
Date:   Wed Apr 17 13:42:06 2024 -0400

    Update dycore to remove compiler warnings (NOAA-EMC#813)

    * Update atmos_cubed_sphere and add compile definition BYPASS_BREED_SLP_INLINE to dycore

    * Pass correct mpi communicator type to post_alctvars routine in inline post

commit 37e7d48
Author: Samuel Trahan (NOAA contractor) <39415369+SamuelTrahanNOAA@users.noreply.github.com>
Date:   Sun Apr 14 13:00:07 2024 -0400

    bug fixes: kchunk3d ignored, hailwat uninitialized in dycore, tile_num wrong for nests (NOAA-EMC#806)

    * nesting fixes
    1. Initialize hailwat index in dynamical core.
    2. Use the correct tile number for nests in atmos_model.F90.

    * remove unneeded write statements

    * Fix kchunk3d in io/module_write_netcdf.F90

    ---------

    Co-authored-by: Dusan Jovic <dusan.jovic@noaa.gov>

commit 383687e
Author: JONG KIM <jong.kim@noaa.gov>
Date:   Thu Apr 4 16:34:52 2024 -0400

    cubed_sphere hash fix to f060e85 (NOAA-EMC#817)

    * Update cubed_sphere@f060e85 hash: a bug fix in the HAILCAST diagnostic code (units issue)

commit 1cac9d3
Author: Denise Worthen <denise.worthen@noaa.gov>
Date:   Wed Apr 3 16:48:31 2024 -0400

    Enable cpl_scalars (NOAA-EMC#794)

    * add cpl_scalars for atm

    * add field cpl_scalars to export state of fv3atm when coupled.
    cpl_scalars contain the dimensions of the fv3atm domain and are
    used by cmeps to write mediator history files as a single 2d
    grid for regional and 6 2d grids for CSG.

    * remove unused NUOPC use statement

commit 1b75fe2
Author: Dusan Jovic <48258889+DusanJovic-NOAA@users.noreply.github.com>
Date:   Mon Apr 1 17:12:08 2024 -0400

    Update module_write_netcdf to avoid hangs in RRFS runs (NOAA-EMC#803)

    * Split add_dim into two routines

    * Add NF90_NODIMSCALE_ATTACH constant

    * Test classic netcdf file formats

commit 1ba8410
Author: lisa-bengtsson <54411948+lisa-bengtsson@users.noreply.github.com>
Date:   Wed Mar 27 12:12:00 2024 -0600

    Introduce namelist flag xr_cnvcld to control if suspended grid-mean convective cloud condensate should be included in cloud fraction and optical depth calculation in radiation in the GFS suite. (NOAA-EMC#799)

    * Update ccpp/physics for namelist flag xr_cnvcld
  • Loading branch information
zhanglikate committed Apr 30, 2024
1 parent 58f1815 commit 9e250eb
Show file tree
Hide file tree
Showing 16 changed files with 540 additions and 127 deletions.
73 changes: 57 additions & 16 deletions .github/workflows/GCC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,34 @@ on:
- develop

jobs:
GCC:
build_spack:
runs-on: ubuntu-latest

strategy:
matrix:
cmake_opts: ["-D32BIT=ON", "-D32BIT=OFF"]
gcc_ver: ["11"]
mpi: ["mpich"]
gcc_ver: ["12"]
mpi: ["mpich", "openmpi"]

steps:

- name: install-doxygen
run: |
sudo apt-get install doxygen graphviz
- name: checkout-fv3atm
uses: actions/checkout@v3
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@v3
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/spack-develop
key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-2-${{ matrix.cmake_opts }}-${{ matrix.mpich }}
key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-${{ matrix.mpi }}

# Building dependencies takes 40+ min
- name: spack-install
Expand All @@ -58,6 +59,42 @@ jobs:
spack config add "packages:mpi:require:'${{ matrix.mpi }}'"
spack concretize |& tee ${SPACK_ENV}/log.concretize
spack install -j2 --fail-fast
spack clean --all
build_fv3atm:
needs: build_spack
runs-on: ubuntu-latest

strategy:
matrix:
cmake_opts: ["-D32BIT=ON", "-D32BIT=OFF"]
gcc_ver: ["12"]
mpi: ["mpich", "openmpi"]

steps:

- name: install-doxygen
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: build-fv3atm
run: |
Expand All @@ -70,20 +107,24 @@ jobs:
mkdir ${GITHUB_WORKSPACE}/build
sed -i 's/doc /upp_doc /' upp/docs/CMakeLists.txt
cd ${GITHUB_WORKSPACE}/build
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
make -j2
ls -l /home/runner/work/fv3atm/fv3atm/fv3atm/io
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: docs
name: docs-gcc${{ matrix.gcc_ver }}-${{ matrix.mpi }}-${{ matrix.cmake_opts }}
path: |
build/docs/html
- name: debug-artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ccpp_prebuild_logs
name: ccpp_prebuild_logs-gcc${{ matrix.gcc_ver }}-${{ matrix.mpi }}-${{ matrix.cmake_opts }}
path: ${{ github.workspace }}/build/ccpp/ccpp_prebuild.*

4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
# Determine whether or not to generate documentation.
if(ENABLE_DOCS)
find_package(Doxygen REQUIRED)
add_subdirectory(docs)
add_subdirectory(docs)
endif()

# Enable CI build & unit testing:
Expand Down Expand Up @@ -38,6 +38,7 @@ if(MOVING_NEST)
set(MOVING_NEST ON)
endif()
add_subdirectory(atmos_cubed_sphere)
target_compile_definitions(fv3 PRIVATE BYPASS_BREED_SLP_INLINE)

###############################################################################
### fv3atm
Expand Down Expand Up @@ -105,6 +106,7 @@ add_library(fv3atm
cpl/module_block_data.F90
cpl/module_cplfields.F90
cpl/module_cap_cpl.F90
cpl/module_cplscalars.F90
io/fv3atm_common_io.F90
io/fv3atm_clm_lake_io.F90
io/fv3atm_rrfs_sd_io.F90
Expand Down
57 changes: 31 additions & 26 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
call atmosphere_diag_axes (Atmos%axes)
call atmosphere_etalvls (Atmos%ak, Atmos%bk, flip=flip_vc)

call atmosphere_control_data (isc, iec, jsc, jec, nlev, p_hydro, hydro, tile_num)
tile_num=-1
call atmosphere_control_data (isc, iec, jsc, jec, nlev, p_hydro, hydro, global_tile_num=tile_num)

allocate (Atmos%lon(nlon,nlat), Atmos%lat(nlon,nlat))
call atmosphere_grid_ctr (Atmos%lon, Atmos%lat)
Expand Down Expand Up @@ -3142,7 +3143,8 @@ subroutine setup_exportdata(rc)

use ESMF

use module_cplfields, only: exportFields, chemistryFieldNames
use module_cplfields, only: exportFields, chemistryFieldNames
use module_cplscalars, only: flds_scalar_name

!--- arguments
integer, optional, intent(out) :: rc
Expand Down Expand Up @@ -3192,33 +3194,36 @@ subroutine setup_exportdata(rc)
if (isFound) then
call ESMF_FieldGet(exportFields(n), name=fieldname, rank=rank, typekind=datatype, rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__, rcToReturn=rc)) return
if (datatype == ESMF_TYPEKIND_R8) then
select case (rank)
case (2)
call ESMF_FieldGet(exportFields(n),farrayPtr=datar82d,localDE=0, rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__, rcToReturn=rc)) return
case (3)
call ESMF_FieldGet(exportFields(n),farrayPtr=datar83d,localDE=0, rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__, rcToReturn=rc)) return
case default
!--- skip field
isFound = .false.
end select
else if (datatype == ESMF_TYPEKIND_R4) then
select case (rank)
case (2)
call ESMF_FieldGet(exportFields(n),farrayPtr=datar42d,localDE=0, rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__, rcToReturn=rc)) return
case default
!--- skip field
isFound = .false.
end select
else
!--- skip field
if (trim(fieldname) == trim(flds_scalar_name)) then
isFound = .false.
else
if (datatype == ESMF_TYPEKIND_R8) then
select case (rank)
case (2)
call ESMF_FieldGet(exportFields(n),farrayPtr=datar82d,localDE=0, rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__, rcToReturn=rc)) return
case (3)
call ESMF_FieldGet(exportFields(n),farrayPtr=datar83d,localDE=0, rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__, rcToReturn=rc)) return
case default
!--- skip field
isFound = .false.
end select
else if (datatype == ESMF_TYPEKIND_R4) then
select case (rank)
case (2)
call ESMF_FieldGet(exportFields(n),farrayPtr=datar42d,localDE=0, rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__, rcToReturn=rc)) return
case default
!--- skip field
isFound = .false.
end select
else
!--- skip field
isFound = .false.
end if
end if
end if

!--- skip field if only required for chemistry
if (isFound .and. GFS_control%cplchm) isFound = .not.any(trim(fieldname) == chemistryFieldNames)

Expand Down
9 changes: 6 additions & 3 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,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 @@ -3817,6 +3818,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 @@ -4249,8 +4251,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 @@ -5130,6 +5132,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 @@ -6462,7 +6465,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
6 changes: 6 additions & 0 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -5534,6 +5534,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
1 change: 0 additions & 1 deletion cpl/module_cap_cpl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module module_cap_cpl

private
public diagnose_cplFields
!
contains

!-----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 9e250eb

Please sign in to comment.