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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.