@@ -314,6 +314,7 @@ module model_mod
314
314
integer :: domain_size
315
315
integer :: localization_coord
316
316
integer :: hybrid_opt
317
+ integer :: theta_m
317
318
real (r8 ), dimension (:), pointer :: znu, dn, dnw, zs, znw, c1h, c2h
318
319
real (r8 ), dimension (:,:), pointer :: mub, hgt
319
320
real (r8 ), dimension (:,:), pointer :: latitude, latitude_u, latitude_v
@@ -708,7 +709,16 @@ subroutine static_init_model()
708
709
' for WRFv4 and later'
709
710
call error_handler(E_ERR,' static_init_model' , errstring, source, revision, revdate)
710
711
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
712
722
713
723
wrf% dom(id)% type_u = get_type_ind_from_type_string(id,' U' )
714
724
wrf% dom(id)% type_v = get_type_ind_from_type_string(id,' V' )
@@ -7159,6 +7169,12 @@ subroutine read_wrf_file_attributes(ncid,id)
7159
7169
' static_init_model' , ' get_att STAND_LON' )
7160
7170
if (debug) write (* ,* ) ' stdlon is ' ,stdlon
7161
7171
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
+
7162
7178
! this attribute is not present in older wrf files, which means it is not
7163
7179
! using a hybrid vertical coordinate. not having this attribute should
7164
7180
! not cause an error.
0 commit comments