diff --git a/models/wrf/model_mod.f90 b/models/wrf/model_mod.f90 index 9ca5ddbe7..b48167294 100644 --- a/models/wrf/model_mod.f90 +++ b/models/wrf/model_mod.f90 @@ -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 (???) + + ! Prevent boundscheck error by making WRF temperature variable 'THM' as mandatory. + ! Also, 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') diff --git a/models/wrf/readme.rst b/models/wrf/readme.rst index ebb322751..04fc4267b 100644 --- a/models/wrf/readme.rst +++ b/models/wrf/readme.rst @@ -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 `__ before beginning new research. @@ -336,6 +339,13 @@ 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. + + - polar, periodic_x The ``Polar`` and ``periodic_x`` namelist values are used in global WRF simulations. diff --git a/models/wrf/tutorial/README.rst b/models/wrf/tutorial/README.rst index 2dd00180d..6e3a7be73 100644 --- a/models/wrf/tutorial/README.rst +++ b/models/wrf/tutorial/README.rst @@ -19,12 +19,14 @@ 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 `__. + 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 `__. 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. 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.