Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

THM is mandatory WRF temp variable #733

Merged
merged 9 commits into from
Oct 22, 2024
Merged
16 changes: 16 additions & 0 deletions models/wrf/model_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,22 @@ subroutine static_init_model()

! JPH now that we have the domain ID just go ahead and get type indices once
! NOTE: this is not strictly necessary - can use only stagger info in the future (???)

! The model_nml must contain WRF temperature variable 'THM' to
! prevent boundcheck error. For WRFv4 and later versions variable 'T' is
! diagnostic, thus updating the 'THM' variable (prognostic) is also preferred
! for all DA applications.



if (get_type_ind_from_type_string(id,'T') >=0 .or. get_type_ind_from_type_string(id,'THM') <=0) then

write(errstring,*)'WRF temperature variable THM must appear in DART model_nml', &
' for WRFv4 and later'
call error_handler(E_ERR,'static_init_model', errstring, source, revision, revdate)

endif

wrf%dom(id)%type_u = get_type_ind_from_type_string(id,'U')
wrf%dom(id)%type_v = get_type_ind_from_type_string(id,'V')
wrf%dom(id)%type_w = get_type_ind_from_type_string(id,'W')
Expand Down
13 changes: 12 additions & 1 deletion models/wrf/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ Some important WRF-DART updates include:
operator calculations.

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



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


.. Important::

It is mandatory to include ``THM`` instead of ``T`` as the ``TYPE_T`` WRF
temperature variable. This is because ``THM`` is the prognostic temperature variable
that will impact the forecast when updated. Also, including ``T`` can give
boundscheck errors as described in `issue #728. <https://github.com/NCAR/DART/issues/728>`__
braczka marked this conversation as resolved.
Show resolved Hide resolved


- polar, periodic_x

The ``Polar`` and ``periodic_x`` namelist values are used in global WRF simulations.
Expand Down
6 changes: 5 additions & 1 deletion models/wrf/tutorial/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ either WRF or DART.
versions 11.4.0 and earlier because those older versions do not account
for different coordinate systems including the sigma hybrid coordinates as
described in `DART Issue #650 <https://github.com/NCAR/DART/pull/650>`__.

Furthermore, older versions do not account for the prognostic temperature variable
switch from ``T`` (perturbation potential temperature) to ``THM``, (either perturbation
potential temperature or perturbation moist potential temperature) as described in
`DART issue #661 <https://github.com/NCAR/DART/issues/661>`__. The current implementation
of the code sets ``T=THM`` because within &dynamics section of ``namelist.input``
``use_theta_m=0``.
``use_theta_m=0``. For this reason, It is mandatory to include ``THM`` instead of
``T`` as the ``TYPE_T`` within the wrf_state_variables namelist. Furthermore, including
``T`` in the namelist can lead to errors in the WRF model_mod bounds check as
described in `Issue #728. <https://github.com/NCAR/DART/issues/728>`__
braczka marked this conversation as resolved.
Show resolved Hide resolved

Earlier version of WRF (v3.9) may run without errors with more recent versions of
DART (later than 11.4.0), but the assimilation performance will be deprecated.
Expand Down