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/plant_canopy_model_mod.f90

    r2274 r2317  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Get topography top index via Function call
    2323!
    2424! Former revisions:
     
    128128    USE indices,                                                               &
    129129        ONLY:  nbgp, nxl, nxlg, nxlu, nxr, nxrg, nyn, nyng, nys, nysg, nysv,   &
    130                nz, nzb, nzb_max, nzt, wall_flags_0
     130               nz, nzb, nzt
    131131
    132132    USE kinds
     133
     134    USE surface_mod,                                                           &
     135        ONLY:  get_topography_top_index
    133136
    134137
     
    10161019!
    10171020!--                Determine topography-top index on u-grid
    1018                    k_wall = MAXLOC(                                            &
    1019                           MERGE( 1, 0,                                         &
    1020                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 14 )    &
    1021                                ), DIM = 1                                      &
    1022                                   ) - 1
     1021                   k_wall = get_topography_top_index( j, i, 'u' )
    10231022                   DO  k = k_wall+1, k_wall+pch_index
    10241023
     
    10841083!
    10851084!--                Determine topography-top index on v-grid
    1086                    k_wall = MAXLOC(                                            &
    1087                           MERGE( 1, 0,                                         &
    1088                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 16 )    &
    1089                                ), DIM = 1                                      &
    1090                                   ) - 1
     1085                   k_wall = get_topography_top_index( j, i, 'v' )
     1086
    10911087                   DO  k = k_wall+1, k_wall+pch_index
    10921088
     
    11521148!
    11531149!--                Determine topography-top index on w-grid
    1154                    k_wall = MAXLOC(                                            &
    1155                           MERGE( 1, 0,                                         &
    1156                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 18 )    &
    1157                                ), DIM = 1                                      &
    1158                                   ) - 1
     1150                   k_wall = get_topography_top_index( j, i, 'w' )
     1151
    11591152                   DO  k = k_wall+1, k_wall+pch_index-1
    11601153
     
    12071200!
    12081201!--                Determine topography-top index on scalar-grid
    1209                    k_wall = MAXLOC(                                            &
    1210                           MERGE( 1, 0,                                         &
    1211                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 12 )    &
    1212                                ), DIM = 1                                      &
    1213                                   ) - 1
     1202                   k_wall = get_topography_top_index( j, i, 's' )
     1203
    12141204                   DO  k = k_wall+1, k_wall+pch_index
    12151205
     
    12271217!
    12281218!--                Determine topography-top index on scalar-grid
    1229                    k_wall = MAXLOC(                                            &
    1230                           MERGE( 1, 0,                                         &
    1231                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 12 )    &
    1232                                ), DIM = 1                                      &
    1233                                   ) - 1
     1219                   k_wall = get_topography_top_index( j, i, 's' )
     1220
    12341221                   DO  k = k_wall+1, k_wall+pch_index
    12351222
     
    12601247!
    12611248!--                Determine topography-top index on scalar-grid
    1262                    k_wall = MAXLOC(                                            &
    1263                           MERGE( 1, 0,                                         &
    1264                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 12 )    &
    1265                                ), DIM = 1                                      &
    1266                                   ) - 1
     1249                   k_wall = get_topography_top_index( j, i, 's' )
     1250
    12671251                   DO  k = k_wall+1, k_wall+pch_index
    12681252
     
    12921276!
    12931277!--                Determine topography-top index on scalar-grid
    1294                    k_wall = MAXLOC(                                            &
    1295                           MERGE( 1, 0,                                         &
    1296                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 12 )    &
    1297                                ), DIM = 1                                      &
    1298                                   ) - 1
     1278                   k_wall = get_topography_top_index( j, i, 's' )
     1279
    12991280                   DO  k = k_wall+1, k_wall+pch_index
    13001281
     
    13901371!
    13911372!--          Determine topography-top index on u-grid
    1392              k_wall = MAXLOC(                                                  &
    1393                           MERGE( 1, 0,                                         &
    1394                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 14 )    &
    1395                                ), DIM = 1                                      &
    1396                             ) - 1
     1373             k_wall = get_topography_top_index( j, i, 'u' )
     1374
    13971375             DO  k = k_wall+1, k_wall+pch_index
    13981376
     
    14531431!
    14541432!--          Determine topography-top index on v-grid
    1455              k_wall = MAXLOC(                                                  &
    1456                           MERGE( 1, 0,                                         &
    1457                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 16 )    &
    1458                                ), DIM = 1                                      &
    1459                             ) - 1
     1433             k_wall = get_topography_top_index( j, i, 'v' )
     1434
    14601435             DO  k = k_wall+1, k_wall+pch_index
    14611436
     
    15161491!
    15171492!--          Determine topography-top index on w-grid
    1518              k_wall = MAXLOC(                                                  &
    1519                           MERGE( 1, 0,                                         &
    1520                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 18 )    &
    1521                                ), DIM = 1                                      &
    1522                             ) - 1
     1493             k_wall = get_topography_top_index( j, i, 'w' )
     1494
    15231495             DO  k = k_wall+1, k_wall+pch_index-1
    15241496
     
    15661538!
    15671539!--          Determine topography-top index on scalar grid
    1568              k_wall = MAXLOC(                                                  &
    1569                           MERGE( 1, 0,                                         &
    1570                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 12 )    &
    1571                                ), DIM = 1                                      &
    1572                             ) - 1
     1540             k_wall = get_topography_top_index( j, i, 's' )
     1541
    15731542             DO  k = k_wall+1, k_wall+pch_index
    15741543                kk = k - k_wall  !- lad arrays are defined flat
     
    15821551!
    15831552!--          Determine topography-top index on scalar grid
    1584              k_wall = MAXLOC(                                                  &
    1585                           MERGE( 1, 0,                                         &
    1586                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 12 )    &
    1587                                ), DIM = 1                                      &
    1588                             ) - 1
     1553             k_wall = get_topography_top_index( j, i, 's' )
     1554
    15891555             DO  k = k_wall+1, k_wall+pch_index
    15901556
     
    16111577!
    16121578!--          Determine topography-top index on scalar grid
    1613              k_wall = MAXLOC(                                                  &
    1614                           MERGE( 1, 0,                                         &
    1615                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 12 )    &
    1616                                ), DIM = 1                                      &
    1617                             ) - 1
     1579             k_wall = get_topography_top_index( j, i, 's' )
     1580
    16181581             DO  k = k_wall+1, k_wall+pch_index
    16191582
     
    16401603!
    16411604!--          Determine topography-top index on scalar grid
    1642              k_wall = MAXLOC(                                                  &
    1643                           MERGE( 1, 0,                                         &
    1644                                  BTEST( wall_flags_0(nzb:nzb_max,j,i), 12 )    &
    1645                                ), DIM = 1                                      &
    1646                             ) - 1
     1605             k_wall = get_topography_top_index( j, i, 's' )
     1606
    16471607             DO  k = k_wall+1, k_wall+pch_index
    16481608
Note: See TracChangeset for help on using the changeset viewer.