Skip to content

Commit 924182f

Browse files
Merge pull request #673 from NCAR/WRF4_updates
Update WRF-DART interface to support WRF4
2 parents 039cd8e + f5d5da5 commit 924182f

File tree

13 files changed

+81
-39
lines changed

13 files changed

+81
-39
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
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+
**May 16 2024 :: WRF v4. Tag v11.5.0**
26+
27+
- WRF-DART and WRF-DART Tutorial updated to WRFv4. Note, not backwards compatible with WRFv3.9.
28+
- local particle filter default value for pf_enkf_hybrid=.false. *contributed by Jon Poterjoy*
29+
2530
**April 23 2024 :: Bug-fix: WRF hybrid vertical coordinate. Tag v11.4.1**
2631

2732
- DART now detects whether WRF is using Hybrid Vertical Coordinate (HVC) introduced in WRFv3.9 or terrain following (TF) system.

assimilation_code/modules/assimilation/assim_tools_mod.pf.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ module assim_tools_mod
165165
real(r8) :: pf_alpha = 0.30_r8
166166
integer :: pf_kddm = 0
167167
logical :: sampling_weighted_prior = .true.
168-
logical :: pf_enkf_hybrid = .true.
168+
logical :: pf_enkf_hybrid = .false.
169169
real(r8) :: min_residual = 0.5_r8
170170
integer :: pf_maxiter = 3
171171
real(r8) :: pf_kf_rtps_coeff = 0.0_r8

conf.py

Lines changed: 1 addition & 1 deletion
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.4.1'
24+
release = '11.5.0'
2525
root_doc = 'index'
2626

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

guide/matlab-observation-space.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
MATLAB observation space diagnostics
33
####################################
44

5+
.. _configMatlab:
6+
57
Configuring MATLAB
68
==================
79

