source: palm/trunk/SOURCE/disturb_field.f90 @ 231

Last change on this file since 231 was 77, checked in by raasch, 18 years ago

New:
---

particle reflection from vertical walls implemented, particle SGS model adjusted to walls

Wall functions for vertical walls now include diabatic conditions. New subroutines wall_fluxes, wall_fluxes_e. New 4D-array rif_wall.

new d3par-parameter netcdf_64bit_3d to switch on 64bit offset only for 3D files

new d3par-parameter dt_max to define the maximum value for the allowed timestep

new inipar-parameter loop_optimization to control the loop optimization method

new inipar-parameter pt_refrence. If given, this value is used as the reference that in buoyancy terms (otherwise, the instantaneous horizontally averaged temperature is used).

new user interface user_advec_particles

new initializing action "by_user" calls user_init_3d_model and allows the initial setting of all 3d arrays

topography height informations are stored on arrays zu_s_inner and zw_w_inner and output to the 2d/3d NetCDF files

samples added to the user interface which show how to add user-define time series quantities.

calculation/output of precipitation amount, precipitation rate and z0 (by setting "pra*", "prr*", "z0*" with data_output). The time interval on which the precipitation amount is defined is set by new d3par-parameter precipitation_amount_interval

unit 9 opened for debug output (file DEBUG_<pe#>)

Makefile, advec_particles, average_3d_data, buoyancy, calc_precipitation, check_open, check_parameters, data_output_2d, diffusion_e, diffusion_u, diffusion_v, diffusion_w, diffusivities, header, impact_of_latent_heat, init_particles, init_3d_model, modules, netcdf, parin, production_e, read_var_list, read_3d_binary, sum_up_3d_data, user_interface, write_var_list, write_3d_binary

New: wall_fluxes

Changed:


General revision of non-cyclic horizontal boundary conditions: radiation boundary conditions are now used instead of Neumann conditions at the outflow (calculation needs velocity values for t-dt, which are stored on new arrays u_m_l, u_m_r, etc.), calculation of mean outflow is not needed any more, volume flow control is added for the outflow boundary (currently only for the north boundary!!), additional gridpoints along x and y (uxrp, vynp) are not needed any more, routine "boundary_conds" now operates on timelevel t+dt and is not split in two parts (main, uvw_outflow) any more, Neumann boundary conditions at inflow/outflow in case of non-cyclic boundary conditions for all 2d-arrays that are handled by exchange_horiz_2d

The FFT-method for solving the Poisson-equation is now working with Neumann boundary conditions both at the bottom and the top. This requires adjustments of the tridiagonal coefficients and subtracting the horizontally averaged mean from the vertical velocity field.

+age_m in particle_type

Particles-package is now part of the default code ("-p particles" is not needed any more).

Move call of user_actions( 'after_integration' ) below increment of times
and counters. user_actions is now called for each statistic region and has as an argument the number of the respective region (sr)

d3par-parameter data_output_ts removed. Timeseries output for "profil" removed. Timeseries are now switched on by dt_dots. Timeseries data is collected in flow_statistics.

Initial velocities at nzb+1 are regarded for volume flow control in case they have been set zero before (to avoid small timesteps); see new internal parameters u/v_nzb_p1_for_vfc.

q is not allowed to become negative (prognostic_equations).

poisfft_init is only called if fft-solver is switched on (init_pegrid).

d3par-parameter moisture renamed to humidity.

Subversion global revision number is read from mrun and added to the run description header and to the run control (_rc) file.

vtk directives removed from main program.

The uitility routine interpret_config reads PALM environment variables from NAMELIST instead using the system call GETENV.

advec_u_pw, advec_u_up, advec_v_pw, advec_v_up, asselin_filter, check_parameters, coriolis, data_output_dvrp, data_output_ptseries, data_output_ts, data_output_2d, data_output_3d, diffusion_u, diffusion_v, exchange_horiz, exchange_horiz_2d, flow_statistics, header, init_grid, init_particles, init_pegrid, init_rankine, init_pt_anomaly, init_1d_model, init_3d_model, modules, palm, package_parin, parin, poisfft, poismg, prandtl_fluxes, pres, production_e, prognostic_equations, read_var_list, read_3d_binary, sor, swap_timelevel, time_integration, write_var_list, write_3d_binary

Errors:


Bugfix: preset of tendencies te_em, te_um, te_vm in init_1d_model

Bugfix in sample for reading user defined data from restart file (user_init)

Bugfix in setting diffusivities for cases with the outflow damping layer extending over more than one subdomain (init_3d_model)

Check for possible negative humidities in the initial humidity profile.

in Makefile, default suffixes removed from the suffix list to avoid calling of m2c in
# case of .mod files

Makefile
check_parameters, init_1d_model, init_3d_model, user_interface

  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1 SUBROUTINE disturb_field( nzb_uv_inner, dist1, field )
2
3!------------------------------------------------------------------------------!
4! Actual revisions:
5! -----------------
6!
7!
8! Former revisions:
9! -----------------
10! $Id: disturb_field.f90 77 2007-03-29 04:26:56Z raasch $
11!
12! 75 2007-03-22 09:54:05Z raasch
13! xrp, ynp eliminated, 2nd+3rd argument removed from exchange horiz
14!
15! RCS Log replace by Id keyword, revision history cleaned up
16!
17! Revision 1.11  2006/08/04 14:31:59  raasch
18! izuf renamed iran
19!
20! Revision 1.1  1998/02/04 15:40:45  raasch
21! Initial revision
22!
23!
24! Description:
25! ------------
26! Imposing a random perturbation on a 3D-array.
27! On parallel computers, the random number generator is as well called for all
28! gridpoints of the total domain to ensure, regardless of the number of PEs
29! used, that the elements of the array have the same values in the same
30! order in every case. The perturbation range is steered by dist_range.
31!------------------------------------------------------------------------------!
32
33    USE control_parameters
34    USE cpulog
35    USE grid_variables
36    USE indices
37    USE interfaces
38    USE random_function_mod
39
40    IMPLICIT NONE
41
42    INTEGER ::  i, j, k
43    INTEGER ::  nzb_uv_inner(nys-1:nyn+1,nxl-1:nxr+1)
44
45    REAL    ::  randomnumber,                             &
46                dist1(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1), &
47                field(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1)
48    REAL, DIMENSION(:,:,:), ALLOCATABLE ::  dist2
49
50
51    CALL cpu_log( log_point(20), 'disturb_field', 'start' )
52
53!
54!-- Create an additional temporary array and initialize the arrays needed
55!-- to store the disturbance
56    ALLOCATE( dist2(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
57    dist1 = 0.0
58    dist2 = 0.0
59
60!
61!-- Create the random perturbation and store it on temporary array
62    IF ( random_generator == 'numerical-recipes' )  THEN
63       DO  i = dist_nxl(dist_range), dist_nxr(dist_range)
64          DO  j = dist_nys(dist_range), dist_nyn(dist_range)
65             DO  k = disturbance_level_ind_b, disturbance_level_ind_t
66                randomnumber = 3.0 * disturbance_amplitude * &
67                               ( random_function( iran ) - 0.5 )
68                IF ( nxl <= i  .AND.  nxr >= i  .AND.  nys <= j  .AND.  &
69                     nyn >= j ) &
70                THEN
71                   dist1(k,j,i) = randomnumber
72                ENDIF
73             ENDDO
74          ENDDO
75       ENDDO
76    ELSEIF ( random_generator == 'system-specific' )  THEN
77       DO  i = dist_nxl(dist_range), dist_nxr(dist_range)
78          DO  j = dist_nys(dist_range), dist_nyn(dist_range)
79             DO  k = disturbance_level_ind_b, disturbance_level_ind_t
80#if defined( __nec )
81                randomnumber = 3.0 * disturbance_amplitude * &
82                               ( RANDOM( 0 ) - 0.5 )
83#else
84                CALL RANDOM_NUMBER( randomnumber )
85                randomnumber = 3.0 * disturbance_amplitude * &
86                                ( randomnumber - 0.5 )
87#endif
88                IF ( nxl <= i .AND. nxr >= i .AND. nys <= j .AND. nyn >= j ) &
89                THEN
90                   dist1(k,j,i) = randomnumber
91                ENDIF
92             ENDDO
93          ENDDO
94       ENDDO
95
96    ENDIF
97
98!
99!-- Exchange of ghost points for the random perturbation
100    CALL exchange_horiz( dist1 )
101
102!
103!-- Applying the Shuman filter in order to smooth the perturbations.
104!-- Neighboured grid points in all three directions are used for the
105!-- filter operation.
106    DO  i = nxl, nxr
107       DO  j = nys, nyn
108          DO  k = disturbance_level_ind_b-1, disturbance_level_ind_t+1
109             dist2(k,j,i) = ( dist1(k,j,i-1) + dist1(k,j,i+1) + dist1(k,j-1,i) &
110                            + dist1(k,j+1,i) + dist1(k+1,j,i) + dist1(k-1,j,i) &
111                            + 6.0 * dist1(k,j,i)                               &
112                            ) / 12.0
113          ENDDO
114       ENDDO
115    ENDDO
116
117!
118!-- Exchange of ghost points for the filtered perturbation.
119!-- Afterwards, filter operation and exchange of ghost points are repeated.
120    CALL exchange_horiz( dist2 )
121    DO  i = nxl, nxr
122       DO  j = nys, nyn
123          DO  k = disturbance_level_ind_b-2, disturbance_level_ind_t+2
124             dist1(k,j,i) = ( dist2(k,j,i-1) + dist2(k,j,i+1) + dist2(k,j-1,i) &
125                            + dist2(k,j+1,i) + dist2(k+1,j,i) + dist2(k-1,j,i) &
126                            + 6.0 * dist2(k,j,i)                               &
127                            ) / 12.0
128          ENDDO
129       ENDDO
130    ENDDO
131    CALL exchange_horiz( dist1 )
132
133!
134!-- Remove perturbations below topography (including one gridpoint above it
135!-- in order to allow for larger timesteps at the beginning of the simulation
136!-- (diffusion criterion))
137    IF ( TRIM( topography ) /= 'flat' )  THEN
138       DO  i = nxl-1, nxr+1
139          DO  j = nys-1, nyn+1
140             dist1(nzb:nzb_uv_inner(j,i)+1,j,i) = 0.0
141          ENDDO
142       ENDDO
143    ENDIF
144
145!
146!-- Random perturbation is added to the array to be disturbed.
147    DO  i = nxl-1, nxr+1
148       DO  j = nys-1, nyn+1
149          DO  k = disturbance_level_ind_b-2, disturbance_level_ind_t+2
150             field(k,j,i) = field(k,j,i) + dist1(k,j,i)
151          ENDDO
152       ENDDO
153    ENDDO
154
155!
156!-- Deallocate the temporary array
157    DEALLOCATE( dist2 )
158
159!
160!-- Set a flag, which indicates that a random perturbation is imposed
161    disturbance_created = .TRUE.
162
163
164    CALL cpu_log( log_point(20), 'disturb_field', 'stop' )
165
166
167 END SUBROUTINE disturb_field
Note: See TracBrowser for help on using the repository browser.