Changeset 163 for palm/trunk/SOURCE


Ignore:
Timestamp:
May 5, 2008 2:09:05 PM (16 years ago)
Author:
raasch
Message:

bugfixes for turbulent inflow in init_pegrid, inflow_turbulence, and init_3d_model

Location:
palm/trunk/SOURCE
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/inflow_turbulence.f90

    r151 r163  
    9191    i = recycling_plane
    9292
    93     IF ( i >= nxl  .AND.  i <= nxr )  THEN
     93    IF ( myidx == id_recycling )  THEN
    9494
    9595       DO  j = nys-1, nyn+1
     
    110110!-- For parallel runs, send the disturbances to the respective inflow PE
    111111#if defined( __parallel )
    112     IF ( i >= nxl  .AND.  i <= nxr  .AND.  myid /= id_inflow )  THEN
     112    IF ( myidx == id_recycling  .AND.  myidx /= id_inflow )  THEN
    113113
    114 !       print*, '*** sending id = ', myid, '   send to:', id_inflow
    115114       CALL MPI_SEND( inflow_dist(nzb,nys-1,1), ngp_ifd, MPI_REAL, &
    116115                      id_inflow, 1, comm1dx, ierr )
    117116
    118     ELSEIF ( ( i < nxl  .OR.  i > nxr )  .AND.  myid == id_inflow )  THEN
     117    ELSEIF ( myidx /= id_recycling  .AND.  myidx == id_inflow )  THEN
    119118
    120 !       print*, '*** receiving id = ', myid
     119       inflow_dist = 0.0
    121120       CALL MPI_RECV( inflow_dist(nzb,nys-1,1), ngp_ifd, MPI_REAL, &
    122                       MPI_ANY_SOURCE, 1, comm1dx, status, ierr )
     121                      id_recycling, 1, comm1dx, status, ierr )
    123122
    124123    ENDIF
  • palm/trunk/SOURCE/init_3d_model.f90

    r153 r163  
    980980
    981981!
     982!--    Read binary data from restart file
     983          WRITE (9,*) 'before read_3d_binary'
     984          CALL local_flush( 9 )
     985       CALL read_3d_binary
     986          WRITE (9,*) 'after read_3d_binary'
     987          CALL local_flush( 9 )
     988
     989!
    982990!--    Calculate the initial volume flow at the right and north boundary
    983        IF ( conserve_volume_flow )  THEN
     991       IF ( conserve_volume_flow  .AND.  &
     992            TRIM( initializing_actions ) == 'read_data_for_recycling' )  THEN
    984993
    985994          volume_flow_initial_l = 0.0
     
    10251034       ENDIF
    10261035
    1027 
    1028 !
    1029 !--    Read binary data from restart file
    1030           WRITE (9,*) 'before read_3d_binary'
    1031           CALL local_flush( 9 )
    1032        CALL read_3d_binary
    1033           WRITE (9,*) 'after read_3d_binary'
    1034           CALL local_flush( 9 )
    10351036
    10361037!
  • palm/trunk/SOURCE/init_pegrid.f90

    r151 r163  
    4848    USE control_parameters
    4949    USE fft_xy
     50    USE grid_variables
    5051    USE indices
    5152    USE pegrid
     
    5859    IMPLICIT NONE
    5960
    60     INTEGER ::  gathered_size, i, id_inflow_l, ind(5), j, k,                &
     61    INTEGER ::  gathered_size, i, id_inflow_l, id_recycling_l, ind(5), j, k, &
    6162                maximum_grid_level_l, mg_switch_to_pe0_level_l, mg_levels_x, &
    6263                mg_levels_y, mg_levels_z, nnx_y, nnx_z, nny_x, nny_z, nnz_x, &
     
    922923!-- Broadcast the id of the inflow PE
    923924    IF ( inflow_l )  THEN
    924        id_inflow_l = myid
     925       id_inflow_l = myidx
    925926    ELSE
    926927       id_inflow_l = 0
    927928    ENDIF
    928929    CALL MPI_ALLREDUCE( id_inflow_l, id_inflow, 1, MPI_INTEGER, MPI_SUM, &
     930                        comm1dx, ierr )
     931
     932!
     933!-- Broadcast the id of the recycling plane
     934!-- WARNING: needs to be adjusted in case of inflows other than from left side!
     935    IF ( ( recycling_width / dx ) >= nxl  .AND.  ( recycling_width / dx ) <= nxr ) &
     936    THEN
     937       id_recycling_l = myidx
     938    ELSE
     939       id_recycling_l = 0
     940    ENDIF
     941    CALL MPI_ALLREDUCE( id_recycling_l, id_recycling, 1, MPI_INTEGER, MPI_SUM, &
    929942                        comm1dx, ierr )
    930943
  • palm/trunk/SOURCE/modules.f90

    r153 r163  
    77! +canopy_heat_flux, cthf, lai,
    88! +leaf_surface_concentration, scalar_exchange_coefficient, sec, sls
    9 ! +hor_index_bounds, hor_index_bounds_previous_run, id_inflow,
     9! +hor_index_bounds, hor_index_bounds_previous_run, id_inflow, id_recycling,
    1010! inflow_damping_*, mean_inflow_profiles, numprocs_previous_run, nx_on_file,
    1111! ny_on_file, offset_ocean_*, recycling_plane, recycling_width, turbulent_inflow
     
    969969#endif
    970970    CHARACTER(LEN=5)       ::  myid_char = ''
    971     INTEGER                ::  id_inflow, myid=0, npex = -1, npey = -1, &
    972                                numprocs = 1, numprocs_previous_run = -1, &
     971    INTEGER                ::  id_inflow = 0, id_recycling = 0, myid=0, npex = -1, &
     972                               npey = -1, numprocs = 1, numprocs_previous_run = -1,&
    973973                               tasks_per_node = -9999, threads_per_task = 1
    974974
Note: See TracChangeset for help on using the changeset viewer.