source: palm/trunk/SOURCE/plant_canopy_model.f90 @ 550

Last change on this file since 550 was 392, checked in by raasch, 14 years ago

New:
---

Adapted for machine lck
(mrun, mbuild, subjob)

bc_lr/bc_ns in most subroutines replaced by LOGICAL variables bc_lr_cyc,
bc_ns_cyc for speed optimization
(check_parameters, diffusion_u, diffusion_v, diffusion_w, modules)

Additional timestep criterion in case of simulations with plant canopy (timestep)

Check for illegal entries in section_xy|xz|yz that exceed nz+1|ny+1|nx+1
(check_parameters)

Clipping of dvrp output implemented. Default colourtable for particles
implemented, particle attributes (color, dvrp_size) can be set with new
parameters particle_color, particle_dvrpsize, color_interval,
dvrpsize_interval (init_dvrp, data_output_dvrp, modules, user_data_output_dvrp).
Slicer attributes (dvrp) are set with new routine set_slicer_attributes_dvrp
and are controlled with existing parameters slicer_range_limits.
(set_slicer_attributes_dvrp)

Ocean atmosphere coupling allows to use independent precursor runs in order
to account for different spin-up times. The time when coupling has to be
started is given by new inipar parameter coupling_start_time. The precursor
ocean run has to be started using new mrun option "-y" in order to add
appendix "_O" to all output files.
(check_for_restart, check_parameters, data_output_2d, data_output_3d,
data_output_profiles, data_output_ptseries, data_output_spectra,
data_output_tseries, header, init_coupling, modules, mrun,
parin, read_var_list, surface_coupler, time_integration, write_var_list)

Polygon reduction for topography and ground plate isosurface. Reduction level
for buildings can be chosen with parameter cluster_size. (init_dvrp)

External pressure gradient (check_parameters, header, init_3d_model, modules,
parin, prognostic_equations, read_var_list, write_var_list)

New topography case 'single_street_canyon' (header, init_grid, modules, parin,
read_var_list, user_check_parameters, user_header, user_init_grid, write_var_list)

Option to predefine a target bulk velocity for conserve_volume_flow
(check_parameters, header, init_3d_model, modules, parin, read_var_list,
write_var_list)

Option for user defined 2D data output in xy cross sections at z=nzb+1
(data_output_2d, user_data_output_2d)

xy cross section output of surface heatfluxes (latent, sensible)
(average_3d_data, check_parameters, data_output_2d, modules, read_3d_binary,
sum_up_3d_data, write_3d_binary)

average_3d_data, check_for_restart, check_parameters, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_ptseries, data_output_spectra, data_output_tseries, init_coupling, init_dvrp, init_grid, init_3d_model, header, mbuild, modules, mrun, package_parin, parin, prognostic_equations, read_3d_binary, read_var_list, subjob, surface_coupler, timestep, time_integration, user_check_parameters, user_data_output_2d, user_data_output_dvrp, user_header, user_init_grid, write_3d_binary, write_var_list

New: set_particle_attributes, set_slicer_attributes_dvrp

Changed:


lcmuk changed to lc to avoid problems with Intel compiler on sgi-ice
(poisfft)

For extended NetCDF files, the updated title attribute includes an update of
time_average_text where appropriate. (netcdf)

In case of restart runs without extension, initial profiles are not written
to NetCDF-file anymore. (data_output_profiles, modules, read_var_list, write_var_list)

Small change in formatting of the message handling routine concering the output in the
job protocoll. (message)

initializing_actions='read_data_for_recycling' renamed to 'cyclic_fill', now
independent of turbulent_inflow (check_parameters, header, init_3d_model)

2 NetCDF error numbers changed. (data_output_3d)

A Link to the website appendix_a.html is printed for further information
about the possible errors. (message)

Temperature gradient criterion for estimating the boundary layer height
replaced by the gradient criterion of Sullivan et al. (1998). (flow_statistics)

NetCDF unit attribute in timeseries output in case of statistic regions added
(netcdf)

Output of NetCDF messages with aid of message handling routine.
(check_open, close_file, data_output_2d, data_output_3d,
data_output_profiles, data_output_ptseries, data_output_spectra,
data_output_tseries, netcdf, output_particles_netcdf)