models/wrf/model_mod.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ subroutine static_init_model()
697697
wrf%dom(id)%type_u = get_type_ind_from_type_string(id,'U')
698698
wrf%dom(id)%type_v = get_type_ind_from_type_string(id,'V')
699699
wrf%dom(id)%type_w = get_type_ind_from_type_string(id,'W')
700-
wrf%dom(id)%type_t = get_type_ind_from_type_string(id,'T')
700+
wrf%dom(id)%type_t = get_type_ind_from_type_string(id,'THM')
701701
wrf%dom(id)%type_gz = get_type_ind_from_type_string(id,'PH')
702702
wrf%dom(id)%type_qv = get_type_ind_from_type_string(id,'QVAPOR')
703703
wrf%dom(id)%type_qr = get_type_ind_from_type_string(id,'QRAIN')
@@ -7465,7 +7465,7 @@ subroutine fill_default_state_table(default_table)
74657465
'UPDATE ', &
74667466
'999 ' /)
74677467
row = row+1
7468-
default_table(:,row) = (/ 'T ', &
7468+
default_table(:,row) = (/ 'THM ', &
74697469
'QTY_POTENTIAL_TEMPERATURE ', &
74707470
'TYPE_T ', &
74717471
'UPDATE ', &

models/wrf/readme.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ DART interface module for the Weather Research and Forecasting
99
`(WRF) <https://www.mmm.ucar.edu/weather-research-and-forecasting-model>`__
1010
model. This page documents the details of the
1111
module compiled into DART that interfaces with the WRF data in the state vector.
12+
**The WRF-DART interface is compatible with WRF versions 4 and later, and is
13+
no longer backwards compatible with WRFv3.9 and earlier.**
14+
For more information on the interface changes required between
15+
different WRF versions see the WRF tutorial link in the next section.
1216

1317
WRF+DART Tutorial
1418
-----------------
@@ -362,4 +366,4 @@ Files
362366
References
363367
----------
364368

365-
http://www2.mmm.ucar.edu/wrf/users/docs/user_guide_V3/contents.html
369+
https://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/contents.html

models/wrf/shell_scripts/add_bank_perts.ncl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,19 @@ begin
4343
asciiwrite("mem"+MEM_NUM+"_pert_bank_num",ens_mem_num)
4444
print ("bank member number "+ens_mem_num)
4545

46+
47+
;For WRFv4 or later prognostic temp variable is THM
4648
pert_fields = (/"U", "V", "T", "QVAPOR","MU"/)
49+
wrf_fields = (/"U", "V", "THM", "QVAPOR","MU"/)
4750
pert_scale = (/scale_U,scale_V,scale_T,scale_Q,scale_M/)
4851
nperts = dimsizes(pert_fields)
4952
pert_in = addfile(pert_bank_path+"/"+pert_bank_file,"r")
5053
wrf_in = addfile(wrf_file,"w")
5154
do n=0,nperts-1
52-
temp_w = wrf_in->$pert_fields(n)$
55+
temp_w = wrf_in->$wrf_fields(n)$
5356
temp_p = pert_in->$pert_fields(n)$
5457
temp_c = temp_w+(temp_p * pert_scale(n))
55-
wrf_in->$pert_fields(n)$ = temp_c
58+
wrf_in->$wrf_fields(n)$ = temp_c
5659
delete(temp_w)
5760
delete(temp_p)
5861
delete(temp_c)

models/wrf/shell_scripts/driver.csh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,11 @@ while ( 1 == 1 )
473473

474474
else if ( $SUPER_PLATFORM == 'derecho' ) then
475475

476+
# Prevent double submission for member 1 only
477+
if ( $n == 1) then
478+
sleep 5
479+
endif
480+
476481
if ( `qstat -wa | grep assim_advance_${n} | wc -l` == 0 ) then
477482

478483
echo "assim_advance_${n} is missing from the queue"
@@ -515,12 +520,12 @@ while ( 1 == 1 )
515520
else if ( $SUPER_PLATFORM == 'derecho' ) then
516521

517522
qsub assim_advance_mem${n}.csh
518-
523+
sleep 5
519524
endif
520525
break
521526

522527
endif
523-
sleep 10 # this might need to be longer, though I moved the done flag lower in the
528+
sleep 15 # this might need to be longer, though I moved the done flag lower in the
524529
# advance_model.csh to hopefully avoid the file moves below failing
525530

526531
end

models/wrf/shell_scripts/param.csh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ set POST_STAGE_DIR = ${BASE_DIR}/post
3434
set OBS_DIAG_DIR = ${BASE_DIR}/obs_diag
3535
set PERTS_DIR = ${BASE_DIR}/perts
3636

37-
# Directories that can be used by many things
37+
# Assign path to DART, WRF, WPS and WRFDA build
3838
set SHELL_SCRIPTS_DIR = ${BASE_DIR}/scripts
3939
set DART_DIR = /glade/work/USER/DART # set this appropriately #%%%#
4040
set WRF_DM_SRC_DIR = /glade/work/USER/WRFV3 # set this appropriately #%%%#
@@ -47,14 +47,14 @@ set GRIB_DATA_DIR = ${ICBC_DIR}/grib_data # set this app
4747
set GRIB_SRC = 'GFS' # set this appropriately #%%%#
4848

4949
# list of variables for extraction and cycling
50-
set extract_vars_a = ( U V PH T MU QVAPOR QCLOUD QRAIN QICE QSNOW QGRAUP QNICE QNRAIN \
50+
set extract_vars_a = ( U V PH THM MU QVAPOR QCLOUD QRAIN QICE QSNOW QGRAUP QNICE QNRAIN \
5151
U10 V10 T2 Q2 PSFC TSLB SMOIS TSK RAINC RAINNC GRAUPELNC )
52-
set extract_vars_b = ( U V W PH T MU QVAPOR QCLOUD QRAIN QICE QSNOW QGRAUP QNICE QNRAIN \
52+
set extract_vars_b = ( U V W PH THM MU QVAPOR QCLOUD QRAIN QICE QSNOW QGRAUP QNICE QNRAIN \
5353
U10 V10 T2 Q2 PSFC TSLB SMOIS TSK RAINC RAINNC GRAUPELNC \
5454
REFL_10CM VT_DBZ_WT )
55-
set cycle_vars_a = ( U V PH T MU QVAPOR QCLOUD QRAIN QICE QSNOW QGRAUP QNICE QNRAIN \
55+
set cycle_vars_a = ( U V PH THM MU QVAPOR QCLOUD QRAIN QICE QSNOW QGRAUP QNICE QNRAIN \
5656
U10 V10 T2 Q2 PSFC TSLB SMOIS TSK )
57-
set increment_vars_a = ( U V PH T MU QVAPOR QCLOUD QRAIN QICE QSNOW QGRAUP QNICE QNRAIN U10 V10 T2 Q2 PSFC )
57+
set increment_vars_a = ( U V PH THM MU QVAPOR QCLOUD QRAIN QICE QSNOW QGRAUP QNICE QNRAIN U10 V10 T2 Q2 PSFC )
5858

5959
# Diagnostic parameters
6060
set OBS_VERIF_DAYS = 7

models/wrf/tutorial/README.rst

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,33 @@ and only covers the WRF-specific aspects of coupling with DART.
1212
It is not wise to try to run WRF-DART if you have no experience with
1313
either WRF or DART.
1414

15-
This tutorial was designed to be compatible with WRF V3.9.1 and was
16-
tested with DART V11.0.2. Other releases of WRF may or may not be
17-
backwards or forwards compatible with this tutorial.
15+
.. Important ::
16+
17+
This tutorial was designed to be compatible with WRF Version 4 and was
18+
tested with WRFv4.5.2. This tutorial should not be used with DART
19+
versions 11.4.0 and earlier because those older versions do not account
20+
for different coordinate systems including the sigma hybrid coordinates as
21+
described in `DART Issue #650 <https://github.com/NCAR/DART/pull/650>`__.
22+
Furthermore, older versions do not account for the prognostic temperature variable
23+
switch from ``T`` (perturbation potential temperature) to ``THM``, (either perturbation
24+
potential temperature or perturbation moist potential temperature) as described in
25+
`DART issue #661 <https://github.com/NCAR/DART/issues/661>`__. The current implementation
26+
of the code sets ``T=THM`` because within &dynamics section of ``namelist.input``
27+
``use_theta_m=0``.
28+
29+
Earlier version of WRF (v3.9) may run without errors with more recent versions of
30+
DART (later than 11.4.0), but the assimilation performance will be deprecated.
31+
If you need to run with earlier versions of WRF, please review the changes required
32+
to switch from WRFv4 to WRFv3 as documented within
33+
`DART issue #661 <https://github.com/NCAR/DART/issues/661>`__,
34+
or contact the DART team. Earlier WRF versions also require different settings
35+
within the WRF ``namelist.input`` file to promote vertical stability for the tutorial
36+
example. These settings are also described in DART Issue #661.
37+
1838
Prior to running this tutorial, we urge the users to familarize themselves with the
1939
`WRF system <https://www2.mmm.ucar.edu/wrf/users/model_overview.html>`__
20-
(WRF_ARW, WPS and WRFDA), and to read through the `WRFv3.9 User's Guide
21-
<https://www2.mmm.ucar.edu/wrf/users/docs/user_guide_V3/user_guide_V3.9/contents.html>`__
40+
(WRF_ARW, WPS and WRFDA), and to read through the `WRFv4.5 User's Guide
41+
<https://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/contents.html>`__
2242
and the `WRF model tutorials <https://www2.mmm.ucar.edu/wrf/users/tutorial/tutorial.html>`__
2343

2444
The DART team is not responsible for and does not maintain the WRF code. For WRF related issues check out the
@@ -233,13 +253,16 @@ bash ``export BASE_DIR=<path_to_your_working_directory>``
233253
::
234254

235255
cd $BASE_DIR
236-
wget http://www.image.ucar.edu/wrfdart/tutorial/wrf_dart_tutorial_23May2018_v3.tar.gz
237-
tar -xzvf wrf_dart_tutorial_23May2018_v3.tar.gz
256+
wget http://www.image.ucar.edu/wrfdart/tutorial/wrf_dart_tutorial_29Apr2024.tar.gz
257+
tar -xzvf wrf_dart_tutorial_29Apr2024.tar.gz
238258

239259
After untarring the file you should see the following directories:
240260
*icbc, output, perts,* and *template.* The directory names (case
241261
sensitive) are important, as the scripts rely on these local paths
242-
and file names.
262+
and file names. Please note that the perturbation, surface and initial
263+
condition files were derived from an earlier version (pre-4.0) of WRF/WPS/WRFDA
264+
but still maintains compatibility with the (post-4.0, post-11.4.0)
265+
WRF-DART versions recommended to run this WRF assimilation example.
243266

244267
2. You will need template WRF namelists from the
245268
``$DART_DIR/models/wrf/tutorial/template`` directory:
@@ -923,10 +946,10 @@ between the background (prior) and the analysis (posterior) after running
923946

924947

925948
The ``analysis_increment.nc`` file includes the following atmospheric variables:
926-
``MU, PH, PSFC, QRAIN, QCLOUD, QGRAUP, QICE, QNICE, QSNOW, QVAPOR, T`` and ``T2``.
927-
The example figure below shows the increments for temperature (T) only. You can
928-
use **ncview** to advance through all 11 atmospheric pressure levels. You should
929-
see spatial patterns that look something like the meteorology of the day.
949+
``MU, PH, PSFC, QRAIN, QCLOUD, QGRAUP, QICE, QNICE, QSNOW, QVAPOR, THM`` and ``T2``.
950+
The example figure below shows the increments for THM (perturbation potential temperature)
951+
only. You can use **ncview** to advance through all 11 atmospheric pressure levels.
952+
You should see spatial patterns that look something like the meteorology of the day.
930953

931954
+--------------------------+--------------------------------+
932955
| |ncview1| | |ncview2| |
@@ -1297,9 +1320,9 @@ period of the assimilation.
12971320
calendar = 'Gregorian',
12981321
first_bin_start = 1601, 1, 1, 0, 0, 0,
12991322
first_bin_end = 2999, 1, 1, 0, 0, 0,
1300-
last_bin_end = 2999, 1, 1, 0, 0, 0,
1301-
bin_interval_days = 0,
1302-
bin_interval_seconds = 21600,
1323+
last_bin_end = 2999, 1, 1, 0, 0, 0,
1324+
bin_interval_days = 1000000,
1325+
bin_interval_seconds = 0,
13031326
max_num_bins = 1000,
13041327
print_table = .true
13051328
/
@@ -1380,10 +1403,8 @@ More Resources
13801403
--------------
13811404

13821405
- `Check or Submit DART Issues <https://github.com/NCAR/DART/issues>`__
1383-
- `DAReS website <ttp://dart.ucar.edu>`__
1384-
- `Preparing
1385-
MATLAB <https://dart.ucar.edu/pages/Getting_Started.html#matlab>`__
1386-
to use with DART.
1406+
- `DAReS website <http://dart.ucar.edu>`__
1407+
- :ref:`Preparing MATLAB<configMatlab>` to use with DART.
13871408
- `WRF model users page <http://www.mmm.ucar.edu/wrf/users>`__
13881409

13891410
.. |ncview1| image:: ../../../guide/images/WRF_tutorial_ncview1.png

models/wrf/tutorial/template/input.nml.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
first_obs_seconds = -1,
2020
last_obs_days = -1,
2121
last_obs_seconds = -1,
22-
num_output_state_members = 0,
23-
num_output_obs_members = 3,
22+
num_output_state_members = 50,
23+
num_output_obs_members = 50,
2424
output_interval = 1,
2525
num_groups = 1,
2626
output_forward_op_errors = .false.,
@@ -117,7 +117,7 @@
117117
wrf_state_variables = 'U','QTY_U_WIND_COMPONENT','TYPE_U','UPDATE','999',
118118
'V','QTY_V_WIND_COMPONENT','TYPE_V','UPDATE','999',
119119
'W','QTY_VERTICAL_VELOCITY','TYPE_W','UPDATE','999',
120-
'T','QTY_POTENTIAL_TEMPERATURE','TYPE_T','UPDATE','999',
120+
'THM','QTY_POTENTIAL_TEMPERATURE','TYPE_T','UPDATE','999',
121121
'PH','QTY_GEOPOTENTIAL_HEIGHT','TYPE_GZ','UPDATE','999',
122122
'MU','QTY_PRESSURE','TYPE_MU','UPDATE','999',
123123
'QVAPOR','QTY_VAPOR_MIXING_RATIO','TYPE_QV','UPDATE','999',

models/wrf/tutorial/template/namelist.input.meso

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
diff_6th_opt = 2, 2,
110110
diff_6th_factor = 0.25, 0.12,
111111
epssm = 0.1
112+
use_theta_m = 0
113+
zadvect_implicit = 1
112114
/
113115

114116
&bdy_control

models/wrf/work/input.nml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
first_obs_seconds = -1,
4949
last_obs_days = -1,
5050
last_obs_seconds = -1,
51-
num_output_state_members = 0,
52-
num_output_obs_members = 32,
51+
num_output_state_members = 3,
52+
num_output_obs_members = 3,
5353
output_interval = 1,
5454
num_groups = 1,
5555
distributed_state = .true.
@@ -205,7 +205,7 @@
205205
'V', 'QTY_V_WIND_COMPONENT', 'TYPE_V', 'UPDATE','999',
206206
'W', 'QTY_VERTICAL_VELOCITY', 'TYPE_W', 'UPDATE','999',
207207
'PH', 'QTY_GEOPOTENTIAL_HEIGHT', 'TYPE_GZ', 'UPDATE','999',
208-
'T', 'QTY_POTENTIAL_TEMPERATURE','TYPE_T', 'UPDATE','999',
208+
'THM', 'QTY_POTENTIAL_TEMPERATURE','TYPE_T', 'UPDATE','999',
209209
'MU', 'QTY_PRESSURE', 'TYPE_MU', 'UPDATE','999',
210210
'QVAPOR','QTY_VAPOR_MIXING_RATIO', 'TYPE_QV', 'UPDATE','999',
211211
'PSFC', 'QTY_SURFACE_PRESSURE', 'TYPE_PSFC', 'UPDATE','999',

0 commit comments

Comments
 (0)