Skip to content

Commit 33c310b

Browse files
Merge pull request #838 from NCAR/WRF_THM
Check for THM USE_THETA_M attribute
2 parents 47338cd + 4f33b0d commit 33c310b

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

CHANGELOG.rst

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ individual files.
2222

2323
The changes are now listed with the most recent at the top.
2424

25+
**March 14 2025 :: WRF use_theta_m check. Tag v11.10.5**
26+
27+
- Assert USE_THETA_M=0 in WRF when initializing wrf model_mod.
28+
- fixed documentation broken links.
29+
2530
**February 6 2025 :: WRF tutorial and prepbufr documentation. Tag v11.10.4**
2631

2732
- Observation section of WRF tutorial updated to match provided obs.

conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
author = 'Data Assimilation Research Section'
2222

2323
# The full version, including alpha/beta/rc tags
24-
release = '11.10.4'
24+
release = '11.10.5'
2525
root_doc = 'index'
2626

2727
# -- General configuration ---------------------------------------------------

models/wrf/model_mod.f90

+17-1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ module model_mod
314314
integer :: domain_size
315315
integer :: localization_coord
316316
integer :: hybrid_opt
317+
integer :: theta_m
317318
real(r8), dimension(:), pointer :: znu, dn, dnw, zs, znw, c1h, c2h
318319
real(r8), dimension(:,:), pointer :: mub, hgt
319320
real(r8), dimension(:,:), pointer :: latitude, latitude_u, latitude_v
@@ -708,7 +709,16 @@ subroutine static_init_model()
708709
' for WRFv4 and later'
709710
call error_handler(E_ERR,'static_init_model', errstring, source, revision, revdate)
710711

711-
endif
712+
endif
713+
714+
! DART requires that THM is the 'perturbed dry adiabatic potential temperature'
715+
! WRF USE_THETA_M namelist option must be 0
716+
if (get_type_ind_from_type_string(id,'THM') >=0 .and. wrf%dom(id)%theta_m /= 0) then
717+
718+
write(errstring,*)'WRF namelist option USE_THETA_M must be 0, where THM = perturbed dry adiabatic potential temperature'
719+
call error_handler(E_ERR,'static_init_model', errstring, source, revision, revdate)
720+
721+
endif
712722

713723
wrf%dom(id)%type_u = get_type_ind_from_type_string(id,'U')
714724
wrf%dom(id)%type_v = get_type_ind_from_type_string(id,'V')
@@ -7159,6 +7169,12 @@ subroutine read_wrf_file_attributes(ncid,id)
71597169
'static_init_model', 'get_att STAND_LON')
71607170
if(debug) write(*,*) ' stdlon is ',stdlon
71617171

7172+
call nc_check( nf90_get_att(ncid, nf90_global, 'USE_THETA_M', wrf%dom(id)%theta_m), &
7173+
'static_init_model', 'get_att USE_THETA_M')
7174+
if(debug) write(*,*) ' theta_m is ',wrf%dom(id)%theta_m
7175+
7176+
7177+
71627178
! this attribute is not present in older wrf files, which means it is not
71637179
! using a hybrid vertical coordinate. not having this attribute should
71647180
! not cause an error.

0 commit comments

Comments
 (0)