Ignore:
Timestamp:
Aug 16, 2007 2:30:26 PM (14 years ago)
Author:
raasch
Message:

preliminary update of bugfixes and extensions for non-cyclic BCs

File:
1 edited

Legend:

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

    r90 r106  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Volume flow conservation added for the remaining three outflow boundaries
    77!
    88! Former revisions:
     
    7474!-- Conserve the volume flow at the outflow in case of non-cyclic lateral
    7575!-- boundary conditions
    76     IF ( conserve_volume_flow  .AND.  bc_ns == 'radiation/dirichlet')  THEN
     76!-- WARNING: so far, this conservation does not work at the left/south
     77!--          boundary if the topography at the inflow differs from that at the
     78!--          outflow! For this case, volume_flow_area needs adjustment!
     79!
     80!-- Left/right
     81    IF ( conserve_volume_flow  .AND.  ( outflow_l  .OR. outflow_r ) )  THEN
     82
     83       volume_flow(1)   = 0.0
     84       volume_flow_l(1) = 0.0
     85
     86       IF ( outflow_l )  THEN
     87          i = 0
     88       ELSEIF ( outflow_r )  THEN
     89          i = nx+1
     90       ENDIF
     91
     92       DO  j = nys, nyn
     93!
     94!--       Sum up the volume flow through the south/north boundary
     95          DO  k = nzb_2d(j,i) + 1, nzt
     96             volume_flow_l(1) = volume_flow_l(1) + u(k,j,i) * dzu(k)
     97          ENDDO
     98       ENDDO
     99
     100#if defined( __parallel )   
     101       CALL MPI_ALLREDUCE( volume_flow_l(1), volume_flow(1), 1, MPI_REAL, &
     102                           MPI_SUM, comm1dy, ierr )   
     103#else
     104       volume_flow = volume_flow_l 
     105#endif
     106       volume_flow_offset(1) = ( volume_flow_initial(1) - volume_flow(1) )    &
     107                               / volume_flow_area(1)
     108
     109       DO  j = nys, nyn
     110          DO  k = nzb_v_inner(j,i) + 1, nzt
     111             u(k,j,i) = u(k,j,i) + volume_flow_offset(1)
     112          ENDDO
     113       ENDDO
     114
     115       CALL exchange_horiz( u )
     116
     117    ENDIF
     118
     119!
     120!-- South/north
     121    IF ( conserve_volume_flow  .AND.  ( outflow_n  .OR. outflow_s ) )  THEN
    77122
    78123       volume_flow(2)   = 0.0
    79124       volume_flow_l(2) = 0.0
    80125
    81        IF ( nyn == ny )  THEN
     126       IF ( outflow_s )  THEN
     127          j = 0
     128       ELSEIF ( outflow_n )  THEN
    82129          j = ny+1
    83           DO  i = nxl, nxr
    84 !
    85 !--          Sum up the volume flow through the north boundary
    86              DO  k = nzb_2d(j,i) + 1, nzt
    87                 volume_flow_l(2) = volume_flow_l(2) + v(k,j,i) * dzu(k)
    88              ENDDO
    89           ENDDO
    90        ENDIF
     130       ENDIF
     131
     132       DO  i = nxl, nxr
     133!
     134!--       Sum up the volume flow through the south/north boundary
     135          DO  k = nzb_2d(j,i) + 1, nzt
     136             volume_flow_l(2) = volume_flow_l(2) + v(k,j,i) * dzu(k)
     137          ENDDO
     138       ENDDO
     139
    91140#if defined( __parallel )   
    92141       CALL MPI_ALLREDUCE( volume_flow_l(2), volume_flow(2), 1, MPI_REAL, &
     
    96145#endif
    97146       volume_flow_offset(2) = ( volume_flow_initial(2) - volume_flow(2) )    &
    98                                / volume_flow_area(2)                         
    99 
    100        IF ( outflow_n )  THEN
    101           j = nyn+1
    102           DO  i = nxl, nxr
    103              DO  k = nzb_v_inner(j,i) + 1, nzt
    104                 v(k,j,i) = v(k,j,i) + volume_flow_offset(2)
    105              ENDDO
    106           ENDDO
    107        ENDIF
     147                               / volume_flow_area(2)
     148
     149       DO  i = nxl, nxr
     150          DO  k = nzb_v_inner(j,i) + 1, nzt
     151             v(k,j,i) = v(k,j,i) + volume_flow_offset(2)
     152          ENDDO
     153       ENDDO
    108154
    109155       CALL exchange_horiz( v )
Note: See TracChangeset for help on using the changeset viewer.