Skip to content

Commit 6d0cfdc

Browse files
authored
Merge pull request #122 from grantfirl/ufs-dev-PR94
UFS-dev PR#94
2 parents a53e98c + 2ab396d commit 6d0cfdc

19 files changed

+3737
-179
lines changed

.github/workflows/GCC.yml

+15-9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626

2727
steps:
2828

29+
- name: install-doxygen
30+
run: |
31+
sudo apt-get install doxygen graphviz
32+
2933
- name: checkout-fv3atm
3034
uses: actions/checkout@v3
3135
with:
@@ -37,7 +41,7 @@ jobs:
3741
uses: actions/cache@v3
3842
with:
3943
path: ${{ github.workspace }}/spack-develop
40-
key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-2
44+
key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-2-${{ matrix.cmake_opts }}-${{ matrix.mpich }}
4145

4246
# Building dependencies takes 40+ min
4347
- name: spack-install
@@ -55,13 +59,6 @@ jobs:
5559
spack concretize |& tee ${SPACK_ENV}/log.concretize
5660
spack install -j2 --fail-fast
5761
58-
- name: cache-save
59-
uses: actions/cache/save@v3
60-
if: ${{ always() }}
61-
with:
62-
path: ${{ github.workspace }}/spack-develop
63-
key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-2
64-
6562
- name: build-fv3atm
6663
run: |
6764
. ${GITHUB_WORKSPACE}/spack-develop/share/spack/setup-env.sh
@@ -71,13 +68,22 @@ jobs:
7168
git clone https://github.com/NOAA-EMC/CMakeModules
7269
git clone --recurse-submodules https://github.com/NOAA-PSL/stochastic_physics stochastic_physics_repo
7370
mkdir ${GITHUB_WORKSPACE}/build
71+
sed -i 's/doc /upp_doc /' upp/docs/CMakeLists.txt
7472
cd ${GITHUB_WORKSPACE}/build
75-
cmake ${GITHUB_WORKSPACE}/fv3atm -DBUILD_TESTING=ON ${{ matrix.cmake_opts }}
73+
cmake ${GITHUB_WORKSPACE}/fv3atm -DBUILD_TESTING=ON ${{ matrix.cmake_opts }} -DENABLE_DOCS=ON
7674
make -j2
75+
ls -l /home/runner/work/fv3atm/fv3atm/fv3atm/io
7776
77+
- uses: actions/upload-artifact@v3
78+
with:
79+
name: docs
80+
path: |
81+
build/docs/html
82+
7883
- name: debug-artifacts
7984
uses: actions/upload-artifact@v3
8085
if: ${{ failure() }}
8186
with:
8287
name: ccpp_prebuild_logs
8388
path: ${{ github.workspace }}/build/ccpp/ccpp_prebuild.*
89+

CMakeLists.txt

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
# This is the main CMake file for fv3atm.
2+
#
3+
# Dusan Jovic, Alex Richert
4+
cmake_minimum_required(VERSION 3.19)
5+
6+
# Handle user build options.
7+
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
8+
9+
# Determine whether or not to generate documentation.
10+
if(ENABLE_DOCS)
11+
find_package(Doxygen REQUIRED)
12+
add_subdirectory(docs)
13+
endif()
14+
115
# Enable CI build & unit testing:
216
if(BUILD_TESTING)
3-
cmake_minimum_required(VERSION 3.19)
417
project(fv3atm VERSION 1.0 LANGUAGES C CXX Fortran)
518
include(ci/CMakeLists.txt)
619
endif()

atmos_model.F90

+260-6
Original file line numberDiff line numberDiff line change
@@ -2349,6 +2349,266 @@ subroutine assign_importdata(jdat, rc)
23492349
endif
23502350
endif
23512351

