Skip to content
Closed
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
1 change: 1 addition & 0 deletions arch/postamble_new
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZ
-DINTIO \
-DKEEP_INT_AROUND \
-DLIMIT_ARGS \
-DBUILD_RRTMG_FAST=1 \
-DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) \
-DMAX_DOMAINS_F=$(MAX_DOMAINS) \
-DMAX_HISTORY=$(MAX_HISTORY) \
Expand Down
18 changes: 16 additions & 2 deletions phys/module_physics_init.F
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,16 @@ SUBROUTINE phy_init ( id, config_flags, DT, restart, zfull, zhalf, &
has_reqi = 0
has_reqs = 0
IF ( config_flags%use_mp_re .EQ. 1 ) THEN
if ((config_flags%ra_lw_physics .eq. RRTMG_LWSCHEME .or. config_flags%ra_lw_physics .eq. RRTMG_LWSCHEME_FAST .or. config_flags%ra_lw_physics .eq. RRTMK_LWSCHEME ) .and. &
(config_flags%ra_sw_physics .eq. RRTMG_SWSCHEME .or. config_flags%ra_sw_physics .eq. RRTMG_SWSCHEME_FAST .or. config_flags%ra_sw_physics .eq. RRTMK_SWSCHEME ) .and. &
if (( (config_flags%ra_lw_physics .eq. RRTMG_LWSCHEME ) .or. &
#if( BUILD_RRTMG_FAST == 1)
(config_flags%ra_lw_physics .eq. RRTMG_LWSCHEME_FAST ) .or. &
#endif
(config_flags%ra_lw_physics .eq. RRTMK_LWSCHEME ) ) .and. &
( (config_flags%ra_sw_physics .eq. RRTMG_SWSCHEME ) .or. &
#if( BUILD_RRTMG_FAST == 1)
(config_flags%ra_sw_physics .eq. RRTMG_SWSCHEME_FAST ) .or. &
#endif
(config_flags%ra_sw_physics .eq. RRTMK_SWSCHEME ) ) .and. &
(config_flags%mp_physics .eq. THOMPSON .or. &
config_flags%mp_physics .eq. THOMPSONAERO &
.or. config_flags%mp_physics .eq. NSSL_2MOM .or. &
Expand Down Expand Up @@ -1744,8 +1752,10 @@ SUBROUTINE ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, &
USE module_ra_rrtm , ONLY : rrtminit
USE module_ra_rrtmg_lw , ONLY : rrtmg_lwinit
USE module_ra_rrtmg_sw , ONLY : rrtmg_swinit
#if( BUILD_RRTMG_FAST == 1)
USE module_ra_rrtmg_lwf , ONLY : rrtmg_lwinit_fast
USE module_ra_rrtmg_swf , ONLY : rrtmg_swinit_fast
#endif
#if (EM_CORE == 1)
USE module_ra_rrtmg_lwk , ONLY : rrtmg_lwinit_k
USE module_ra_rrtmg_swk , ONLY : rrtmg_swinit_k
Expand Down Expand Up @@ -1955,6 +1965,7 @@ SUBROUTINE ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, &
aclwalloc = .true.
#endif

#if( BUILD_RRTMG_FAST == 1)
CASE (RRTMG_LWSCHEME_FAST)
CALL rrtmg_lwinit_fast( &
p_top, allowed_to_read , &
Expand All @@ -1963,6 +1974,7 @@ SUBROUTINE ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, &
its, ite, jts, jte, kts, kte )

aclwalloc = .true.
#endif

CASE (GFDLLWSCHEME)
CALL nl_get_start_month(id,month)
Expand Down Expand Up @@ -2060,6 +2072,7 @@ SUBROUTINE ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, &
#endif


#if( BUILD_RRTMG_FAST == 1)
CASE (RRTMG_SWSCHEME_FAST)
CALL rrtmg_swinit_fast( &
allowed_to_read , &
Expand All @@ -2068,6 +2081,7 @@ SUBROUTINE ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, &
its, ite, jts, jte, kts, kte )

acswalloc = .true.
#endif


CASE (GFDLSWSCHEME)
Expand Down
10 changes: 10 additions & 0 deletions phys/module_ra_rrtmg_lwf.F
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#if( BUILD_RRTMG_FAST != 1)
MODULE module_ra_rrtmg_lwf
CONTAINS
SUBROUTINE RRTMG_LWRAD_FAST
REAL :: dummy
dummy = 1
END SUBROUTINE RRTMG_LWRAD_FAST
END MODULE module_ra_rrtmg_lwf
#else
!MODULE module_ra_rrtmg_lwf
#define CHNK 8
!#define CHNK 1849
Expand Down Expand Up @@ -18234,3 +18243,4 @@ end subroutine reicalc
!------------------------------------------------------------------

END MODULE module_ra_rrtmg_lwf
#endif
10 changes: 10 additions & 0 deletions phys/module_ra_rrtmg_swf.F
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#if( BUILD_RRTMG_FAST != 1)
MODULE module_ra_rrtmg_swf
CONTAINS
SUBROUTINE RRTMG_SWRAD_FAST
REAL :: dummy
dummy = 1
END SUBROUTINE RRTMG_SWRAD_FAST
END MODULE module_ra_rrtmg_swf
#else
!!MODULE module_ra_rrtmg_swf
#define CHNK 8
!#define CHNK 1849
Expand Down Expand Up @@ -13765,3 +13774,4 @@ end subroutine sw_kgb29
!------------------------------------------------------------------

END MODULE module_ra_rrtmg_swf
#endif
43 changes: 38 additions & 5 deletions phys/module_radiation_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ SUBROUTINE radiation_driver ( &
! !USES:
USE module_state_description, ONLY : RRTMSCHEME, GFDLLWSCHEME &
,RRTMG_LWSCHEME, RRTMG_SWSCHEME &
#if( BUILD_RRTMG_FAST == 1)
,RRTMG_LWSCHEME_FAST, RRTMG_SWSCHEME_FAST &
#endif
,RRTMK_LWSCHEME, RRTMK_SWSCHEME &
,SWRADSCHEME, GSFCSWSCHEME &
,GFDLSWSCHEME, CAMLWSCHEME, CAMSWSCHEME &
Expand All @@ -185,8 +187,10 @@ SUBROUTINE radiation_driver ( &
USE module_ra_rrtm , ONLY : rrtmlwrad
USE module_ra_rrtmg_lw , ONLY : rrtmg_lwrad
USE module_ra_rrtmg_sw , ONLY : rrtmg_swrad
#if( BUILD_RRTMG_FAST == 1)
USE module_ra_rrtmg_lwf , ONLY : rrtmg_lwrad_fast
USE module_ra_rrtmg_swf , ONLY : rrtmg_swrad_fast
#endif
USE module_ra_rrtmg_swk , ONLY : rad_rrtmg_driver
USE module_ra_cam , ONLY : camrad
USE module_ra_gfdleta , ONLY : etara
Expand Down Expand Up @@ -926,7 +930,11 @@ SUBROUTINE radiation_driver ( &
allocate(ssaaer_sw(ims:ime, kms:kme, jms:jme, 1:11))
allocate(asyaer_sw(ims:ime, kms:kme, jms:jme, 1:11))

case(RRTMG_SWSCHEME,RRTMG_SWSCHEME_FAST,RRTMK_SWSCHEME)
case(RRTMG_SWSCHEME,&
#if( BUILD_RRTMG_FAST == 1)
RRTMG_SWSCHEME_FAST,&
#endif
RRTMK_SWSCHEME)
allocate(tauaer_sw(ims:ime, kms:kme, jms:jme, 1:14))
allocate(ssaaer_sw(ims:ime, kms:kme, jms:jme, 1:14))
allocate(asyaer_sw(ims:ime, kms:kme, jms:jme, 1:14))
Expand All @@ -939,7 +947,9 @@ SUBROUTINE radiation_driver ( &
IF (PRESENT(f_qnwfa) .AND. PRESENT(f_qnifa) .AND. PRESENT(taod5503d) .AND. PRESENT(taod5502d)) THEN
IF (F_QNWFA .AND. aer_opt.eq.3 .AND. &
(sw_physics.eq.RRTMG_SWSCHEME .OR. &
#if( BUILD_RRTMG_FAST == 1)
sw_physics.eq.RRTMG_SWSCHEME_FAST .OR. &
#endif
sw_physics.eq.RRTMK_SWSCHEME )) THEN
CALL wrf_debug (150, 'DEBUG-GT: computing 3D AOD from QNWFA+QNIFA')

Expand Down Expand Up @@ -1714,6 +1724,7 @@ SUBROUTINE radiation_driver ( &
ENDIF


#if( BUILD_RRTMG_FAST == 1)
CASE (RRTMG_LWSCHEME_FAST)
CALL wrf_debug (100, 'CALL rrtmg_lw')

Expand Down Expand Up @@ -1767,6 +1778,7 @@ SUBROUTINE radiation_driver ( &
LWUPFLX=LWUPFLX,LWUPFLXC=LWUPFLXC, &
LWDNFLX=LWDNFLX,LWDNFLXC=LWDNFLXC &
)
#endif

CASE (HELDSUAREZ)
CALL wrf_debug (100, 'CALL heldsuarez')
Expand Down Expand Up @@ -1871,7 +1883,11 @@ SUBROUTINE radiation_driver ( &
end do
end do

case(RRTMG_SWSCHEME,RRTMG_SWSCHEME_FAST,RRTMK_SWSCHEME)
case(RRTMG_SWSCHEME,&
#if( BUILD_RRTMG_FAST == 1)
RRTMG_SWSCHEME_FAST,&
#endif
RRTMK_SWSCHEME)
call wrf_debug(100, 'call calc_aerosol_rrtmg_sw')
call calc_aerosol_rrtmg_sw(ht,dz8w,p,t,qv,aer_type,aer_aod550_opt,aer_angexp_opt, &
aer_ssa_opt,aer_asy_opt,aer_aod550_val,aer_angexp_val, &
Expand All @@ -1896,7 +1912,9 @@ SUBROUTINE radiation_driver ( &
IF (PRESENT(f_qnwfa) .AND. PRESENT(f_qnifa)) THEN
IF (F_QNWFA .AND. aer_opt.eq.3 .AND. &
(sw_physics.eq.RRTMG_SWSCHEME .OR. &
#if( BUILD_RRTMG_FAST == 1)
sw_physics.eq.RRTMG_SWSCHEME_FAST .OR. &
#endif
sw_physics.eq.RRTMK_SWSCHEME )) THEN
call wrf_debug(100, 'call calc_aerosol_rrtmg_sw with 3D AOD values')
call calc_aerosol_rrtmg_sw(ht,dz8w,p,t,qv,taer_type,taer_aod550_opt,taer_angexp_opt, &
Expand Down Expand Up @@ -2159,6 +2177,7 @@ SUBROUTINE radiation_driver ( &
ENDDO
ENDDO

#if( BUILD_RRTMG_FAST == 1)
CASE (RRTMG_SWSCHEME_FAST)
CALL wrf_debug(100, 'CALL rrtmg_sw_fast')
CALL RRTMG_SWRAD_FAST( &
Expand Down Expand Up @@ -2228,6 +2247,7 @@ SUBROUTINE radiation_driver ( &
ENDDO
ENDDO
ENDDO
#endif

CASE (GFDLSWSCHEME)

Expand Down Expand Up @@ -2348,7 +2368,10 @@ SUBROUTINE radiation_driver ( &
! jararias, 14/08/2013
! surface direct and diffuse SW fluxes computation. Only for schemes other than RRTMG and Goddard
! Backup method in case sw scheme in use does not provide surface SW direct and diffuse irradiances
IF ((sw_physics .NE. RRTMG_SWSCHEME) .AND. (sw_physics .NE. RRTMG_SWSCHEME_FAST) &
IF ((sw_physics .NE. RRTMG_SWSCHEME) &
#if( BUILD_RRTMG_FAST == 1)
.AND. (sw_physics .NE. RRTMG_SWSCHEME_FAST) &
#endif
.AND. (sw_physics .NE. FLGSWSCHEME) .AND. (sw_physics .NE. CAMSWSCHEME) & ! amontornes-bcodina (2014-04-20)
.AND. (sw_physics .NE. RRTMK_SWSCHEME) &
.AND. (sw_physics .ne. GODDARDSWSCHEME)) THEN
Expand Down Expand Up @@ -2472,7 +2495,12 @@ SUBROUTINE radiation_driver ( &

accumulate_lw_select: SELECT CASE(lw_physics)

CASE (CAMLWSCHEME,RRTMG_LWSCHEME,RRTMG_LWSCHEME_FAST,RRTMK_LWSCHEME)
CASE (CAMLWSCHEME,&
RRTMG_LWSCHEME,&
#if( BUILD_RRTMG_FAST == 1)
RRTMG_LWSCHEME_FAST,&
#endif
RRTMK_LWSCHEME)
IF(PRESENT(LWUPTC))THEN
! NMM calls the driver every RADT time steps, EM calls every DT
#if (EM_CORE == 1)
Expand Down Expand Up @@ -2509,7 +2537,12 @@ SUBROUTINE radiation_driver ( &

accumulate_sw_select: SELECT CASE(sw_physics)

CASE (CAMSWSCHEME,RRTMG_SWSCHEME,RRTMG_SWSCHEME_FAST,RRTMK_SWSCHEME)
CASE (CAMSWSCHEME,&
RRTMG_SWSCHEME,&
#if( BUILD_RRTMG_FAST == 1)
RRTMG_SWSCHEME_FAST,&
#endif
RRTMK_SWSCHEME)
IF(PRESENT(SWUPTC))THEN
! NMM calls the driver every RADT time steps, EM calls every DT
#if (EM_CORE == 1)
Expand Down
16 changes: 16 additions & 0 deletions share/module_check_a_mundo.F
Original file line number Diff line number Diff line change
Expand Up @@ -1649,6 +1649,22 @@ SUBROUTINE check_nml_consistency
END IF
#endif

!-----------------------------------------------------------------------
! If the RRTMG FAST schemes are requested, check that the code with
! built to use them.
!-----------------------------------------------------------------------

#if( BUILD_RRTMG_FAST != 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamiebresch
Jamie,
With the default behavior set up as "always build RRTMG FAST", if a user has ever modified the build to not have the RRTMG FAST code part of the executable, then the easy way to get this check_a_mundo test to be resolved is with a clean -a, configure, compile. This is much easier to understand (I think) than the previous message to users.

IF ( ( model_config_rec % ra_lw_physics(1) .EQ. RRTMG_LWSCHEME_FAST ) .OR. &
( model_config_rec % ra_sw_physics(1) .EQ. RRTMG_SWSCHEME_FAST ) ) THEN
wrf_err_message = '--- ERROR: RRTMG FAST schemes must be built with a default compile-time flag'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Run ./clean -a, ./configure, ./compile scripts again'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
END IF
#endif

!-----------------------------------------------------------------------
! Set the namelist parameter o3input to 0 for the radiation schemes other
! than RRTMG_LWSCHEME and RRTMG_SWSCHEME.
Expand Down