Ignore:
Timestamp:
Dec 7, 2018 6:20:37 PM (3 years ago)
Author:
eckhard
Message:

inifor: Average initial profiles over the PALM, not the geostrophic, region

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/UTIL/inifor/src/inifor_transform.f90

    r3557 r3613  
    2626! -----------------
    2727! $Id$
     28! Use averaged heights profile for level-based averaging instead of modified
     29!    COSMO heights array
     30!
     31!
     32! 3557 2018-11-22 16:01:22Z eckhard
    2833! Updated documentation
    2934!
     
    898903!> iii(:) and jjj(:).
    899904!------------------------------------------------------------------------------!
    900     SUBROUTINE find_vertical_neighbours_and_weights_average( avg_grid )
    901        TYPE(grid_definition), INTENT(INOUT) ::  avg_grid
    902 
    903        INTEGER  ::  i, j, k_palm, k_intermediate, l, nlev
    904        LOGICAL  ::  point_is_below_grid, point_is_above_grid,                  &
    905                     point_is_in_current_cell
    906        REAL(dp) ::  current_height, column_base, column_top, h_top, h_bottom,  &
    907                     weight
     905    SUBROUTINE find_vertical_neighbours_and_weights_average(                   &
     906       avg_grid, level_based_averaging                                         &
     907    )
     908
     909       TYPE(grid_definition), INTENT(INOUT), TARGET ::  avg_grid
     910       LOGICAL                                      ::  level_based_averaging
     911
     912       INTEGER           ::  i, j, k_palm, k_intermediate, l, nlev
     913       LOGICAL           ::  point_is_below_grid, point_is_above_grid,         &
     914                             point_is_in_current_cell
     915       REAL(dp)          ::  current_height, column_base, column_top, h_top,   &
     916                             h_bottom, weight
     917       REAL(dp), POINTER ::  cosmo_h(:,:,:)
    908918
    909919
     
    911921
    912922       nlev = SIZE(avg_grid % cosmo_h, 3)
     923
     924       IF (level_based_averaging)  THEN
     925          cosmo_h => avg_grid % h
     926       ELSE
     927          cosmo_h => avg_grid % cosmo_h
     928       END IF
    913929
    914930!
     
    916932       DO l = 1, avg_grid % n_columns
    917933
    918           i = avg_grid % iii(l)
    919           j = avg_grid % jjj(l)
    920 
    921           column_base = avg_grid % cosmo_h(i,j,1)
    922           column_top  = avg_grid % cosmo_h(i,j,nlev)
     934          IF (level_based_averaging)  THEN
     935             i = 1
     936             j = 1
     937          ELSE
     938             i = avg_grid % iii(l)
     939             j = avg_grid % jjj(l)
     940          END IF
     941
     942          column_base = cosmo_h(i,j,1)
     943          column_top  = cosmo_h(i,j,nlev)
    923944
    924945!
     
    934955!--          current height within it
    935956             current_height = avg_grid % z(k_palm) + avg_grid % z0
    936              h_top    = avg_grid % cosmo_h(i,j,k_intermediate+1)
    937              h_bottom = avg_grid % cosmo_h(i,j,k_intermediate)
     957             h_top    = cosmo_h(i,j,k_intermediate+1)
     958             h_bottom = cosmo_h(i,j,k_intermediate)
    938959
    939960!
     
    972993                   k_intermediate = k_intermediate + 1
    973994
    974                    h_top    = avg_grid % cosmo_h(i,j,k_intermediate+1)
    975                    h_bottom = avg_grid % cosmo_h(i,j,k_intermediate)
     995                   h_top    = cosmo_h(i,j,k_intermediate+1)
     996                   h_bottom = cosmo_h(i,j,k_intermediate)
    976997                   point_is_in_current_cell = (                                &
    977998                      current_height >= h_bottom .AND.                         &
Note: See TracChangeset for help on using the changeset viewer.