2352+
! get surface snow area fraction: over land (if cpllnd=true and cpllnd2atm=true)
2353+
!------------------------------------------------
2354+
fldname = 'inst_snow_area_fraction_lnd'
2355+
if (trim(impfield_name) == trim(fldname)) then
2356+
findex = queryImportFields(fldname)
2357+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2358+
!$omp parallel do default(shared) private(i,j,nb,ix)
2359+
do j=jsc,jec
2360+
do i=isc,iec
2361+
nb = Atm_block%blkno(i,j)
2362+
ix = Atm_block%ixp(i,j)
2363+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2364+
GFS_data(nb)%Coupling%sncovr1_lnd(ix) = datar8(i,j)
2365+
endif
2366+
enddo
2367+
enddo
2368+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get snow area fraction from land'
2369+
endif
2370+
endif
2371+
2372+
! get latent heat flux: over land (if cpllnd=true and cpllnd2atm=true)
2373+
!------------------------------------------------
2374+
fldname = 'inst_laten_heat_flx_lnd'
2375+
if (trim(impfield_name) == trim(fldname)) then
2376+
findex = queryImportFields(fldname)
2377+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2378+
!$omp parallel do default(shared) private(i,j,nb,ix)
2379+
do j=jsc,jec
2380+
do i=isc,iec
2381+
nb = Atm_block%blkno(i,j)
2382+
ix = Atm_block%ixp(i,j)
2383+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2384+
GFS_data(nb)%Coupling%evap_lnd(ix) = datar8(i,j)
2385+
endif
2386+
enddo
2387+
enddo
2388+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get latent heat flux from land'
2389+
endif
2390+
endif
2391+
2392+
! get sensible heat flux: over land (if cpllnd=true and cpllnd2atm=true)
2393+
!--------------------------------------------------
2394+
fldname = 'inst_sensi_heat_flx_lnd'
2395+
if (trim(impfield_name) == trim(fldname)) then
2396+
findex = queryImportFields(fldname)
2397+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2398+
!$omp parallel do default(shared) private(i,j,nb,ix)
2399+
do j=jsc,jec
2400+
do i=isc,iec
2401+
nb = Atm_block%blkno(i,j)
2402+
ix = Atm_block%ixp(i,j)
2403+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2404+
GFS_data(nb)%Coupling%hflx_lnd(ix) = datar8(i,j)
2405+
endif
2406+
enddo
2407+
enddo
2408+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get sensible heat flux from land'
2409+
endif
2410+
endif
2411+
2412+
! get surface upward potential latent heat flux: over land (if cpllnd=true and cpllnd2atm=true)
2413+
!------------------------------------------------
2414+
fldname = 'inst_potential_laten_heat_flx_lnd'
2415+
if (trim(impfield_name) == trim(fldname)) then
2416+
findex = queryImportFields(fldname)
2417+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2418+
!$omp parallel do default(shared) private(i,j,nb,ix)
2419+
do j=jsc,jec
2420+
do i=isc,iec
2421+
nb = Atm_block%blkno(i,j)
2422+
ix = Atm_block%ixp(i,j)
2423+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2424+
GFS_data(nb)%Coupling%ep_lnd(ix) = datar8(i,j)
2425+
endif
2426+
enddo
2427+
enddo
2428+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get potential latent heat flux from land'
2429+
endif
2430+
endif
2431+
2432+
! get 2m air temperature: over land (if cpllnd=true and cpllnd2atm=true)
2433+
!------------------------------------------------
2434+
fldname = 'inst_temp_height2m_lnd'
2435+
if (trim(impfield_name) == trim(fldname)) then
2436+
findex = queryImportFields(fldname)
2437+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2438+
!$omp parallel do default(shared) private(i,j,nb,ix)
2439+
do j=jsc,jec
2440+
do i=isc,iec
2441+
nb = Atm_block%blkno(i,j)
2442+
ix = Atm_block%ixp(i,j)
2443+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2444+
GFS_data(nb)%Coupling%t2mmp_lnd(ix) = datar8(i,j)
2445+
endif
2446+
enddo
2447+
enddo
2448+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get temperature at 2m from land'
2449+
endif
2450+
endif
2451+
2452+
! get 2m specific humidity: over land (if cpllnd=true and cpllnd2atm=true)
2453+
!------------------------------------------------
2454+
fldname = 'inst_spec_humid_height2m_lnd'
2455+
if (trim(impfield_name) == trim(fldname)) then
2456+
findex = queryImportFields(fldname)
2457+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2458+
!$omp parallel do default(shared) private(i,j,nb,ix)
2459+
do j=jsc,jec
2460+
do i=isc,iec
2461+
nb = Atm_block%blkno(i,j)
2462+
ix = Atm_block%ixp(i,j)
2463+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2464+
GFS_data(nb)%Coupling%q2mp_lnd(ix) = datar8(i,j)
2465+
endif
2466+
enddo
2467+
enddo
2468+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get specific humidity at 2m from land'
2469+
endif
2470+
endif
2471+
2472+
! get specific humidity: over land (if cpllnd=true and cpllnd2atm=true)
2473+
!------------------------------------------------
2474+
fldname = 'inst_spec_humid_lnd'
2475+
if (trim(impfield_name) == trim(fldname)) then
2476+
findex = queryImportFields(fldname)
2477+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2478+
!$omp parallel do default(shared) private(i,j,nb,ix)
2479+
do j=jsc,jec
2480+
do i=isc,iec
2481+
nb = Atm_block%blkno(i,j)
2482+
ix = Atm_block%ixp(i,j)
2483+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2484+
GFS_data(nb)%Coupling%qsurf_lnd(ix) = datar8(i,j)
2485+
endif
2486+
enddo
2487+
enddo
2488+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get specific humidity from land'
2489+
endif
2490+
endif
2491+
2492+
! get upward heat flux in soil (if cpllnd=true and cpllnd2atm=true)
2493+
!------------------------------------------------
2494+
fldname = 'inst_upward_heat_flux_lnd'
2495+
if (trim(impfield_name) == trim(fldname)) then
2496+
findex = queryImportFields(fldname)
2497+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2498+
!$omp parallel do default(shared) private(i,j,nb,ix)
2499+
do j=jsc,jec
2500+
do i=isc,iec
2501+
nb = Atm_block%blkno(i,j)
2502+
ix = Atm_block%ixp(i,j)
2503+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2504+
GFS_data(nb)%Coupling%gflux_lnd(ix) = datar8(i,j)
2505+
endif
2506+
enddo
2507+
enddo
2508+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get upward heat flux from land'
2509+
endif
2510+
endif
2511+
2512+
! get surface runoff in soil (if cpllnd=true and cpllnd2atm=true)
2513+
!------------------------------------------------
2514+
fldname = 'inst_runoff_rate_lnd'
2515+
if (trim(impfield_name) == trim(fldname)) then
2516+
findex = queryImportFields(fldname)
2517+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2518+
!$omp parallel do default(shared) private(i,j,nb,ix)
2519+
do j=jsc,jec
2520+
do i=isc,iec
2521+
nb = Atm_block%blkno(i,j)
2522+
ix = Atm_block%ixp(i,j)
2523+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2524+
GFS_data(nb)%Coupling%runoff_lnd(ix) = datar8(i,j)
2525+
endif
2526+
enddo
2527+
enddo
2528+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get surface runoff from land'
2529+
endif
2530+
endif
2531+
2532+
! get subsurface runoff in soil (if cpllnd=true and cpllnd2atm=true)
2533+
!------------------------------------------------
2534+
fldname = 'inst_subsurface_runoff_rate_lnd'
2535+
if (trim(impfield_name) == trim(fldname)) then
2536+
findex = queryImportFields(fldname)
2537+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2538+
!$omp parallel do default(shared) private(i,j,nb,ix)
2539+
do j=jsc,jec
2540+
do i=isc,iec
2541+
nb = Atm_block%blkno(i,j)
2542+
ix = Atm_block%ixp(i,j)
2543+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2544+
GFS_data(nb)%Coupling%drain_lnd(ix) = datar8(i,j)
2545+
endif
2546+
enddo
2547+
enddo
2548+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get subsurface runoff from land'
2549+
endif
2550+
endif
2551+
2552+
! get momentum exchange coefficient (if cpllnd=true and cpllnd2atm=true)
2553+
!------------------------------------------------
2554+
fldname = 'inst_drag_wind_speed_for_momentum'
2555+
if (trim(impfield_name) == trim(fldname)) then
2556+
findex = queryImportFields(fldname)
2557+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2558+
!$omp parallel do default(shared) private(i,j,nb,ix)
2559+
do j=jsc,jec
2560+
do i=isc,iec
2561+
nb = Atm_block%blkno(i,j)
2562+
ix = Atm_block%ixp(i,j)
2563+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2564+
GFS_data(nb)%Coupling%cmm_lnd(ix) = datar8(i,j)
2565+
endif
2566+
enddo
2567+
enddo
2568+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get drag wind speed for momentum from land'
2569+
endif
2570+
endif
2571+
2572+
! get thermal exchange coefficient (if cpllnd=true and cpllnd2atm=true)
2573+
!------------------------------------------------
2574+
fldname = 'inst_drag_mass_flux_for_heat_and_moisture'
2575+
if (trim(impfield_name) == trim(fldname)) then
2576+
findex = queryImportFields(fldname)
2577+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2578+
!$omp parallel do default(shared) private(i,j,nb,ix)
2579+
do j=jsc,jec
2580+
do i=isc,iec
2581+
nb = Atm_block%blkno(i,j)
2582+
ix = Atm_block%ixp(i,j)
2583+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2584+
GFS_data(nb)%Coupling%chh_lnd(ix) = datar8(i,j)
2585+
endif
2586+
enddo
2587+
enddo
2588+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get thermal exchange coefficient form land'
2589+
endif
2590+
endif
2591+
2592+
! get function of surface roughness length and green vegetation fraction (if cpllnd=true and cpllnd2atm=true)
2593+
!------------------------------------------------
2594+
fldname = 'inst_func_of_roughness_length_and_vfrac'
2595+
if (trim(impfield_name) == trim(fldname)) then
2596+
findex = queryImportFields(fldname)
2597+
if (importFieldsValid(findex) .and. GFS_control%cpllnd .and. GFS_control%cpllnd2atm) then
2598+
!$omp parallel do default(shared) private(i,j,nb,ix)
2599+
do j=jsc,jec
2600+
do i=isc,iec
2601+
nb = Atm_block%blkno(i,j)
2602+
ix = Atm_block%ixp(i,j)
2603+
if (GFS_data(nb)%Sfcprop%landfrac(ix) > zero) then
2604+
GFS_data(nb)%Coupling%zvfun_lnd(ix) = datar8(i,j)
2605+
endif
2606+
enddo
2607+
enddo
2608+
if (mpp_pe() == mpp_root_pe() .and. debug) print *,'fv3 assign_import: get func. of roughness length and vfrac form land'
2609+
endif
2610+
endif
2611+
23522612
endif ! if (datar8(isc,jsc) > -99999.0) then
23532613

