Index: palm/trunk/DOC/app/chapter_4.1.html
===================================================================
--- palm/trunk/DOC/app/chapter_4.1.html (revision 71)
+++ palm/trunk/DOC/app/chapter_4.1.html (revision 72)
@@ -1245,5 +1245,5 @@
coagulation of cloud drops among themselves. Precipitation begins and
is immediately removed from the flow as soon as the liquid water
-content exceeds the critical value of 0.5 g/kg.
+content exceeds the critical value of 0.5 g/kg.The precipitation rate and amount can be output by assigning the runtime parameter data_output = 'prr*' or 'pra*', respectively. The time interval on which the precipitation amount is defined can be controlled via runtime parameter precipitation_amount_interval.
profile_columns
|
R | I
Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS (revision 71)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS (revision 72)
@@ -22,7 +22,9 @@
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_)
-Makefile, advec_particles, buoyancy, check_open, check_parameters, diffusion_e, diffusion_u, diffusion_v, diffusion_w, diffusivities, header, init_particles, init_3d_model, modules, netcdf, parin, production_e, read_var_list, user_interface, write_var_list
+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
@@ -44,4 +46,6 @@
__vtk directives removed from main program.
+The uitility routine interpret_config reads PALM environment variables from NAMELIST instead using the system call GETENV.
+
check_parameters, data_output_dvrp, data_output_ptseries, data_output_ts, flow_statistics, header, init_particles, init_3d_model, modules, palm, package_parin, parin, time_integration
@@ -54,7 +58,9 @@
Bugfix in sample for reading user defined data from restart file (user_init)
+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
-init_1d_model, user_interface
+check_parameters, init_1d_model, user_interface
Index: palm/trunk/SOURCE/average_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/average_3d_data.f90 (revision 71)
+++ palm/trunk/SOURCE/average_3d_data.f90 (revision 72)
@@ -4,5 +4,5 @@
! Actual revisions:
! -----------------
-!
+! Averaging the precipitation rate and roughness length (prr*, z0*)
!
! Former revisions:
@@ -90,4 +90,12 @@
ENDDO
+ CASE ( 'prr*' )
+ DO i = nxl-1, nxr+1
+ DO j = nys-1, nyn+1
+ precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / &
+ REAL( average_count_3d )
+ ENDDO
+ ENDDO
+
CASE ( 'pt' )
DO i = nxl-1, nxr+1
@@ -213,4 +221,11 @@
ENDDO
+ CASE ( 'z0*' )
+ DO i = nxl-1, nxr+1
+ DO j = nys-1, nyn+1
+ z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d )
+ ENDDO
+ ENDDO
+
CASE DEFAULT
!
Index: palm/trunk/SOURCE/calc_precipitation.f90
===================================================================
--- palm/trunk/SOURCE/calc_precipitation.f90 (revision 71)
+++ palm/trunk/SOURCE/calc_precipitation.f90 (revision 72)
@@ -4,5 +4,6 @@
! Actual revisions:
! -----------------
-!
+! Precipitation rate and amount are calculated/stored,
+! + module control_parameters
!
! Former revisions:
@@ -48,4 +49,5 @@
USE cloud_parameters
USE constants
+ USE control_parameters
USE indices
@@ -53,6 +55,8 @@
INTEGER :: i, j, k
- REAL :: precipitation_rate
+ REAL :: dqdt_precip
+
+ precipitation_rate = 0.0
DO i = nxl, nxr
@@ -61,12 +65,25 @@
IF ( ql(k,j,i) > ql_crit ) THEN
- precipitation_rate = prec_time_const * &
- ( ql(k,j,i) - ql_crit )
+ dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
ELSE
- precipitation_rate = 0.0
+ dqdt_precip = 0.0
ENDIF
- tend(k,j,i) = tend(k,j,i) - precipitation_rate
+ tend(k,j,i) = tend(k,j,i) - dqdt_precip
+!
+!-- Precipitation rate in (kg * 0.001) / m**2 / s (because 1kg
+!-- gives 1 mm)
+ precipitation_rate(j,i) = precipitation_rate(j,i) + &
+ dqdt_precip * dzw(k) * 0.001
ENDDO
+!
+!-- Sum up the precipitation amount (unit kg * 0.001 / m**2)
+ IF ( intermediate_timestep_count == &
+ intermediate_timestep_count_max .AND. &
+ ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )&
+ THEN
+ precipitation_amount(j,i) = precipitation_amount(j,i) + &
+ precipitation_rate(j,i) * dt_3d
+ ENDIF
ENDDO
ENDDO
@@ -83,22 +100,43 @@
USE cloud_parameters
USE constants
+ USE control_parameters
USE indices
IMPLICIT NONE
- INTEGER :: i, j, k
- REAL :: precipitation_rate
+ INTEGER :: i, j, k
+ REAL :: dqdt_precip
+ precipitation_rate(j,i) = 0.0
+
+!
+!-- Ghostpoints are included (although not needed for tend) to avoid a later
+!-- exchange of these data for the precipitation amount/rate arrays
DO k = nzb_2d(j,i)+1, nzt
IF ( ql(k,j,i) > ql_crit ) THEN
- precipitation_rate = prec_time_const * ( ql(k,j,i) - ql_crit )
+ dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
ELSE
- precipitation_rate = 0.0
+ dqdt_precip = 0.0
ENDIF
- tend(k,j,i) = tend(k,j,i) - precipitation_rate
+ tend(k,j,i) = tend(k,j,i) - dqdt_precip
+
+!
+!-- Precipitation rate in (kg * 0.001) / m**2 / s (because 1kg gives 1 mm)
+! precipitation_rate(j,i) = precipitation_rate(j,i) + dqdt_precip * &
+! dzw(k) * 0.001
+ precipitation_rate(j,i) = 1.0
ENDDO
+
+!
+!-- Sum up the precipitation amount (unit kg * 0.001 / m**2)
+ IF ( intermediate_timestep_count == intermediate_timestep_count_max &
+ .AND. ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )&
+ THEN
+ precipitation_amount(j,i) = precipitation_amount(j,i) + &
+ precipitation_rate(j,i) * dt_3d
+ ENDIF
END SUBROUTINE calc_precipitation_ij
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90 (revision 71)
+++ palm/trunk/SOURCE/check_parameters.f90 (revision 72)
@@ -6,5 +6,7 @@
! "by_user" allowed as initializing action, -data_output_ts,
! leapfrog with non-flat topography not allowed any more, loop_optimization
-! and pt_reference are checked
+! and pt_reference are checked,
+! output of precipitation amount/rate and roughnes length + check
+! possible negative humidities are avoided in initial profile
!
! Former revisions:
@@ -351,7 +353,14 @@
IF ( cloud_physics .AND. .NOT. moisture ) THEN
- IF ( myid == 0 ) PRINT*, '+++ check_parameters: moisture =', &
- moisture, ' is not allowed with ', &
- 'cloud_physics=', cloud_physics
+ IF ( myid == 0 ) PRINT*, '+++ check_parameters: cloud_physics =', &
+ cloud_physics, ' is not allowed with ', &
+ 'moisture =', moisture
+ CALL local_stop
+ ENDIF
+
+ IF ( precipitation .AND. .NOT. cloud_physics ) THEN
+ IF ( myid == 0 ) PRINT*, '+++ check_parameters: precipitation =', &
+ precipitation, ' is not allowed with ', &
+ 'cloud_physics =', cloud_physics
CALL local_stop
ENDIF
@@ -570,4 +579,9 @@
q_init(k) = q_init(k-1)
ENDIF
+!
+!-- Avoid negative humidities
+ IF ( q_init(k) < 0.0 ) THEN
+ q_init(k) = 0.0
+ ENDIF
ENDDO
@@ -1163,4 +1177,21 @@
!
+!-- Set the default value for the integration interval of precipitation amount
+ IF ( precipitation ) THEN
+ IF ( precipitation_amount_interval == 9999999.9 ) THEN
+ precipitation_amount_interval = dt_do2d_xy
+ ELSE
+ IF ( precipitation_amount_interval > dt_do2d_xy ) THEN
+ IF ( myid == 0 ) PRINT*, '+++ check_parameters: ', &
+ 'precipitation_amount_interval =', &
+ precipitation_amount_interval, &
+ ' must not be larger than dt_do2d_xy', &
+ ' = ', dt_do2d_xy
+ CALL local_stop
+ ENDIF
+ ENDIF
+ ENDIF
+
+!
!-- Determine the number of output profiles and check whether they are
!-- permissible
@@ -1840,5 +1871,5 @@
unit = 'conc'
- CASE ( 'u*', 't*', 'lwp*' )
+ CASE ( 'u*', 't*', 'lwp*', 'pra*', 'prr*', 'z0*' )
IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN
IF ( myid == 0 ) THEN
@@ -1856,7 +1887,34 @@
CALL local_stop
ENDIF
+ IF ( TRIM( var ) == 'pra*' .AND. .NOT. precipitation ) THEN
+ IF ( myid == 0 ) THEN
+ PRINT*, '+++ check_parameters: output of "', TRIM( var ), &
+ '" requires precipitation = .TRUE.'
+ ENDIF
+ CALL local_stop
+ ENDIF
+ IF ( TRIM( var ) == 'pra*' .AND. j == 1 ) THEN
+ IF ( myid == 0 ) THEN
+ PRINT*, '+++ check_parameters: temporal averaging of ', &
+ ' precipitation amount "', TRIM( var ), &
+ '" not possible'
+ ENDIF
+ CALL local_stop
+ ENDIF
+ IF ( TRIM( var ) == 'prr*' .AND. .NOT. precipitation ) THEN
+ IF ( myid == 0 ) THEN
+ PRINT*, '+++ check_parameters: output of "', TRIM( var ), &
+ '" requires precipitation = .TRUE.'
+ ENDIF
+ CALL local_stop
+ ENDIF
+
+
IF ( TRIM( var ) == 'u*' ) unit = 'm/s'
IF ( TRIM( var ) == 't*' ) unit = 'K'
IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/kg*m'
+ IF ( TRIM( var ) == 'pra*' ) unit = 'mm'
+ IF ( TRIM( var ) == 'prr*' ) unit = 'mm/s'
+ IF ( TRIM( var ) == 'z0*' ) unit = 'm'
CASE ( 'p', 'pt', 'u', 'v', 'w' )
Index: palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_2d.f90 (revision 71)
+++ palm/trunk/SOURCE/data_output_2d.f90 (revision 72)
@@ -4,5 +4,5 @@
! Actual revisions:
! -----------------
-!
+! Output of precipitation amount/rate and roughness length
!
! Former revisions:
@@ -257,4 +257,36 @@
ENDIF
+ CASE ( 'pra*_xy' ) ! 2d-array / integral quantity => no av
+ CALL exchange_horiz_2d( precipitation_amount )
+ DO i = nxl-1, nxr+1
+ DO j = nys-1, nyn+1
+ local_pf(i,j,nzb+1) = precipitation_amount(j,i)
+ ENDDO
+ ENDDO
+ precipitation_amount = 0.0 ! reset for next integ. interval
+ resorted = .TRUE.
+ two_d = .TRUE.
+ level_z(nzb+1) = zu(nzb+1)
+
+ CASE ( 'prr*_xy' ) ! 2d-array
+ IF ( av == 0 ) THEN
+ CALL exchange_horiz_2d( precipitation_rate )
+ DO i = nxl-1, nxr+1
+ DO j = nys-1, nyn+1
+ local_pf(i,j,nzb+1) = precipitation_rate(j,i)
+ ENDDO
+ ENDDO
+ ELSE
+ CALL exchange_horiz_2d( precipitation_rate_av )
+ DO i = nxl-1, nxr+1
+ DO j = nys-1, nyn+1
+ local_pf(i,j,nzb+1) = precipitation_rate_av(j,i)
+ ENDDO
+ ENDDO
+ ENDIF
+ resorted = .TRUE.
+ two_d = .TRUE.
+ level_z(nzb+1) = zu(nzb+1)
+
CASE ( 'pt_xy', 'pt_xz', 'pt_yz' )
IF ( av == 0 ) THEN
@@ -419,4 +451,22 @@
ENDIF
IF ( mode == 'xy' ) level_z = zw
+
+ CASE ( 'z0*_xy' ) ! 2d-array
+ IF ( av == 0 ) THEN
+ DO i = nxl-1, nxr+1
+ DO j = nys-1, nyn+1
+ local_pf(i,j,nzb+1) = z0(j,i)
+ ENDDO
+ ENDDO
+ ELSE
+ DO i = nxl-1, nxr+1
+ DO j = nys-1, nyn+1
+ local_pf(i,j,nzb+1) = z0_av(j,i)
+ ENDDO
+ ENDDO
+ ENDIF
+ resorted = .TRUE.
+ two_d = .TRUE.
+ level_z(nzb+1) = zu(nzb+1)
CASE DEFAULT
Index: palm/trunk/SOURCE/impact_of_latent_heat.f90
===================================================================
--- palm/trunk/SOURCE/impact_of_latent_heat.f90 (revision 71)
+++ palm/trunk/SOURCE/impact_of_latent_heat.f90 (revision 72)
@@ -4,5 +4,5 @@
! Actual revisions:
! -----------------
-!
+! precipitation_rate renamed dqdt_precip
!
! Former revisions:
@@ -52,5 +52,5 @@
INTEGER :: i, j, k
- REAL :: precipitation_rate
+ REAL :: dqdt_precip
@@ -60,11 +60,9 @@
IF ( ql(k,j,i) > ql_crit ) THEN
- precipitation_rate = prec_time_const * &
- ( ql(k,j,i) - ql_crit )
+ dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
ELSE
- precipitation_rate = 0.0
+ dqdt_precip = 0.0
ENDIF
- tend(k,j,i) = tend(k,j,i) + precipitation_rate * l_d_cp * &
- pt_d_t(k)
+ tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k)
ENDDO
@@ -87,6 +85,6 @@
IMPLICIT NONE
- INTEGER :: i, j, k
- REAL :: precipitation_rate
+ INTEGER :: i, j, k
+ REAL :: dqdt_precip
@@ -94,9 +92,9 @@
IF ( ql(k,j,i) > ql_crit ) THEN
- precipitation_rate = prec_time_const * ( ql(k,j,i) - ql_crit )
+ dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
ELSE
- precipitation_rate = 0.0
+ dqdt_precip = 0.0
ENDIF
- tend(k,j,i) = tend(k,j,i) + precipitation_rate * l_d_cp * pt_d_t(k)
+ tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k)
ENDDO
Index: palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_3d_model.f90 (revision 71)
+++ palm/trunk/SOURCE/init_3d_model.f90 (revision 72)
@@ -8,5 +8,5 @@
! -----------------
! New initializing action "by_user" calls user_init_3d_model,
-! ts_value is allocated, +module netcdf_control,
+! precipitation_amount/rate, ts_value are allocated, +module netcdf_control,
! initial velocities at nzb+1 are regarded for volume
! flow control in case they have been set zero before (to avoid small timesteps)
@@ -40,4 +40,5 @@
USE arrays_3d
USE averaging
+ USE cloud_parameters
USE constants
USE control_parameters
@@ -157,4 +158,8 @@
!-- Liquid water content
ALLOCATE ( ql_1(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
+!
+!-- Precipitation amount and rate (only needed if output is switched)
+ ALLOCATE( precipitation_amount(nys-1:nyn+1,nxl-1:nxr+1), &
+ precipitation_rate(nys-1:nyn+1,nxl-1:nxr+1) )
ENDIF
@@ -642,7 +647,10 @@
!
-!-- Treating cloud physics, liquid water content is zero at beginning of
-!-- the simulation
- IF ( cloud_physics ) ql = 0.0
+!-- Treating cloud physics, liquid water content and precipitation amount
+!-- are zero at beginning of the simulation
+ IF ( cloud_physics ) THEN
+ ql = 0.0
+ IF ( precipitation ) precipitation_amount = 0.0
+ ENDIF
!
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90 (revision 71)
+++ palm/trunk/SOURCE/modules.f90 (revision 72)
@@ -5,8 +5,9 @@
! Actual revisions:
! -----------------
-! +array rif_wall
+! +arrays precipitation_amount, precipitation_rate, precipitation_rate_av,
+! rif_wall, z0_av
! +loop_optimization, netcdf_64bit_3d, zu_s_inner, zw_w_inner, id_var_zusi_*,
! id_var_zwwi_*, ts_value, u_nzb_p1_for_vfc, v_nzb_p1_for_vfc, pt_reference,
-! use_pt_reference,
+! use_pt_reference, precipitation_amount_interval
! +age_m in particle_type
! -data_output_ts, dots_n
@@ -128,5 +129,6 @@
!------------------------------------------------------------------------------!
- REAL, DIMENSION(:,:), ALLOCATABLE :: lwp_av, ts_av, us_av
+ REAL, DIMENSION(:,:), ALLOCATABLE :: lwp_av, precipitation_rate_av, &
+ ts_av, us_av, z0_av
REAL, DIMENSION(:,:,:), ALLOCATABLE, TARGET :: &
@@ -156,4 +158,7 @@
REAL, DIMENSION(:), ALLOCATABLE :: hydro_press, pt_d_t, t_d_pt
+ REAL, DIMENSION(:,:), ALLOCATABLE :: precipitation_amount, &
+ precipitation_rate
+
SAVE
@@ -211,5 +216,5 @@
CHARACTER (LEN=8) :: run_date, run_time
CHARACTER (LEN=9) :: simulated_time_chr
- CHARACTER (LEN=12) :: version = 'PALM 3.1c'
+ CHARACTER (LEN=12) :: version = 'PALM 3.2'
CHARACTER (LEN=16) :: loop_optimization = 'default', &
momentum_advec = 'pw-scheme', &
@@ -333,5 +338,7 @@
overshoot_limit_u = 0.0, overshoot_limit_v = 0.0, &
overshoot_limit_w = 0.0, particle_maximum_age = 9999999.9, &
- phi = 55.0, prandtl_number = 1.0, pt_reference = 9999999.9, &
+ phi = 55.0, prandtl_number = 1.0, &
+ precipitation_amount_interval = 9999999.9, &
+ pt_reference = 9999999.9, &
pt_slope_offset = 0.0, pt_surface = 300.0, &
pt_surface_initial_change = 0.0, q_surface = 0.0, &
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90 (revision 71)
+++ palm/trunk/SOURCE/parin.f90 (revision 72)
@@ -4,6 +4,6 @@
! Actual revisions:
! -----------------
-! +dt_max, netcdf_64bit_3d in d3par, +loop_optimization, pt_reference in
-! inipar, -data_output_ts
+! +dt_max, netcdf_64bit_3d, precipitation_amount_interval in d3par,
+! +loop_optimization, pt_reference in inipar, -data_output_ts
!
! Former revisions:
@@ -105,5 +105,6 @@
mg_switch_to_pe0_level, netcdf_64bit, netcdf_64bit_3d, &
ngsrb, normalizing_region, nsor, nz_do3d, omega_sor, &
- prandtl_number, profile_columns, profile_rows, psolver, &
+ prandtl_number, precipitation_amount_interval, &
+ profile_columns, profile_rows, psolver, &
rayleigh_damping_factor, rayleigh_damping_height, &
residual_limit, restart_time, section_xy, section_xz, &
Index: palm/trunk/SOURCE/production_e.f90
===================================================================
--- palm/trunk/SOURCE/production_e.f90 (revision 71)
+++ palm/trunk/SOURCE/production_e.f90 (revision 72)
@@ -910,6 +910,6 @@
!-- of the eddy diffusivity by km = u* * kappa * zp / phi_m.
!$OMP PARALLEL DO PRIVATE( ku, kv )
- DO i = nxl, nxr
- DO j = nys, nyn
+ DO i = nxl, nxr+1
+ DO j = nys, nyn+1
ku = nzb_u_inner(j,i)+1
Index: palm/trunk/SOURCE/read_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/read_3d_binary.f90 (revision 71)
+++ palm/trunk/SOURCE/read_3d_binary.f90 (revision 72)
@@ -4,5 +4,5 @@
! Actual revisions:
! -----------------
-! +rif_wall
+! +precipitation_amount, precipitation_rate_av, rif_wall, z0_av
!
! Former revisions:
@@ -29,4 +29,5 @@
USE arrays_3d
USE averaging
+ USE cloud_parameters
USE control_parameters
USE cpulog
@@ -219,4 +220,9 @@
ALLOCATE( pr_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
READ ( 13 ) pr_av
+ CASE ( 'precipitation_amount' )
+ READ ( 13 ) precipitation_amount
+ CASE ( 'precipitation_rate_a' )
+ ALLOCATE( precipitation_rate_av(nys-1:nyn+1,nxl-1:nxr+1) )
+ READ ( 13 ) precipitation_rate_av
CASE ( 'pt' )
READ ( 13 ) pt
@@ -336,4 +342,7 @@
CASE ( 'z0' )
READ ( 13 ) z0
+ CASE ( 'z0_av' )
+ ALLOCATE( z0_av(nys-1:nyn+1,nxl-1:nxr+1) )
+ READ ( 13 ) z0_av
CASE ( 'cross_linecolors' )
Index: palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/sum_up_3d_data.f90 (revision 71)
+++ palm/trunk/SOURCE/sum_up_3d_data.f90 (revision 72)
@@ -4,5 +4,5 @@
! Actual revisions:
! -----------------
-!
+! +sum-up of precipitation rate and roughness length (prr*, z0*)
!
! Former revisions:
@@ -80,4 +80,10 @@
pr_av = 0.0
+ CASE ( 'prr*' )
+ IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN
+ ALLOCATE( precipitation_rate_av(nys-1:nyn+1,nxl-1:nxr+1) )
+ ENDIF
+ precipitation_rate_av = 0.0
+
CASE ( 'pt' )
IF ( .NOT. ALLOCATED( pt_av ) ) THEN
@@ -163,4 +169,10 @@
ENDIF
w_av = 0.0
+
+ CASE ( 'z0*' )
+ IF ( .NOT. ALLOCATED( z0_av ) ) THEN
+ ALLOCATE( z0_av(nys-1:nyn+1,nxl-1:nxr+1) )
+ ENDIF
+ z0_av = 0.0
CASE DEFAULT
@@ -239,4 +251,12 @@
ENDDO
+ CASE ( 'pr*' )
+ DO i = nxl-1, nxr+1
+ DO j = nys-1, nyn+1
+ precipitation_rate_av(j,i) = precipitation_rate_av(j,i) + &
+ precipitation_rate(j,i)
+ ENDDO
+ ENDDO
+
CASE ( 'pt' )
IF ( .NOT. cloud_physics ) THEN
@@ -372,4 +392,11 @@
ENDDO
+ CASE ( 'z0*' )
+ DO i = nxl-1, nxr+1
+ DO j = nys-1, nyn+1
+ z0_av(j,i) = z0_av(j,i) + z0(j,i)
+ ENDDO
+ ENDDO
+
CASE DEFAULT
!
Index: palm/trunk/SOURCE/write_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/write_3d_binary.f90 (revision 71)
+++ palm/trunk/SOURCE/write_3d_binary.f90 (revision 72)
@@ -4,5 +4,5 @@
! Actual revisions:
! -----------------
-! +rif_wall
+! +precipitation_amount, precipitation_rate_av, rif_wall, z0_av
!
! Former revisions:
@@ -29,4 +29,5 @@
USE arrays_3d
USE averaging
+ USE cloud_parameters
USE control_parameters
USE cpulog
@@ -93,4 +94,11 @@
WRITE ( 14 ) 'pr_av '; WRITE ( 14 ) pr_av
ENDIF
+ IF ( ALLOCATED( precipitation_amount ) ) THEN
+ WRITE ( 14 ) 'precipitation_amount'; WRITE ( 14 ) precipitation_amount
+ ENDIF
+ IF ( ALLOCATED( precipitation_rate_av ) ) THEN
+ WRITE ( 14 ) 'precipitation_rate_a'; WRITE ( 14 ) &
+ precipitation_rate_av
+ ENDIF
WRITE ( 14 ) 'pt '; WRITE ( 14 ) pt
IF ( ALLOCATED( pt_av ) ) THEN
@@ -195,4 +203,7 @@
WRITE ( 14 ) 'w_m '; WRITE ( 14 ) w_m
WRITE ( 14 ) 'z0 '; WRITE ( 14 ) z0
+ IF ( ALLOCATED( z0_av ) ) THEN
+ WRITE ( 14 ) 'z0_av '; WRITE ( 14 ) z0_av
+ ENDIF
WRITE ( 14 ) 'cross_linecolors '; WRITE ( 14 ) cross_linecolors
Index: palm/trunk/UTIL/interpret_config.f90
===================================================================
--- palm/trunk/UTIL/interpret_config.f90 (revision 71)
+++ palm/trunk/UTIL/interpret_config.f90 (revision 72)
@@ -1,42 +1,52 @@
PROGRAM interpret_config
-!-------------------------------------------------------------------------------!
+!------------------------------------------------------------------------------!
+! Actual revisions:
+! -----------------
+! mrun environment variables are read from NAMELIST instead of using GETENV.
+! Variables are allways assigned a value, also if they already got one. These
+! values are re-assigned later in mrun.
+!
+! Former revisions:
+! -----------------
+! $Id$
+!
+! 28/02/07 - Siggi - empty lines in configuration file are accepted
+! 01/11/05 - Siggi - s2b-Feld erlaubt den Wert locopt
+! 29/06/05 - Siggi - Fehlermeldung ins englische uebertragen und ergaenzt
+! 29/04/05 - Siggi - extin wird auch fuer Input-Dateien ausgegeben
+! 18/11/97 - Siggi - Komma in 2010-FORMAT hinzugefuegt
! 21/07/97 - Siggi - Erste Fassung
-! 18/11/97 - Siggi - Komma in 2010-FORMAT hinzugefuegt
-! 29/04/05 - Siggi - extin wird auch fuer Input-Dateien ausgegeben
-! 29/06/05 - Siggi - Fehlermeldung ins englische uebertragen und ergaenzt
-! 01/11/05 - Siggi - s2b-Feld erlaubt den Wert locopt
-! 28/02/07 - Siggi - empty lines in configuration file are accepted
-!
-! Letzte Aenderungen:
-! -------------------
-!
-! Beschreibung:
+!
+! Description:
! -------------
-! Interpretation der MRUN-Konfigurationsdatei. Ausgegeben werden ksh-Kommandos,
-! die anschliessend von MRUN ausgefuehrt werden muessen.
-!-------------------------------------------------------------------------------!
+! This program reads the mrun-configuration file .mrun.config and outputs
+! its content in form of ksh-commands, which can then be executed by mrun.
+! mrun is also able to directly read from the configuration file by using
+! the option "-S" (but with much slower speed).
+!------------------------------------------------------------------------------!
IMPLICIT NONE
- CHARACTER (LEN=1) :: bs = ACHAR( 92 ) ! backslash (auf vpp sonst n. druckbar)
+ CHARACTER (LEN=1) :: bs = ACHAR( 92 ) ! backslash (auf vpp sonst n.
+ ! druckbar)
CHARACTER (LEN=20) :: do_remote, do_trace, host, localhost
CHARACTER (LEN=100) :: config_file, icf
- CHARACTER (LEN=300) :: cond1, cond2, empty = REPEAT( ' ', 240 ), &
- for_cond1, for_cond2, for_host, input_list, &
+ CHARACTER (LEN=300) :: cond1, cond2, empty = REPEAT( ' ', 240 ), &
+ for_cond1, for_cond2, for_host, input_list, &
iolist, output_list, s1, s2, s2a, s2b, s2c, s3, &
- s3cond, s4, s5, s6, value, value_mrun,&
- var, zeile
-
- INTEGER :: dummy, i, icomment = 0, icond1, icond2, idatver = 0, iec = 0, &
- ienvvar = 0, ifor_cond1, ifor_cond2, ifor_host, ihost, &
+ s3cond, s4, s5, s6, value, value_mrun, var, zeile
+
+ INTEGER :: dummy, i, icomment = 0, icond1, icond2, idatver = 0, iec = 0, &
+ ienvvar = 0, ifor_cond1, ifor_cond2, ifor_host, ihost, &
iic = 0, iicf, iin = 0, iinput_list, il, ilocalhost, ioc = 0, &
- ios, iout = 0, ioutput_list, is1, is2, is2a, is2b, is2c, &
- is3, is3cond, is4, is5, is6, ivalue, ivalue_mrun, ivar, izeile
+ ios, iout = 0, ioutput_list, is1, is2, is2a, is2b, is2c, &
+ is3, is3cond, is4, is5, is6, ivalue, ivar, izeile
LOGICAL :: found
- NAMELIST /mrun_environment/ cond1, cond2, config_file, do_remote, do_trace, &
- host, input_list, icf, localhost, output_list
+ NAMELIST /mrun_environment/ cond1, cond2, config_file, do_remote, &
+ do_trace, host, input_list, icf, localhost, &
+ output_list
@@ -53,14 +63,4 @@
ioutput_list = LEN_TRIM( output_list )
-! CALL local_getenv( 'cond1', 5, cond1, icond1 )
-! CALL local_getenv( 'cond2', 5, cond2, icond2 )
-! CALL local_getenv( 'config_file', 11, config_file, il )
-! CALL local_getenv( 'do_remote', 9, do_remote, dummy )
-! CALL local_getenv( 'do_trace', 8, do_trace, dummy )
-! CALL local_getenv( 'host', 4, host, ihost )
-! CALL local_getenv( 'input_list', 10, input_list, iinput_list )
-! CALL local_getenv( 'interpreted_config_file', 23, icf, iicf )
-! CALL local_getenv( 'localhost', 9, localhost, ilocalhost )
-! CALL local_getenv( 'output_list', 11, output_list, ioutput_list )
iolist = input_list(1:iinput_list) // output_list(1:ioutput_list)
@@ -89,8 +89,13 @@
IF ( LEN_TRIM( zeile ) == 0 ) THEN
+
CONTINUE
+
ELSEIF ( zeile(1:1) == '#' ) THEN
+
icomment = icomment + 1
+
ELSEIF ( zeile(1:1) == '%' ) THEN
+
ienvvar = ienvvar + 1
i = INDEX( zeile, ' ' )
@@ -98,30 +103,25 @@
ivar = i - 2
-!
-!-- Achtung: Auf hpmuk und vpp sind nur die Variablen bekannt, die
-!-- von MRUN exportiert wurden!
-! CALL local_getenv( var, ivar, value_mrun, ivalue_mrun )
- value_mrun = ''
- ivalue_mrun = 1
-
-!
-!-- Variable bekommt nur dann neuen Wert, wenn ihr per Shellscript-
-!-- Option noch keiner zugewiesen wurde
- IF ( value_mrun(1:ivalue_mrun) == '' .OR. &
- value_mrun(1:ivalue_mrun) == '0' ) THEN
+ zeile(1:i) = empty(1:i)
+ zeile = ADJUSTL( zeile )
+ i = INDEX( zeile, ' ' )
+ value = zeile(1:i-1)
+ ivalue = i - 1
+
+ zeile(1:i) = empty(1:i)
+ zeile = ADJUSTL( zeile )
+ i = INDEX( zeile, ' ' )
+
+ IF ( i /= 1 ) THEN
+ for_host = zeile(1:i-1)
+ ifor_host = i - 1
zeile(1:i) = empty(1:i)
zeile = ADJUSTL( zeile )
i = INDEX( zeile, ' ' )
- value = zeile(1:i-1)
- ivalue = i - 1
-
- zeile(1:i) = empty(1:i)
- zeile = ADJUSTL( zeile )
- i = INDEX( zeile, ' ' )
IF ( i /= 1 ) THEN
- for_host = zeile(1:i-1)
- ifor_host = i - 1
+ for_cond1 = zeile(1:i-1)
+ ifor_cond1 = i - 1
zeile(1:i) = empty(1:i)
@@ -130,27 +130,11 @@
IF ( i /= 1 ) THEN
- for_cond1 = zeile(1:i-1)
- ifor_cond1 = i - 1
-
- zeile(1:i) = empty(1:i)
- zeile = ADJUSTL( zeile )
- i = INDEX( zeile, ' ' )
-
- IF ( i /= 1 ) THEN
- for_cond2 = zeile(1:i-1)
- ifor_cond2 = i - 1
- ELSE
- for_cond2 = ''
- ifor_cond2 = 0
- ENDIF
+ for_cond2 = zeile(1:i-1)
+ ifor_cond2 = i - 1
ELSE
- for_cond1 = ''
- ifor_cond1 = 0
for_cond2 = ''
ifor_cond2 = 0
ENDIF
ELSE
- for_host = ' '
- ifor_host = 1
for_cond1 = ''
ifor_cond1 = 0
@@ -158,80 +142,86 @@
ifor_cond2 = 0
ENDIF
+ ELSE
+ for_host = ' '
+ ifor_host = 1
+ for_cond1 = ''
+ ifor_cond1 = 0
+ for_cond2 = ''
+ ifor_cond2 = 0
+ ENDIF
+ IF ( do_trace(1:4) == 'true' ) THEN
+ PRINT*,'var="',var(1:ivar),'"'
+ PRINT*,'value="',value(1:ivalue),'"'
+ PRINT*,'for_host="',for_host(1:ifor_host),'"'
+ PRINT*,'for_cond1="',for_cond1(1:ifor_cond1),'"'
+ PRINT*,'for_cond2="',for_cond2(1:ifor_cond2),'"'
+ ENDIF
+!
+!-- Geltungsbereich pruefen und evtl. Variable ausgeben
+ IF ( for_host == ' ' .OR. ( &
+ for_host(1:ifor_host) == host(1:ihost) .AND. &
+ for_cond1(1:ifor_cond1) == cond1(1:icond1) .AND. &
+ for_cond2(1:ifor_cond2) == cond2(1:icond2) &
+ ) .OR. ( &
+ INDEX( iolist, for_host(1:ifor_host) ) /= 0 &
+ ) ) THEN
+
+!
+!-- Zuerst Doppelpunkte durch Blanks ersetzen (aber doppelt
+!-- auftretende Doppelpunkte durch einen Doppelpunkt)
+ i = 0
+ DO
+ i = i + 1
+ IF ( i > ivalue ) EXIT
+ IF ( value(i:i) == ':' ) THEN
+ IF ( value(i+1:i+1) == ':' ) THEN
+ value = value(1:i) // value(i+2:ivalue)
+ ivalue = ivalue - 1
+ ELSE
+ value(i:i) = ' '
+ ENDIF
+ ENDIF
+ ENDDO
+
+!
+!-- Variable ausgeben
+ WRITE (2,2200) var(1:ivar), bs, value(1:ivalue), bs, &
+ var(1:ivar)
+ 2200 FORMAT ('eval ',A,'=',A,'"',A,A,'"'/'export ',A)
+
IF ( do_trace(1:4) == 'true' ) THEN
- PRINT*,'var="',var(1:ivar),'"'
- PRINT*,'value="',value(1:ivalue),'"'
- PRINT*,'for_host="',for_host(1:ifor_host),'"'
- PRINT*,'for_cond1="',for_cond1(1:ifor_cond1),'"'
- PRINT*,'for_cond2="',for_cond2(1:ifor_cond2),'"'
- ENDIF
-!
-!-- Geltungsbereich pruefen und evtl. Variable ausgeben
- IF ( for_host == ' ' .OR. ( &
- for_host(1:ifor_host) == host(1:ihost) .AND. &
- for_cond1(1:ifor_cond1) == cond1(1:icond1) .AND. &
- for_cond2(1:ifor_cond2) == cond2(1:icond2) &
- ) .OR. ( &
- INDEX( iolist, for_host(1:ifor_host) ) /= 0 &
- ) ) THEN
-
-!
-!-- Zuerst Doppelpunkte durch Blanks ersetzen (aber doppelt
-!-- auftretende Doppelpunkte durch einen Doppelpunkt)
- i = 0
- DO
- i = i + 1
- IF ( i > ivalue ) EXIT
- IF ( value(i:i) == ':' ) THEN
- IF ( value(i+1:i+1) == ':' ) THEN
- value = value(1:i) // value(i+2:ivalue)
- ivalue = ivalue - 1
- ELSE
- value(i:i) = ' '
- ENDIF
- ENDIF
- ENDDO
-
-!
-!-- Variable ausgeben
- WRITE (2,2200) var(1:ivar), bs, value(1:ivalue), bs, &
- var(1:ivar)
- 2200 FORMAT ('eval ',A,'=',A,'"',A,A,'"'/'export ',A)
-
- IF ( do_trace(1:4) == 'true' ) THEN
- WRITE (2,2201) bs, var(1:ivar), value(1:ivalue)
- 2201 FORMAT ('printf "',A,'n*** ENVIRONMENT-VARIABLE ',A,' = ',A)
- ENDIF
-
- ENDIF
-
-!
-!-- Variable "host" muss gleich ausgewertet werden, da mit ihr ein
-!-- neuer Geltungsbereich festgelegt wird
- IF ( var(1:ivar) == 'host' ) THEN
-
- host = value(1:ivalue)
- ihost = ivalue
-
-! IF ( host(1:ihost) /= localhost(1:ilocalhost) ) THEN
-!
-! SELECT CASE ( value(1:ivalue) )
-!
-! CASE ( 'cray','hpcs','t3d','t3eb','t3eh','unics','vpp' )
-!
-! dummy = 1
-!
-! CASE DEFAULT
-!
-! WRITE (2,2202) bs, bs, value(1:ivalue), bs, bs
-! 2202 FORMAT ('printf "',A,'n +++ Auf Zielrechner ',A,'"',A,A,'" ist kein NQS-System vorhanden"'/ &
-! 'printf "',A,'n Programmlauf kann deshalb nicht gestartet werden"'/ &
-! 'locat=nqs; exit')
-! STOP
-!
-! END SELECT
-!
-! ENDIF
-
- ENDIF
+ WRITE (2,2201) bs, var(1:ivar), value(1:ivalue)
+ 2201 FORMAT ('printf "',A,'n*** ENVIRONMENT-VARIABLE ',A,' = ',A)
+ ENDIF
+
+ ENDIF
+
+!
+!-- Variable "host" muss gleich ausgewertet werden, da mit ihr ein
+!-- neuer Geltungsbereich festgelegt wird
+ IF ( var(1:ivar) == 'host' ) THEN
+
+ host = value(1:ivalue)
+ ihost = ivalue
+
+! IF ( host(1:ihost) /= localhost(1:ilocalhost) ) THEN
+!
+! SELECT CASE ( value(1:ivalue) )
+!
+! CASE ( 'cray','hpcs','t3d','t3eb','t3eh','unics','vpp' )
+!
+! dummy = 1
+!
+! CASE DEFAULT
+!
+! WRITE (2,2202) bs, bs, value(1:ivalue), bs, bs
+! 2202 FORMAT ('printf "',A,'n +++ Auf Zielrechner ',A,'"',A,A,'" ist kein NQS-System vorhanden"'/ &
+! 'printf "',A,'n Programmlauf kann deshalb nicht gestartet werden"'/ &
+! 'locat=nqs; exit')
+! STOP
+!
+! END SELECT
+!
+! ENDIF
ENDIF
|