Changeset 150 for palm/trunk/SOURCE


Ignore:
Timestamp:
Feb 29, 2008 8:19:58 AM (17 years ago)
Author:
raasch
Message:

particle advection allowed for ocean runs

Location:
palm/trunk/SOURCE
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/CURRENT_MODIFICATIONS

    r148 r150  
    2121'read_data_for_recycling').
    2222
     23Particle advection adjusted for ocean runs.
     24
     25
    2326User-defined spectra.
    2427
    25 calc_spectra, check_open, check_parameters, data_output_spectra, init_pegrid, init_3d_model, modules, netcdf, read_var_list, read_3d_binary, user_interface, write_var_list, write_3d_binary
     28advec_particles, calc_spectra, check_open, check_parameters, data_output_spectra, init_particles, init_pegrid, init_3d_model, modules, netcdf, particle_boundary_conds, read_var_list, read_3d_binary, user_interface, write_var_list, write_3d_binary
    2629
    2730
     
    6366
    6467
     68
    6569flow_statistics, local_stop, plant_canopy_model, read_3d_binary, user_interface, write_3d_binary
    6670
  • palm/trunk/SOURCE/advec_particles.f90

    r139 r150  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Bottom boundary condition and vertical index calculations adjusted for
     7! ocean runs.
    78! TEST: PRINT statements on unit 9 (commented out)
    89!
     
    207208          i = particles(n)%x * ddx
    208209          j = particles(n)%y * ddy
    209           k = ( particles(n)%z + 0.5 * dz ) / dz  ! only exact if equidistant
     210          k = ( particles(n)%z + 0.5 * dz * atmos_ocean_sign ) / dz  &
     211              + offset_ocean_nzt                     ! only exact if equidistant
    210212
    211213          x  = particles(n)%x - i * dx
     
    295297          i = ( particles(n)%x + 0.5 * dx ) * ddx
    296298          j = ( particles(n)%y + 0.5 * dy ) * ddy
    297           k = particles(n)%z / dz + 1  ! only exact if equidistant
     299          k = particles(n)%z / dz + 1 + offset_ocean_nzt_m1
     300              ! only exact if equidistant
    298301
    299302          ql_c(k,j,i) = ql_c(k,j,i) + particles(n)%weight_factor *            &
     
    832835          i = ( particles(n)%x + 0.5 * dx ) * ddx
    833836          j =   particles(n)%y * ddy
    834           k = ( particles(n)%z + 0.5 * dz ) / dz  ! only exact if equidistant
     837          k = ( particles(n)%z + 0.5 * dz * atmos_ocean_sign ) / dz  &
     838              + offset_ocean_nzt                     ! only exact if equidistant
    835839                                               
    836840!
     
    889893          IF ( vertical_particle_advection )  THEN
    890894             j = particles(n)%y * ddy
    891              k = particles(n)%z / dz
     895             k = particles(n)%z / dz + offset_ocean_nzt_m1
    892896
    893897             x  = particles(n)%x - i * dx
     
    925929             i = particles(n)%x * ddx
    926930             j = particles(n)%y * ddy
    927              k = ( particles(n)%z + 0.5 * dz ) / dz  ! only exact if eq.dist
     931             k = ( particles(n)%z + 0.5 * dz * atmos_ocean_sign ) / dz  &
     932                 + offset_ocean_nzt                      ! only exact if eq.dist
    928933
    929934             IF ( topography == 'flat' )  THEN       
     
    31173122             ENDIF
    31183123          ENDIF
    3119           IF ( particles(n)%z < 0.0  .AND.  particle_mask(n) )  THEN
     3124          IF ( particles(n)%z < zw(0)  .AND.  particle_mask(n) )  THEN
    31203125             IF ( ibc_par_b == 1 )  THEN
    31213126!
     
    31303135!
    31313136!--             Particle reflection
    3132                 particles(n)%z       = -particles(n)%z
     3137                particles(n)%z       = 2.0 * zw(0) - particles(n)%z
    31333138                particles(n)%speed_z = -particles(n)%speed_z
    31343139                IF ( use_sgs_for_particles  .AND. &
     
    31413146                ENDIF
    31423147                IF ( use_particle_tails  .AND.  nn /= 0 )  THEN
    3143                    particle_tail_coordinates(1,3,nn) = &
    3144                                               -particle_tail_coordinates(1,3,nn)
     3148                   particle_tail_coordinates(1,3,nn) = 2.0 * zw(0) - &
     3149                                               particle_tail_coordinates(1,3,nn)
    31453150                ENDIF
    31463151             ENDIF
     
    38833888       i = ( particles(n)%x + 0.5 * dx ) * ddx
    38843889       j = ( particles(n)%y + 0.5 * dy ) * ddy
    3885        k = particles(n)%z / dz + 1  ! only exact if equidistant
     3890       k = particles(n)%z / dz + 1 + offset_ocean_nzt_m1
     3891           ! only exact if equidistant
    38863892
    38873893       prt_count(k,j,i) = prt_count(k,j,i) + 1
     
    39173923       i = ( particles(n)%x + 0.5 * dx ) * ddx
    39183924       j = ( particles(n)%y + 0.5 * dy ) * ddy
    3919        k = particles(n)%z / dz + 1  ! only exact if equidistant
     3925       k = particles(n)%z / dz + 1 + offset_ocean_nzt_m1
     3926           ! only exact if equidistant
    39203927
    39213928       particles_temp(prt_start_index(k,j,i)) = particles(n)
  • palm/trunk/SOURCE/init_particles.f90

    r139 r150  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Set offset_ocean_* needed for calculating vertical indices within ocean runs
    77!
    88! Former revisions:
     
    7979    CALL MPI_TYPE_COMMIT( mpi_particle_type, ierr )
    8080#endif
     81
     82!
     83!-- In case of oceans runs, the vertical index calculations need an offset,
     84!-- because otherwise the k indices will become negative
     85    IF ( ocean )  THEN
     86       offset_ocean_nzt    = nzt
     87       offset_ocean_nzt_m1 = nzt - 1
     88    ENDIF
     89
    8190
    8291!
  • palm/trunk/SOURCE/modules.f90

    r147 r150  
    66! -----------------
    77! +hor_index_bounds, hor_index_bounds_previous_run, numprocs_previous_run,
    8 ! nx_on_file, ny_on_file
     8! nx_on_file, ny_on_file, offset_ocean_*
    99! -myid_char_14
    1010!
     
    880880                number_of_initial_particles = 0, number_of_particles = 0,      &
    881881                number_of_particle_groups = 1, number_of_tails = 0,            &
    882                 number_of_initial_tails = 0, particles_per_point = 1,          &
     882                number_of_initial_tails = 0, offset_ocean_nzt = 0,             &
     883                offset_ocean_nzt_m1 = 0, particles_per_point = 1,              &
    883884                particle_file_count = 0, skip_particles_for_tail = 100,        &
    884885                total_number_of_particles, total_number_of_tails = 0
  • palm/trunk/SOURCE/particle_boundary_conds.f90

    r61 r150  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Vertical index calculations adjusted for ocean runs.
    77!
    88! Former revisions:
     
    1818!        reflection conditions is basically the same for all four cases, so it
    1919!        should be possible to further simplify/shorten it.
     20! THIS ROUTINE HAS NOT BEEN TESTED FOR OCEAN RUNS SO FAR! (see offset_ocean_*)
    2021!------------------------------------------------------------------------------!
    2122
     
    5455       i2 = ( particles(n)%x + 0.5 * dx ) * ddx
    5556       j2 = ( particles(n)%y + 0.5 * dy ) * ddy
    56        k2 = particles(n)%z / dz + 1
     57       k2 = particles(n)%z / dz + 1 + offset_ocean_nzt_m1
    5758
    5859       prt_x = particles(n)%x
     
    6970          i1 = ( pos_x_old + 0.5 * dx ) * ddx
    7071          j1 = ( pos_y_old + 0.5 * dy ) * ddy
    71           k1 = pos_z_old / dz
     72          k1 = pos_z_old / dz + offset_ocean_nzt_m1
    7273
    7374!
     
    132133                i3 = ( pos_x + 0.5 * dx ) * ddx   
    133134                j3 = ( pos_y + 0.5 * dy ) * ddy
    134                 k3 = pos_z / dz
     135                k3 = pos_z / dz + offset_ocean_nzt_m1
    135136
    136137                i5 = pos_x * ddx
    137138                j5 = pos_y * ddy
    138                 k5 = pos_z / dz
     139                k5 = pos_z / dz + offset_ocean_nzt_m1
    139140
    140141                IF ( k5 <= nzb_s_inner(j5,i3)  .AND. &
     
    246247                i3 = ( pos_x + 0.5 * dx ) * ddx
    247248                j3 = ( pos_y + 0.5 * dy ) * ddy
    248                 k3 = pos_z / dz
     249                k3 = pos_z / dz + offset_ocean_nzt_m1
    249250
    250251                i5 = pos_x * ddx
    251252                j5 = pos_y * ddy
    252                 k5 = pos_z / dz
     253                k5 = pos_z / dz + offset_ocean_nzt_m1
    253254
    254255                IF ( k5 <= nzb_s_inner(j3,i5)  .AND. &
     
    361362                i3 = ( pos_x + 0.5 * dx ) * ddx
    362363                j3 = ( pos_y + 0.5 * dy ) * ddy
    363                 k3 =  pos_z / dz
     364                k3 = pos_z / dz + offset_ocean_nzt_m1
    364365
    365366                i5 = pos_x * ddx
    366367                j5 = pos_y * ddy
    367                 k5 = pos_z / dz
     368                k5 = pos_z / dz + offset_ocean_nzt_m1
    368369
    369370                IF ( k5 <= nzb_s_inner(j5,i3)  .AND. &
     
    476477                i3 = ( pos_x + 0.5 * dx ) * ddx   
    477478                j3 = ( pos_y + 0.5 * dy ) * ddy
    478                 k3 = pos_z / dz
     479                k3 = pos_z / dz + offset_ocean_nzt_m1
    479480
    480481                i5 = pos_x * ddx
    481482                j5 = pos_y * ddy
    482                 k5 = pos_z / dz
     483                k5 = pos_z / dz + offset_ocean_nzt_m1
    483484
    484485                IF ( k3 <= nzb_s_inner(j3,i3)  .AND. &
  • palm/trunk/SOURCE/read_3d_binary.f90

    r147 r150  
    6363    CHARACTER (LEN=20) ::  field_chr
    6464
    65     INTEGER ::  files_to_be_opened, i, idum1, j, myid_on_file,                &
     65    INTEGER ::  files_to_be_opened, i, j, myid_on_file,                       &
    6666                numprocs_on_file, nxlc, nxlf, nxlpr, nxl_on_file, nxrc, nxrf, &
    6767                nxrpr, nxr_on_file, nync, nynf, nynpr, nyn_on_file, nysc,     &
Note: See TracChangeset for help on using the changeset viewer.