Changeset 3776


Ignore:
Timestamp:
Mar 4, 2019 1:06:12 PM (6 years ago)
Author:
gronemeier
Message:

write out preprocessor directives; remove tailing whitespaces

File:
1 edited

Legend:

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

    r3775 r3776  
    2525! -----------------
    2626! $Id$
     27! write out preprocessor directives; remove tailing whitespaces
     28!
     29! 3775 2019-03-04 12:40:20Z gronemeier
    2730! removed unused variables
    28 ! 
     31!
    2932! 3724 2019-02-06 16:28:23Z kanani
    3033! Correct double-used log_point_s units
    31 ! 
     34!
    3235! 3719 2019-02-06 13:10:18Z kanani
    33 ! Changed log_point to log_point_s, otherwise this overlaps with 
     36! Changed log_point to log_point_s, otherwise this overlaps with
    3437! 'all progn.equations' cpu measurement.
    35 ! 
     38!
    3639! 3684 2019-01-20 20:20:58Z knoop
    3740! Remove unused variable simulated_time
    38 ! 
     41!
    3942! 3636 2018-12-19 13:48:34Z raasch
    4043! nopointer option removed
    41 ! 
     44!
    4245! 3634 2018-12-18 12:31:28Z knoop
    4346! OpenACC port for SPEC
    44 ! 
     47!
    4548! 3550 2018-11-21 16:01:01Z gronemeier
    4649! - calculate diss production same in vector and cache optimization
    4750! - move boundary condition for e and diss to boundary_conds
    48 ! 
     51!
    4952! 3545 2018-11-21 11:19:41Z gronemeier
    5053! - Set rans_mode according to value of turbulence_closure
    5154! - removed debug output
    52 ! 
     55!
    5356! 3430 2018-10-25 13:36:23Z maronga
    5457! Added support for buildings in the dynamic SGS model
    55 ! 
     58!
    5659! 3398 2018-10-22 19:30:24Z knoop
    5760! Refactored production_e and production_e_ij (removed code redundancy)
    58 ! 
     61!
    5962! 3386 2018-10-19 16:28:22Z gronemeier
    6063! Renamed tcm_prognostic to tcm_prognostic_equations
    61 ! 
     64!
    6265! 3385 2018-10-19 14:52:29Z knoop
    6366! Restructured loops and ifs in production_e to ease vectorization on GPUs
    64 ! 
     67!
    6568! 3300 2018-10-02 14:16:54Z gronemeier
    6669! - removed global array wall_flags_0_global, hence reduced accuracy of l_wall
     
    6871! - removed maxloc call as this produced different results for different
    6972!   compiler options
    70 ! 
     73!
    7174! 3294 2018-10-01 02:37:10Z raasch
    7275! changes concerning modularization of ocean option
    73 ! 
     76!
    7477! 3274 2018-09-24 15:42:55Z knoop
    7578! Modularization of all bulk cloud physics code components
    76 ! 
     79!
    7780! 3245 2018-09-13 14:08:16Z knoop
    7881! unused variables removed, shortest_distance has wp now
    79 ! 
     82!
    8083! 3183 2018-07-27 14:25:55Z suehring
    8184! Rename variables and remove unused variable from USE statement
    82 ! 
     85!
    8386! 3182 2018-07-27 13:36:03Z suehring
    8487! Use MOST for km only in RANS mode
    85 ! 
     88!
    8689! 3130 2018-07-16 11:08:55Z gronemeier
    8790! - move boundary condition of km and kh to tcm_diffusivities
    8891! - calculate km at boundaries according to MOST
    8992! - move phi_m to surface_layer_fluxes_mod
    90 ! 
     93!
    9194! 3129 2018-07-16 07:45:13Z gronemeier
    9295! - move limitation of diss to boundary_conds
     
    9699! - resort output after case select -> reduced code duplication
    97100! - when using rans_tke_e and 1d-model, do not use e1d, km1d and diss1d
    98 ! 
     101!
    99102! 3121 2018-07-11 18:46:49Z gronemeier
    100103! - created the function phi_m
    101104! - implemented km = u* * kappa * zp / phi_m in production_e_init for all
    102105!   surfaces
    103 ! 
     106!
    104107! 3120 2018-07-11 18:30:57Z gronemeier
    105108! - changed tcm_diffusivities to tcm_diffusivities_default
    106109! - created subroutine tcm_diffusivities that calls tcm_diffusivities_default
    107110!   and tcm_diffusivities_dynamic
    108 ! 
     111!
    109112! 3086 2018-06-25 09:08:04Z gronemeier
    110113! bugfix: set rans_const_sigma(1) = 1.3
    111 ! 
     114!
    112115! 3083 2018-06-19 14:03:12Z gronemeier
    113116! - set limits of diss at the end of prognostic equations
     
    130133!    - calculate km based on l_wall
    131134!    - initialize diss if 1D model is not used
    132 ! 
     135!
    133136! 3045 2018-05-28 07:55:41Z Giersch
    134137! Error message revised
    135 ! 
     138!
    136139! 3014 2018-05-09 08:42:38Z maronga
    137140! Bugfix: nzb_do and nzt_do were not used for 3d data output
    138 ! 
     141!
    139142! 3004 2018-04-27 12:33:25Z Giersch
    140143! Further allocation checks implemented
    141 ! 
     144!
    142145! 2938 2018-03-27 15:52:42Z suehring
    143146! Further todo's
    144 ! 
     147!
    145148! 2936 2018-03-27 14:49:27Z gronemeier
    146149! - defined l_grid only within this module
     
    153156! - Moved init_mixing_length from init_grid.f90 and
    154157!   renamed it to tcm_init_mixing_length
    155 ! 
     158!
    156159! 2764 2018-01-22 09:25:36Z gronemeier
    157160! Bugfix: remove duplicate SAVE statements
    158 ! 
     161!
    159162! 2746 2018-01-15 12:06:04Z suehring
    160163! Move flag plant canopy to modules
    161 ! 
     164!
    162165! 2718 2018-01-02 08:49:38Z maronga
    163166! Corrected "Former revisions" section
    164 ! 
     167!
    165168! 2701 2017-12-15 15:40:50Z suehring
    166169! Changes from last commit documented
    167 ! 
     170!
    168171! 2698 2017-12-14 18:46:24Z suehring
    169172! Bugfix in get_topography_top_index
     
    172175! Initial revision
    173176!
    174 ! 
    175 ! 
     177!
     178!
    176179!
    177180! Authors:
     
    191194!------------------------------------------------------------------------------!
    192195 MODULE turbulence_closure_mod
    193  
     196
    194197
    195198    USE arrays_3d,                                                             &
     
    264267    REAL(wp), DIMENSION(:), ALLOCATABLE ::  l_black    !< mixing length according to Blackadar
    265268
    266     REAL(wp), DIMENSION(:), ALLOCATABLE ::  l_grid     !< geometric mean of grid sizes dx, dy, dz 
     269    REAL(wp), DIMENSION(:), ALLOCATABLE ::  l_grid     !< geometric mean of grid sizes dx, dy, dz
    267270
    268271    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  l_wall !< near-wall mixing length
     
    309312
    310313!
    311 !-- Initialization actions 
     314!-- Initialization actions
    312315    INTERFACE tcm_init
    313316       MODULE PROCEDURE tcm_init
     
    476479       c_0 = 0.1_wp    !according to Lilly (1967) and Deardorff (1980)
    477480
    478        dsig_e = 1.0_wp !assure to use K_m to calculate TKE instead 
     481       dsig_e = 1.0_wp !assure to use K_m to calculate TKE instead
    479482                       !of K_e which is used in RANS mode
    480483
     
    489492!------------------------------------------------------------------------------!
    490493 SUBROUTINE tcm_check_data_output( var, unit )
    491  
     494
    492495    IMPLICIT NONE
    493496
     
    519522!------------------------------------------------------------------------------!
    520523 SUBROUTINE tcm_define_netcdf_grid( var, found, grid_x, grid_y, grid_z )
    521    
     524
    522525    IMPLICIT NONE
    523526
     
    567570!------------------------------------------------------------------------------!
    568571 SUBROUTINE tcm_3d_data_averaging( mode, variable )
    569  
     572
    570573
    571574    USE averaging,                                                             &
     
    616619
    617620          CASE ( 'diss' )
    618              IF ( ALLOCATED( diss_av ) ) THEN             
     621             IF ( ALLOCATED( diss_av ) ) THEN
    619622                DO  i = nxlg, nxrg
    620623                   DO  j = nysg, nyng
     
    662665                   DO  j = nysg, nyng
    663666                      DO  k = nzb, nzt+1
    664                          diss_av(k,j,i) = diss_av(k,j,i)                       & 
     667                         diss_av(k,j,i) = diss_av(k,j,i)                       &
    665668                                        / REAL( average_count_3d, KIND=wp )
    666669                      ENDDO
     
    674677                   DO  j = nysg, nyng
    675678                      DO  k = nzb, nzt+1
    676                          kh_av(k,j,i) = kh_av(k,j,i)                           & 
     679                         kh_av(k,j,i) = kh_av(k,j,i)                           &
    677680                                        / REAL( average_count_3d, KIND=wp )
    678681                      ENDDO
     
    686689                   DO  j = nysg, nyng
    687690                      DO  k = nzb, nzt+1
    688                          km_av(k,j,i) = km_av(k,j,i)                           & 
     691                         km_av(k,j,i) = km_av(k,j,i)                           &
    689692                                        / REAL( average_count_3d, KIND=wp )
    690693                      ENDDO
     
    707710 SUBROUTINE tcm_data_output_2d( av, variable, found, grid, mode, local_pf,     &
    708711                                nzb_do, nzt_do )
    709  
     712
    710713    USE averaging,                                                             &
    711714        ONLY:  diss_av, kh_av, km_av
     
    734737
    735738    REAL(wp), DIMENSION(:,:,:), POINTER ::  to_be_resorted  !< points to selected output variable
    736    
     739
    737740    found = .TRUE.
    738741    resorted = .FALSE.
     
    791794                local_pf(i,j,k) = MERGE( to_be_resorted(k,j,i),                &
    792795                                         REAL( fill_value, KIND = wp ),        &
    793                                          BTEST( wall_flags_0(k,j,i), flag_nr ) ) 
     796                                         BTEST( wall_flags_0(k,j,i), flag_nr ) )
    794797             ENDDO
    795798          ENDDO
    796799       ENDDO
    797800    ENDIF
    798  
     801
    799802 END SUBROUTINE tcm_data_output_2d
    800803
    801  
     804
    802805!------------------------------------------------------------------------------!
    803806! Description:
     
    806809!------------------------------------------------------------------------------!
    807810 SUBROUTINE tcm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
    808  
     811
    809812
    810813    USE averaging,                                                             &
     
    873876             to_be_resorted => km_av
    874877          ENDIF
    875          
     878
    876879       CASE DEFAULT
    877880          found = .FALSE.
     
    923926
    924927!
    925 !-- Allocate arrays required for dissipation. 
     928!-- Allocate arrays required for dissipation.
    926929!-- Please note, if it is a nested run, arrays need to be allocated even if
    927 !-- they do not necessarily need to be transferred, which is attributed to 
    928 !-- the design of the model coupler which allocates memory for each variable. 
     930!-- they do not necessarily need to be transferred, which is attributed to
     931!-- the design of the model coupler which allocates memory for each variable.
    929932    IF ( rans_mode  .OR.  use_sgs_for_particles  .OR.  wang_kernel  .OR.       &
    930933         collision_turbulence  .OR.  nested_run )  THEN
     
    10251028             ELSE
    10261029                IF ( .NOT. ocean_mode )  THEN
    1027                    kh   = 0.01_wp   ! there must exist an initial diffusion, because 
     1030                   kh   = 0.01_wp   ! there must exist an initial diffusion, because
    10281031                   km   = 0.01_wp   ! otherwise no TKE would be produced by the
    10291032                                    ! production terms, as long as not yet
     
    10691072          ELSE
    10701073             IF ( .NOT. ocean_mode )  THEN
    1071                 kh   = 0.01_wp   ! there must exist an initial diffusion, because 
     1074                kh   = 0.01_wp   ! there must exist an initial diffusion, because
    10721075                km   = 0.01_wp   ! otherwise no TKE would be produced by the
    10731076                                 ! production terms, as long as not yet
     
    11121115!
    11131116!--    In case of complex terrain and cyclic fill method as initialization,
    1114 !--    shift initial data in the vertical direction for each point in the 
     1117!--    shift initial data in the vertical direction for each point in the
    11151118!--    x-y-plane depending on local surface height
    11161119       IF ( complex_terrain  .AND.                                             &
     
    11421145          mean_inflow_profiles(:,5) = hom_sum(:,8,0)   ! e
    11431146!
    1144 !--       In case of complex terrain, determine vertical displacement at inflow 
     1147!--       In case of complex terrain, determine vertical displacement at inflow
    11451148!--       boundary and adjust mean inflow profiles
    11461149          IF ( complex_terrain )  THEN
     
    13441347                                           SQRT( 0.25_wp * dy**2 +             &
    13451348                                          ( zw(k) - zu(k) )**2 ) )
    1346 !   
     1349!
    13471350!--                 xz-distance (vertical edges, down)
    13481351                    IF ( .NOT. BTEST( wall_flags_0(k-1,j,i-1), 0 )  .OR.       &
     
    13841387                                           SQRT( 0.25_wp * ( dx**2 + dy**2 )   &
    13851388                                                 +  ( zw(k) - zu(k) )**2  ) )
    1386                      
     1389
    13871390                ENDIF
    13881391             ENDDO
     
    14261429!
    14271430!--    Limit mixing length to either nearest wall or Blackadar mixing length.
    1428 !--    For that, analyze each grid point (i/j/k) ("analysed grid point") and 
     1431!--    For that, analyze each grid point (i/j/k) ("analysed grid point") and
    14291432!--    search within its vicinity for the shortest distance to a wall by cal-
    14301433!--    culating the distance between the analysed grid point and the "viewed
     
    14591462!
    14601463!--       When analysed grid point lies above maximum topography, set search
    1461 !--       radius to 0 if the distance between the analysed grid point and max 
     1464!--       radius to 0 if the distance between the analysed grid point and max
    14621465!--       topography height is larger than the maximum search radius
    14631466          IF ( zu(k-rad_k_b) > zu(k_max_topo) )  rad_k_b = 0
     
    16281631! Description:
    16291632! ------------
    1630 !> Calculate the shortest distance between position (i/j/k)=(0/0/0) and 
     1633!> Calculate the shortest distance between position (i/j/k)=(0/0/0) and
    16311634!> (pos_i/jj/kk), where (jj/kk) is the position of the maximum of 'array'
    16321635!> closest to the origin (0/0) of 'array'.
     
    16941697          ENDDO
    16951698       ENDIF
    1696        
     1699
    16971700    END FUNCTION
    16981701
     
    17001703! Description:
    17011704! ------------
    1702 !> Copy a subarray of size (kb:kt,js:jn,il:ir) centered around grid point 
     1705!> Copy a subarray of size (kb:kt,js:jn,il:ir) centered around grid point
    17031706!> (kp,jp,ip) containing the first bit of wall_flags_0 into the array
    17041707!> 'vicinity'. Only copy first bit as this indicates the presence of topography.
     
    17531756
    17541757    USE surface_mod,                                                           &
    1755         ONLY :  surf_def_h, surf_lsm_h, surf_usm_h 
     1758        ONLY :  surf_def_h, surf_lsm_h, surf_usm_h
    17561759
    17571760    IMPLICIT NONE
     
    17611764    INTEGER(iwp) ::  k      !< grid index z-direction
    17621765    INTEGER(iwp) ::  m      !< running index surface elements
    1763    
     1766
    17641767    REAL(wp) ::  km_sfc     !< diffusion coefficient, used to compute virtual velocities
    17651768
     
    17801783       DO  m = 1, surf_def_h(0)%ns
    17811784
    1782           i = surf_def_h(0)%i(m)           
     1785          i = surf_def_h(0)%i(m)
    17831786          j = surf_def_h(0)%j(m)
    17841787          k = surf_def_h(0)%k(m)
    17851788!
    1786 !--       Note, calculation of u_0 and v_0 is not fully accurate, as u/v 
    1787 !--       and km are not on the same grid. Actually, a further 
     1789!--       Note, calculation of u_0 and v_0 is not fully accurate, as u/v
     1790!--       and km are not on the same grid. Actually, a further
    17881791!--       interpolation of km onto the u/v-grid is necessary. However, the
    17891792!--       effect of this error is negligible.
     
    17981801                                     drho_air_zw(k-1)               *          &
    17991802                                     ( zu(k+1) - zu(k-1)    )       /          &
    1800                                      ( km_sfc  + 1.0E-20_wp )   
     1803                                     ( km_sfc  + 1.0E-20_wp )
    18011804
    18021805          IF ( ABS( u(k+1,j,i) - surf_def_h(0)%u_0(m) )  >                     &
     
    18161819       DO  m = 1, surf_def_h(1)%ns
    18171820
    1818           i = surf_def_h(1)%i(m)           
     1821          i = surf_def_h(1)%i(m)
    18191822          j = surf_def_h(1)%j(m)
    18201823          k = surf_def_h(1)%k(m)
    18211824!
    1822 !--       Note, calculation of u_0 and v_0 is not fully accurate, as u/v 
    1823 !--       and km are not on the same grid. Actually, a further 
     1825!--       Note, calculation of u_0 and v_0 is not fully accurate, as u/v
     1826!--       and km are not on the same grid. Actually, a further
    18241827!--       interpolation of km onto the u/v-grid is necessary. However, the
    18251828!--       effect of this error is negligible.
     
    18271830                                     drho_air_zw(k-1) *                        &
    18281831                                     ( zu(k+1)    - zu(k-1)    )  /            &
    1829                                      ( km(k,j,i)  + 1.0E-20_wp ) 
     1832                                     ( km(k,j,i)  + 1.0E-20_wp )
    18301833          surf_def_h(1)%v_0(m) = v(k-1,j,i) - surf_def_h(1)%vsws(m) *          &
    18311834                                     drho_air_zw(k-1) *                        &
    18321835                                     ( zu(k+1)    - zu(k-1)    )  /            &
    1833                                      ( km(k,j,i)  + 1.0E-20_wp ) 
     1836                                     ( km(k,j,i)  + 1.0E-20_wp )
    18341837
    18351838          IF ( ABS( surf_def_h(1)%u_0(m) - u(k-1,j,i) )  >                     &
     
    18531856          k = surf_lsm_h%k(m)
    18541857!
    1855 !--       Note, calculation of u_0 and v_0 is not fully accurate, as u/v 
    1856 !--       and km are not on the same grid. Actually, a further 
     1858!--       Note, calculation of u_0 and v_0 is not fully accurate, as u/v
     1859!--       and km are not on the same grid. Actually, a further
    18571860!--       interpolation of km onto the u/v-grid is necessary. However, the
    18581861!--       effect of this error is negligible.
     
    18631866                                        drho_air_zw(k-1)         *             &
    18641867                                        ( zu(k+1) - zu(k-1)    ) /             &
    1865                                         ( km_sfc  + 1.0E-20_wp ) 
     1868                                        ( km_sfc  + 1.0E-20_wp )
    18661869          surf_lsm_h%v_0(m) = v(k+1,j,i) + surf_lsm_h%vsws(m)    *             &
    18671870                                        drho_air_zw(k-1)         *             &
     
    18891892          k = surf_usm_h%k(m)
    18901893!
    1891 !--       Note, calculation of u_0 and v_0 is not fully accurate, as u/v 
    1892 !--       and km are not on the same grid. Actually, a further 
     1894!--       Note, calculation of u_0 and v_0 is not fully accurate, as u/v
     1895!--       and km are not on the same grid. Actually, a further
    18931896!--       interpolation of km onto the u/v-grid is necessary. However, the
    18941897!--       effect of this error is negligible.
     
    23652368    REAL(wp)     ::  theta       !< virtual potential temperature
    23662369    REAL(wp)     ::  temp        !< theta * Exner-function
    2367     REAL(wp)     ::  sign_dir    !< sign of wall-tke flux, depending on wall orientation 
     2370    REAL(wp)     ::  sign_dir    !< sign of wall-tke flux, depending on wall orientation
    23682371    REAL(wp)     ::  usvs        !< momentum flux u"v"
    23692372    REAL(wp)     ::  vsus        !< momentum flux v"u"
     
    36693672 SUBROUTINE diffusion_e( var, var_reference )
    36703673
    3671 #ifdef _OPENACC
     3674#if defined( _OPENACC )
    36723675    USE arrays_3d,                                                             &
    36733676        ONLY:  ddzu, dd2zu, ddzw, drho_air, rho_air_zw
     
    37033706    REAL(wp)     ::  ll             !< adjusted l
    37043707    REAL(wp)     ::  var_reference  !< reference temperature
    3705 #ifdef _OPENACC
     3708#if defined( _OPENACC )
    37063709!
    37073710!-- From mixing_length_les:
     
    37423745             IF ( les_dynamic .OR. les_mw )  THEN
    37433746
    3744 #ifdef _OPENACC
     3747#if defined( _OPENACC )
    37453748!
    37463749!--             Cannot call subroutine mixing_length_les because after adding all required
     
    37773780             ELSEIF ( rans_tke_l )  THEN
    37783781
    3779 #ifdef _OPENACC
     3782#if defined( _OPENACC )
    37803783!
    37813784!--             Same reason as above...
     
    38573860!--    Upward facing surfaces
    38583861       DO  m = 1, bc_h(0)%ns
    3859           i = bc_h(0)%i(m)           
     3862          i = bc_h(0)%i(m)
    38603863          j = bc_h(0)%j(m)
    38613864          k = bc_h(0)%k(m)
     
    38653868!--    Downward facing surfaces
    38663869       DO  m = 1, bc_h(1)%ns
    3867           i = bc_h(1)%i(m)           
     3870          i = bc_h(1)%i(m)
    38683871          j = bc_h(1)%j(m)
    38693872          k = bc_h(1)%k(m)
     
    38893892    USE grid_variables,                                                        &
    38903893        ONLY:  ddx2, ddy2
    3891        
     3894
    38923895    USE bulk_cloud_model_mod,                                                  &
    38933896        ONLY:  collision_turbulence
     
    39843987!--    For each surface type determine start and end index (in case of elevated
    39853988!--    topography several up/downward facing surfaces may exist.
    3986        surf_s = bc_h(0)%start_index(j,i)   
    3987        surf_e = bc_h(0)%end_index(j,i)   
     3989       surf_s = bc_h(0)%start_index(j,i)
     3990       surf_e = bc_h(0)%end_index(j,i)
    39883991       DO  m = surf_s, surf_e
    39893992          k             = bc_h(0)%k(m)
     
    39923995!
    39933996!--    Downward facing surfaces
    3994        surf_s = bc_h(1)%start_index(j,i)   
    3995        surf_e = bc_h(1)%end_index(j,i)   
     3997       surf_s = bc_h(1)%start_index(j,i)
     3998       surf_e = bc_h(1)%end_index(j,i)
    39963999       DO  m = surf_s, surf_e
    39974000          k             = bc_h(1)%k(m)
     
    42984301          kh(k,j,i) = 1.35_wp * km(k,j,i)
    42994302       ENDDO
    4300 !     
     4303!
    43014304!--    Natural surfaces
    43024305       !$OMP PARALLEL DO PRIVATE(i,j,k,m)
     
    43094312          kh(k,j,i) = 1.35_wp * km(k,j,i)
    43104313       ENDDO
    4311 !     
     4314!
    43124315!--    Urban surfaces
    43134316       !$OMP PARALLEL DO PRIVATE(i,j,k,m)
     
    43204323          kh(k,j,i) = 1.35_wp * km(k,j,i)
    43214324       ENDDO
    4322        
    4323 !     
     4325
     4326!
    43244327!--    North-, south-, west and eastward facing surfaces
    43254328!--    Do not consider stratification at these surfaces.
    43264329       DO  n = 0, 3
    4327 !     
     4330!
    43284331!--       Default surfaces
    43294332          !$OMP PARALLEL DO PRIVATE(i,j,k,m)
     
    43354338             kh(k,j,i) = 1.35_wp * km(k,j,i)
    43364339          ENDDO
    4337 !     
     4340!
    43384341!--       Natural surfaces
    43394342          !$OMP PARALLEL DO PRIVATE(i,j,k,m)
     
    43454348             kh(k,j,i) = 1.35_wp * km(k,j,i)
    43464349          ENDDO
    4347 !     
     4350!
    43484351!--       Urban surfaces
    43494352          !$OMP PARALLEL DO PRIVATE(i,j,k,m)
     
    43564359          ENDDO
    43574360       ENDDO
    4358        
     4361
    43594362       CALL exchange_horiz( km, nbgp )
    43604363       CALL exchange_horiz( kh, nbgp )
     
    44244427! Description:
    44254428! ------------
    4426 !> Computation of the turbulent diffusion coefficients for momentum and heat 
     4429!> Computation of the turbulent diffusion coefficients for momentum and heat
    44274430!> according to Prandtl-Kolmogorov.
    44284431!------------------------------------------------------------------------------!
    44294432 SUBROUTINE tcm_diffusivities_default( var, var_reference )
    4430  
    4431 #ifdef _OPENACC
     4433
     4434#if defined( _OPENACC )
    44324435    USE arrays_3d,                                                             &
    44334436        ONLY:  dd2zu
     
    44544457    REAL(wp)     ::  ll                  !< adjusted mixing length
    44554458    REAL(wp)     ::  var_reference       !< reference temperature
    4456 #ifdef _OPENACC
     4459#if defined( _OPENACC )
    44574460!
    44584461!-- From mixing_length_les:
     
    44934496!
    44944497!--             Determine the mixing length for LES closure
    4495 #ifdef _OPENACC
     4498#if defined( _OPENACC )
    44964499!
    44974500!--             Cannot call subroutine mixing_length_les because after adding all required
     
    46024605! Description:
    46034606! ------------
    4604 !> Calculates the eddy viscosity dynamically using the linear dynamic model 
    4605 !> according to 
    4606 !> Heinz, Stefan. "Realizability of dynamic subgrid-scale stress models via 
    4607 !> stochastic analysis." 
     4607!> Calculates the eddy viscosity dynamically using the linear dynamic model
     4608!> according to
     4609!> Heinz, Stefan. "Realizability of dynamic subgrid-scale stress models via
     4610!> stochastic analysis."
    46084611!> Monte Carlo Methods and Applications 14.4 (2008): 311-329.
    46094612!>
    4610 !> Furthermore dynamic bounds are used to limit the absolute value of c* as 
     4613!> Furthermore dynamic bounds are used to limit the absolute value of c* as
    46114614!> described in
    4612 !> Mokhtarpoor, Reza, and Stefan Heinz. "Dynamic large eddy simulation: 
     4615!> Mokhtarpoor, Reza, and Stefan Heinz. "Dynamic large eddy simulation:
    46134616!> Stability via realizability." Physics of Fluids 29.10 (2017): 105104.
    46144617!>
     
    46174620!------------------------------------------------------------------------------!
    46184621 SUBROUTINE tcm_diffusivities_dynamic
    4619        
     4622
    46204623    USE arrays_3d,                                                             &
    46214624        ONLY:  ddzw, dzw, dd2zu, w, ug, vg
    4622    
     4625
    46234626    USE grid_variables,                                                        &
    46244627        ONLY : ddx, ddy, dx, dy
     
    46434646
    46444647    REAL(wp)     ::  flag        !< topography flag
    4645    
     4648
    46464649    REAL(wp)     ::  uc(-1:1,-1:1)  !< u on grid center
    46474650    REAL(wp)     ::  vc(-1:1,-1:1)  !< v on grid center
     
    47064709       DO  j = nys, nyn
    47074710          DO  k = nzb+1, nzt
    4708            
     4711
    47094712             flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 0 ) )
    4710              
     4713
    47114714!
    47124715!--          Compute the deviatoric shear tensor s_ij on grid centers:
     
    48294832             cst_max = fac_cmax * SQRT( e(k,j,i) ) /                           &
    48304833                       ( delta * SQRT( 2.0_wp * sd2 ) + 1.0E-20_wp )
    4831              
     4834
    48324835             IF ( ABS( cst ) > cst_max )  THEN
    48334836                cst = cst_max * cst / ABS( cst )
     
    48354838
    48364839             km(k,j,i) = cst * delta * SQRT( e(k,j,i) ) * flag
    4837              
     4840
    48384841          ENDDO
    48394842       ENDDO
     
    48504853!------------------------------------------------------------------------------!
    48514854 SUBROUTINE tcm_box_filter_2d_single( var, var_fil )
    4852  
     4855
    48534856    IMPLICIT NONE
    48544857
     
    48564859    REAL(wp)     ::  var_fil             !< filtered variable
    48574860!
    4858 !-- It is assumed that a box with a side length of 2 * dx and centered at the 
     4861!-- It is assumed that a box with a side length of 2 * dx and centered at the
    48594862!-- variable*s position contains one half of the four closest neigbours and one
    48604863!-- forth of the diagonally closest neighbours.
     
    48844887    REAL(wp)     ::  var_fil(nzb:nzt+1,nysg:nyng,nxlg:nxrg)  !< filtered variable
    48854888!
    4886 !-- It is assumed that a box with a side length of 2 * dx and centered at the 
     4889!-- It is assumed that a box with a side length of 2 * dx and centered at the
    48874890!-- variable's position contains one half of the four closest neigbours and one
    48884891!-- forth of the diagonally closest neighbours.
Note: See TracChangeset for help on using the changeset viewer.