Changeset 1409 for palm


Ignore:
Timestamp:
May 23, 2014 12:11:32 PM (10 years ago)
Author:
suehring
Message:

Bugfix: set inflow boundary conditions also if no humidity or passive_scalar is used

Location:
palm/trunk/SOURCE
Files:
3 edited

Legend:

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

    r1399 r1409  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Bugfix: set inflow boundary conditions also if no humidity or passive_scalar
     23! is used.
    2324!
    2425! Former revisions:
     
    301302           
    302303       ENDIF
    303 !
    304 !--    In case of inflow at the south boundary the boundary for v is at nys
    305 !--    and in case of inflow at the left boundary the boundary for u is at nxl.
    306 !--    Since in prognostic_equations (cache optimized version) these levels are
    307 !--    handled as a prognostic level, boundary values have to be restored here.
    308 !--    For the SGS-TKE, Neumann boundary conditions are used at the inflow.
    309        IF ( inflow_s )  THEN
    310           v_p(:,nys,:) = v_p(:,nys-1,:)
    311           IF ( .NOT. constant_diffusion ) e_p(:,nys-1,:) = e_p(:,nys,:)
    312        ELSEIF ( inflow_n )  THEN
    313           IF ( .NOT. constant_diffusion ) e_p(:,nyn+1,:) = e_p(:,nyn,:)
    314        ELSEIF ( inflow_l ) THEN
    315           u_p(:,:,nxl) = u_p(:,:,nxl-1)
    316           IF ( .NOT. constant_diffusion ) e_p(:,:,nxl-1) = e_p(:,:,nxl)
    317        ELSEIF ( inflow_r )  THEN
    318           IF ( .NOT. constant_diffusion ) e_p(:,:,nxr+1) = e_p(:,:,nxr)
    319        ENDIF
    320 
    321 !
    322 !--    Lateral boundary conditions for scalar quantities at the outflow
    323        IF ( outflow_s )  THEN
    324           pt_p(:,nys-1,:)     = pt_p(:,nys,:)
    325           IF ( .NOT. constant_diffusion     )  e_p(:,nys-1,:) = e_p(:,nys,:)
    326           IF ( humidity  .OR.  passive_scalar )  THEN
    327              q_p(:,nys-1,:) = q_p(:,nys,:)
    328              IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
    329                   precipitation)  THEN
    330                 qr_p(:,nys-1,:) = qr_p(:,nys,:)
    331                 nr_p(:,nys-1,:) = nr_p(:,nys,:)
    332              ENDIF
    333           ENDIF
    334        ELSEIF ( outflow_n )  THEN
    335           pt_p(:,nyn+1,:)     = pt_p(:,nyn,:)
    336           IF ( .NOT. constant_diffusion     )  e_p(:,nyn+1,:) = e_p(:,nyn,:)
    337           IF ( humidity  .OR.  passive_scalar )  THEN
    338              q_p(:,nyn+1,:) = q_p(:,nyn,:)
    339              IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
    340                   precipitation )  THEN
    341                 qr_p(:,nyn+1,:) = qr_p(:,nyn,:)
    342                 nr_p(:,nyn+1,:) = nr_p(:,nyn,:)
    343              ENDIF
    344           ENDIF
    345        ELSEIF ( outflow_l )  THEN
    346           pt_p(:,:,nxl-1)     = pt_p(:,:,nxl)
    347           IF ( .NOT. constant_diffusion     )  e_p(:,:,nxl-1) = e_p(:,:,nxl)
    348           IF ( humidity  .OR.  passive_scalar )  THEN
    349              q_p(:,:,nxl-1) = q_p(:,:,nxl)
    350              IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
    351                   precipitation )  THEN
    352                 qr_p(:,:,nxl-1) = qr_p(:,:,nxl)
    353                 nr_p(:,:,nxl-1) = nr_p(:,:,nxl)
    354              ENDIF
    355           ENDIF
    356        ELSEIF ( outflow_r )  THEN
    357           pt_p(:,:,nxr+1)     = pt_p(:,:,nxr)
    358           IF ( .NOT. constant_diffusion     )  e_p(:,:,nxr+1) = e_p(:,:,nxr)
    359           IF ( humidity .OR. passive_scalar )  THEN
    360              q_p(:,:,nxr+1) = q_p(:,:,nxr)
    361              IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.  precipitation )  THEN
    362                 qr_p(:,:,nxr+1) = qr_p(:,:,nxr)
    363                 nr_p(:,:,nxr+1) = nr_p(:,:,nxr)
    364              ENDIF
    365           ENDIF
    366        ENDIF
    367 
     304    ENDIF
     305!
     306!-- In case of inflow at the south boundary the boundary for v is at nys
     307!-- and in case of inflow at the left boundary the boundary for u is at nxl.
     308!-- Since in prognostic_equations (cache optimized version) these levels are
     309!-- handled as a prognostic level, boundary values have to be restored here.
     310!-- For the SGS-TKE, Neumann boundary conditions are used at the inflow.
     311    IF ( inflow_s )  THEN
     312       v_p(:,nys,:) = v_p(:,nys-1,:)
     313       IF ( .NOT. constant_diffusion ) e_p(:,nys-1,:) = e_p(:,nys,:)
     314    ELSEIF ( inflow_n )  THEN
     315       IF ( .NOT. constant_diffusion ) e_p(:,nyn+1,:) = e_p(:,nyn,:)
     316    ELSEIF ( inflow_l ) THEN
     317       u_p(:,:,nxl) = u_p(:,:,nxl-1)
     318       IF ( .NOT. constant_diffusion ) e_p(:,:,nxl-1) = e_p(:,:,nxl)
     319    ELSEIF ( inflow_r )  THEN
     320       IF ( .NOT. constant_diffusion ) e_p(:,:,nxr+1) = e_p(:,:,nxr)
     321    ENDIF
     322
     323!
     324!-- Lateral boundary conditions for scalar quantities at the outflow
     325    IF ( outflow_s )  THEN
     326       pt_p(:,nys-1,:)     = pt_p(:,nys,:)
     327       IF ( .NOT. constant_diffusion     )  e_p(:,nys-1,:) = e_p(:,nys,:)
     328       IF ( humidity  .OR.  passive_scalar )  THEN
     329          q_p(:,nys-1,:) = q_p(:,nys,:)
     330          IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
     331               precipitation)  THEN
     332             qr_p(:,nys-1,:) = qr_p(:,nys,:)
     333             nr_p(:,nys-1,:) = nr_p(:,nys,:)
     334          ENDIF
     335       ENDIF
     336    ELSEIF ( outflow_n )  THEN
     337       pt_p(:,nyn+1,:)     = pt_p(:,nyn,:)
     338       IF ( .NOT. constant_diffusion     )  e_p(:,nyn+1,:) = e_p(:,nyn,:)
     339       IF ( humidity  .OR.  passive_scalar )  THEN
     340          q_p(:,nyn+1,:) = q_p(:,nyn,:)
     341          IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
     342               precipitation )  THEN
     343             qr_p(:,nyn+1,:) = qr_p(:,nyn,:)
     344             nr_p(:,nyn+1,:) = nr_p(:,nyn,:)
     345          ENDIF
     346       ENDIF
     347    ELSEIF ( outflow_l )  THEN
     348       pt_p(:,:,nxl-1)     = pt_p(:,:,nxl)
     349       IF ( .NOT. constant_diffusion     )  e_p(:,:,nxl-1) = e_p(:,:,nxl)
     350       IF ( humidity  .OR.  passive_scalar )  THEN
     351          q_p(:,:,nxl-1) = q_p(:,:,nxl)
     352          IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.              &
     353               precipitation )  THEN
     354             qr_p(:,:,nxl-1) = qr_p(:,:,nxl)
     355             nr_p(:,:,nxl-1) = nr_p(:,:,nxl)
     356          ENDIF
     357       ENDIF
     358    ELSEIF ( outflow_r )  THEN
     359       pt_p(:,:,nxr+1)     = pt_p(:,:,nxr)
     360       IF ( .NOT. constant_diffusion     )  e_p(:,:,nxr+1) = e_p(:,:,nxr)
     361       IF ( humidity .OR. passive_scalar )  THEN
     362          q_p(:,:,nxr+1) = q_p(:,:,nxr)
     363          IF ( cloud_physics  .AND.  icloud_scheme == 0  .AND.  precipitation )  THEN
     364             qr_p(:,:,nxr+1) = qr_p(:,:,nxr)
     365             nr_p(:,:,nxr+1) = nr_p(:,:,nxr)
     366          ENDIF
     367       ENDIF
    368368    ENDIF
    369369
  • palm/trunk/SOURCE/init_grid.f90

    r1354 r1409  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Bugfix: set wall_flags_0 at inflow and outflow boundary also for i <= nxlu
     23! j <= nysv
    2324!
    2425! Former revisions:
     
    12291230!--             WS1 (9), WS3 (10), WS5 (11)
    12301231                IF ( k <= nzb_u_inner(j,i+1)                                  &
    1231                      .OR. ( ( inflow_l .OR. outflow_l ) .AND. i == nxlu )     &
     1232                     .OR. ( ( inflow_l .OR. outflow_l ) .AND. i <= nxlu )     &
    12321233                     .OR. ( ( inflow_r .OR. outflow_r ) .AND. i == nxr  )     &
    12331234                   )  THEN
     
    12981299!--             WS1 (21), WS3 (22), WS5 (23)
    12991300                IF ( k <= nzb_v_inner(j+1,i)                                   &
    1300                      .OR. ( ( inflow_s .OR. outflow_s ) .AND. i == nysv )      &
     1301                     .OR. ( ( inflow_s .OR. outflow_s ) .AND. j <= nysv )      &
    13011302                     .OR. ( ( inflow_n .OR. outflow_n ) .AND. j == nyn  )      &
    13021303                   )  THEN
  • palm/trunk/SOURCE/prognostic_equations.f90

    r1399 r1409  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! Bugfix: i_omp_start changed for advec_u_ws at left inflow and outflow boundary.
     23! This ensures that left-hand side fluxes are also calculated for nxl in that
     24! case, even though the solution at nxl is overwritten in boundary_conds()
    2325!
    2426! Former revisions:
     
    349351             IF ( timestep_scheme(1:5) == 'runge' )  THEN
    350352                IF ( ws_scheme_mom )  THEN
    351                    IF ( ( inflow_l .OR. outflow_l ) .AND. i_omp_start == nxl )  THEN
    352                       CALL advec_u_ws( i, j, i_omp_start + 1, tn )
    353                    ELSE
    354                       CALL advec_u_ws( i, j, i_omp_start, tn )
    355                    ENDIF
     353                   CALL advec_u_ws( i, j, i_omp_start, tn )
    356354                ELSE
    357355                   CALL advec_u_pw( i, j )
Note: See TracChangeset for help on using the changeset viewer.