Skip to content

Commit 94e5ed9

Browse files
authored
Add missing "IF km_opt==5" tests for diag computations (#1013)
TYPE: bug fix KEYWORDS: sms3dtke, km_opt==5 SOURCE: Internal DESCRIPTION OF CHANGES: Each location where the optional diagnostics for km_opt==5 are computed, instead of only using a local IF test, now a combination of the same local IF test (T/F do the computation) is used in conjunction with and a test for if the diagnostic is permitted (is km_opt==5). The km_opt==5 scheme originally had (and hopefully, will eventually again have) specified arrays via the package capability in the Registry. Those fields need to be protected from accidental use when km_opt==2. LIST OF MODIFIED FILES: modified: dyn_em/module_diffusion_em.F TESTS CONDUCTED: - [x] Without mods, there are attempts to compute km_opt==5 diags when km_opt==2. - [x] With mods, no attempts to compute km_opt==5 diags when km_opt==2.
1 parent 6d95883 commit 94e5ed9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dyn_em/module_diffusion_em.F

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3344,7 +3344,7 @@ SUBROUTINE horizontal_diffusion_u_2( tendency, config_flags, &
33443344
ENDDO
33453345
33463346
! XZ
3347-
IF (output_tend) THEN
3347+
IF ( ( output_tend ) .AND. ( config_flags%km_opt .EQ. 5 ) ) THEN
33483348
DO j = j_start, j_end
33493349
DO k = kts,ktf
33503350
DO i = i_start, i_end
@@ -3564,7 +3564,7 @@ SUBROUTINE horizontal_diffusion_v_2( tendency, config_flags, &
35643564
ENDDO
35653565
35663566
! XZ
3567-
IF (output_tend) THEN
3567+
IF ( ( output_tend ) .AND. ( config_flags%km_opt .EQ. 5 ) ) THEN
35683568
DO j = j_start, j_end
35693569
DO k = kts,ktf
35703570
DO i = i_start, i_end
@@ -3783,7 +3783,7 @@ SUBROUTINE horizontal_diffusion_w_2( tendency, config_flags, &
37833783
ENDDO
37843784
37853785
! XZ
3786-
IF (output_tend) THEN
3786+
IF ( ( output_tend ) .AND. ( config_flags%km_opt .EQ. 5 ) ) THEN
37873787
DO j = j_start, j_end
37883788
DO k = kts+1,ktf
37893789
DO i = i_start, i_end
@@ -3885,7 +3885,7 @@ SUBROUTINE horizontal_diffusion_s (tendency, config_flags, &
38853885
INTEGER :: ktes1,ktes2
38863886
!XZ
38873887
LOGICAL :: output_tend
3888-
output_tend = .true.
3888+
output_tend = .false.
38893889
!
38903890
! End declarations.
38913891
!-----------------------------------------------------------------------
@@ -4092,7 +4092,7 @@ SUBROUTINE horizontal_diffusion_s (tendency, config_flags, &
40924092
ENDDO
40934093
40944094
! XZ
4095-
IF (output_tend) THEN
4095+
IF ( ( output_tend ) .AND. ( config_flags%km_opt .EQ. 5 ) ) THEN
40964096
DO j = j_start, j_end
40974097
DO k = kts,ktf
40984098
DO i = i_start, i_end
@@ -4124,7 +4124,7 @@ SUBROUTINE horizontal_diffusion_s (tendency, config_flags, &
41244124
ENDIF
41254125
41264126
! XZ
4127-
IF(output_tend) THEN
4127+
IF ( ( output_tend ) .AND. ( config_flags%km_opt .EQ. 5 ) ) THEN
41284128
IF ( doing_tke ) THEN
41294129
DO j = j_start, j_end
41304130
DO k = kts,ktf

0 commit comments

Comments
 (0)