Ignore:
Timestamp:
Oct 26, 2016 11:15:40 AM (5 years ago)
Author:
knoop
Message:

Anelastic approximation implemented

File:
1 edited

Legend:

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

    r2022 r2037  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Anelastic approximation implemented
    2323!
    2424! Former revisions:
     
    222222         
    223223    USE grid_variables,                                                        &
    224         ONLY:  ddx, ddx2, ddx2_mg, ddy, ddy2, ddy2_mg, dx, dx2, dy, dy2, fwxm, &
     224        ONLY:  ddx, ddx2, ddy, ddy2, dx, dx2, dy, dy2, fwxm,                  &
    225225               fwxp, fwym, fwyp, fxm, fxp, fym, fyp, wall_e_x, wall_e_y,       &
    226226               wall_u, wall_v, wall_w_x, wall_w_y, zu_s_inner, zw_w_inner
     
    293293
    294294    REAL(wp) ::  dum           !< dummy variable to skip columns while reading topography file   
    295     REAL(wp) ::  dx_l          !< grid spacing along x on different multigrid level
    296     REAL(wp) ::  dy_l          !< grid spacing along y on different multigrid level
    297295    REAL(wp) ::  dz_stretched  !< stretched vertical grid spacing
    298296
     
    431429       ddzu_pres = ddzu
    432430       ddzu_pres(1) = ddzu_pres(2)  ! change for lowest level
    433     ENDIF   
    434 
    435 !
    436 !-- In case of multigrid method, compute grid lengths and grid factors for the
    437 !-- grid levels
    438     IF ( psolver(1:9) == 'multigrid' )  THEN
    439 
    440        ALLOCATE( ddx2_mg(maximum_grid_level), ddy2_mg(maximum_grid_level), &
    441                  dzu_mg(nzb+1:nzt+1,maximum_grid_level),                   &
    442                  dzw_mg(nzb+1:nzt+1,maximum_grid_level),                   &
    443                  f1_mg(nzb+1:nzt,maximum_grid_level),                      &
    444                  f2_mg(nzb+1:nzt,maximum_grid_level),                      &
    445                  f3_mg(nzb+1:nzt,maximum_grid_level) )
    446 
    447        dzu_mg(:,maximum_grid_level) = dzu
    448 !       
    449 !--    Next line to ensure an equally spaced grid.
    450        dzu_mg(1,maximum_grid_level) = dzu(2)
    451 
    452        dzw_mg(:,maximum_grid_level) = dzw
    453        nzt_l = nzt
    454        DO  l = maximum_grid_level-1, 1, -1
    455            dzu_mg(nzb+1,l) = 2.0_wp * dzu_mg(nzb+1,l+1)
    456            dzw_mg(nzb+1,l) = 2.0_wp * dzw_mg(nzb+1,l+1)
    457            nzt_l = nzt_l / 2
    458            DO  k = 2, nzt_l+1
    459               dzu_mg(k,l) = dzu_mg(2*k-2,l+1) + dzu_mg(2*k-1,l+1)
    460               dzw_mg(k,l) = dzw_mg(2*k-2,l+1) + dzw_mg(2*k-1,l+1)
    461            ENDDO
    462        ENDDO
    463 
    464        nzt_l = nzt
    465        dx_l  = dx
    466        dy_l  = dy
    467        DO  l = maximum_grid_level, 1, -1
    468           ddx2_mg(l) = 1.0_wp / dx_l**2
    469           ddy2_mg(l) = 1.0_wp / dy_l**2
    470           DO  k = nzb+1, nzt_l
    471              f2_mg(k,l) = 1.0_wp / ( dzu_mg(k+1,l) * dzw_mg(k,l) )
    472              f3_mg(k,l) = 1.0_wp / ( dzu_mg(k,l)   * dzw_mg(k,l) )
    473              f1_mg(k,l) = 2.0_wp * ( ddx2_mg(l) + ddy2_mg(l) ) + &
    474                           f2_mg(k,l) + f3_mg(k,l)
    475           ENDDO
    476           nzt_l = nzt_l / 2
    477           dx_l  = dx_l * 2.0_wp
    478           dy_l  = dy_l * 2.0_wp
    479        ENDDO
    480 
    481431    ENDIF
    482432
Note: See TracChangeset for help on using the changeset viewer.