Ignore:
Timestamp:
Mar 10, 2015 5:57:55 PM (9 years ago)
Author:
suehring
Message:

Bugfixes in monotonic limter.

File:
1 edited

Legend:

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

    r1563 r1567  
    2020! Current revisions:
    2121! ------------------
    22 
     22! Bugfixes in monotonic limiter.
    2323!
    2424! Former revisions:
     
    825825!
    826826!--           Calculate empirical limiter function (van Albada2 limiter).
    827               phi_l = MIN( 1.0_wp, ( 2.0_wp * rl ) /                          &
     827              phi_l = MIN( 1.0_wp, ( 2.0_wp * ABS( rl ) ) /                   &
    828828                                         ( rl**2 + 1.0_wp ) )
    829               phi_r = MIN( 1.0_wp, ( 2.0_wp * rr ) /                          &
     829              phi_r = MIN( 1.0_wp, ( 2.0_wp * ABS( rr ) ) /                   &
    830830                                         ( rr**2 + 1.0_wp ) )
    831               phi_s = MIN( 1.0_wp, ( 2.0_wp * rs ) /                          &
     831              phi_s = MIN( 1.0_wp, ( 2.0_wp * ABS( rs ) ) /                   &
    832832                                         ( rs**2 + 1.0_wp ) )
    833               phi_n = MIN( 1.0_wp, ( 2.0_wp * rn ) /                          &
     833              phi_n = MIN( 1.0_wp, ( 2.0_wp * ABS( rn ) ) /                   &
    834834                                         ( rn**2 + 1.0_wp ) )
    835               phi_d = MIN( 1.0_wp, ( 2.0_wp * rd ) /                          &
     835              phi_d = MIN( 1.0_wp, ( 2.0_wp * ABS( rd ) ) /                   &
    836836                                         ( rd**2 + 1.0_wp ) )
    837               phi_t = MIN( 1.0_wp, ( 2.0_wp * rt ) /                          &
     837              phi_t = MIN( 1.0_wp, ( 2.0_wp * ABS( rt ) ) /                   &
    838838                                         ( rt**2 + 1.0_wp ) )
    839839!
     
    847847              flux_n(k)                 = fn_1 - phi_n *                      &
    848848                                        ( fn_1 - flux_n(k)                  )
    849               flux_d                    = fd_1  !- phi_d *                      &
    850 !                                         ( fd_1 - flux_d                     )
    851               flux_t(k)                 = ft_1 !- phi_t *                      &
    852 !                                         ( ft_1 - flux_t(k)                  )
     849              flux_d                    = fd_1 - phi_d *                      &
     850                                        ( fd_1 - flux_d                     )
     851              flux_t(k)                 = ft_1 - phi_t *                      &
     852                                        ( ft_1 - flux_t(k)                  )
    853853!
    854854!--          Moreover, modify dissipation flux according to the limiter.
     
    857857             swap_diss_y_local(k,tn)   = swap_diss_y_local(k,tn)   * phi_s
    858858             diss_n(k)                 = diss_n(k)                 * phi_n
    859              diss_d                    = 0.0 !diss_d                    * phi_d
    860              diss_t(k)                 = 0.0 !diss_t(k)                 * phi_t
     859             diss_d                    = diss_d                    * phi_d
     860             diss_t(k)                 = diss_t(k)                 * phi_t
    861861
    862862          ENDIF
     
    10541054!
    10551055!--           Calculate empirical limiter function (van Albada2 limiter).
    1056               phi_l = MIN( 1.0_wp, ( 2.0_wp * rl ) /                          &
     1056              phi_l = MIN( 1.0_wp, ( 2.0_wp * ABS( rl ) ) /                   &
    10571057                                         ( rl**2 + 1.0_wp ) )
    1058               phi_r = MIN( 1.0_wp, ( 2.0_wp * rr ) /                          &
     1058              phi_r = MIN( 1.0_wp, ( 2.0_wp * ABS( rr ) ) /                   &
    10591059                                         ( rr**2 + 1.0_wp ) )
    1060               phi_s = MIN( 1.0_wp, ( 2.0_wp * rs ) /                          &
     1060              phi_s = MIN( 1.0_wp, ( 2.0_wp * ABS( rs ) ) /                   &
    10611061                                         ( rs**2 + 1.0_wp ) )
    1062               phi_n = MIN( 1.0_wp, ( 2.0_wp * rn ) /                          &
     1062              phi_n = MIN( 1.0_wp, ( 2.0_wp * ABS( rn ) ) /                   &
    10631063                                         ( rn**2 + 1.0_wp ) )
    1064               phi_d = MIN( 1.0_wp, ( 2.0_wp * rd ) /                          &
     1064              phi_d = MIN( 1.0_wp, ( 2.0_wp * ABS( rd ) ) /                   &
    10651065                                         ( rd**2 + 1.0_wp ) )
    1066               phi_t = MIN( 1.0_wp, ( 2.0_wp * rt ) /                          &
     1066              phi_t = MIN( 1.0_wp, ( 2.0_wp * ABS( rt ) ) /                   &
    10671067                                         ( rt**2 + 1.0_wp ) )
    10681068!
     
    11301130                                          ( flux_t(k) + diss_t(k) )           &
    11311131                                  * weight_substep(intermediate_timestep_count)
    1132              ENDDO
     1132                ENDDO
    11331133             
    11341134             CASE ( 'sa' )
     
    29612961!
    29622962!--                Calculate empirical limiter function (van Albada2 limiter).
    2963                    phi_l = MIN( 1.0_wp, ( 2.0_wp * rl ) /                     &
     2963                   phi_l = MIN( 1.0_wp, ( 2.0_wp * ABS( rl ) ) /              &
    29642964                                        ( rl**2 + 1.0_wp ) )
    2965                    phi_r = MIN( 1.0_wp, ( 2.0_wp * rr ) /                     &
     2965                   phi_r = MIN( 1.0_wp, ( 2.0_wp * ABS( rr ) ) /              &
    29662966                                        ( rr**2 + 1.0_wp ) )
    2967                    phi_s = MIN( 1.0_wp, ( 2.0_wp * rs ) /                     &
     2967                   phi_s = MIN( 1.0_wp, ( 2.0_wp * ABS( rs ) ) /              &
    29682968                                        ( rs**2 + 1.0_wp ) )
    2969                    phi_n = MIN( 1.0_wp, ( 2.0_wp * rn ) /                     &
     2969                   phi_n = MIN( 1.0_wp, ( 2.0_wp * ABS( rn ) ) /              &
    29702970                                        ( rn**2 + 1.0_wp ) )
    2971                    phi_d = MIN( 1.0_wp, ( 2.0_wp * rd ) /                     &
     2971                   phi_d = MIN( 1.0_wp, ( 2.0_wp * ABS( rd ) ) /              &
    29722972                                        ( rd**2 + 1.0_wp ) )
    2973                    phi_t = MIN( 1.0_wp, ( 2.0_wp * rt ) /                     &
     2973                   phi_t = MIN( 1.0_wp, ( 2.0_wp * ABS( rt ) ) /              &
    29742974                                        ( rt**2 + 1.0_wp ) )
    29752975!
     
    31863186!
    31873187!--                Calculate empirical limiter function (van Albada2 limiter).
    3188                    phi_l = MIN( 1.0_wp, ( 2.0_wp * rl ) /                     &
     3188                   phi_l = MIN( 1.0_wp, ( 2.0_wp * ABS( rl ) ) /              &
    31893189                                        ( rl**2 + 1.0_wp ) )
    3190                    phi_r = MIN( 1.0_wp, ( 2.0_wp * rr ) /                     &
     3190                   phi_r = MIN( 1.0_wp, ( 2.0_wp * ABS( rr ) ) /              &
    31913191                                        ( rr**2 + 1.0_wp ) )
    3192                    phi_s = MIN( 1.0_wp, ( 2.0_wp * rs ) /                     &
     3192                   phi_s = MIN( 1.0_wp, ( 2.0_wp * ABS( rs ) ) /              &
    31933193                                        ( rs**2 + 1.0_wp ) )
    3194                    phi_n = MIN( 1.0_wp, ( 2.0_wp * rn ) /                     &
     3194                   phi_n = MIN( 1.0_wp, ( 2.0_wp * ABS( rn ) ) /              &
    31953195                                        ( rn**2 + 1.0_wp ) )
    3196                    phi_d = MIN( 1.0_wp, ( 2.0_wp * rd ) /                     &
     3196                   phi_d = MIN( 1.0_wp, ( 2.0_wp * ABS( rd ) ) /              &
    31973197                                        ( rd**2 + 1.0_wp ) )
    3198                    phi_t = MIN( 1.0_wp, ( 2.0_wp * rt ) /                     &
     3198                   phi_t = MIN( 1.0_wp, ( 2.0_wp * ABS( rt ) ) /              &
    31993199                                        ( rt**2 + 1.0_wp ) )
    32003200!
     
    36993699!
    37003700!--                Calculate empirical limiter function (van Albada2 limiter).
    3701                    phi_l = MIN( 1.0_wp, ( 2.0_wp * rl ) /                     &
     3701                   phi_l = MIN( 1.0_wp, ( 2.0_wp * ABS( rl ) ) /              &
    37023702                                        ( rl**2 + 1.0_wp ) )
    3703                    phi_r = MIN( 1.0_wp, ( 2.0_wp * rr ) /                     &
     3703                   phi_r = MIN( 1.0_wp, ( 2.0_wp * ABS( rr ) ) /              &
    37043704                                        ( rr**2 + 1.0_wp ) )
    3705                    phi_s = MIN( 1.0_wp, ( 2.0_wp * rs ) /                     &
     3705                   phi_s = MIN( 1.0_wp, ( 2.0_wp * ABS( rs ) ) /              &
    37063706                                        ( rs**2 + 1.0_wp ) )
    3707                    phi_n = MIN( 1.0_wp, ( 2.0_wp * rn ) /                     &
     3707                   phi_n = MIN( 1.0_wp, ( 2.0_wp * ABS( rn ) ) /              &
    37083708                                        ( rn**2 + 1.0_wp ) )
    3709                    phi_d = MIN( 1.0_wp, ( 2.0_wp * rd ) /                     &
     3709                   phi_d = MIN( 1.0_wp, ( 2.0_wp * ABS( rd ) ) /              &
    37103710                                        ( rd**2 + 1.0_wp ) )
    3711                    phi_t = MIN( 1.0_wp, ( 2.0_wp * rt ) /                     &
     3711                   phi_t = MIN( 1.0_wp, ( 2.0_wp * ABS( rt ) ) /              &
    37123712                                        ( rt**2 + 1.0_wp ) )
    37133713!
Note: See TracChangeset for help on using the changeset viewer.