Output of messages replaced by message handling routine.
(advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart,
check_open, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp,
data_output_profiles, data_output_spectra, fft_xy, flow_statistics, header,
init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid,
netcdf, parin, plant_canopy_model, poisfft_hybrid, poismg, read_3d_binary,
read_var_list, surface_coupler, temperton_fft, timestep, user_actions,
user_data_output_dvrp, user_dvrp_coltab, user_init_grid, user_init_plant_canopy,
user_parin, user_read_restart_data, user_spectra )

Maximum number of tails is calculated from maximum number of particles and
skip_particles_for_tail (init_particles)

Value of vertical_particle_advection may differ for each particle group
(advec_particles, header, modules)

First constant in array den also defined as type double. (eqn_state_seawater)

Parameter dvrp_psize moved from particles_par to dvrp_graphics_par. (package_parin)

topography_grid_convention moved from userpar to inipar (check_parameters,
header, parin, read_var_list, user_check_parameters, user_header,
user_init_grid, user_parin, write_var_list)

Default value of grid_matching changed to strict.

Adjustments for runs on lcxt4 (necessary due to an software update on CRAY) and
for coupled runs on ibmy (mrun, subjob)

advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart, check_open, check_parameters, close_file, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_ptseries, data_output_spectra, data_output_tseries, eqn_state_seawater, fft_xy, flow_statistics, header, init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid, message, mrun, netcdf, output_particles_netcdf, package_parin, parin, plant_canopy_model, poisfft, poisfft_hybrid, poismg, read_3d_binary, read_var_list, sort_particles, subjob, user_check_parameters, user_header, user_init_grid, user_parin, surface_coupler, temperton_fft, timestep, user_actions, user_data_output_dvrp, user_dvrp_coltab, user_init_grid, user_init_plant_canopy, user_parin, user_read_restart_data, user_spectra, write_var_list

Errors:


Bugfix: Initial hydrostatic pressure profile in case of ocean runs is now
calculated in 5 iteration steps. (init_ocean)

Bugfix: wrong sign in buoyancy production of ocean part in case of not using
the reference density (only in 3D routine production_e) (production_e)

Bugfix: output of averaged 2d/3d quantities requires that an avaraging
interval has been set, respective error message is included (check_parameters)

Bugfix: Output on unit 14 only if requested by write_binary.
(user_last_actions)

Bugfix to avoid zero division by km_neutral (production_e)

Bugfix for extended NetCDF files: In order to avoid 'data mode' errors if
updated attributes are larger than their original size, NF90_PUT_ATT is called
in 'define mode' enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a
possible performance loss; an alternative strategy would be to ensure equal
attribute size in a job chain. (netcdf)

Bugfix: correction of initial volume flow for non-flat topography (init_3d_model)
Bugfix: zero initialization of arrays within buildings for 'cyclic_fill' (init_3d_model)

Bugfix: to_be_resorted => s_av for time-averaged scalars (data_output_2d, data_output_3d)

Bugfix: error in formatting the output (message)

Bugfix: avoid that ngp_2dh_s_inner becomes zero (init_3_model)

Typographical error: unit of wpt in dots_unit (modules)

Bugfix: error in check, if particles moved further than one subdomain length.
This check must not be applied for newly released particles. (advec_particles)

Bugfix: several tail counters are initialized, particle_tail_coordinates is
only written to file if its third index is > 0, arrays for tails are allocated
with a minimum size of 10 tails if there is no tail initially (init_particles,
advec_particles)

Bugfix: pressure included for profile output (check_parameters)

Bugfix: Type of count and count_rate changed to default INTEGER on NEC machines
(cpu_log)

Bugfix: output if particle time series only if particle advection is switched
on. (time_integration)

Bugfix: qsws was calculated in case of constant heatflux = .FALSE. (prandtl_fluxes)

Bugfix: averaging along z is not allowed for 2d quantities (e.g. u* and z0) (data_output_2d)

Typographical errors (netcdf)

If the inversion height calculated by the prerun is zero, inflow_damping_height
must be explicitly specified (init_3d_model)

Small bugfix concerning 3d 64bit netcdf output format (header)

Bugfix: dt_fixed removed from the restart file, because otherwise, no change
from a fixed to a variable timestep would be possible in restart runs.
(read_var_list, write_var_list)

Bugfix: initial setting of time_coupling in coupled restart runs (time_integration)

