Skip to content

Commit a58694a

Browse files
Merge branch 'main' into GOES_obs_converter
2 parents effe720 + 5c4c880 commit a58694a

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

models/wrf/model_mod.f90

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,22 @@ subroutine static_init_model()
694694

695695
! JPH now that we have the domain ID just go ahead and get type indices once
696696
! NOTE: this is not strictly necessary - can use only stagger info in the future (???)
697+
698+
! Prevent boundscheck error by making WRF temperature variable 'THM' as mandatory.
699+
! Also, for WRFv4 and later versions variable 'T' is
700+
! diagnostic, thus updating the 'THM' variable (prognostic) is also preferred
701+
! for all DA applications.
702+
703+
704+
705+
if (get_type_ind_from_type_string(id,'T') >=0 .or. get_type_ind_from_type_string(id,'THM') <=0) then
706+
707+
write(errstring,*)'WRF temperature variable THM must appear in DART model_nml', &
708+
' for WRFv4 and later'
709+
call error_handler(E_ERR,'static_init_model', errstring, source, revision, revdate)
710+
711+
endif
712+
697713
wrf%dom(id)%type_u = get_type_ind_from_type_string(id,'U')
698714
wrf%dom(id)%type_v = get_type_ind_from_type_string(id,'V')
699715
wrf%dom(id)%type_w = get_type_ind_from_type_string(id,'W')

models/wrf/readme.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ Some important WRF-DART updates include:
2424
operator calculations.
2525

2626
- Version 11.5.0: Improves compatibility with WRFv4+ versions where
27-
the prognostic 3D temperature variable is THM.
27+
the prognostic 3D temperature variable is THM. It is now mandatory to
28+
include THM instead of T in the ``wrf_state_variables`` namelist.
29+
30+
2831

2932
It is always recommended that you update your DART version to the
3033
`latest release <https://github.com/NCAR/DART/releases>`__ before beginning new research.
@@ -336,6 +339,13 @@ For example:
336339
'PSFC','QTY_PRESSURE','TYPE_PS','UPDATE','999',
337340

338341

342+
.. Important::
343+
344+
It is mandatory to include ``THM`` instead of ``T`` as the ``TYPE_T`` WRF
345+
temperature variable. This is because ``THM`` is the prognostic temperature variable
346+
that will impact the forecast when updated.
347+
348+
339349
- polar, periodic_x
340350

341351
The ``Polar`` and ``periodic_x`` namelist values are used in global WRF simulations.

models/wrf/tutorial/README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ either WRF or DART.
1919
versions 11.4.0 and earlier because those older versions do not account
2020
for different coordinate systems including the sigma hybrid coordinates as
2121
described in `DART Issue #650 <https://github.com/NCAR/DART/pull/650>`__.
22+
2223
Furthermore, older versions do not account for the prognostic temperature variable
2324
switch from ``T`` (perturbation potential temperature) to ``THM``, (either perturbation
2425
potential temperature or perturbation moist potential temperature) as described in
2526
`DART issue #661 <https://github.com/NCAR/DART/issues/661>`__. The current implementation
2627
of the code sets ``T=THM`` because within &dynamics section of ``namelist.input``
27-
``use_theta_m=0``.
28+
``use_theta_m=0``. For this reason, It is mandatory to include ``THM`` instead of
29+
``T`` as the ``TYPE_T`` within the wrf_state_variables namelist.
2830
2931
Earlier version of WRF (v3.9) may run without errors with more recent versions of
3032
DART (later than 11.4.0), but the assimilation performance will be deprecated.

0 commit comments

Comments
 (0)