Commit 3db4bbe2 authored by William Gustafson's avatar William Gustafson
Browse files

Bug fixes for LES patch and RSL_LITE

These changes are being brought up from wrf_noaa branch.
1) module_big_step_utilities.F: Fixes bug with check for first time
step that results in uninitialized values for subsequent steps.

2) module_dm.F: Fixes bug with bad MPI buffer size calculation.
parent bacdc2b8
......@@ -6280,26 +6280,20 @@ SUBROUTINE theta_to_thetam ( t_1 , moist_old , &
INTEGER :: i , j , k
! First time step, there is no OLD moisture.
IF ( ( itimestep .EQ. 1 ) .AND. ( rk_step .EQ. 1 ) ) THEN
IF ( rk_step .EQ. 1 ) THEN
DO j = jts , MIN(jte,jde-1)
DO k = kts , kte-1
DO i = its , MIN(ite,ide-1)
! We need to initialize moist_old here for the first RK step at every time step
! (not just the first time step). It should be OK. Later in the first RK step rk_update_scalar
! would do the same assignment to moist_old. - Heng Xiao 10-08-2015
moist_old(i,k,j) = moist(i,k,j)
END DO
END DO
END DO
END IF
! First RK loop, this info is from the physics packages. It is modified immediately after the
! call to the physics schemes, and the remains constant for the remainder of the RK loops.
IF ( rk_step .EQ. 1 ) THEN
DO j = jts , MIN(jte,jde-1)
DO k = kts , kte-1
DO i = its , MIN(ite,ide-1)
t_tendf(i,k,j) = (1. + (R_v/R_d) * moist_old(i,k,j))*t_tendf(i,k,j) + (R_v/R_d)*(t_1(i,k,j)+T0)*moist_tend(i,k,j)
t_tendf(i,k,j) = (1. + (R_v/R_d) * moist_old(i,k,j))*t_tendf(i,k,j) &
+ (R_v/R_d)*(t_1(i,k,j)+T0)*moist_tend(i,k,j)
h_diabatic(i,k,j) = (1. + (R_v/R_d) * moist_old(i,k,j))*h_diabatic(i,k,j)
END DO
END DO
......
......@@ -2844,19 +2844,19 @@ END
Patch(3,1) = ps3 ; Patch(3,2) = pe3
IF ( typesize .EQ. RWORDSIZE ) THEN
CALL just_patch_r ( buf , locbuf , size(locbuf), &
CALL just_patch_r ( buf , locbuf , size(locbuf)*RWORDSIZE/typesize, &
PS1, PE1, PS2, PE2, PS3, PE3 , &
MS1, ME1, MS2, ME2, MS3, ME3 )
ELSE IF ( typesize .EQ. IWORDSIZE ) THEN
CALL just_patch_i ( buf , locbuf , size(locbuf), &
CALL just_patch_i ( buf , locbuf , size(locbuf)*RWORDSIZE/typesize, &
PS1, PE1, PS2, PE2, PS3, PE3 , &
MS1, ME1, MS2, ME2, MS3, ME3 )
ELSE IF ( typesize .EQ. DWORDSIZE ) THEN
CALL just_patch_d ( buf , locbuf , size(locbuf), &
CALL just_patch_d ( buf , locbuf , size(locbuf)*RWORDSIZE/typesize, &
PS1, PE1, PS2, PE2, PS3, PE3 , &
MS1, ME1, MS2, ME2, MS3, ME3 )
ELSE IF ( typesize .EQ. LWORDSIZE ) THEN
CALL just_patch_l ( buf , locbuf , size(locbuf), &
CALL just_patch_l ( buf , locbuf , size(locbuf)*RWORDSIZE/typesize, &
PS1, PE1, PS2, PE2, PS3, PE3 , &
MS1, ME1, MS2, ME2, MS3, ME3 )
ENDIF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment