Skip to content

Commit 9dd83ad

Browse files
authored
Zero out tendencies if Rayleigh friction is disabled. (ESCOMP#300)
Originator(s): fvitt, nusbaume Description (include issue title and the keyword ['closes', 'fixes', 'resolves'] and issue number): Sets Rayleigh friction output tendencies to zero if Rayleigh friction is disabled (but still in the SDF). closes ESCOMP#296 List all namelist files that were added or changed: N/A List all files eliminated and why: N/A List all files added and what they do: N/A List all existing files that have been modified, and describe the changes: (Helpful git command: `git diff --name-status development...<your_branch_name>`) M schemes/rayleigh_friction/rayleigh_friction.F90 - Zeroed out tendencies if Rayleigh friction is disabled, and did some minor commenting and code cleanup. List all automated tests that failed, as well as an explanation for why they weren't fixed: All passed. Is this an answer-changing PR? If so, is it a new physics package, algorithm change, tuning change, etc? No, this PR should be non-answer changing. If yes to the above question, describe how this code was validated with the new/modified features:
1 parent 38a5a49 commit 9dd83ad

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

schemes/rayleigh_friction/rayleigh_friction.F90

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,29 +113,34 @@ end subroutine rayleigh_friction_init
113113
subroutine rayleigh_friction_run(pver, ztodt, u, v, dudt, dvdt, dsdt, errmsg, errflg)
114114

115115
!------------------------------Arguments--------------------------------
116-
integer, intent(in) :: pver
117-
real(kind_phys), intent(in) :: ztodt !physics timestep
118-
real(kind_phys), intent(in) :: u(:,:)
119-
real(kind_phys), intent(in) :: v(:,:)
120-
real(kind_phys), intent(out) :: dudt(:,:) !tendency_of_eastward_wind
121-
real(kind_phys), intent(out) :: dvdt(:,:) !tendency_of_northward_wind
122-
real(kind_phys), intent(out) :: dsdt(:,:) !heating_rate
116+
integer, intent(in) :: pver
117+
real(kind_phys), intent(in) :: ztodt !physics timestep
118+
real(kind_phys), intent(in) :: u(:,:) !eastward wind
119+
real(kind_phys), intent(in) :: v(:,:) !northward wind
120+
real(kind_phys), intent(out) :: dudt(:,:) !tendency of eastward wind
121+
real(kind_phys), intent(out) :: dvdt(:,:) !tendency of northward wind
122+
real(kind_phys), intent(out) :: dsdt(:,:) !heating rate (tendency of dry air enthalpy at constant pressure)
123123

124124
character(len=512), intent(out) :: errmsg
125125
integer, intent(out) :: errflg
126126

127127
!---------------------------Local storage-------------------------------
128-
character(len=*), parameter :: subname = 'rayleigh_friction_run'
129-
integer :: k ! level
130-
real(kind_phys) :: rztodt ! 1./ztodt
131-
real(kind_phys) :: c1, c2, c3 ! temporary variables
128+
integer :: k ! level
129+
real(kind_phys) :: rztodt ! 1./ztodt
130+
real(kind_phys) :: c1, c2, c3 ! temporary variables
132131
!-----------------------------------------------------------------------
133132

134133
! initialize values
135134
errmsg = ''
136135
errflg = 0
137136

138-
if (raytau0 .eq. 0._kind_phys) return
137+
if (raytau0 == 0._kind_phys) then
138+
! Rayleigh friction not enabled, return zero tendencies
139+
dudt = 0._kind_phys
140+
dvdt = 0._kind_phys
141+
dsdt = 0._kind_phys
142+
return
143+
end if
139144

140145
rztodt = 1._kind_phys/ztodt
141146

0 commit comments

Comments
 (0)