@@ -5,7 +5,7 @@ module gw_nlgw
55!
66
77use gw_utils, only: r8 , r4
8- use ppgrid, only: pver ! vertical levels
8+ use ppgrid, only: pcols, pver ! vertical levels
99use physics_types, only: physics_state, physics_ptend
1010use spmd_utils, only: mpicom, mstrid= >masterprocid, masterproc, mpi_real8, iam
1111use 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
233234end subroutine gw_nlgw_dp_init
234235
0 commit comments