Skip to content

Commit 0f2e4af

Browse files
sjspreciouscacraigucarpeverwhee
authored
Fix broken RRTMGP GPU test in CAM (ESCOMP#316)
Originator(s): sjsprecious Description (include issue title and the keyword ['closes', 'fixes', 'resolves'] and issue number): This pull request fixes the broken GPU test of RRTMGP in CAM (ESCOMP/CAM#1408). List all namelist files that were added or changed: N/A List all files eliminated and why: N/A List all files added and what they do: N/A List all existing files that have been modified, and describe the changes: (Helpful git command: `git diff --name-status development...<your_branch_name>`) ``` M schemes/rrtmgp/rrtmgp_sw_gas_optics_pre.F90 ``` List all automated tests that failed, as well as an explanation for why they weren't fixed: N/A Is this an answer-changing PR? If so, is it a new physics package, algorithm change, tuning change, etc? No If yes to the above question, describe how this code was validated with the new/modified features: --------- Co-authored-by: cacraigucar <cacraig@ucar.edu> Co-authored-by: Courtney Peverley <courtneyp@ucar.edu>
1 parent 4d80987 commit 0f2e4af

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

schemes/rrtmgp/rrtmgp_sw_gas_optics_pre.F90

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ subroutine rrtmgp_sw_gas_optics_pre_run(rad_const_array, pmid, pint, nlay, nday,
3939
! Local variables
4040
integer :: i, gas_idx
4141
integer :: istat
42-
real(kind_phys), allocatable :: gas_mmr(:,:)
4342
real(kind_phys), allocatable :: gas_vmr(:,:)
4443
real(kind_phys) :: mmr(nday, nlay)
4544
real(kind_phys) :: massratio
@@ -59,11 +58,6 @@ subroutine rrtmgp_sw_gas_optics_pre_run(rad_const_array, pmid, pint, nlay, nday,
5958
return
6059
end if
6160

62-
allocate(gas_mmr(nday, pverp-1), stat=errflg, errmsg=alloc_errmsg)
63-
if (errflg /= 0) then
64-
write(errmsg,*) sub//": failed to allocate 'gas_mmr' - message: "//alloc_errmsg
65-
return
66-
end if
6761
allocate(gas_vmr(nday, nlay), stat=errflg, errmsg=alloc_errmsg)
6862
if (errflg /= 0) then
6963
write(errmsg,*) sub//": failed to allocate 'gas_vmr' - message: "//alloc_errmsg
@@ -73,11 +67,8 @@ subroutine rrtmgp_sw_gas_optics_pre_run(rad_const_array, pmid, pint, nlay, nday,
7367

7468
do gas_idx = 1, nradgas
7569

76-
! grab mass mixing ratio of gas
77-
gas_mmr = rad_const_array(:,:,gas_idx)
78-
7970
do i = 1, nday
80-
mmr(i,ktoprad:) = gas_mmr(idxday(i),ktopcam:)
71+
mmr(i,ktoprad:) = rad_const_array(idxday(i),ktopcam:,gas_idx)
8172
end do
8273

8374
! If an extra layer is being used, copy mmr from the top layer of CAM to the extra layer.

0 commit comments

Comments
 (0)