Ignore:
Timestamp:
Mar 3, 2021 3:39:08 PM (3 years ago)
Author:
suehring
Message:

Remove offset in terrain-following masked output and allow only mask_k_over_surface >= 1

File:
1 edited

Legend:

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

    r4828 r4895  
    2020! Current revisions:
    2121! -----------------
    22 ! 
    23 ! 
     22!
     23!
    2424! Former revisions:
    2525! -----------------
    2626! $Id$
     27! Remove offset in terrain-following masked output
     28!
     29! 4828 2021-01-05 11:21:41Z Giersch
    2730! file re-formatted to follow the PALM coding standard
    2831!
     
    154157    INTEGER(iwp) ::  k                       !< loop index
    155158    INTEGER(iwp) ::  kk                      !< vertical index
    156     INTEGER(iwp) ::  ktt                     !< k index of highest terrain surface
     159    INTEGER(iwp) ::  ktt                     !< k index of lowest non-terrain surface
    157160    INTEGER(iwp) ::  mid                     !< masked output running index
    158161    INTEGER(iwp) ::  n                       !< loop index
     
    288291                   DO  i = 1, mask_size_l(mid,1)
    289292                      DO  j = 1, mask_size_l(mid,2)
    290 !--                      Get k index of the highest terraing surface
     293!
     294!--                      Get k index of the lowest non-terrain grid point
    291295                         im = mask_i(mid,i)
    292296                         jm = mask_j(mid,j)
     
    294298                                       DIM = 1 ) - 1
    295299                         DO  k = 1, mask_size_l(mid,3)
    296                             kk = MIN( ktt+mask_k(mid,k), nzt+1 )
    297 !--                         Set value if not in building
     300                            kk = MIN( ktt + mask_k(mid,k) - 1, nzt+1 )
     301!--                         Set value if not in building, else set fill value
    298302                            IF ( BTEST( wall_flags_total_0(kk,jm,im), 6 ) )  THEN
    299303                               local_pf(i,j,k) = fill_value
     
    356360                   DO  i = 1, mask_size_l(mid,1)
    357361                      DO  j = 1, mask_size_l(mid,2)
    358 !--                      Get k index of the highest terraing surface
     362!
     363!--                      Get k index of the lowest non-terrain grid point
    359364                         im = mask_i(mid,i)
    360365                         jm = mask_j(mid,j)
     
    362367                                       DIM = 1 ) - 1
    363368                         DO  k = 1, mask_size_l(mid,3)
    364                             kk = MIN( ktt+mask_k(mid,k), nzt+1 )
    365 !--                         Set value if not in building
     369                            kk = MIN( ktt + mask_k(mid,k) - 1, nzt+1 )
     370!--                         Set value if not in building, else set fill value
    366371                            IF ( BTEST( wall_flags_total_0(kk,jm,im), 6 ) )  THEN
    367372                               local_pf(i,j,k) = fill_value
     
    399404                      DO  i = 1, mask_size_l(mid,1)
    400405                         DO  j = 1, mask_size_l(mid,2)
    401 !--                         Get k index of the highest terraing surface
     406!
     407!--                         Get k index of the lowest non-terrain grid point
    402408                            im = mask_i(mid,i)
    403409                            jm = mask_j(mid,j)
     
    405411                                          DIM = 1 ) - 1
    406412                            DO  k = 1, mask_size_l(mid,3)
    407                                kk = MIN( ktt+mask_k(mid,k), nzt+1 )
    408 !--                            Set value if not in building
     413                               kk = MIN( ktt + mask_k(mid,k) - 1, nzt+1 )
     414!
     415!--                            Set value if not in building, else set fill value
    409416                               IF ( BTEST( wall_flags_total_0(kk,jm,im), 6 ) )  THEN
    410417                                  local_pf(i,j,k) = fill_value
     
    493500                   DO  i = 1, mask_size_l(mid,1)
    494501                      DO  j = 1, mask_size_l(mid,2)
    495 !--                      Get k index of the highest terraing surface
     502!
     503!--                      Get k index of the lowest non-terrain grid point
    496504                         im = mask_i(mid,i)
    497505                         jm = mask_j(mid,j)
     
    499507                                       DIM = 1 ) - 1
    500508                         DO  k = 1, mask_size_l(mid,3)
    501                             kk = MIN( ktt+mask_k(mid,k), nzt+1 )
    502 !--                         Set value if not in building
     509                            kk = MIN( ktt + mask_k(mid,k) - 1, nzt+1 )
     510!
     511!--                         Set value if not in building, else set fill value
    503512                            IF ( BTEST( wall_flags_total_0(kk,jm,im), 6 ) )  THEN
    504513                               local_pf(i,j,k) = fill_value
     
    532541                   DO  i = 1, mask_size_l(mid,1)
    533542                      DO  j = 1, mask_size_l(mid,2)
    534 !--                      Get k index of the highest terraing surface
     543!
     544!--                      Get k index of the lowest non-terrain grid point
    535545                         im = mask_i(mid,i)
    536546                         jm = mask_j(mid,j)
     
    538548                                       DIM = 1 ) - 1
    539549                         DO  k = 1, mask_size_l(mid,3)
    540                             kk = MIN( ktt+mask_k(mid,k), nzt+1 )
    541 !--                         Set value if not in building
     550                            kk = MIN( ktt + mask_k(mid,k) - 1, nzt+1 )
     551!--                         Set value if not in building, else set fill value
    542552                            IF ( BTEST( wall_flags_total_0(kk,jm,im), 6 ) )  THEN
    543553                               local_pf(i,j,k) = fill_value
     
    679689             DO  i = 1, mask_size_l(mid,1)
    680690                DO  j = 1, mask_size_l(mid,2)
    681 !--                Get k index of the highest terraing surface
     691!
     692!--                Get k index of the lowest non-terrain grid point
    682693                   im = mask_i(mid,i)
    683694                   jm = mask_j(mid,j)
    684                    ktt = MINLOC( MERGE( 1, 0, BTEST( wall_flags_total_0(:,jm,im), 5 ) ),           &
     695                   ktt = MINLOC( MERGE( 1, 0, BTEST( wall_flags_total_0(:,jm,im), 5 ) ),     &
    685696                                 DIM = 1 ) - 1
    686697                   DO  k = 1, mask_size_l(mid,3)
    687                       kk = MIN( ktt+mask_k(mid,k), nzt+1 )
    688 !--                   Set value if not in building
     698                      kk = MIN( ktt + mask_k(mid,k) - 1, nzt+1 )
     699!
     700!--                   Set value if not in building, else set fill value
    689701                      IF ( BTEST( wall_flags_total_0(kk,jm,im), 6 ) )  THEN
    690702                         local_pf(i,j,k) = fill_value
Note: See TracChangeset for help on using the changeset viewer.