1 | 2010 12 21, JM |
---|
2 | |
---|
3 | Description of code in solve_em.F that allows computation of decoupled |
---|
4 | horizontal and vertical advective tendencies. This is a feature that |
---|
5 | was added John Wong and the WRF_CHEM developers and involves threading |
---|
6 | additional arrays through the RK advection routines. The developers |
---|
7 | also worked with the WRF Dynamics Working Group to add placeholders |
---|
8 | so that this capability could be used to compute decoupled horizontal |
---|
9 | and vertical advective tendencies for fields in other 4D tracer arrays |
---|
10 | (e.g. moist, scalar, etc.). However, these are only placeholders for |
---|
11 | the other tracer arrays and users wishing to make this modification to |
---|
12 | solve_em should read this file carefully. THIS IS AN ADVANCED TOPIC. |
---|
13 | |
---|
14 | The logical variable tenddec defined at the top of the solve_em routine |
---|
15 | is set within each loops over tracers for the 4D tracer arrays in WRF. |
---|
16 | The variable is passed into the RK advection routines and controls whether |
---|
17 | or not those routines do the necessary extra computations and store or |
---|
18 | accumulate the results into the 3D arrays h_tendency and z_tendency, also |
---|
19 | defined at the top of solve_em. Currently, and with the exception of the |
---|
20 | loops over chemical species, tenddec is always set to false. The chemical |
---|
21 | loops and the statement to declare h_tendency and z_tendency as fully |
---|
22 | 3D are guarded by #ifdef WRF_CHEM. Otherwise, h_tendency and z_tendency |
---|
23 | are allocated only minimal storage to save memory. As long as tenddec is |
---|
24 | false, the RK routines will not attempt to access or modify these arrays. |
---|
25 | |
---|
26 | To enable computational of decoupled horizontal and vertical advective |
---|
27 | tendencies for other 4D tracer arrays, first modify the declaration |
---|
28 | of h_tendency and z_tendency so they are fully dimensioned (as they are |
---|
29 | with WRF_CHEM). Then, in the Registry, add definitions for the fields for |
---|
30 | which you wish to have these decoupled tendencies computed to the 4D array |
---|
31 | advh_t and advz_t . Set up an index array similar to the adv_ct_indices |
---|
32 | array that is defined in solve_em when WRF_CHEM is defined and then |
---|
33 | set up assignments to that array similar to the assignments use to set |
---|
34 | adv_ct_indices in the routine setup_ct_indices(), which is defined in |
---|
35 | chem/chemics_init.F . This will cause the rk_update_scalar routine to |
---|
36 | update the fields you have specified in the advh_t and advz_t arrays. |
---|
37 | Note that you must use your adv_*_indices array as the last index of |
---|
38 | the advh_t and advz_t arrays in the arguments to rk_update_scalar (see |
---|
39 | the call to rk_update_scalar for the chemistry species as an example). |
---|
40 | |
---|
41 | Additional note: currently advh_t and advz_t are the only 4D arrays |
---|
42 | defined in the Registry for this purpose. Therefore, you can only compute |
---|
43 | decoupled horizontal and vertical tendencies for only one non-chemistry |
---|
44 | 4D tracer array. If you need to do this for more than one, add another |
---|
45 | advh_* and advz_* array to the Registry and management them separately. |
---|
46 | |
---|
47 | Only after you have done this should you modify how tenddec is set in |
---|
48 | the scalar loop you are working with. Use the assignement at the top |
---|
49 | of the chemistry tracer loop as an example. |
---|
50 | |
---|