Ignore:
Timestamp:
Nov 20, 2017 12:40:38 PM (6 years ago)
Author:
schwenkel
Message:

enable particle advection with grid stretching and some formatation changes in lpm

File:
1 edited

Legend:

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

    r2610 r2628  
    2020! Current revisions:
    2121! ------------------
    22 !
     22!  Removed indices ilog and jlog which are no longer needed since particle box
     23! locations are identical to scalar boxes and topography.
     24
    2325!
    2426! Former revisions:
     
    167169    INTEGER(iwp) ::  i                           !< index variable along x
    168170    INTEGER(iwp) ::  ip                          !< index variable along x
    169     INTEGER(iwp) ::  ilog                        !< index variable along x
    170171    INTEGER(iwp) ::  j                           !< index variable along y
    171172    INTEGER(iwp) ::  jp                          !< index variable along y
    172     INTEGER(iwp) ::  jlog                        !< index variable along y
    173173    INTEGER(iwp) ::  k                           !< index variable along z
    174174    INTEGER(iwp) ::  k_wall                      !< vertical index of topography top
     
    299299!--       First, check if particle is located below first vertical grid level
    300300!--       above topography (Prandtl-layer height)
    301           ilog = particles(n)%x * ddx
    302           jlog = particles(n)%y * ddy
    303 !
    304301!--       Determine vertical index of topography top
    305           k_wall = get_topography_top_index( jlog, ilog, 's' )
     302          k_wall = get_topography_top_index( jp, ip, 's' )
    306303
    307304          IF ( constant_flux_layer  .AND.  zv(n) - zw(k_wall) < z_p )  THEN
     
    327324!--             Get friction velocity and momentum flux from new surface data
    328325!--             types.
    329                 IF ( surf_def_h(0)%start_index(jlog,ilog) <=                   &
    330                      surf_def_h(0)%end_index(jlog,ilog) )  THEN
    331                    surf_start = surf_def_h(0)%start_index(jlog,ilog)
     326                IF ( surf_def_h(0)%start_index(jp,ip) <=                   &
     327                     surf_def_h(0)%end_index(jp,ip) )  THEN
     328                   surf_start = surf_def_h(0)%start_index(jp,ip)
    332329!--                Limit friction velocity. In narrow canyons or holes the
    333330!--                friction velocity can become very small, resulting in a too
     
    335332                   us_int    = MAX( surf_def_h(0)%us(surf_start), 0.01_wp ) 
    336333                   usws_int  = surf_def_h(0)%usws(surf_start)
    337                 ELSEIF ( surf_lsm_h%start_index(jlog,ilog) <=                  &
    338                          surf_lsm_h%end_index(jlog,ilog) )  THEN
    339                    surf_start = surf_lsm_h%start_index(jlog,ilog)
     334                ELSEIF ( surf_lsm_h%start_index(jp,ip) <=                  &
     335                         surf_lsm_h%end_index(jp,ip) )  THEN
     336                   surf_start = surf_lsm_h%start_index(jp,ip)
    340337                   us_int    = MAX( surf_lsm_h%us(surf_start), 0.01_wp ) 
    341338                   usws_int  = surf_lsm_h%usws(surf_start)
    342                 ELSEIF ( surf_usm_h%start_index(jlog,ilog) <=                  &
    343                          surf_usm_h%end_index(jlog,ilog) )  THEN
    344                    surf_start = surf_usm_h%start_index(jlog,ilog)
     339                ELSEIF ( surf_usm_h%start_index(jp,ip) <=                  &
     340                         surf_usm_h%end_index(jp,ip) )  THEN
     341                   surf_start = surf_usm_h%start_index(jp,ip)
    345342                   us_int    = MAX( surf_usm_h%us(surf_start), 0.01_wp ) 
    346343                   usws_int  = surf_usm_h%usws(surf_start)
     
    396393       DO  n = start_index(nb), end_index(nb)
    397394
    398           ilog = particles(n)%x * ddx
    399           jlog = particles(n)%y * ddy
    400395!
    401396!--       Determine vertical index of topography top
    402           k_wall = get_topography_top_index( jlog,ilog, 's' )
     397          k_wall = get_topography_top_index( jp,ip, 's' )
    403398
    404399          IF ( constant_flux_layer  .AND.  zv(n) - zw(k_wall) < z_p )  THEN
     
    427422!--             Get friction velocity and momentum flux from new surface data
    428423!--             types.
    429                 IF ( surf_def_h(0)%start_index(jlog,ilog) <=                   &
    430                      surf_def_h(0)%end_index(jlog,ilog) )  THEN
    431                    surf_start = surf_def_h(0)%start_index(jlog,ilog)
     424                IF ( surf_def_h(0)%start_index(jp,ip) <=                   &
     425                     surf_def_h(0)%end_index(jp,ip) )  THEN
     426                   surf_start = surf_def_h(0)%start_index(jp,ip)
    432427!--                Limit friction velocity. In narrow canyons or holes the
    433428!--                friction velocity can become very small, resulting in a too
     
    435430                   us_int    = MAX( surf_def_h(0)%us(surf_start), 0.01_wp ) 
    436431                   vsws_int  = surf_def_h(0)%vsws(surf_start)
    437                 ELSEIF ( surf_lsm_h%start_index(jlog,ilog) <=                  &
    438                          surf_lsm_h%end_index(jlog,ilog) )  THEN
    439                    surf_start = surf_lsm_h%start_index(jlog,ilog)
     432                ELSEIF ( surf_lsm_h%start_index(jp,ip) <=                  &
     433                         surf_lsm_h%end_index(jp,ip) )  THEN
     434                   surf_start = surf_lsm_h%start_index(jp,ip)
    440435                   us_int    = MAX( surf_lsm_h%us(surf_start), 0.01_wp ) 
    441436                   vsws_int  = surf_lsm_h%vsws(surf_start)
    442                 ELSEIF ( surf_usm_h%start_index(jlog,ilog) <=                  &
    443                          surf_usm_h%end_index(jlog,ilog) )  THEN
    444                    surf_start = surf_usm_h%start_index(jlog,ilog)
     437                ELSEIF ( surf_usm_h%start_index(jp,ip) <=                  &
     438                         surf_usm_h%end_index(jp,ip) )  THEN
     439                   surf_start = surf_usm_h%start_index(jp,ip)
    445440                   us_int    = MAX( surf_usm_h%us(surf_start), 0.01_wp ) 
    446441                   vsws_int  = surf_usm_h%vsws(surf_start)
Note: See TracChangeset for help on using the changeset viewer.