From c898fff99d3fa4be43ea5d92bf31009f48b9b771 Mon Sep 17 00:00:00 2001 From: Benjamin Hillman Date: Tue, 11 Jun 2019 13:28:37 -0700 Subject: [PATCH 1/5] Make RRTMGP track develop instead of master --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 49fed2101cb4..6f8d3a557e4e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,4 +18,4 @@ [submodule "components/cam/src/physics/rrtmgp/external"] path = components/cam/src/physics/rrtmgp/external url = git@github.com:RobertPincus/rte-rrtmgp.git - branch = master + branch = develop From f8359153e7b792fd1d12211a94bf0576f809590f Mon Sep 17 00:00:00 2001 From: Benjamin Hillman Date: Tue, 11 Jun 2019 13:40:15 -0700 Subject: [PATCH 2/5] Update RRTMGP version to include thread-safety --- components/cam/src/physics/rrtmgp/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cam/src/physics/rrtmgp/external b/components/cam/src/physics/rrtmgp/external index 54440ad72cc6..0b1cffdd51a3 160000 --- a/components/cam/src/physics/rrtmgp/external +++ b/components/cam/src/physics/rrtmgp/external @@ -1 +1 @@ -Subproject commit 54440ad72cc65f8c368a0c6235157c38d30bd84e +Subproject commit 0b1cffdd51a35045c28aae314e2b29e2a663b5e6 From 847537bb360cd491a5c3a49e1b1311bc0848447f Mon Sep 17 00:00:00 2001 From: Benjamin Hillman Date: Tue, 11 Jun 2019 13:41:15 -0700 Subject: [PATCH 3/5] Make RRTMGP rad interface thread-safe --- components/cam/src/physics/rrtmgp/radiation.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cam/src/physics/rrtmgp/radiation.F90 b/components/cam/src/physics/rrtmgp/radiation.F90 index 1bad1b84d70b..39e20221b510 100644 --- a/components/cam/src/physics/rrtmgp/radiation.F90 +++ b/components/cam/src/physics/rrtmgp/radiation.F90 @@ -1126,8 +1126,8 @@ subroutine radiation_tend(state, ptend, pbuf, cam_out, cam_in, & ! --------------------------------------------------------------------------- ! Pointers to heating rates on physics buffer - real(r8), pointer :: qrs(:,:) => null() ! shortwave radiative heating rate - real(r8), pointer :: qrl(:,:) => null() ! longwave radiative heating rate + real(r8), pointer :: qrs(:,:) ! shortwave radiative heating rate + real(r8), pointer :: qrl(:,:) ! longwave radiative heating rate ! Clear-sky heating rates are not on the physics buffer, and we have no ! reason to put them there, so declare these are regular arrays here From 7a32d6baaef514da17dab8fe62f4c61d9fce7973 Mon Sep 17 00:00:00 2001 From: Benjamin Hillman Date: Tue, 11 Jun 2019 16:14:05 -0700 Subject: [PATCH 4/5] Remove initialization on declaration for qrsc/qrlc --- components/cam/src/physics/rrtmgp/radiation.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cam/src/physics/rrtmgp/radiation.F90 b/components/cam/src/physics/rrtmgp/radiation.F90 index 39e20221b510..f7ce85d6b5dc 100644 --- a/components/cam/src/physics/rrtmgp/radiation.F90 +++ b/components/cam/src/physics/rrtmgp/radiation.F90 @@ -1131,8 +1131,8 @@ subroutine radiation_tend(state, ptend, pbuf, cam_out, cam_in, & ! Clear-sky heating rates are not on the physics buffer, and we have no ! reason to put them there, so declare these are regular arrays here - real(r8) :: qrsc(pcols,pver) = 0._r8 - real(r8) :: qrlc(pcols,pver) = 0._r8 + real(r8) :: qrsc(pcols,pver) + real(r8) :: qrlc(pcols,pver) ! Flag to carry (QRS,QRL)*dp across time steps. ! TODO: what does this mean? From c4ce81a9e0ef1dafbdb7636dcc75106f2c07ec47 Mon Sep 17 00:00:00 2001 From: Benjamin Hillman Date: Tue, 11 Jun 2019 16:25:11 -0700 Subject: [PATCH 5/5] Add explicit init of clearsky heating --- components/cam/src/physics/rrtmgp/radiation.F90 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/cam/src/physics/rrtmgp/radiation.F90 b/components/cam/src/physics/rrtmgp/radiation.F90 index f7ce85d6b5dc..e91bfd2e5219 100644 --- a/components/cam/src/physics/rrtmgp/radiation.F90 +++ b/components/cam/src/physics/rrtmgp/radiation.F90 @@ -1157,6 +1157,11 @@ subroutine radiation_tend(state, ptend, pbuf, cam_out, cam_in, & ! modified in this routine. call pbuf_get_field(pbuf, pbuf_get_index('QRS'), qrs) call pbuf_get_field(pbuf, pbuf_get_index('QRL'), qrl) + + ! Initialize clearsky-heating rates to make sure we do not get garbage + ! for columns beyond ncol or nday + qrsc(:,:) = 0 + qrlc(:,:) = 0 ! Do shortwave stuff... if (radiation_do('sw')) then