Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Doxygen GitHub Pages Deploy Action

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:

- name: Install Doxygen + Graphviz + LaTeX
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz perl texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra

- name: Verify installations
run: |
which perl
which bibtex
doxygen --version

- name: Checkout current ccpp-physics code
uses: actions/checkout@v4
with:
path: ccpp_repo

- name: Checkout CCPP SCM main
uses: actions/checkout@v4
with:
repository: NCAR/ccpp-scm
path: scm_repo
fetch-depth: 0
submodules: recursive

- name: Switch physics submodule to main
run: |
cd scm_repo/ccpp/physics
git remote set-url origin https://github.com/NCAR/ccpp-physics.git
git fetch origin
git checkout main

- name: Generate metadata tables main branch
run: |
cd scm_repo
mkdir -p ccpp/physics/physics/docs/doc/html
export PYTHONPATH=$GITHUB_WORKSPACE/scm_repo/ccpp/framework/scripts:$GITHUB_WORKSPACE/scm_repo/ccpp/framework/scripts/parse_tools
./ccpp/framework/scripts/metadata2html.py -c ccpp/config/ccpp_prebuild_config.py
mv ccpp/physics/physics/docs/*.html ccpp/physics/physics/docs/doc/html

- name: Build HSD docs
run: |
cd scm_repo/ccpp/physics/physics/docs
doxygen ccpphsd_doxyfile
mkdir -p $GITHUB_WORKSPACE/physics/docs/html/HSD
mv doc/html/* $GITHUB_WORKSPACE/physics/docs/html/HSD

- name: Switch to v7 tag
run: |
cd scm_repo
git fetch origin tag v7.0.0
git checkout v7.0.0
git submodule update --init --recursive

- name: Generate metadata tables v7 branch
run: |
cd scm_repo
mkdir -p ccpp/physics/physics/docs/doc/html
export PYTHONPATH=$GITHUB_WORKSPACE/scm_repo/ccpp/framework/scripts:$GITHUB_WORKSPACE/scm_repo/ccpp/framework/scripts/parse_tools
./ccpp/framework/scripts/metadata2html.py -c ccpp/config/ccpp_prebuild_config.py
mv ccpp/physics/physics/docs/*.html ccpp/physics/physics/docs/doc/html

- name: Build v7 docs
run: |
cd scm_repo/ccpp/physics/physics/docs
doxygen ccpp_doxyfile
mkdir -p $GITHUB_WORKSPACE/physics/docs/html/V7
mv doc/html/* $GITHUB_WORKSPACE/physics/docs/html/V7

- name: Switch physics submodule to SRWv3 (ufs-community)
run: |
cd scm_repo/ccpp/physics
git remote set-url origin https://github.com/ufs-community/ccpp-physics.git
git fetch origin release/srw-v3
git checkout -B release/srw-v3 FETCH_HEAD

- name: Generate metadata tables SRWv3 branch
run: |
cd scm_repo
mkdir -p ccpp/physics/physics/docs/doc/html
export PYTHONPATH=$GITHUB_WORKSPACE/scm_repo/ccpp/framework/scripts:$GITHUB_WORKSPACE/scm_repo/ccpp/framework/scripts/parse_tools
./ccpp/framework/scripts/metadata2html.py -c $GITHUB_WORKSPACE/ccpp_repo/physics/docs/pdftxt/RE300/ccpp_prebuild_config.py
mv ccpp/physics/physics/docs/*.html ccpp/physics/physics/docs/doc/html

- name: Build SRWv3 docs
run: |
cd scm_repo/ccpp/physics/physics/docs
doxygen ccppsrw_doxyfile
mkdir -p $GITHUB_WORKSPACE/physics/docs/html/SRWv3
mv doc/html/* $GITHUB_WORKSPACE/physics/docs/html/SRWv3

- name: Switch to submodule main (ncar)
run: |
cd scm_repo/ccpp/physics
git remote set-url origin https://github.com/NCAR/ccpp-physics.git
git fetch origin main
git checkout -B main FETCH_HEAD

- name: Build landing page
run: |
cd scm_repo/ccpp/physics/physics/docs
doxygen mainpage_doxyfile
mv html/main/* $GITHUB_WORKSPACE/physics/docs/html

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: physics/docs/html

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.5
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,13 @@ target_include_directories(ccpp_physics PUBLIC

target_link_libraries(ccpp_physics PRIVATE MPI::MPI_Fortran)
target_link_libraries(ccpp_physics PUBLIC w3emc::w3emc_d
sp::sp_d
NetCDF::NetCDF_Fortran
)
if(ip_FOUND)
target_link_libraries(ccpp_physics PUBLIC ip::ip_d)
else()
target_link_libraries(ccpp_physics PUBLIC sp::sp_d)
endif()
#add FMS for FV3 only
if(FV3 OR MPAS)
target_link_libraries(ccpp_physics PUBLIC fms)
Expand Down
68 changes: 39 additions & 29 deletions physics/GWD/cires_tauamf_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
module cires_tauamf_data

use machine, only: kind_phys
use mpi_f08
!...........................................................................................
! tabulated GW-sources: GRACILE/Ern et al., 2018 and/or Resolved GWs from C384-Annual run
!...........................................................................................
Expand All @@ -20,27 +21,28 @@ module cires_tauamf_data
contains

!>
subroutine read_tau_amf(me, master, errmsg, errflg)
subroutine read_tau_amf(mpicomm, mpirank, mpiroot, errmsg, errflg)

use netcdf
integer, intent(in) :: me, master
use netcdf
use mpiutil, only: ccpp_bcast
type(MPI_Comm), intent(in) :: mpicomm
integer, intent(in) :: mpirank, mpiroot
integer :: ncid, iernc, vid, dimid, status
integer :: k

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
!
iernc=NF90_OPEN(trim(ugwp_taufile), nf90_nowrite, ncid)
read_and_broadcast_1: if (mpirank==mpiroot) then
iernc=NF90_OPEN(trim(ugwp_taufile), nf90_nowrite, ncid)

if(iernc.ne.0) then
write(errmsg,'(*(a))') "read_tau_amf: cannot open file_limb_tab data-file ", &
trim(ugwp_taufile)
print *, 'cannot open ugwp-v1 tau-file=',trim(ugwp_taufile)
errflg = 1
return
else

endif

status = nf90_inq_dimid(ncid, "lat", DimID)
! if (status /= nf90_noerr) call handle_err(status)
Expand All @@ -50,28 +52,36 @@ subroutine read_tau_amf(me, master, errmsg, errflg)
status = nf90_inq_dimid(ncid, "days", DimID)
status = nf90_inquire_dimension(ncid, DimID, len =ntau_d2t )

if (me == master) print *, ntau_d1y, ntau_d2t, ' dimd of tau_ngw ugwp-v1 '
if (ntau_d2t .le. 0 .or. ntau_d1y .le. 0) then
print *, 'ugwp-v1 tau-file=', trim(ugwp_taufile)
print *, ' ugwp-v1: ', 'ntau_d2t=',ntau_d2t, 'ntau_d2t=',ntau_d1y
stop
endif

if (.not.allocated(ugwp_taulat)) allocate (ugwp_taulat(ntau_d1y ))
if (.not.allocated(days_limb)) allocate (days_limb(ntau_d2t))
if (.not.allocated(tau_limb)) allocate (tau_limb(ntau_d1y, ntau_d2t ))

iernc=nf90_inq_varid( ncid, 'DAYS', vid )
iernc= nf90_get_var( ncid, vid, days_limb)
iernc=nf90_inq_varid( ncid, 'LATS', vid )
iernc= nf90_get_var( ncid, vid, ugwp_taulat)
iernc=nf90_inq_varid( ncid, 'ABSMF', vid )
iernc= nf90_get_var( ncid, vid, tau_limb)

iernc=nf90_close(ncid)

endif

print *, ntau_d1y, ntau_d2t, ' dimd of tau_ngw ugwp-v1 '
if (ntau_d2t .le. 0 .or. ntau_d1y .le. 0) then
print *, 'ugwp-v1 tau-file=', trim(ugwp_taufile)
print *, ' ugwp-v1: ', 'ntau_d2t=',ntau_d2t, 'ntau_d2t=',ntau_d1y
errflg = 1
return
endif
endif read_and_broadcast_1

call ccpp_bcast(ntau_d1y, mpiroot, mpicomm, errflg)
call ccpp_bcast(ntau_d2t, mpiroot, mpicomm, errflg)

if (.not.allocated(ugwp_taulat)) allocate (ugwp_taulat(ntau_d1y ))
if (.not.allocated(days_limb)) allocate (days_limb(ntau_d2t))
if (.not.allocated(tau_limb)) allocate (tau_limb(ntau_d1y, ntau_d2t ))

read_and_broadcast_2: if (mpirank==mpiroot) then
iernc=nf90_inq_varid( ncid, 'DAYS', vid )
iernc= nf90_get_var( ncid, vid, days_limb)
iernc=nf90_inq_varid( ncid, 'LATS', vid )
iernc= nf90_get_var( ncid, vid, ugwp_taulat)
iernc=nf90_inq_varid( ncid, 'ABSMF', vid )
iernc= nf90_get_var( ncid, vid, tau_limb)
iernc=nf90_close(ncid)
endif read_and_broadcast_2

call ccpp_bcast(days_limb, mpiroot, mpicomm, errflg)
call ccpp_bcast(tau_limb, mpiroot, mpicomm, errflg)
call ccpp_bcast(ugwp_taulat, mpiroot, mpicomm, errflg)

end subroutine read_tau_amf

!>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
standard_name = ozone_forcing
long_name = ozone forcing data
units = mixed
dimensions = (horizontal_loop_extent,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_data)
dimensions = (horizontal_loop_extent,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data)
type = real
kind = kind_phys
intent = in
Expand Down
Loading
Loading