Ignore:
Timestamp:
Aug 16, 2019 1:50:17 PM (2 years ago)
Author:
suehring
Message:

Replace get_topography_top_index functions by pre-calculated arrays in order to save computational resources

File:
1 edited

Legend:

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

    r4127 r4168  
    2727! -----------------
    2828! $Id$
     29! Replace function get_topography_top_index by topo_top_ind
     30!
     31! 4127 2019-07-30 14:47:10Z suehring
    2932! Output of 3D plant canopy variables changed. It is now relative to the local
    3033! terrain rather than located at the acutal vertical level in the model. This
     
    269272    USE indices,                                                               &
    270273        ONLY:  nbgp, nxl, nxlg, nxlu, nxr, nxrg, nyn, nyng, nys, nysg, nysv,   &
    271                nz, nzb, nzt
     274               nz, nzb, nzt, topo_top_ind
    272275
    273276    USE kinds
    274277
    275278    USE pegrid
    276 
    277     USE surface_mod,                                                           &
    278         ONLY:  get_topography_top_index_ji
    279279
    280280
     
    12921292!--          Check whether topography and local vegetation on top exceed
    12931293!--          height of the model domain.
    1294              k = get_topography_top_index_ji( j, i, 's' )
     1294             k = topo_top_ind(j,i,0)
    12951295             IF ( k + pch_index_ji(j,i) >= nzt + 1 )  THEN
    12961296                message_string =  'Local vegetation height on top of ' //      &
     
    15911591                   CALL message( 'pcm_read_plant_canopy_3d', 'PA0349', 1, 2, 0, 6, 0 )
    15921592                ENDIF
    1593                 kk = get_topography_top_index_ji( j, i, 's' )
     1593                kk = topo_top_ind(j,i,0)
    15941594                lad_s(nzb:nzpltop-kk, j, i) = col(kk:nzpl-1)*lad_type_coef(pctype)
    15951595             CASE DEFAULT
     
    16771677!
    16781678!--                Determine topography-top index on u-grid
    1679                    k_wall = get_topography_top_index_ji( j, i, 'u' )
     1679                   k_wall = topo_top_ind(j,i,1)
    16801680                   DO  k = k_wall+1, k_wall + pch_index_ji(j,i)
    16811681
     
    17411741!
    17421742!--                Determine topography-top index on v-grid
    1743                    k_wall = get_topography_top_index_ji( j, i, 'v' )
     1743                   k_wall = topo_top_ind(j,i,2)
    17441744
    17451745                   DO  k = k_wall+1, k_wall + pch_index_ji(j,i)
     
    18061806!
    18071807!--                Determine topography-top index on w-grid
    1808                    k_wall = get_topography_top_index_ji( j, i, 'w' )
     1808                   k_wall = topo_top_ind(j,i,3)
    18091809
    18101810                   DO  k = k_wall+1, k_wall + pch_index_ji(j,i) - 1
     
    18581858                   DO  j = nys, nyn
    18591859!--                   Determine topography-top index on scalar-grid
    1860                       k_wall = get_topography_top_index_ji( j, i, 's' )
     1860                      k_wall = topo_top_ind(j,i,0)
    18611861                      DO  k = k_wall+1, k_wall + pch_index_ji(j,i)
    18621862                         kk = k - k_wall   !- lad arrays are defined flat
     
    18691869                   DO  j = nys, nyn
    18701870!--                   Determine topography-top index on scalar-grid
    1871                       k_wall = get_topography_top_index_ji( j, i, 's' )
     1871                      k_wall = topo_top_ind(j,i,0)
    18721872                      DO  k = k_wall+1, k_wall + pch_index_ji(j,i)
    18731873                         kk = k - k_wall   !- lad arrays are defined flat
     
    18851885!
    18861886!--                Determine topography-top index on scalar-grid
    1887                    k_wall = get_topography_top_index_ji( j, i, 's' )
     1887                   k_wall = topo_top_ind(j,i,0)
    18881888
    18891889                   DO  k = k_wall+1, k_wall + pch_index_ji(j,i)
     
    19231923!
    19241924!--                Determine topography-top index on scalar-grid
    1925                    k_wall = get_topography_top_index_ji( j, i, 's' )
     1925                   k_wall = topo_top_ind(j,i,0)
    19261926
    19271927                   DO  k = k_wall+1, k_wall + pch_index_ji(j,i)
     
    19521952!
    19531953!--                Determine topography-top index on scalar-grid
    1954                    k_wall = get_topography_top_index_ji( j, i, 's' )
     1954                   k_wall = topo_top_ind(j,i,0)
    19551955
    19561956                   DO  k = k_wall+1, k_wall + pch_index_ji(j,i)
     
    20462046!
    20472047!--          Determine topography-top index on u-grid
    2048              k_wall = get_topography_top_index_ji( j, i, 'u' )
     2048             k_wall = topo_top_ind(j,i,1)
    20492049             DO  k = k_wall + 1, k_wall + pch_index_ji(j,i)
    20502050
     
    21062106!
    21072107!--          Determine topography-top index on v-grid
    2108              k_wall = get_topography_top_index_ji( j, i, 'v' )
     2108             k_wall = topo_top_ind(j,i,2)
    21092109
    21102110             DO  k = k_wall + 1, k_wall + pch_index_ji(j,i)
     
    21662166!
    21672167!--          Determine topography-top index on w-grid
    2168              k_wall = get_topography_top_index_ji( j, i, 'w' )
     2168             k_wall = topo_top_ind(j,i,3)
    21692169
    21702170             DO  k = k_wall + 1, k_wall + pch_index_ji(j,i) - 1
     
    22132213!
    22142214!--          Determine topography-top index on scalar grid
    2215              k_wall = get_topography_top_index_ji( j, i, 's' )
     2215             k_wall = topo_top_ind(j,i,0)
    22162216
    22172217             IF ( humidity ) THEN
     
    22332233!
    22342234!--          Determine topography-top index on scalar grid
    2235              k_wall = get_topography_top_index_ji( j, i, 's' )
     2235             k_wall = topo_top_ind(j,i,0)
    22362236
    22372237             DO  k = k_wall + 1, k_wall + pch_index_ji(j,i)
     
    22662266!
    22672267!--          Determine topography-top index on scalar grid
    2268              k_wall = get_topography_top_index_ji( j, i, 's' )
     2268             k_wall = topo_top_ind(j,i,0)
    22692269
    22702270             DO  k = k_wall + 1, k_wall + pch_index_ji(j,i)
     
    22922292!
    22932293!--          Determine topography-top index on scalar grid
    2294              k_wall = get_topography_top_index_ji( j, i, 's' )
     2294             k_wall = topo_top_ind(j,i,0)
    22952295
    22962296             DO  k = k_wall + 1, k_wall + pch_index_ji(j,i)
Note: See TracChangeset for help on using the changeset viewer.