Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/physics/cam/gw_drag.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat)
flx_heat = 0._r8

if ( use_gw_nlgw ) then
call gw_nlgw_dp_ml(state1,ptend)
call gw_nlgw_dp_ml(state1,ptend,lchnk)
end if

if (use_gw_convect_dp) then
Expand Down
16 changes: 15 additions & 1 deletion src/physics/cam/gw_nlgw.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module gw_nlgw
use cam_logfile, only: iulog
use physconst, only: cappa, pi
use interpolate_data, only: lininterp
use cam_history, only: outfld, addfld

use ftorch

Expand Down Expand Up @@ -104,10 +105,11 @@ module gw_nlgw

!==========================================================================

subroutine gw_nlgw_dp_ml(state_in, ptend)
subroutine gw_nlgw_dp_ml(state_in, ptend, lchnk)

! inputs
type(physics_state), intent(in) :: state_in
integer, intent(in) :: lchnk
! outputs
type(physics_ptend), intent(inout) :: ptend

Expand Down Expand Up @@ -173,6 +175,13 @@ subroutine gw_nlgw_dp_ml(state_in, ptend)
call flux_to_forcing(uflux, utgw)
call flux_to_forcing(vflux, vtgw)

! Write UTGW and VTGW to file
call outfld('UTGW_NL', utgw, ncol, lchnk)
call outfld('VTGW_NL', vtgw, ncol, lchnk)

call outfld('UFLUX_NL', uflux, ncol, lchnk)
call outfld('VFLUX_NL', vflux, ncol, lchnk)

! update the tendencies
ptend%u(:ncol,:pver) = ptend%u(:ncol,:pver) + utgw(:ncol,:pver)
ptend%v(:ncol,:pver) = ptend%v(:ncol,:pver) + vtgw(:ncol,:pver)
Expand Down Expand Up @@ -219,6 +228,11 @@ subroutine gw_nlgw_dp_init(model_path)
write(iulog,*)'nlgw model loaded from: ', model_path
endif

call addfld('UTGW_NL', (/ 'lev' /), 'A', 'm/s2', 'Nonlinear GW zonal wind tendency')
call addfld('VTGW_NL', (/ 'lev' /), 'A', 'm/s2', 'Nonlinear GW meridional wind tendency')
call addfld('UFLUX_NL', (/ 'lev' /), 'A', 'm/s', 'Nonlinear GW zonal wind flux')
call addfld('VFLUX_NL', (/ 'lev' /), 'A', 'm/s', 'Nonlinear GW meridional wind flux')

end subroutine gw_nlgw_dp_init


Expand Down