Skip to content

Commit

Permalink
correct the logic to use specific humidity or mixing ratio directly (#…
Browse files Browse the repository at this point in the history
…2031)

TYPE: bug fix

KEYWORDS: real, use_sh_qv

SOURCE: internal

DESCRIPTION OF CHANGES:
The logic to control whether specific humidity or mixing ratio is used instead of RH is wrong (PR-1959) when either SH or Qv is available. It is corrected in this PR.

LIST OF MODIFIED FILES:
M dyn_em/module_initialize_real.F

TESTS CONDUCTED:

Tested before and after this change. The data without SH is not affected, and the data with SH (EC model level data) is now used directly if use_sh_qv is set to true.
The Jenkins tests are all passing.
  • Loading branch information
weiwangncar authored Mar 27, 2024
1 parent 9c09ef9 commit 0b68af0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dyn_em/module_initialize_real.F
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,7 @@ SUBROUTINE init_domain_rk ( grid &
ELSE
k = num_metgrid_levels
END IF
config_flags%use_sh_qv = .FALSE.
IF ( config_flags%rh2qv_method .eq. 1 ) THEN
CALL rh_to_mxrat1(grid%rh_gc, grid%t_gc, grid%p_gc, grid%qv_gc , &
Expand Down Expand Up @@ -1821,7 +1822,7 @@ SUBROUTINE init_domain_rk ( grid &
END IF
! do not compute qv from RH if flag_sh or flag_qv = 1, or use_sh_qv = F
IF ( flag_sh .ne. 1 .or. flag_qv .ne. 1 .or. .not. config_flags%use_sh_qv ) THEN
IF ( .not.config_flags%use_sh_qv ) THEN
IF ( config_flags%rh2qv_method .eq. 1 ) THEN
CALL rh_to_mxrat1(grid%u_1, grid%v_1, grid%p , moist(:,:,:,P_QV) , &
config_flags%rh2qv_wrt_liquid , &
Expand Down Expand Up @@ -4100,7 +4101,7 @@ SUBROUTINE init_domain_rk ( grid &
ims , ime , jms , jme , kms , kme , &
its , ite , jts , jte , kts , kte )
IF ( flag_sh .ne. 1 .or. flag_qv .ne. 1 .or. .not. config_flags%use_sh_qv ) THEN
IF ( .not.config_flags%use_sh_qv ) THEN
IF ( config_flags%rh2qv_method .eq. 1 ) THEN
CALL rh_to_mxrat1(grid%u_1, grid%v_1, grid%p_hyd , moist(:,:,:,P_QV) , &
config_flags%rh2qv_wrt_liquid , &
Expand Down

0 comments on commit 0b68af0

Please sign in to comment.