Skip to content

Commit a484ca5

Browse files
committed
Pass lchnk to gw_nlgw_dp_ml fix oob block_id error
1 parent e5aae33 commit a484ca5

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/physics/cam/gw_drag.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat)
15491549
flx_heat = 0._r8
15501550

15511551
if ( use_gw_nlgw ) then
1552-
call gw_nlgw_dp_ml(state1,ptend)
1552+
call gw_nlgw_dp_ml(state1,ptend,lchnk)
15531553
end if
15541554

15551555
if (use_gw_convect_dp) then

src/physics/cam/gw_nlgw.F90

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module gw_nlgw
55
!
66

77
use gw_utils, only: r8, r4
8-
use ppgrid, only: pver !vertical levels
8+
use ppgrid, only: pcols, pver !vertical levels
99
use physics_types, only: physics_state, physics_ptend
1010
use spmd_utils, only: mpicom, mstrid=>masterprocid, masterproc, mpi_real8, iam
1111
use cam_abortutils, only: endrun
@@ -105,10 +105,11 @@ module gw_nlgw
105105

106106
!==========================================================================
107107

108-
subroutine gw_nlgw_dp_ml(state_in, ptend)
108+
subroutine gw_nlgw_dp_ml(state_in, ptend, lchnk)
109109

110110
! inputs
111111
type(physics_state), intent(in) :: state_in
112+
integer, intent(in) :: lchnk
112113
! outputs
113114
type(physics_ptend), intent(inout) :: ptend
114115

@@ -136,7 +137,7 @@ subroutine gw_nlgw_dp_ml(state_in, ptend)
136137

137138
allocate(uflux(ncol,pver))
138139
allocate(vflux(ncol,pver))
139-
allocate(utgw(ncol,pver))
140+
allocate(utgw(pcols,pver))
140141
allocate(vtgw(ncol,pver))
141142

142143
allocate(net_inputs(ncol, 4*pver_interp+3))
@@ -175,8 +176,8 @@ subroutine gw_nlgw_dp_ml(state_in, ptend)
175176
call flux_to_forcing(vflux, vtgw)
176177

177178
! Write UTGW and VTGW to file
178-
call outfld('UTGW_NL', utgw, ncol, pver)
179-
call outfld('VTGW_NL', vtgw, ncol, pver)
179+
call outfld('UTGW_NL', utgw, ncol, lchnk)
180+
call outfld('VTGW_NL', vtgw, ncol, lcnhk)
180181

181182

182183
! update the tendencies
@@ -227,8 +228,8 @@ subroutine gw_nlgw_dp_init(model_path)
227228
write(iulog,*)'nlgw model loaded from: ', model_path
228229
endif
229230

230-
call addfld('UTGW_NL', (/ 'lev' /), 'U', 'm/s2', 'Nonlinear GW zonal wind tendency')
231-
call addfld('VTGW_NL', (/ 'lev' /), 'U', 'm/s2', 'Nonlinear GW meridional wind tendency')
231+
call addfld('UTGW_NL', (/ 'lev' /), 'A', 'm/s2', 'Nonlinear GW zonal wind tendency')
232+
call addfld('VTGW_NL', (/ 'lev' /), 'A', 'm/s2', 'Nonlinear GW meridional wind tendency')
232233

233234
end subroutine gw_nlgw_dp_init
234235

0 commit comments

Comments
 (0)