Changeset 1910


Ignore:
Timestamp:
May 26, 2016 6:49:46 AM (9 years ago)
Author:
raasch
Message:

Bugfix: if topography is read from file, Neumann conditions are used for the nzb_local array (instead of cyclic conditions) in case that non-cyclic boundary conditions are used for the run

File:
1 edited

Legend:

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

    r1903 r1910  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! Bugfix: if topography is read from file, Neumann conditions are used for the
     22! nzb_local array (instead of cyclic conditions) in case that non-cyclic
     23! boundary conditions are used for the run
    2224!
    2325! Former revisions:
     
    2628!
    2729! 1902 2016-05-09 11:18:56Z suehring
    28 ! Set topography flags only for multigrid solver, not for multigrid_fast
     30! Set topography flags for multigrid solver only (not for multigrid_fast)
    2931!
    3032! 1886 2016-04-21 11:20:47Z suehring
     
    169171       
    170172    USE control_parameters,                                                    &
    171         ONLY:  bc_lr, bc_ns, building_height, building_length_x,               &
     173        ONLY:  bc_lr_cyc, bc_ns_cyc, building_height, building_length_x,       &
    172174               building_length_y, building_wall_left, building_wall_south,     &
    173175               canyon_height, canyon_wall_left, canyon_wall_south,             &
     
    745747
    746748          DEALLOCATE ( topo_height )
    747 !
    748 !--       Add cyclic boundaries (additional layers are for calculating
    749 !--       flag arrays needed for the multigrid sover)
    750           nzb_local(-gls:-1,0:nx)     = nzb_local(ny-gls+1:ny,0:nx)
    751           nzb_local(ny+1:ny+gls,0:nx) = nzb_local(0:gls-1,0:nx)
    752           nzb_local(:,-gls:-1)        = nzb_local(:,nx-gls+1:nx)
    753           nzb_local(:,nx+1:nx+gls)    = nzb_local(:,0:gls-1)
     749
     750!
     751!--       Add cyclic or Neumann boundary conditions (additional layers are for
     752!--       calculating flag arrays needed for the multigrid sover)
     753          IF ( bc_ns_cyc )  THEN
     754             nzb_local(-gls:-1,0:nx)     = nzb_local(ny-gls+1:ny,0:nx)
     755             nzb_local(ny+1:ny+gls,0:nx) = nzb_local(0:gls-1,0:nx)
     756          ELSE
     757             DO  j = -gls, -1
     758                nzb_local(j,0:nx)  = nzb_local(0,0:nx)
     759             ENDDO
     760             DO  j = ny+1, ny+gls
     761                 nzb_local(j,0:nx) = nzb_local(ny,0:nx)
     762             ENDDO
     763          ENDIF
     764
     765          IF ( bc_lr_cyc )  THEN
     766             nzb_local(:,-gls:-1)     = nzb_local(:,nx-gls+1:nx)
     767             nzb_local(:,nx+1:nx+gls) = nzb_local(:,0:gls-1)
     768          ELSE
     769             DO  i = -gls, -1
     770                nzb_local(:,i) = nzb_local(:,0)
     771             ENDDO
     772             DO  i = nx+1, nx+gls
     773                nzb_local(:,i) = nzb_local(:,nx)
     774             ENDDO
     775          ENDIF
    754776
    755777       CASE DEFAULT
     
    791813       ENDIF
    792814
    793        IF ( bc_lr == 'cyclic' )  THEN
     815       IF ( bc_lr_cyc )  THEN
    794816          IF ( ANY( nzb_local(:,-1) /= nzb_local(:,nx)   )  .OR.               &
    795817               ANY( nzb_local(:,0)  /= nzb_local(:,nx+1) ) )  THEN
     
    799821          ENDIF
    800822       ENDIF
    801        IF ( bc_ns == 'cyclic' )  THEN
     823       IF ( bc_ns_cyc )  THEN
    802824          IF ( ANY( nzb_local(-1,:) /= nzb_local(ny,:)   )  .OR.               &
    803825               ANY( nzb_local(0,:)  /= nzb_local(ny+1,:) ) )  THEN
Note: See TracChangeset for help on using the changeset viewer.