Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radiation Improvements for prototype 8 #871

Merged
merged 41 commits into from
Apr 8, 2022
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
68f97b1
Potential bug fix for RRTMGP GP flux coupling.
dustinswales Jan 24, 2022
0ea0fd0
Code update for radiation_clouds.f and GFS_rrtmg_pre.F90 GFS_cloud_di…
Qingfu-Liu Feb 14, 2022
242dcc9
updated the radiation code based on review's suggestions
Qingfu-Liu Feb 22, 2022
c6faeb1
updated radiation_cloud_overlap.F90 based on Mike's comment
Qingfu-Liu Feb 22, 2022
6e6acb9
Initial commit
dustinswales Feb 25, 2022
f46396f
Add explict treatment of convective cloud to RRTMGP.
dustinswales Feb 25, 2022
dcbad0a
Some cleanup and bug fixes from previous commit. working now with Tho…
dustinswales Feb 25, 2022
7fee2d6
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into gpsw…
dustinswales Feb 28, 2022
45f3e83
Merge branch 'feature/codeupdate2' of https://github.com/Qingfu-Liu/c…
dustinswales Mar 2, 2022
5830a82
RRTMGP coupling to Thompson MP (Sundqvist 1989)
dustinswales Mar 3, 2022
bcbea32
Housekeeping
dustinswales Mar 3, 2022
dec5bbd
Initial implementation of explicit coupling of convective (GF/SAMF) a…
dustinswales Mar 4, 2022
63fb052
Added new cloud-optics for MYNN-EDMF clouds
dustinswales Mar 4, 2022
fb7003b
Added MYNN-EDMF optical properties to RRTMGP RTE
dustinswales Mar 5, 2022
6327749
Removed RRTMG cloud-optics option in RRTMGP.
dustinswales Mar 7, 2022
4a4d159
Bug fix
dustinswales Mar 7, 2022
be960f0
Added switches for sgs clouds in GP.
dustinswales Mar 8, 2022
ac173e2
Replaced cld_mynn_ naming convention with cld_pbl_
dustinswales Mar 9, 2022
475b1be
Fixed inconsistency between G/GP in Thompson MP.
dustinswales Mar 9, 2022
182b2c6
Housekeeping, combine loops.
dustinswales Mar 9, 2022
646c65b
Some more cleanup of cloud-fraction...
dustinswales Mar 9, 2022
3206fa9
Changes from code review.
dustinswales Mar 10, 2022
ba5b1f8
Bug from previous commit
dustinswales Mar 10, 2022
71ab24d
resolve the code conflicts
Qingfu-Liu Mar 11, 2022
8e21c40
Merge branch 'feature/codeupdate2' of https://github.com/Qingfu-Liu/c…
dustinswales Mar 11, 2022
d89d738
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into enha…
dustinswales Mar 11, 2022
d3ff8f6
SPP bugfix from Jeff Beck
grantfirl Mar 11, 2022
defde63
Merge pull request #17 from grantfirl/enhanced_GP2cld_coupling_tight_gjf
dustinswales Mar 11, 2022
a6e960d
Revert change from previous commits (sampling of different cloud types).
dustinswales Mar 15, 2022
f2d46db
Changed arguments to implied shape.
dustinswales Mar 21, 2022
152048e
Merge branch 'gpswflx_issue' into enhanced_GP2cld_coupling_tight
dustinswales Mar 21, 2022
ec19fbe
Pulled in SW coupling fix for RRTMGP. Share SW_rad_pre between RRTMG …
dustinswales Mar 21, 2022
acc802a
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into enha…
dustinswales Mar 22, 2022
8e6580e
Syntax error
dustinswales Mar 22, 2022
4d9e2b3
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into enha…
dustinswales Apr 4, 2022
2617af6
Cleanup suggestions from PR.
dustinswales Apr 4, 2022
0148905
Revert "Cleanup suggestions from PR."
dustinswales Apr 5, 2022
2cf6a38
Cleanup
dustinswales Apr 5, 2022
4407989
Added bounding to temperature at layer-interface used by RRTMGP.
dustinswales Apr 6, 2022
d0a2dd8
Reorder loop
dustinswales Apr 6, 2022
77aa061
Combined gp sw and lw aerosol routines. Modest speedup (~4%)
dustinswales Apr 6, 2022
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
12 changes: 10 additions & 2 deletions physics/GFS_rrtmgp_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, nTracers, i_o3, lsswr, lslwr, fhsw
gas_concentrations ! RRTMGP DDT: gas volumne mixing ratios

! Local variables
integer :: i, j, iCol, iBand, iLay
integer :: i, j, iCol, iBand, iLay, iLev, iSFC_ilev
real(kind_phys),dimension(nCol,nLev) :: vmr_o3, vmr_h2o
real(kind_phys) :: es, tem1, tem2, pfac
real(kind_phys), dimension(nLev+1) :: hgtb
Expand All @@ -202,9 +202,11 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, nTracers, i_o3, lsswr, lslwr, fhsw
if (top_at_1) then
iSFC = nLev
iTOA = 1
iSFC_ilev = iSFC + 1
else
iSFC = 1
iTOA = nLev
iSFC_ilev = 1
endif

! #######################################################################################
Expand Down Expand Up @@ -244,6 +246,12 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, nTracers, i_o3, lsswr, lslwr, fhsw

! Temperature at layer-interfaces
call cmp_tlev(nCol,nLev,minGPpres,p_lay,t_lay,p_lev,tsfc,t_lev)
do iCol=1,nCol
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FORTRAN arrays are stored in column-major order. So it should be:
do iLev=1,nlev+1
do iCol=1,nCol
....
end do
end do

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just found out that you need to change many loop orders in the code. I believe the wrong orders can increase the computational costs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Dom mentioned, the optimization is probably catching these.
Additionally, the profiling of the code does not point to these _pre routines, they take a trivial amount of time.
The major contributors to GP's timing are from rrtmgp_lw(sw)_gas_optics and rrtmgp_lw(sw)_rte, ~60% of GP's total runtime

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall the configuration, it's been a long time, but here is where the time is being spent in the GP suite:
Screen Shot 2022-04-06 at 2 27 06 PM

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a compiler can optimize it, it is ok.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dustinswales Thanks for sharing the statistics.

do iLev=1,nLev+1
if (t_lev(iCol,iLev) .le. minGPtemp) t_lev(iCol,iLev) = minGPtemp + epsilon(minGPtemp)
if (t_lev(iCol,iLev) .ge. maxGPtemp) t_lev(iCol,iLev) = maxGPtemp - epsilon(maxGPtemp)
enddo
enddo

! Save surface temperature at radiation time-step, used for LW flux adjustment betwen
! radiation calls.
Expand Down Expand Up @@ -361,7 +369,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, nTracers, i_o3, lsswr, lslwr, fhsw
! #######################################################################################
! Setup surface ground temperature and ground/air skin temperature if required.
! #######################################################################################
tsfg(1:NCOL) = tsfc(1:NCOL)
tsfg(1:NCOL) = t_lev(1:NCOL,iSFC_ilev)
tsfa(1:NCOL) = t_lay(1:NCOL,iSFC)

! #######################################################################################
Expand Down