Ignore:
Timestamp:
Jul 20, 2017 5:27:19 PM (7 years ago)
Author:
suehring
Message:

get topograpyh top index via function call

File:
1 edited

Legend:

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

    r2296 r2317  
    2121! Current revisions:
    2222! ------------------
    23 !
     23! Get topography top index via Function call
    2424!
    2525! Former revisions:
     
    603603!
    604604!--                 Find topography top index
    605                     k_topo = MAXLOC( MERGE( 1, 0,                              &
    606                                              BTEST( wall_flags_0(:,j,i), 12 )  &
    607                                            ), DIM = 1                          &
    608                                    ) - 1
     605                    k_topo = get_topography_top_index( j, i, 's' )
     606
    609607                    DO k = nzt+1, 0, -1
    610608                        IF ( lad_s(k,j,i) /= 0.0_wp )  THEN
     
    706704                 DO  j = ijdb(3,ids), ijdb(4,ids)
    707705
    708                     k_topo =   MAXLOC( MERGE( 1, 0,                            &
    709                                              BTEST( wall_flags_0(:,j,i), 12 )  &
    710                                             ), DIM = 1                         &
    711                                      ) - 1
    712                     k_topo2 =  MAXLOC( MERGE( 1, 0,                            &
    713                                              BTEST( wall_flags_0(:,j-jdir(ids),i-idir(ids)), 12 )  &
    714                                             ), DIM = 1                         &
    715                                      ) - 1
     706                    k_topo  = get_topography_top_index( j, i, 's' )
     707                    k_topo2 = get_topography_top_index( j-jdir(ids), i-idir(ids), 's' )
    716708
    717709                    k = nzut - MAX( k_topo, k_topo2 )
     
    732724!
    733725!--                 Find topography top index
    734                     k_topo = MAXLOC( MERGE( 1, 0,                              &
    735                                              BTEST( wall_flags_0(:,j,i), 12 )  &
    736                                           ), DIM = 1                           &
    737                                    ) - 1
     726                    k_topo = get_topography_top_index( j, i, 's' )
     727
    738728                    DO k = k_topo + 1, pct(j,i)
    739729                        ipcgb = ipcgb + 1
     
    813803                DO i = ijdb(1,ids), ijdb(2,ids)
    814804                    DO j = ijdb(3,ids), ijdb(4,ids)
    815                         k_topo =   MAXLOC( MERGE( 1, 0,                        &
    816                                              BTEST( wall_flags_0(:,j,i), 12 )  &
    817                                                 ), DIM = 1                     &
    818                                          ) - 1
    819                         k_topo2 =  MAXLOC( MERGE( 1, 0,                        &
    820                                              BTEST( wall_flags_0(:,j-jdir(ids),i-idir(ids)), 12 )  &
    821                                                 ), DIM = 1                     &
    822                                          ) - 1
     805                        k_topo  = get_topography_top_index( j, i, 's' )
     806                        k_topo2 = get_topography_top_index( j-jdir(ids), i-idir(ids), 's' )
     807
    823808                        DO k = MAX(k_topo,k_topo2)+1, nzut
    824809                            isurf = isurf + 1
     
    19291914            DO i = nxl, nxr
    19301915                DO j = nys, nyn
    1931                     k = MAXLOC(                                                &
    1932                                 MERGE( 1, 0,                                   &
    1933                                        BTEST( wall_flags_0(:,j,i), 12 )        &
    1934                                      ), DIM = 1                                &
    1935                               ) - 1
     1916                    k = get_topography_top_index( j, i, 's' )
    19361917
    19371918                    usm_lad(k:nzut, j, i) = lad_s(0:nzut-k, j, i)
     
    38063787!
    38073788!--             Following expression equals former kk = k - nzb_s_inner(j,i)
    3808                 kk = k - ( MAXLOC(                                             &
    3809                                 MERGE( 1, 0,                                   &
    3810                                        BTEST( wall_flags_0(:,j,i), 12 )        &
    3811                                      ), DIM = 1                                &
    3812                                ) - 1                                           &
    3813                          )  !- lad arrays are defined flat
     3789                kk = k - ( get_topography_top_index( j, i, 's' ) )  !- lad arrays are defined flat
    38143790                pc_heating_rate(kk, j, i) = (pcbinsw(ipcgb) + pcbinlw(ipcgb)) &
    38153791                    * pchf_prep(k) * pt(k, j, i) !-- = dT/dt
Note: See TracChangeset for help on using the changeset viewer.