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
22 changes: 21 additions & 1 deletion phys/module_radiation_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ SUBROUTINE radiation_driver ( &
USE module_ra_sw , ONLY : swrad
USE module_ra_gsfcsw , ONLY : gsfcswrad
USE module_ra_rrtm , ONLY : rrtmlwrad
USE module_ra_rrtmg_lw , ONLY : rrtmg_lwrad
USE module_ra_rrtmg_lw , ONLY : rrtmg_lwrad, rrtmg_lwinit
USE module_ra_rrtmg_sw , ONLY : rrtmg_swrad
#if( BUILD_RRTMG_FAST == 1)
USE module_ra_rrtmg_lwf , ONLY : rrtmg_lwrad_fast
Expand Down Expand Up @@ -1836,6 +1836,26 @@ SUBROUTINE radiation_driver ( &
ENDDO
END IF

!Need to reset NLAYERS if vertical nesting is used.
!This code follows that for case RRTMSCHEME within
!subroutine RRTMLWRAD.
IF ( PRESENT(p_top) ) THEN
p_top_dummy = p_top
ELSE
p_top_dummy = -1. ! not used by NMM
END IF
IF ( p_top_dummy .GT. 0 ) THEN ! flag value for NMM = -1
!NLAYERS is recalculated
!every time the radiation scheme is called. This is
!necessary if e_vert parent .NE. e_vert nest since
!NLAYERS could then be different for each domain.
CALL RRTMG_LWINIT( &
p_top, .FALSE. , &
ids, ide, jds, jde, kds, kde, &
ims, ime, jms, jme, kms, kme, &
its, ite, jts, jte, kts, kte )
ENDIF

CALL RRTMG_LWRAD( &
RTHRATENLW=RTHRATEN, &
LWUPT=LWUPT,LWUPTC=LWUPTC,LWUPTCLN=LWUPTCLN, &
Expand Down
10 changes: 6 additions & 4 deletions share/module_check_a_mundo.F
Original file line number Diff line number Diff line change
Expand Up @@ -1906,19 +1906,21 @@ END FUNCTION bep_bem_nbui_max
!-----------------------------------------------------------------------
! Consistency checks between vertical refinement and radiation
! scheme selection. For "choose any vertical levels" for the nest,
! only RRTM is eligible.
! only option 1 (RRTM/Dudhia) or option 4 (RRTMG) are eligible.
!-----------------------------------------------------------------------

DO i = 2, model_config_rec % max_dom
IF (model_config_rec%vert_refine_method(i) .NE. 0) THEN
IF ( ( ( model_config_rec%ra_lw_physics(i) .EQ. 0 ) .OR. &
( model_config_rec%ra_lw_physics(i) .EQ. RRTMSCHEME ) ) .AND. &
( model_config_rec%ra_lw_physics(i) .EQ. RRTMSCHEME ) .OR. &
( model_config_rec%ra_lw_physics(i) .EQ. RRTMG_LWSCHEME ) ) .AND. &
( ( model_config_rec%ra_sw_physics(i) .EQ. 0 ) .OR. &
( model_config_rec%ra_sw_physics(i) .EQ. SWRADSCHEME ) ) ) THEN
( model_config_rec%ra_sw_physics(i) .EQ. SWRADSCHEME ) .OR. &
( model_config_rec%ra_sw_physics(i) .EQ. RRTMG_SWSCHEME ) ) ) THEN
! We are OK, I just hate writing backwards / negative / convoluted if tests
! that are not easily comprehensible.
ELSE
wrf_err_message = '--- ERROR: vert_refine_method=2 only works with ra_lw_physics=1 (RRTM) and ra_sw_physics=1 (Dudhia)'
wrf_err_message = '--- ERROR: vert_refine_method=2 only works with ra_lw/sw_physics=1 (RRTM/Dudhia) or ra_lw/sw_physics=4 (RRTMG)'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
Expand Down