advec_particles, check_parameters, cpu_log, data_output_2d, data_output_3d, header, init_3d_model, init_particles, init_ocean, modules, netcdf, prandtl_fluxes, production_e, read_var_list, time_integration, user_last_actions, write_var_list

  • Property svn:keywords set to Id
File size: 13.4 KB
Line 
1 MODULE plant_canopy_model_mod
2
3!------------------------------------------------------------------------------!
4! Current revisions:
5! -----------------
6!
7!
8! Former revisions:
9! -----------------
10! $Id: plant_canopy_model.f90 392 2009-09-24 10:39:14Z maronga $
11!
12! 257 2009-03-11 15:17:42Z heinze
13! Output of messages replaced by message handling routine.
14! Bugfix: remove IF statement in plant_canopy_model_ij
15!
16! 153 2008-03-19 09:41:30Z steinfeld
17! heat sources within the forest canopy are added, which represent the
18! rate of heat input into the air from the forest leaves, evaluation of sinks
19! and sources for scalar concentration due to canopy elements
20!
21! 138 2007-11-28 10:03:58Z letzel
22! Initial revision
23!
24! Description:
25! ------------
26! Evaluation of sinks and sources of momentum, heat and scalar concentration
27! due to canopy elements
28!------------------------------------------------------------------------------!
29
30    PRIVATE
31    PUBLIC plant_canopy_model
32
33    INTERFACE plant_canopy_model
34       MODULE PROCEDURE plant_canopy_model
35       MODULE PROCEDURE plant_canopy_model_ij
36    END INTERFACE plant_canopy_model
37
38 CONTAINS
39
40
41!------------------------------------------------------------------------------!
42! Call for all grid points
43!------------------------------------------------------------------------------!
44    SUBROUTINE plant_canopy_model( component )
45
46       USE arrays_3d
47       USE control_parameters
48       USE indices
49       USE pegrid
50
51       IMPLICIT NONE
52
53       INTEGER ::  component, i, j, k
54 
55!
56!--    Compute drag for the three velocity components and the SGS-TKE
57       SELECT CASE ( component )
58
59!
60!--       u-component
61          CASE ( 1 )
62             DO  i = nxlu, nxr
63                DO  j = nys, nyn
64                   DO  k = nzb_u_inner(j,i)+1, pch_index
65                      tend(k,j,i) = tend(k,j,i) -                &
66                                    cdc(k,j,i) * lad_u(k,j,i) *  &
67                                    SQRT(     u(k,j,i)**2     +  &
68                                          ( ( v(k,j,i-1)      +  &
69                                              v(k,j,i)        +  &
70                                              v(k,j+1,i)      +  &
71                                              v(k,j+1,i-1) )     &
72                                            / 4.0 )**2        +  &
73                                          ( ( w(k-1,j,i-1)    +  &
74                                              w(k-1,j,i)      +  &
75                                              w(k,j,i-1)      +  &
76                                              w(k,j,i) )         &
77                                            / 4.0 )**2 )      *  &
78                                    u(k,j,i)
79                   ENDDO
80                ENDDO
81             ENDDO
82
83!
84!--       v-component
85          CASE ( 2 )
86             DO  i = nxl, nxr
87                DO  j = nysv, nyn
88                   DO  k = nzb_v_inner(j,i)+1, pch_index
89                      tend(k,j,i) = tend(k,j,i) -                &
90                                    cdc(k,j,i) * lad_v(k,j,i) *  &
91                                    SQRT( ( ( u(k,j-1,i)      +  &
92                                              u(k,j-1,i+1)    +  &
93                                              u(k,j,i)        +  &
94                                              u(k,j,i+1) )       &
95                                            / 4.0 )**2        +  &
96                                              v(k,j,i)**2     +  &
97                                          ( ( w(k-1,j-1,i)    +  &
98                                              w(k-1,j,i)      +  &
99                                              w(k,j-1,i)      +  &
100                                              w(k,j,i) )         &
101                                            / 4.0 )**2 )      *  &
102                                    v(k,j,i) 
103                   ENDDO
104                ENDDO
105             ENDDO
106
107!
108!--       w-component
109          CASE ( 3 )
110             DO  i = nxl, nxr
111                DO  j = nys, nyn
112                   DO  k = nzb_w_inner(j,i)+1, pch_index
113                      tend(k,j,i) = tend(k,j,i) -                & 
114                                    cdc(k,j,i) * lad_w(k,j,i) *  &
115                                    SQRT( ( ( u(k,j,i)        +  &
116                                              u(k,j,i+1)      +  &
117                                              u(k+1,j,i)      +  &
118                                              u(k+1,j,i+1) )     &
119                                            / 4.0 )**2        +  &
120                                          ( ( v(k,j,i)        +  &
121                                              v(k,j+1,i)      +  &
122                                              v(k+1,j,i)      +  &
123                                              v(k+1,j+1,i) )     &
124                                            / 4.0 )**2        +  &
125                                              w(k,j,i)**2 )   *  &
126                                    w(k,j,i)
127                   ENDDO
128                ENDDO
129             ENDDO
130
131!
132!--       potential temperature
133          CASE ( 4 )
134             DO  i = nxl, nxr
135                DO  j = nys, nyn
136                   DO  k = nzb_s_inner(j,i)+1, pch_index
137                      tend(k,j,i) = tend(k,j,i) +                     &
138                                    ( canopy_heat_flux(k,j,i) -     &
139                                      canopy_heat_flux(k-1,j,i) ) / &
140                                      dzw(k)
141                   ENDDO
142                ENDDO
143             ENDDO
144
145!
146!--       scalar concentration
147          CASE ( 5 )
148             DO  i = nxl, nxr
149                DO  j = nys, nyn
150                   DO  k = nzb_s_inner(j,i)+1, pch_index
151                      tend(k,j,i) = tend(k,j,i) -                     &
152                                    sec(k,j,i) * lad_s(k,j,i) *       &
153                                    SQRT( ( ( u(k,j,i)        +       &
154                                              u(k,j,i+1) )            &
155                                            / 2.0 )**2        +       &
156                                          ( ( v(k,j,i)        +       &
157                                              v(k,j+1,i) )            &
158                                            / 2.0 )**2        +       &
159                                          ( ( w(k-1,j,i)      +       & 
160                                              w(k,j,i) )              &
161                                            / 2.0 )**2 )      *       &
162                                    ( q(k,j,i) - sls(k,j,i) )
163                   ENDDO
164                ENDDO
165             ENDDO
166
167!
168!--       sgs-tke
169          CASE ( 6 )
170             DO  i = nxl, nxr
171                DO  j = nys, nyn
172                   DO  k = nzb_s_inner(j,i)+1, pch_index
173                      tend(k,j,i) = tend(k,j,i) -                     &
174                                    2.0 * cdc(k,j,i) * lad_s(k,j,i) * &
175                                    SQRT( ( ( u(k,j,i)              + &
176                                              u(k,j,i+1) )            &
177                                            / 2.0 )**2              + &
178                                          ( ( v(k,j,i)              + &
179                                              v(k,j+1,i) )            &
180                                            / 2.0 )**2              + &
181                                          ( ( w(k,j,i)              + &
182                                              w(k+1,j,i) )            &
183                                            / 2.0 )**2 )            * &
184                                    e(k,j,i)
185                   ENDDO
186                ENDDO
187             ENDDO 
188                       
189          CASE DEFAULT
190
191             WRITE( message_string, * ) 'wrong component: ', component
192             CALL message( 'plant_canopy_model', 'PA0279', 1, 2, 0, 6, 0 ) 
193
194       END SELECT
195
196    END SUBROUTINE plant_canopy_model
197
198
199!------------------------------------------------------------------------------!
200! Call for grid point i,j
201!------------------------------------------------------------------------------!
202    SUBROUTINE plant_canopy_model_ij( i, j, component )
203
204       USE arrays_3d
205       USE control_parameters
206       USE indices
207       USE pegrid
208
209       IMPLICIT NONE
210
211       INTEGER ::  component, i, j, k
212
213!
214!--    Compute drag for the three velocity components
215       SELECT CASE ( component )
216
217!
218!--       u-component
219       CASE ( 1 )
220          DO  k = nzb_u_inner(j,i)+1, pch_index
221             tend(k,j,i) = tend(k,j,i) -                  &
222                              cdc(k,j,i) * lad_u(k,j,i) *    &   
223                              SQRT(     u(k,j,i)**2 +        &
224                                    ( ( v(k,j,i-1)  +        &
225                                        v(k,j,i)    +        &
226                                        v(k,j+1,i)  +        &
227                                        v(k,j+1,i-1) )       &
228                                      / 4.0 )**2    +        &
229                                    ( ( w(k-1,j,i-1) +       &
230                                        w(k-1,j,i)   +       &
231                                        w(k,j,i-1)   +       &
232                                        w(k,j,i) )           &
233                                      / 4.0 )**2 ) *         &
234                              u(k,j,i)
235          ENDDO
236
237!
238!--       v-component
239       CASE ( 2 )
240          DO  k = nzb_v_inner(j,i)+1, pch_index
241             tend(k,j,i) = tend(k,j,i) -                  &
242                              cdc(k,j,i) * lad_v(k,j,i) *    &
243                              SQRT( ( ( u(k,j-1,i)   +       &
244                                        u(k,j-1,i+1) +       &
245                                        u(k,j,i)     +       &
246                                        u(k,j,i+1) )         &
247                                      / 4.0 )**2     +       &
248                                        v(k,j,i)**2  +       &
249                                    ( ( w(k-1,j-1,i) +       &
250                                        w(k-1,j,i)   +       &
251                                        w(k,j-1,i)   +       &
252                                        w(k,j,i) )           &
253                                      / 4.0 )**2 ) *         &
254                              v(k,j,i)
255          ENDDO
256
257!
258!--       w-component
259       CASE ( 3 )
260          DO  k = nzb_w_inner(j,i)+1, pch_index
261             tend(k,j,i) = tend(k,j,i) -                  &
262                              cdc(k,j,i) * lad_w(k,j,i) *    & 
263                              SQRT( ( ( u(k,j,i)    +        & 
264                                        u(k,j,i+1)  +        &
265                                        u(k+1,j,i)  +        &
266                                        u(k+1,j,i+1) )       &
267                                      / 4.0 )**2    +        &
268                                    ( ( v(k,j,i)    +        &
269                                        v(k,j+1,i)  +        &
270                                        v(k+1,j,i)  +        &
271                                        v(k+1,j+1,i) )       &
272                                      / 4.0 )**2    +        &
273                                        w(k,j,i)**2 ) *      &
274                              w(k,j,i)
275   
276          ENDDO
277
278!
279!--       potential temperature
280          CASE ( 4 )
281             DO  k = nzb_s_inner(j,i)+1, pch_index
282                tend(k,j,i) = tend(k,j,i) +                     &
283                              ( canopy_heat_flux(k,j,i) -     &
284                                canopy_heat_flux(k-1,j,i) ) / &
285                                dzw(k)
286             ENDDO
287
288
289!
290!--       scalar concentration
291          CASE ( 5 )
292             DO  k = nzb_s_inner(j,i)+1, pch_index
293                tend(k,j,i) = tend(k,j,i) -                     &
294                              sec(k,j,i) * lad_s(k,j,i) *       &
295                              SQRT( ( ( u(k,j,i)        +       &
296                                        u(k,j,i+1) )            &
297                                      / 2.0 )**2        +       &
298                                    ( ( v(k,j,i)        +       &
299                                        v(k,j+1,i) )            &
300                                      / 2.0 )**2        +       &
301                                    ( ( w(k-1,j,i)      +       &
302                                        w(k,j,i) )              &
303                                      / 2.0 )**2 )      *       &
304                              ( q(k,j,i) - sls(k,j,i) )
305             ENDDO   
306
307!
308!--       sgs-tke
309       CASE ( 6 )
310          DO  k = nzb_s_inner(j,i)+1, pch_index   
311             tend(k,j,i) = tend(k,j,i) -                     &
312                              2.0 * cdc(k,j,i) * lad_s(k,j,i) * &
313                              SQRT( ( ( u(k,j,i)           +    &
314                                        u(k,j,i+1) )            &
315                                      / 2.0 )**2           +    & 
316                                    ( ( v(k,j,i)           +    &
317                                        v(k,j+1,i) )            &
318                                      / 2.0 )**2           +    &
319                                    ( ( w(k,j,i)           +    &
320                                        w(k+1,j,i) )            &
321                                      / 2.0 )**2 )         *    &
322                              e(k,j,i)
323          ENDDO
324
325       CASE DEFAULT
326
327          WRITE( message_string, * ) 'wrong component: ', component
328          CALL message( 'plant_canopy_model', 'PA0279', 1, 2, 0, 6, 0 ) 
329
330       END SELECT
331
332    END SUBROUTINE plant_canopy_model_ij
333
334 END MODULE plant_canopy_model_mod
Note: See TracBrowser for help on using the repository browser.