23542614
!-------------------------------------------------------
@@ -3072,12 +3332,6 @@ subroutine setup_exportdata(rc)
30723332
! bottom layer meridional wind (v)
30733333
case('inst_merid_wind_height_lowest')
30743334
call block_data_copy_or_fill(datar82d, DYCORE_data(nb)%coupling%v_bot, zeror8, Atm_block, nb, rc=localrc)
3075-
! bottom layer zonal wind (u) from physics
3076-
case('inst_zonal_wind_height_lowest_from_phys')
3077-
call block_data_copy_or_fill(datar82d, GFS_data(nb)%Statein%ugrs, 1, zeror8, Atm_block, nb, rc=localrc)
3078-
! bottom layer meridional wind (v) from physics
3079-
case('inst_merid_wind_height_lowest_from_phys')
3080-
call block_data_copy_or_fill(datar82d, GFS_data(nb)%Statein%vgrs, 1, zeror8, Atm_block, nb, rc=localrc)
30813335
! surface friction velocity
30823336
case('surface_friction_velocity')
30833337
call block_data_copy_or_fill(datar82d, GFS_data(nb)%Sfcprop%uustar, zeror8, Atm_block, nb, rc=localrc)

ccpp/config/ccpp_prebuild_config.py

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@
192192
'physics/physics/SFC_Layer/UFS/sfc_nst_post.f90',
193193
'physics/physics/SFC_Models/Land/RUC/lsm_ruc.F90',
194194
'physics/physics/SFC_Models/SeaIce/CICE/sfc_cice.f',
195+
'physics/physics/SFC_Models/Land/sfc_land.F90',
195196
'physics/physics/SFC_Models/Land/Noah/lsm_noah.f',
196197
'physics/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90',
197198
'physics/physics/SFC_Models/Lake/Flake/flake_driver.F90',

0 commit comments

Comments
 (0)