Ignore:
Timestamp:
Apr 29, 2020 2:19:18 PM (4 years ago)
Author:
raasch
Message:

files re-formatted to follow the PALM coding standard

File:
1 edited

Legend:

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

    r4509 r4510  
    1818! Copyright 1997-2020 Leibniz Universitaet Hannover
    1919!--------------------------------------------------------------------------------------------------!
     20!
    2021!
    2122! Current revisions:
     
    2627! -----------------
    2728! $Id$
    28 ! file re-formatted to follow the PALM coding standard
     29! Further re-formatting to follow the PALM coding standard
     30!
     31! 4509 2020-04-26 15:57:55Z raasch
     32! File re-formatted to follow the PALM coding standard
    2933!
    3034! 4500 2020-04-17 10:12:45Z suehring
    3135! Allocate array for wall heat flux, which is further used to aggregate tile
    3236! fractions in the surface output
    33 ! 
     37!
    3438! 4495 2020-04-13 20:11:20Z raasch
    35 ! restart data handling with MPI-IO added
     39! Restart data handling with MPI-IO added
    3640!
    3741! 4493 2020-04-10 09:49:43Z pavelkrc
    3842! J.Resler, 2020/03/19
    39 ! - remove reading of deprecated input parameters c_surface and lambda_surf
    40 ! - and calculate them from parameters of the outer wall/roof layer
     43! - Remove reading of deprecated input parameters c_surface and lambda_surf
     44! - And calculate them from parameters of the outer wall/roof layer
    4145!
    4246! 4481 2020-03-31 18:55:54Z maronga
    43 ! use statement for exchange horiz added
     47! Use statement for exchange horiz added
    4448!
    4549! 4442 2020-03-04 19:21:13Z suehring
     
    8084!
    8185! 4227 2019-09-10 18:04:34Z gronemeier
    82 ! implement new palm_date_time_mod
     86! Implement new palm_date_time_mod
    8387!
    8488! 4214 2019-09-02 15:57:02Z suehring
     
    152156!
    153157! 3832 2019-03-28 13:16:58Z raasch
    154 ! instrumented with openmp directives
     158! Instrumented with openmp directives
    155159!
    156160! 3824 2019-03-27 15:56:16Z pavelkrc
     
    159163!
    160164! 3814 2019-03-26 08:40:31Z pavelkrc
    161 ! unused subroutine commented out
     165! Unused subroutine commented out
    162166!
    163167! 3769 2019-02-28 10:16:49Z moh.hefny
    164 ! removed unused variables
     168! Removed unused variables
    165169!
    166170! 3767 2019-02-27 08:18:02Z raasch
    167 ! unused variables removed from rrd-subroutines parameter list
     171! Unused variables removed from rrd-subroutines parameter list
    168172!
    169173! 3748 2019-02-18 10:38:31Z suehring
     
    172176! 3745 2019-02-15 18:57:56Z suehring
    173177! - Remove internal flag indoor_model (is a global control parameter)
    174 ! - add waste heat from buildings to the kinmatic heat flux
    175 ! - consider waste heat in restart data
    176 ! - remove unused USE statements
     178! - Add waste heat from buildings to the kinmatic heat flux
     179! - Consider waste heat in restart data
     180! - Remove unused USE statements
    177181!
    178182! 3744 2019-02-15 18:38:58Z suehring
    179 ! fixed surface heat capacity in the building parameters convert the file back to unix format
     183! Fixed surface heat capacity in the building parameters convert the file back to unix format
    180184!
    181185! 3730 2019-02-11 11:26:47Z moh.hefny
     
    186190!
    187191! 3705 2019-01-29 19:56:39Z suehring
    188 ! make nzb_wall public, required for virtual-measurements
     192! Make nzb_wall public, required for virtual-measurements
    189193!
    190194! 3704 2019-01-29 19:51:41Z suehring
     
    208212!> Module for Urban Surface Model (USM)
    209213!> The module includes:
    210 !>    1. radiation model with direct/diffuse radiation, shading, reflections and integration with
     214!>    1. Radiation model with direct/diffuse radiation, shading, reflections and integration with
    211215!>       plant canopy
    212 !>    2. wall and wall surface model
    213 !>    3. surface layer energy balance
    214 !>    4. anthropogenic heat (only from transportation so far)
    215 !>    5. necessary auxiliary subroutines (reading inputs, writing outputs, restart simulations, ...)
     216!>    2. Wall and wall surface model
     217!>    3. Surface layer energy balance
     218!>    4. Anthropogenic heat (only from transportation so far)
     219!>    5. Necessary auxiliary subroutines (reading inputs, writing outputs, restart simulations, ...)
    216220!> It also makes use of standard radiation and integrates it into urban surface model.
    217221!>
     
    223227!> fraq(0,m) + fraq(1,m) = 0?!
    224228!> @todo Use unit 90 for OPEN/CLOSE of input files (FK)
    225 !> @todo remove reading of old csv inputs
     229!> @todo Remove reading of old csv inputs
    226230!--------------------------------------------------------------------------------------------------!
    227231 MODULE urban_surface_mod
     
    418422                                 /), (/ 4, 7 /) )
    419423!
    420 !-- value 9999999.9_wp -> generic available or user-defined value must be set otherwise
    421 !-- -> no generic variable and user setting is optional
     424!-- Value 9999999.9_wp -> Generic available or user-defined value must be set otherwise
     425!-- -> No generic variable and user setting is optional
    422426    REAL(wp) ::  alpha_vangenuchten = 9999999.9_wp      !< NAMELIST alpha_vg
    423427    REAL(wp) ::  field_capacity = 9999999.9_wp          !< NAMELIST fc
     
    430434
    431435!
    432 !-- configuration parameters (they can be setup in PALM config)
     436!-- Configuration parameters (they can be setup in PALM config)
    433437    LOGICAL ::  force_radiation_call_l = .FALSE.   !< flag parameter for unscheduled radiation model calls
    434438    LOGICAL ::  read_wall_temp_3d = .FALSE.        !<
     
    645649    TYPE(surf_type_usm), TARGET   ::  tm_liq_usm_h_m  !< liquid water reservoir tendency (m), horizontal surface elements
    646650!
    647 !-- anthropogenic heat sources
     651!-- Anthropogenic heat sources
    648652    INTEGER(iwp)                                   ::  naheatlayers = 1  !< number of layers of anthropogenic heat
    649653
     
    653657
    654658!
    655 !-- wall surface model
    656 !-- wall surface model constants
     659!-- Wall surface model
     660!-- Wall surface model constants
    657661    INTEGER(iwp), PARAMETER                        ::  nzb_wall = 0  !< inner side of the wall model (to be switched)
    658662    INTEGER(iwp), PARAMETER                        ::  nzt_wall = 3  !< outer side of the wall model (to be switched)
     
    680684
    681685!
    682 !-- surface and material model variables for walls, ground, roofs
     686!-- Surface and material model variables for walls, ground, roofs
    683687    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  zwn                 !< normalized wall layer depths (m)
    684688    REAL(wp), DIMENSION(:), ALLOCATABLE            ::  zwn_green           !< normalized green layer depths (m)
     
    715719!
    716720!-- Energy balance variables
    717 !-- parameters of the land, roof and wall surfaces
     721!-- Parameters of the land, roof and wall surfaces
    718722    REAL(wp), DIMENSION(:,:), POINTER                ::  fc_h          !<
    719723    REAL(wp), DIMENSION(:,:), POINTER                ::  rootfr_h      !<
     
    763767!
    764768!-- Surface and material parameter classes (surface_type)
    765 !-- albedo, emissivity, lambda_surf, roughness, thickness, volumetric heat capacity, thermal conductivity
     769!-- Albedo, emissivity, lambda_surf, roughness, thickness, volumetric heat capacity, thermal conductivity
    766770    CHARACTER(12), DIMENSION(:), ALLOCATABLE  ::  surface_type_names    !< names of wall types (used only for reports)
    767771
     
    790794
    791795!
    792 !-- interfaces of subroutines accessed from outside of this module
     796!-- Interfaces of subroutines accessed from outside of this module
    793797    INTERFACE usm_3d_data_averaging
    794798       MODULE PROCEDURE usm_3d_data_averaging
     
    923927!
    924928!-- Wall surface model
    925 !-- allocate arrays for wall surface model and define pointers
    926 !-- allocate array of wall types and wall parameters
     929!-- Allocate arrays for wall surface model and define pointers
     930!-- Allocate array of wall types and wall parameters
    927931    ALLOCATE ( surf_usm_h%surface_types(1:surf_usm_h%ns)      )
    928932    ALLOCATE ( surf_usm_h%building_type(1:surf_usm_h%ns)      )
     
    984988
    985989!
    986 !-- wall and roof surface parameters. First for horizontal surfaces
     990!-- Wall and roof surface parameters. First for horizontal surfaces
    987991    ALLOCATE ( surf_usm_h%isroof_surf(1:surf_usm_h%ns)        )
    988992    ALLOCATE ( surf_usm_h%lambda_surf(1:surf_usm_h%ns)        )
     
    10201024
    10211025!
    1022 !-- allocate wall and roof material parameters. First for horizontal surfaces
     1026!-- Allocate wall and roof material parameters. First for horizontal surfaces
    10231027    ALLOCATE ( surf_usm_h%thickness_wall(1:surf_usm_h%ns)                    )
    10241028    ALLOCATE ( surf_usm_h%thickness_window(1:surf_usm_h%ns)                  )
     
    10551059
    10561060!
    1057 !-- allocate green wall and roof vegetation and soil parameters. First horizontal surfaces
     1061!-- Allocate green wall and roof vegetation and soil parameters. First horizontal surfaces
    10581062    ALLOCATE ( surf_usm_h%g_d(1:surf_usm_h%ns)              )
    10591063    ALLOCATE ( surf_usm_h%c_liq(1:surf_usm_h%ns)            )
     
    10771081
    10781082!
    1079 !-- allocate wall and roof layers sizes. For horizontal surfaces.
     1083!-- Allocate wall and roof layers sizes. For horizontal surfaces.
    10801084    ALLOCATE ( zwn(nzb_wall:nzt_wall)                                        )
    10811085    ALLOCATE ( surf_usm_h%dz_wall(nzb_wall:nzt_wall+1,1:surf_usm_h%ns)       )
     
    13261330
    13271331
    1328     IF ( variable(1:4) == 'usm_' )  THEN  ! is such a check really required?
    1329 
    1330 !
    1331 !-- find the real name of the variable
     1332    IF ( variable(1:4) == 'usm_' )  THEN  ! Is such a check really required?
     1333
     1334!
     1335!-- Find the real name of the variable
    13321336    ids = -1
    13331337    l = -1
     
    13431347       ENDIF
    13441348    ENDDO
    1345     l = idsint - 2  ! horizontal direction index - terrible hack !
     1349    l = idsint - 2  ! Horizontal direction index - terrible hack !
    13461350    IF ( l < 0 .OR. l > 3 )  THEN
    13471351       l = -1
     
    13521356    IF ( var(1:11) == 'usm_t_wall_'  .AND.  len( TRIM( var ) ) >= 12 )  THEN
    13531357!
    1354 !--      wall layers
     1358!--      Wall layers
    13551359        READ( var(12:12), '(I1)', iostat=istat ) iwl
    13561360        IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
     
    13581362        ELSE
    13591363!
    1360 !--         wrong wall layer index
     1364!--         Wrong wall layer index
    13611365            RETURN
    13621366        ENDIF
     
    13641368    IF ( var(1:13) == 'usm_t_window_'  .AND.  len( TRIM(var) ) >= 14 )  THEN
    13651369!
    1366 !--      wall layers
     1370!--      Wall layers
    13671371        READ( var(14:14), '(I1)', iostat=istat ) iwl
    13681372        IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
     
    13701374        ELSE
    13711375!
    1372 !--         wrong window layer index
     1376!--         Wrong window layer index
    13731377            RETURN
    13741378        ENDIF
     
    13761380    IF ( var(1:12) == 'usm_t_green_'  .AND.  len( TRIM( var ) ) >= 13 )  THEN
    13771381!
    1378 !--      wall layers
     1382!--      Wall layers
    13791383        READ( var(13:13), '(I1)', iostat=istat ) iwl
    13801384        IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
     
    13821386        ELSE
    13831387!
    1384 !--         wrong green layer index
     1388!--         Wrong green layer index
    13851389            RETURN
    13861390        ENDIF
     
    13881392    IF ( var(1:8) == 'usm_swc_'  .AND.  len( TRIM( var ) ) >= 9 )  THEN
    13891393!
    1390 !--      swc layers
     1394!--      Swc layers
    13911395        READ( var(9:9), '(I1)', iostat=istat ) iwl
    13921396        IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
     
    13941398        ELSE
    13951399!
    1396 !--         wrong swc layer index
     1400!--         Wrong swc layer index
    13971401            RETURN
    13981402        ENDIF
     
    14051409            CASE ( 'usm_wshf' )
    14061410!
    1407 !--             array of sensible heat flux from surfaces
    1408 !--             land surfaces
     1411!--             Array of sensible heat flux from surfaces
     1412!--             Land surfaces
    14091413                IF ( l == -1 )  THEN
    14101414                   IF ( .NOT.  ALLOCATED( surf_usm_h%wshf_eb_av ) )  THEN
     
    14211425            CASE ( 'usm_qsws' )
    14221426!
    1423 !--             array of latent heat flux from surfaces
    1424 !--             land surfaces
     1427!--             Array of latent heat flux from surfaces
     1428!--             Land surfaces
    14251429                IF ( l == -1 .AND. .NOT.  ALLOCATED( surf_usm_h%qsws_av ) )  THEN
    14261430                    ALLOCATE ( surf_usm_h%qsws_av(1:surf_usm_h%ns) )
     
    14351439            CASE ( 'usm_qsws_veg' )
    14361440!
    1437 !--             array of latent heat flux from vegetation surfaces
    1438 !--             land surfaces
     1441!--             Array of latent heat flux from vegetation surfaces
     1442!--             Land surfaces
    14391443                IF ( l == -1 .AND. .NOT.  ALLOCATED( surf_usm_h%qsws_veg_av ) )  THEN
    14401444                    ALLOCATE ( surf_usm_h%qsws_veg_av(1:surf_usm_h%ns) )
     
    14491453            CASE ( 'usm_qsws_liq' )
    14501454!
    1451 !--             array of latent heat flux from surfaces with liquid
    1452 !--             land surfaces
     1455!--             Array of latent heat flux from surfaces with liquid
     1456!--             Land surfaces
    14531457                IF ( l == -1 .AND. .NOT.  ALLOCATED( surf_usm_h%qsws_liq_av ) )  THEN
    14541458                    ALLOCATE ( surf_usm_h%qsws_liq_av(1:surf_usm_h%ns) )
     
    14661470            CASE ( 'usm_wghf' )
    14671471!
    1468 !--             array of heat flux from ground (wall, roof, land)
     1472!--             Array of heat flux from ground (wall, roof, land)
    14691473                IF ( l == -1 )  THEN
    14701474                   IF ( .NOT.  ALLOCATED( surf_usm_h%wghf_eb_av ) )  THEN
     
    14811485            CASE ( 'usm_wghf_window' )
    14821486!
    1483 !--             array of heat flux from window ground (wall, roof, land)
     1487!--             Array of heat flux from window ground (wall, roof, land)
    14841488                IF ( l == -1 )  THEN
    14851489                   IF ( .NOT.  ALLOCATED( surf_usm_h%wghf_eb_window_av ) )  THEN
     
    14961500            CASE ( 'usm_wghf_green' )
    14971501!
    1498 !--             array of heat flux from green ground (wall, roof, land)
     1502!--             Array of heat flux from green ground (wall, roof, land)
    14991503                IF ( l == -1 )  THEN
    15001504                   IF ( .NOT.  ALLOCATED( surf_usm_h%wghf_eb_green_av ) )  THEN
     
    15111515            CASE ( 'usm_iwghf' )
    15121516!
    1513 !--             array of heat flux from indoor ground (wall, roof, land)
     1517!--             Array of heat flux from indoor ground (wall, roof, land)
    15141518                IF ( l == -1 )  THEN
    15151519                   IF ( .NOT.  ALLOCATED( surf_usm_h%iwghf_eb_av ) )  THEN
     
    15261530            CASE ( 'usm_iwghf_window' )
    15271531!
    1528 !--             array of heat flux from indoor window ground (wall, roof, land)
     1532!--             Array of heat flux from indoor window ground (wall, roof, land)
    15291533                IF ( l == -1 ) THEN
    15301534                   IF ( .NOT.  ALLOCATED( surf_usm_h%iwghf_eb_window_av ) )  THEN
     
    15411545            CASE ( 'usm_t_surf_wall' )
    15421546!
    1543 !--             surface temperature for surfaces
     1547!--             Surface temperature for surfaces
    15441548                IF ( l == -1 )  THEN
    15451549                   IF ( .NOT.  ALLOCATED( surf_usm_h%t_surf_wall_av ) )  THEN
     
    15561560            CASE ( 'usm_t_surf_window' )
    15571561!
    1558 !--             surface temperature for window surfaces
     1562!--             Surface temperature for window surfaces
    15591563                IF ( l == -1 )  THEN
    15601564                   IF ( .NOT.  ALLOCATED( surf_usm_h%t_surf_window_av ) )  THEN
     
    15711575            CASE ( 'usm_t_surf_green' )
    15721576!
    1573 !--             surface temperature for green surfaces
     1577!--             Surface temperature for green surfaces
    15741578                IF ( l == -1 )  THEN
    15751579                   IF ( .NOT.  ALLOCATED( surf_usm_h%t_surf_green_av ) )  THEN
     
    15861590            CASE ( 'usm_theta_10cm' )
    15871591!
    1588 !--             near surface (10cm) temperature for whole surfaces
     1592!--             Near surface (10cm) temperature for whole surfaces
    15891593                IF ( l == -1 )  THEN
    15901594                   IF ( .NOT.  ALLOCATED( surf_usm_h%pt_10cm_av ) )  THEN
     
    16011605            CASE ( 'usm_t_wall' )
    16021606!
    1603 !--             wall temperature for iwl layer of walls and land
     1607!--             Wall temperature for iwl layer of walls and land
    16041608                IF ( l == -1 )  THEN
    16051609                   IF ( .NOT.  ALLOCATED( surf_usm_h%t_wall_av ) )  THEN
     
    16161620            CASE ( 'usm_t_window' )
    16171621!
    1618 !--             window temperature for iwl layer of walls and land
     1622!--             Window temperature for iwl layer of walls and land
    16191623                IF ( l == -1 )  THEN
    16201624                   IF ( .NOT.  ALLOCATED( surf_usm_h%t_window_av ) )  THEN
     
    16311635            CASE ( 'usm_t_green' )
    16321636!
    1633 !--             green temperature for iwl layer of walls and land
     1637!--             Green temperature for iwl layer of walls and land
    16341638                IF ( l == -1 )  THEN
    16351639                   IF ( .NOT.  ALLOCATED( surf_usm_h%t_green_av ) )  THEN
     
    16451649            CASE ( 'usm_swc' )
    16461650!
    1647 !--             soil water content for iwl layer of walls and land
     1651!--             Soil water content for iwl layer of walls and land
    16481652                IF ( l == -1 .AND. .NOT.  ALLOCATED( surf_usm_h%swc_av ) )  THEN
    16491653                    ALLOCATE ( surf_usm_h%swc_av(nzb_wall:nzt_wall,1:surf_usm_h%ns) )
     
    16671671            CASE ( 'usm_wshf' )
    16681672!
    1669 !--             array of sensible heat flux from surfaces (land, roof, wall)
     1673!--             Array of sensible heat flux from surfaces (land, roof, wall)
    16701674                IF ( l == -1 )  THEN
    16711675                   DO  m = 1, surf_usm_h%ns
     
    16811685            CASE ( 'usm_qsws' )
    16821686!
    1683 !--             array of latent heat flux from surfaces (land, roof, wall)
     1687!--             Array of latent heat flux from surfaces (land, roof, wall)
    16841688                IF ( l == -1 ) THEN
    16851689                DO  m = 1, surf_usm_h%ns
     
    16951699            CASE ( 'usm_qsws_veg' )
    16961700!
    1697 !--             array of latent heat flux from vegetation surfaces (land, roof, wall)
     1701!--             Array of latent heat flux from vegetation surfaces (land, roof, wall)
    16981702                IF ( l == -1 )  THEN
    16991703                DO  m = 1, surf_usm_h%ns
     
    17091713            CASE ( 'usm_qsws_liq' )
    17101714!
    1711 !--             array of latent heat flux from surfaces with liquid (land, roof, wall)
     1715!--             Array of latent heat flux from surfaces with liquid (land, roof, wall)
    17121716                IF ( l == -1 ) THEN
    17131717                DO  m = 1, surf_usm_h%ns
     
    17241728            CASE ( 'usm_wghf' )
    17251729!
    1726 !--             array of heat flux from ground (wall, roof, land)
     1730!--             Array of heat flux from ground (wall, roof, land)
    17271731                IF ( l == -1 ) THEN
    17281732                   DO  m = 1, surf_usm_h%ns
     
    17391743            CASE ( 'usm_wghf_window' )
    17401744!
    1741 !--             array of heat flux from window ground (wall, roof, land)
     1745!--             Array of heat flux from window ground (wall, roof, land)
    17421746                IF ( l == -1 )  THEN
    17431747                   DO  m = 1, surf_usm_h%ns
     
    17541758            CASE ( 'usm_wghf_green' )
    17551759!
    1756 !--             array of heat flux from green ground (wall, roof, land)
     1760!--             Array of heat flux from green ground (wall, roof, land)
    17571761                IF ( l == -1 )  THEN
    17581762                   DO  m = 1, surf_usm_h%ns
     
    17691773            CASE ( 'usm_iwghf' )
    17701774!
    1771 !--             array of heat flux from indoor ground (wall, roof, land)
     1775!--             Array of heat flux from indoor ground (wall, roof, land)
    17721776                IF ( l == -1 )  THEN
    17731777                   DO  m = 1, surf_usm_h%ns
     
    17831787            CASE ( 'usm_iwghf_window' )
    17841788!
    1785 !--             array of heat flux from indoor window ground (wall, roof, land)
     1789!--             Array of heat flux from indoor window ground (wall, roof, land)
    17861790                IF ( l == -1 )  THEN
    17871791                   DO  m = 1, surf_usm_h%ns
     
    17981802            CASE ( 'usm_t_surf_wall' )
    17991803!
    1800 !--             surface temperature for surfaces
     1804!--             Surface temperature for surfaces
    18011805                IF ( l == -1 )  THEN
    18021806                   DO  m = 1, surf_usm_h%ns
     
    18121816            CASE ( 'usm_t_surf_window' )
    18131817!
    1814 !--             surface temperature for window surfaces
     1818!--             Surface temperature for window surfaces
    18151819                IF ( l == -1 )  THEN
    18161820                   DO  m = 1, surf_usm_h%ns
     
    18271831            CASE ( 'usm_t_surf_green' )
    18281832!
    1829 !--             surface temperature for green surfaces
     1833!--             Surface temperature for green surfaces
    18301834                IF ( l == -1 )  THEN
    18311835                   DO  m = 1, surf_usm_h%ns
     
    18421846            CASE ( 'usm_theta_10cm' )
    18431847!
    1844 !--             near surface temperature for whole surfaces
     1848!--             Near surface temperature for whole surfaces
    18451849                IF ( l == -1 )  THEN
    18461850                   DO  m = 1, surf_usm_h%ns
     
    18571861            CASE ( 'usm_t_wall' )
    18581862!
    1859 !--             wall temperature for  iwl layer of walls and land
     1863!--             Wall temperature for  iwl layer of walls and land
    18601864                IF ( l == -1 )  THEN
    18611865                   DO  m = 1, surf_usm_h%ns
     
    18721876            CASE ( 'usm_t_window' )
    18731877!
    1874 !--             window temperature for  iwl layer of walls and land
     1878!--             Window temperature for  iwl layer of walls and land
    18751879                IF ( l == -1 )  THEN
    18761880                   DO  m = 1, surf_usm_h%ns
     
    18871891            CASE ( 'usm_t_green' )
    18881892!
    1889 !--             green temperature for  iwl layer of walls and land
     1893!--             Green temperature for  iwl layer of walls and land
    18901894                IF ( l == -1 )  THEN
    18911895                   DO  m = 1, surf_usm_h%ns
     
    19011905            CASE ( 'usm_swc' )
    19021906!
    1903 !--             soil water content for  iwl layer of walls and land
     1907!--             Soil water content for  iwl layer of walls and land
    19041908                IF ( l == -1 )  THEN
    19051909                   DO  m = 1, surf_usm_h%ns
     
    19201924            CASE ( 'usm_wshf' )
    19211925!
    1922 !--             array of sensible heat flux from surfaces (land, roof, wall)
     1926!--             Array of sensible heat flux from surfaces (land, roof, wall)
    19231927                IF ( l == -1 )  THEN
    19241928                   DO  m = 1, surf_usm_h%ns
     
    19351939            CASE ( 'usm_qsws' )
    19361940!
    1937 !--             array of latent heat flux from surfaces (land, roof, wall)
     1941!--             Array of latent heat flux from surfaces (land, roof, wall)
    19381942                IF ( l == -1 )  THEN
    19391943                DO  m = 1, surf_usm_h%ns
     
    19501954            CASE ( 'usm_qsws_veg' )
    19511955!
    1952 !--             array of latent heat flux from vegetation surfaces (land, roof, wall)
     1956!--             Array of latent heat flux from vegetation surfaces (land, roof, wall)
    19531957                IF ( l == -1 )  THEN
    19541958                DO  m = 1, surf_usm_h%ns
     
    19651969            CASE ( 'usm_qsws_liq' )
    19661970!
    1967 !--             array of latent heat flux from surfaces with liquid (land, roof, wall)
     1971!--             Array of latent heat flux from surfaces with liquid (land, roof, wall)
    19681972                IF ( l == -1 )  THEN
    19691973                DO  m = 1, surf_usm_h%ns
     
    19801984            CASE ( 'usm_wghf' )
    19811985!
    1982 !--             array of heat flux from ground (wall, roof, land)
     1986!--             Array of heat flux from ground (wall, roof, land)
    19831987                IF ( l == -1 )  THEN
    19841988                   DO  m = 1, surf_usm_h%ns
     
    19951999            CASE ( 'usm_wghf_window' )
    19962000!
    1997 !--             array of heat flux from window ground (wall, roof, land)
     2001!--             Array of heat flux from window ground (wall, roof, land)
    19982002                IF ( l == -1 )  THEN
    19992003                   DO  m = 1, surf_usm_h%ns
     
    20102014            CASE ( 'usm_wghf_green' )
    20112015!
    2012 !--             array of heat flux from green ground (wall, roof, land)
     2016!--             Array of heat flux from green ground (wall, roof, land)
    20132017                IF ( l == -1 )  THEN
    20142018                   DO  m = 1, surf_usm_h%ns
     
    20252029            CASE ( 'usm_iwghf' )
    20262030!
    2027 !--             array of heat flux from indoor ground (wall, roof, land)
     2031!--             Array of heat flux from indoor ground (wall, roof, land)
    20282032                IF ( l == -1 )  THEN
    20292033                   DO  m = 1, surf_usm_h%ns
     
    20402044            CASE ( 'usm_iwghf_window' )
    20412045!
    2042 !--             array of heat flux from indoor window ground (wall, roof, land)
     2046!--             Array of heat flux from indoor window ground (wall, roof, land)
    20432047                IF ( l == -1 )  THEN
    20442048                   DO  m = 1, surf_usm_h%ns
     
    20552059            CASE ( 'usm_t_surf_wall' )
    20562060!
    2057 !--             surface temperature for surfaces
     2061!--             Surface temperature for surfaces
    20582062                IF ( l == -1 )  THEN
    20592063                   DO  m = 1, surf_usm_h%ns
     
    20702074            CASE ( 'usm_t_surf_window' )
    20712075!
    2072 !--             surface temperature for window surfaces
     2076!--             Surface temperature for window surfaces
    20732077                IF ( l == -1 )  THEN
    20742078                   DO  m = 1, surf_usm_h%ns
     
    20852089            CASE ( 'usm_t_surf_green' )
    20862090!
    2087 !--             surface temperature for green surfaces
     2091!--             Surface temperature for green surfaces
    20882092                IF ( l == -1 )  THEN
    20892093                   DO  m = 1, surf_usm_h%ns
     
    21002104            CASE ( 'usm_theta_10cm' )
    21012105!
    2102 !--             near surface temperature for whole surfaces
     2106!--             Near surface temperature for whole surfaces
    21032107                IF ( l == -1 )  THEN
    21042108                   DO  m = 1, surf_usm_h%ns
     
    21162120            CASE ( 'usm_t_wall' )
    21172121!
    2118 !--             wall temperature for  iwl layer of walls and land
     2122!--             Wall temperature for  iwl layer of walls and land
    21192123                IF ( l == -1 )  THEN
    21202124                   DO  m = 1, surf_usm_h%ns
     
    21312135            CASE ( 'usm_t_window' )
    21322136!
    2133 !--             window temperature for  iwl layer of walls and land
     2137!--             Window temperature for  iwl layer of walls and land
    21342138                IF ( l == -1 )  THEN
    21352139                   DO  m = 1, surf_usm_h%ns
     
    21462150            CASE ( 'usm_t_green' )
    21472151!
    2148 !--             green temperature for  iwl layer of walls and land
     2152!--             Green temperature for  iwl layer of walls and land
    21492153                IF ( l == -1 )  THEN
    21502154                   DO  m = 1, surf_usm_h%ns
     
    21612165            CASE ( 'usm_swc' )
    21622166!
    2163 !--             soil water content for  iwl layer of walls and land
     2167!--             Soil water content for  iwl layer of walls and land
    21642168                IF ( l == -1 )  THEN
    21652169                DO  m = 1, surf_usm_h%ns
     
    22812285
    22822286!
    2283 !-- check if variable exists
    2284 !-- directional variables
     2287!-- Check if variable exists
     2288!-- Directional variables
    22852289    DO  i = 1, nl1
    22862290       DO  j = 1, nd
     
    22942298    IF ( lfound )  GOTO 10
    22952299!
    2296 !-- directional layer variables
     2300!-- Directional layer variables
    22972301    DO  i = 1, nl2
    22982302       DO  j = 1, nd
     
    23882392    ENDIF
    23892393!
    2390 !-- naheatlayers
     2394!-- Naheatlayers
    23912395    IF ( naheatlayers > nzt )  THEN
    23922396       message_string = 'number of anthropogenic heat layers "naheatlayers" can not be larger ' // &
     
    24732477    IF ( var(1:11) == 'usm_t_wall_'  .AND.  len( TRIM( var ) ) >= 12 )  THEN
    24742478!
    2475 !--     wall layers
     2479!--     Wall layers
    24762480        READ( var(12:12), '(I1)', iostat = istat ) iwl
    24772481        IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
     
    24812485    IF ( var(1:13) == 'usm_t_window_'  .AND.  len( TRIM( var ) ) >= 14 )  THEN
    24822486!
    2483 !--     window layers
     2487!--     Window layers
    24842488        READ( var(14:14), '(I1)', iostat = istat ) iwl
    24852489        IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
     
    24892493    IF ( var(1:12) == 'usm_t_green_'  .AND.  len( TRIM( var ) ) >= 13 )  THEN
    24902494!
    2491 !--     green layers
     2495!--     Green layers
    24922496        READ( var(13:13), '(I1)', iostat = istat ) iwl
    24932497        IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
     
    24972501    IF ( var(1:8) == 'usm_swc_'  .AND.  len( TRIM( var ) ) >= 9 )  THEN
    24982502!
    2499 !--     green layers soil water content
     2503!--     Green layers soil water content
    25002504        READ( var(9:9), '(I1)', iostat = istat ) iwl
    25012505        IF ( istat == 0  .AND.  iwl >= nzb_wall  .AND.  iwl <= nzt_wall )  THEN
     
    25082512      CASE ( 'usm_surfz' )
    25092513!
    2510 !--       array of surface height (z)
     2514!--       Array of surface height (z)
    25112515          IF ( idsint == iup_u )  THEN
    25122516             DO  m = 1, surf_usm_h%ns
     
    25282532      CASE ( 'usm_surfcat' )
    25292533!
    2530 !--       surface category
     2534!--       Surface category
    25312535          IF ( idsint == iup_u )  THEN
    25322536             DO  m = 1, surf_usm_h%ns
     
    25482552      CASE ( 'usm_surfwintrans' )
    25492553!
    2550 !--       transmissivity window tiles
     2554!--       Transmissivity window tiles
    25512555          IF ( idsint == iup_u )  THEN
    25522556             DO  m = 1, surf_usm_h%ns
     
    25682572      CASE ( 'usm_wshf' )
    25692573!
    2570 !--       array of sensible heat flux from surfaces
     2574!--       Array of sensible heat flux from surfaces
    25712575          IF ( av == 0 )  THEN
    25722576             IF ( idsint == iup_u )  THEN
     
    26082612      CASE ( 'usm_qsws' )
    26092613!
    2610 !--       array of latent heat flux from surfaces
     2614!--       Array of latent heat flux from surfaces
    26112615          IF ( av == 0 )  THEN
    26122616             IF ( idsint == iup_u )  THEN
     
    26472651      CASE ( 'usm_qsws_veg' )
    26482652!
    2649 !--       array of latent heat flux from vegetation surfaces
     2653!--       Array of latent heat flux from vegetation surfaces
    26502654          IF ( av == 0 )  THEN
    26512655             IF ( idsint == iup_u )  THEN
     
    26862690      CASE ( 'usm_qsws_liq' )
    26872691!
    2688 !--       array of latent heat flux from surfaces with liquid
     2692!--       Array of latent heat flux from surfaces with liquid
    26892693          IF ( av == 0 )  THEN
    26902694             IF ( idsint == iup_u )  THEN
     
    27252729      CASE ( 'usm_wghf' )
    27262730!
    2727 !--       array of heat flux from ground (land, wall, roof)
     2731!--       Array of heat flux from ground (land, wall, roof)
    27282732          IF ( av == 0 )  THEN
    27292733             IF ( idsint == iup_u )  THEN
     
    27642768      CASE ( 'usm_wghf_window' )
    27652769!
    2766 !--       array of heat flux from window ground (land, wall, roof)
     2770!--       Array of heat flux from window ground (land, wall, roof)
    27672771          IF ( av == 0 )  THEN
    27682772             IF ( idsint == iup_u )  THEN
     
    28032807      CASE ( 'usm_wghf_green' )
    28042808!
    2805 !--       array of heat flux from green ground (land, wall, roof)
     2809!--       Array of heat flux from green ground (land, wall, roof)
    28062810          IF ( av == 0 )  THEN
    28072811             IF ( idsint == iup_u )  THEN
     
    28422846      CASE ( 'usm_iwghf' )
    28432847!
    2844 !--       array of heat flux from indoor ground (land, wall, roof)
     2848!--       Array of heat flux from indoor ground (land, wall, roof)
    28452849          IF ( av == 0 )  THEN
    28462850             IF ( idsint == iup_u )  THEN
     
    28812885      CASE ( 'usm_iwghf_window' )
    28822886!
    2883 !--       array of heat flux from indoor window ground (land, wall, roof)
     2887!--       Array of heat flux from indoor window ground (land, wall, roof)
    28842888          IF ( av == 0 )  THEN
    28852889             IF ( idsint == iup_u )  THEN
     
    29202924      CASE ( 'usm_t_surf_wall' )
    29212925!
    2922 !--       surface temperature for surfaces
     2926!--       Surface temperature for surfaces
    29232927          IF ( av == 0 )  THEN
    29242928             IF ( idsint == iup_u )  THEN
     
    29592963      CASE ( 'usm_t_surf_window' )
    29602964!
    2961 !--       surface temperature for window surfaces
     2965!--       Surface temperature for window surfaces
    29622966          IF ( av == 0 )  THEN
    29632967             IF ( idsint == iup_u )  THEN
     
    30013005      CASE ( 'usm_t_surf_green' )
    30023006!
    3003 !--       surface temperature for green surfaces
     3007!--       Surface temperature for green surfaces
    30043008          IF ( av == 0 )  THEN
    30053009             IF ( idsint == iup_u )  THEN
     
    30433047      CASE ( 'usm_theta_10cm' )
    30443048!
    3045 !--       near surface temperature for whole surfaces
     3049!--       Near surface temperature for whole surfaces
    30463050          IF ( av == 0 )  THEN
    30473051             IF ( idsint == iup_u )  THEN
     
    30853089      CASE ( 'usm_t_wall' )
    30863090!
    3087 !--       wall temperature for  iwl layer of walls and land
     3091!--       Wall temperature for  iwl layer of walls and land
    30883092          IF ( av == 0 )  THEN
    30893093             IF ( idsint == iup_u )  THEN
     
    31243128      CASE ( 'usm_t_window' )
    31253129!
    3126 !--       window temperature for iwl layer of walls and land
     3130!--       Window temperature for iwl layer of walls and land
    31273131          IF ( av == 0 )  THEN
    31283132             IF ( idsint == iup_u )  THEN
     
    31633167      CASE ( 'usm_t_green' )
    31643168!
    3165 !--       green temperature for  iwl layer of walls and land
     3169!--       Green temperature for  iwl layer of walls and land
    31663170          IF ( av == 0 )  THEN
    31673171             IF ( idsint == iup_u )  THEN
     
    32023206          CASE ( 'usm_swc' )
    32033207!
    3204 !--       soil water content for  iwl layer of walls and land
     3208!--       Soil water content for  iwl layer of walls and land
    32053209          IF ( av == 0 )  THEN
    32063210             IF ( idsint == iup_u )  THEN
     
    33463350       IF (surf_usm_h%green_type_roof(m) == 2.0_wp )  THEN
    33473351!
    3348 !-- extensive green roof
    3349 !-- set ratio of substrate layer thickness, soil-type and LAI
     3352!-- Extensive green roof
     3353!-- Set ratio of substrate layer thickness, soil-type and LAI
    33503354          soil_type = 3
    33513355          surf_usm_h%lai(m) = 2.0_wp
     
    33573361       ELSE
    33583362!
    3359 !-- intensiv green roof
    3360 !-- set ratio of substrate layer thickness, soil-type and LAI
     3363!-- Intensiv green roof
     3364!-- Set ratio of substrate layer thickness, soil-type and LAI
    33613365          soil_type = 6
    33623366          surf_usm_h%lai(m) = 4.0_wp
     
    35603564    CALL cpu_log( log_point_s(78), 'usm_init', 'start' )
    35613565!
    3562 !-- surface forcing has to be disabled for LSF in case of enabled urban surface module
     3566!-- Surface forcing has to be disabled for LSF in case of enabled urban surface module
    35633567    IF ( large_scale_forcing )  THEN
    35643568        lsf_surf = .FALSE.
     
    36943698        surf_usm_h%target_temp_winter(m)  = building_pars(ind_indoor_target_temp_winter,building_type)
    36953699!
    3696 !--     emissivity of wall-, green- and window fraction
     3700!--     Emissivity of wall-, green- and window fraction
    36973701        surf_usm_h%emissivity(m,ind_veg_wall)  = building_pars(ind_emis_wall_r,building_type)
    36983702        surf_usm_h%emissivity(m,ind_pav_green) = building_pars(ind_emis_green_r,building_type)
     
    37053709        surf_usm_h%z0q(m)                      = building_pars(ind_z0qh,building_type)
    37063710!
    3707 !--     albedo type for wall fraction, green fraction, window fraction
     3711!--     Albedo type for wall fraction, green fraction, window fraction
    37083712        surf_usm_h%albedo_type(m,ind_veg_wall)  = INT( building_pars(ind_alb_wall_r,building_type) )
    37093713        surf_usm_h%albedo_type(m,ind_pav_green) = INT( building_pars(ind_alb_green_r,building_type) )
     
    37323736        DO  m = 1, surf_usm_v(l)%ns
    37333737
    3734            surf_usm_v(l)%surface_types(m) = wall_category         !< default category for root surface
     3738           surf_usm_v(l)%surface_types(m) = wall_category     !< Default category for root surface
    37353739!
    37363740!--        In order to distinguish between ground floor level and above-ground-floor level surfaces,
     
    38503854           surf_usm_v(l)%target_temp_winter(m)  = building_pars(ind_indoor_target_temp_winter,building_type)
    38513855!
    3852 !--        emissivity of wall-, green- and window fraction
     3856!--        Emissivity of wall-, green- and window fraction
    38533857           surf_usm_v(l)%emissivity(m,ind_veg_wall)  = building_pars(ind_emis_wall,building_type)
    38543858           surf_usm_v(l)%emissivity(m,ind_pav_green) = building_pars(ind_emis_green,building_type)
     
    39433947              surf_usm_h%target_temp_winter(m)  = building_pars(ind_indoor_target_temp_winter,st)
    39443948!
    3945 !--           emissivity of wall-, green- and window fraction
     3949!--           Emissivity of wall-, green- and window fraction
    39463950              surf_usm_h%emissivity(m,ind_veg_wall)  = building_pars(ind_emis_wall_r,st)
    39473951              surf_usm_h%emissivity(m,ind_pav_green) = building_pars(ind_emis_green_r,st)
     
    39543958              surf_usm_h%z0q(m)                 = building_pars(ind_z0qh,st)
    39553959!
    3956 !--           albedo type for wall fraction, green fraction, window fraction
     3960!--           Albedo type for wall fraction, green fraction, window fraction
    39573961              surf_usm_h%albedo_type(m,ind_veg_wall)  = INT( building_pars(ind_alb_wall_r,st) )
    39583962              surf_usm_h%albedo_type(m,ind_pav_green) = INT( building_pars(ind_alb_green_r,st) )
     
    41064110                 surf_usm_v(l)%target_temp_winter(m) = building_pars(ind_indoor_target_temp_winter,st)
    41074111!
    4108 !--              emissivity of wall-, green- and window fraction
     4112!--              Emissivity of wall-, green- and window fraction
    41094113                 surf_usm_v(l)%emissivity(m,ind_veg_wall)  = building_pars(ind_emis_wall,st)
    41104114                 surf_usm_v(l)%emissivity(m,ind_pav_green) = building_pars(ind_emis_green,st)
     
    46594663                 ENDIF
    46604664
    4661                  EXIT ! surface was found and processed
     4665                 EXIT ! Surface was found and processed
    46624666              ENDIF
    46634667           ENDDO
     
    46914695                       surf_usm_v(l)%frac(m,ind_pav_green) =                                       &
    46924696                       building_surface_pars_f%pars(ind_s_green_frac_r,is)
    4693                        !TODO clarify: why should _w and _r be on the same surface?
     4697                       !TODO Clarify: why should _w and _r be on the same surface?
    46944698
    46954699                    IF ( building_surface_pars_f%pars(ind_s_win_frac,is) /=                        &
     
    48024806                    ENDIF
    48034807
    4804                     EXIT ! surface was found and processed
     4808                    EXIT ! Surface was found and processed
    48054809                 ENDIF
    48064810              ENDDO
     
    48834887     CALL usm_init_material_model()
    48844888
    4885 !--  init skin layer properties (can be done after initialization of wall layers)
     4889!--  Init skin layer properties (can be done after initialization of wall layers)
    48864890
    48874891     DO  m = 1, surf_usm_h%ns
     
    49244928
    49254929!
    4926 !--  init anthropogenic sources of heat
     4930!--  Init anthropogenic sources of heat
    49274931     IF ( usm_anthropogenic_heat )  THEN
    49284932!
    4929 !--      init anthropogenic sources of heat (from transportation for now)
     4933!--      Init anthropogenic sources of heat (from transportation for now)
    49304934         CALL usm_read_anthropogenic_heat()
    49314935     ENDIF
     
    50315035         ENDIF
    50325036!
    5033 !--      initial values for t_wall
    5034 !--      outer value is set to surface temperature, inner value is set to wall_inner_temperature
     5037!--      Initial values for t_wall
     5038!--      Outer value is set to surface temperature, inner value is set to wall_inner_temperature
    50355039!--      and profile is logaritmic (linear in nz).
    50365040!--      Horizontal surfaces
     
    50905094
    50915095!
    5092 !--  initialize prognostic values for the first timestep
     5096!--  Initialize prognostic values for the first timestep
    50935097     t_surf_wall_h_p = t_surf_wall_h
    50945098     t_surf_wall_v_p = t_surf_wall_v
     
    51825186       k = surf_usm_h%k(m)
    51835187!
    5184 !--    prognostic equation for ground/roof temperature t_wall_h
     5188!--    Prognostic equation for ground/roof temperature t_wall_h
    51855189       wtend(:) = 0.0_wp
    51865190       wtend(nzb_wall) = ( 1.0_wp / surf_usm_h%rho_c_wall(nzb_wall,m) )                            &
     
    52065210                            ) * surf_usm_h%ddz_wall_stag(nzb_wall,m)
    52075211!
    5208 !-- if indoor model is used inner wall layer is calculated by using iwghf (indoor wall ground heat flux)
     5212!-- If indoor model is used inner wall layer is calculated by using iwghf (indoor wall ground heat flux)
    52095213       IF ( indoor_model )  THEN
    52105214          DO  kw = nzb_wall+1, nzt_wall-1
     
    52455249
    52465250!
    5247 !-- during spinup the tempeature inside window layers is not calculated to make larger timesteps possible
     5251!-- During spinup the tempeature inside window layers is not calculated to make larger timesteps possible
    52485252       IF ( .NOT. during_spinup )  THEN
    52495253          win_absorp = -log( surf_usm_h%transmissivity(m) ) / surf_usm_h%zw_window(nzt_wall,m)
    52505254!
    5251 !--       prognostic equation for ground/roof window temperature t_window_h takes absorption of
     5255!--       Prognostic equation for ground/roof window temperature t_window_h takes absorption of
    52525256!--       shortwave radiation into account
    52535257          wintend(:) = 0.0_wp
     
    53125316
    53135317!
    5314 !--    calculate t_wall tendencies for the next Runge-Kutta step
     5318!--    Calculate t_wall tendencies for the next Runge-Kutta step
    53155319       IF ( timestep_scheme(1:5) == 'runge' )  THEN
    53165320           IF ( intermediate_timestep_count == 1 )  THEN
     
    53285332       IF ( .NOT. during_spinup )  THEN
    53295333!
    5330 !--       calculate t_window tendencies for the next Runge-Kutta step
     5334!--       Calculate t_window tendencies for the next Runge-Kutta step
    53315335          IF ( timestep_scheme(1:5) == 'runge' )  THEN
    53325336              IF ( intermediate_timestep_count == 1 )  THEN
     
    53565360          k = surf_usm_v(l)%k(m)
    53575361!
    5358 !--       prognostic equation for wall temperature t_wall_v
     5362!--       Prognostic equation for wall temperature t_wall_v
    53595363          wtend(:) = 0.0_wp
    53605364
     
    54255429                          surf_usm_v(l)%zw_window(nzt_wall,m)
    54265430!
    5427 !--          prognostic equation for window temperature t_window_v
     5431!--          Prognostic equation for window temperature t_window_v
    54285432             wintend(:) = 0.0_wp
    54295433             wintend(nzb_wall) = ( 1.0_wp / surf_usm_v(l)%rho_c_window(nzb_wall,m) )               &
     
    54925496
    54935497!
    5494 !--       calculate t_wall tendencies for the next Runge-Kutta step
     5498!--       Calculate t_wall tendencies for the next Runge-Kutta step
    54955499          IF ( timestep_scheme(1:5) == 'runge' )  THEN
    54965500              IF ( intermediate_timestep_count == 1 )  THEN
     
    55095513          IF ( .NOT. during_spinup )  THEN
    55105514!
    5511 !--          calculate t_window tendencies for the next Runge-Kutta step
     5515!--          Calculate t_window tendencies for the next Runge-Kutta step
    55125516             IF ( timestep_scheme(1:5) == 'runge' )  THEN
    55135517                 IF ( intermediate_timestep_count == 1 )  THEN
     
    58375841          IF (surf_usm_v(l)%frac(m,ind_pav_green) > 0.0_wp)  THEN
    58385842!
    5839 !-- no substrate layer for green walls / only groundbase green walls (ivy i.e.) -> green layers get
     5843!-- No substrate layer for green walls / only groundbase green walls (ivy i.e.) -> Green layers get
    58405844!-- same temperature as first wall layer, therefore no temperature calculations for vertical green
    58415845!-- substrate layers now
     
    58505854!              t_green_v(l)%t(nzt_wall+1,m) = t_wall_v(l)%t(nzb_wall,m)
    58515855! !
    5852 ! !--          prognostic equation for green temperature t_green_v
     5856! !--          Prognostic equation for green temperature t_green_v
    58535857!              gtend(:) = 0.0_wp
    58545858!              gtend(nzb_wall) = (1.0_wp / surf_usm_v(l)%rho_c_green(nzb_wall,m)) * &
     
    58785882!
    58795883! !
    5880 ! !--          calculate t_green tendencies for the next Runge-Kutta step
     5884! !--          Calculate t_green tendencies for the next Runge-Kutta step
    58815885!              IF ( timestep_scheme(1:5) == 'runge' )  THEN
    58825886!                  IF ( intermediate_timestep_count == 1 )  THEN
     
    60376041        IF ( ii == io_group )  THEN
    60386042
    6039 !--         open anthropogenic heat file
     6043!--         Open anthropogenic heat file
    60406044            OPEN( 151, file = 'ANTHROPOGENIC_HEAT' // TRIM( coupling_char ), action = 'read',      &
    60416045                  status = 'old', form = 'formatted', err = 11 )
     
    60466050                IF ( i >= nxl  .AND.  i <= nxr  .AND.  j >= nys  .AND.  j <= nyn )  THEN
    60476051                    IF ( k <= naheatlayers  .AND.  k > topo_top_ind(j,i,0) )  THEN
    6048 !--                     write heat into the array
     6052!--                     Write heat into the array
    60496053                        aheat(k,j,i) = heat
    60506054                    ENDIF
     
    67046708
    67056709!
    6706 !-- read categories of walls and their parameters
     6710!-- Read categories of walls and their parameters
    67076711    DO  ii = 0, io_blocks-1
    67086712        IF ( ii == io_group )  THEN
    67096713!
    6710 !--         open urban surface file
     6714!--         Open urban surface file
    67116715            OPEN( 151, file = 'SURFACE_PARAMETERS' // coupling_char,  action = 'read', &
    67126716                       status = 'old', form = 'formatted', err = 15 )
    67136717!
    6714 !--         first test and get n_surface_types
     6718!--         First test and get n_surface_types
    67156719            k = 0
    67166720            l = 0
     
    67276731            ALLOCATE( surface_params(n_surface_params, n_surface_types) )
    67286732!
    6729 !--         real reading
     6733!--         Real reading
    67306734            rewind( 151 )
    67316735            k = 0
     
    67496753
    67506754!
    6751 !-- read types of surfaces
     6755!-- Read types of surfaces
    67526756    usm_par = 0
    67536757    DO  ii = 0, io_blocks-1
     
    67556759
    67566760!
    6757 !--         open csv urban surface file
     6761!--         Open csv urban surface file
    67586762            OPEN( 151, file = 'URBAN_SURFACE' // TRIM( coupling_char ), action = 'read',           &
    67596763                  status = 'old', form = 'formatted', err = 23 )
     
    67786782               IF ( i >= nxlg  .AND.  i <= nxrg  .AND.  j >= nysg  .AND.  j <= nyng )  THEN
    67796783!
    6780 !--                write integer variables into array
     6784!--                Write integer variables into array
    67816785                   usm_par(:,j,i) = (/1, nz, roof, dirwe, dirsn, category,                         &
    67826786                                     weheight1, wecat1, weheight2, wecat2, weheight3, wecat3,      &
    67836787                                     snheight1, sncat1, snheight2, sncat2, snheight3, sncat3 /)
    67846788!
    6785 !--                write real values into array
     6789!--                Write real values into array
    67866790                   usm_val(:,j,i) = (/ albedo, thick,                                              &
    67876791                                      wealbedo1, wethick1, wealbedo2, wethick2,                    &
     
    68076811
    68086812!
    6809 !-- check completeness and formal correctness of the data
     6813!-- Check completeness and formal correctness of the data
    68106814    DO  i = nxlg, nxrg
    68116815        DO  j = nysg, nyng
     
    68296833                ) )  THEN
    68306834!
    6831 !--             incorrect input data
     6835!--             Incorrect input data
    68326836                WRITE( message_string, '(A,2I5)' )                                                 &
    68336837                'missing or incorrect data in file URBAN_SURFACE' //  TRIM( coupling_char ) //     &
     
    68526856          IF ( zu(kw) >= roof_height_limit )  THEN
    68536857             surf_usm_h%isroof_surf(m)   = .TRUE.
    6854              surf_usm_h%surface_types(m) = roof_category !< default category for root surface
     6858             surf_usm_h%surface_types(m) = roof_category !< Default category for root surface
    68556859          ELSE
    68566860             surf_usm_h%isroof_surf(m)   = .FALSE.
    6857              surf_usm_h%surface_types(m) = land_category !< default category for land surface
     6861             surf_usm_h%surface_types(m) = land_category !< Default category for land surface
    68586862          ENDIF
    68596863
     
    68906894       IF ( ip == -99999 )  THEN
    68916895!
    6892 !--       land/roof category not found
     6896!--       Land/roof category not found
    68936897          WRITE(9, '(A, I5, A, 3I5)' ) 'land/roof category ', it, ' not found  for i, j, k = ',    &
    68946898                                       iw, jw, kw
     
    69076911          IF ( ip == -99999 )  THEN
    69086912!
    6909 !--          default land/roof category not found
     6913!--          Default land/roof category not found
    69106914             WRITE( 9, '(A, I5, A, 3I5)' ) 'Default land/roof category ', category, ' not found!'
    69116915             FLUSH( 9 )
     
    69276931       ENDIF
    69286932!
    6929 !--    emissivity of the wall
     6933!--    Emissivity of the wall
    69306934       surf_usm_h%emissivity(m,:) = surface_params(iemiss, ip)
    69316935!
    6932 !--    heat conductivity λS between air and wall ( W m−2 K−1 )
     6936!--    Heat conductivity λS between air and wall ( W m−2 K−1 )
    69336937       surf_usm_h%lambda_surf(m)        = surface_params(ilambdas,ip)
    69346938       surf_usm_h%lambda_surf_window(m) = surface_params(ilambdas,ip)
    69356939       surf_usm_h%lambda_surf_green(m)  = surface_params(ilambdas,ip)
    69366940!
    6937 !--    roughness length for momentum, heat and humidity
     6941!--    Roughness length for momentum, heat and humidity
    69386942       surf_usm_h%z0(m)  = surface_params(irough,ip)
    69396943       surf_usm_h%z0h(m) = surface_params(iroughh,ip)
     
    69456949       surf_usm_h%c_surface_green(m)  = surface_params(icsurf,ip)
    69466950!
    6947 !--    wall material parameters:
    6948 !--    thickness of the wall (m) missing values are replaced by default value for category
     6951!--    Wall material parameters:
     6952!--    Thickness of the wall (m) missing values are replaced by default value for category
    69496953       IF ( surf_usm_h%thickness_wall(m) <= 0.001_wp )  THEN
    69506954            surf_usm_h%thickness_wall(m) = surface_params(ithick,ip)
     
    69576961       ENDIF
    69586962!
    6959 !--    volumetric heat capacity rho*C of the wall ( J m−3 K−1 )
     6963!--    Volumetric heat capacity rho*C of the wall ( J m−3 K−1 )
    69606964       surf_usm_h%rho_c_wall(:,m)   = surface_params(irhoC,ip)
    69616965       surf_usm_h%rho_c_window(:,m) = surface_params(irhoC,ip)
    69626966       surf_usm_h%rho_c_green(:,m)  = surface_params(irhoC,ip)
    69636967!
    6964 !--    thermal conductivity λH of the wall (W m−1 K−1 )
     6968!--    Thermal conductivity λH of the wall (W m−1 K−1 )
    69656969       surf_usm_h%lambda_h(:,m)        = surface_params(ilambdah,ip)
    69666970       surf_usm_h%lambda_h_window(:,m) = surface_params(ilambdah,ip)
     
    69816985          kw = surf_usm_v(l)%k(m)
    69826986
    6983           IF ( l == 3 )  THEN ! westward facing
     6987          IF ( l == 3 )  THEN ! Westward facing
    69846988             iw = i
    69856989             jw = j
     
    70057009          IF ( iw < 0 .OR. jw < 0 ) THEN
    70067010!
    7007 !--          wall on west or south border of the domain - assign default category
     7011!--          Wall on west or south border of the domain - assign default category
    70087012             IF ( kw <= roof_height_limit ) THEN
    7009                  surf_usm_v(l)%surface_types(m) = wall_category   !< default category for wall surface in wall zone
     7013                 surf_usm_v(l)%surface_types(m) = wall_category   !< Default category for wall surface in wall zone
    70107014             ELSE
    7011                  surf_usm_v(l)%surface_types(m) = roof_category   !< default category for wall surface in roof zone
     7015                 surf_usm_v(l)%surface_types(m) = roof_category   !< Default category for wall surface in roof zone
    70127016             ENDIF
    70137017             surf_usm_v(l)%albedo(m,:)         = -1.0_wp
     
    70187022          ELSE IF ( kw <= usm_par(ii,jw,iw) )  THEN
    70197023!
    7020 !--             pedestrian zone
     7024!--             Pedestrian zone
    70217025             IF ( usm_par(ii+1,jw,iw) == 0 )  THEN
    7022                  surf_usm_v(l)%surface_types(m)  = pedestrian_category   !< default category for wall surface in
    7023                                                                          !< pedestrian zone
     7026                 surf_usm_v(l)%surface_types(m)  = pedestrian_category   !< Default category for wall surface in
     7027                                                                         !< Pedestrian zone
    70247028                 surf_usm_v(l)%albedo(m,:)         = -1.0_wp
    70257029                 surf_usm_v(l)%thickness_wall(m)   = -1.0_wp
     
    70377041          ELSE IF ( kw <= usm_par(ii+2,jw,iw) )  THEN
    70387042!
    7039 !--          wall zone
     7043!--          Wall zone
    70407044             IF ( usm_par(ii+3,jw,iw) == 0 )  THEN
    70417045                 surf_usm_v(l)%surface_types(m)    = wall_category  !< default category for wall surface
     
    70557059          ELSE IF ( kw <= usm_par(ii+4,jw,iw) )  THEN
    70567060!
    7057 !--          roof zone
     7061!--          Roof zone
    70587062             IF ( usm_par(ii+5,jw,iw) == 0 )  THEN
    7059                  surf_usm_v(l)%surface_types(m)    = roof_category  !< default category for roof surface
     7063                 surf_usm_v(l)%surface_types(m)    = roof_category  !< Default category for roof surface
    70607064                 surf_usm_v(l)%albedo(m,:)         = -1.0_wp
    70617065                 surf_usm_v(l)%thickness_wall(m)   = -1.0_wp
     
    70817085             FLUSH( 9 )
    70827086!
    7083 !--          supply the default category
     7087!--          Supply the default category
    70847088             IF ( kw <= roof_height_limit )  THEN
    7085                  surf_usm_v(l)%surface_types(m) = wall_category  !< default category for wall surface in wall zone
     7089                 surf_usm_v(l)%surface_types(m) = wall_category  !< Default category for wall surface in wall zone
    70867090             ELSE
    7087                  surf_usm_v(l)%surface_types(m) = roof_category  !< default category for wall surface in roof zone
     7091                 surf_usm_v(l)%surface_types(m) = roof_category  !< Default category for wall surface in roof zone
    70887092             ENDIF
    70897093             surf_usm_v(l)%albedo(m,:)         = -1.0_wp
     
    71057109          IF ( ip == -99999 )  THEN
    71067110!
    7107 !--          wall category not found
     7111!--          Wall category not found
    71087112             WRITE( 9, '(A,I7,A,3I5)' ) 'wall category ', it, ' not found  for i,j,k = ', iw, jw, kw
    71097113             FLUSH(9)
     
    71177121             IF ( ip == -99999 )  THEN
    71187122!
    7119 !--             default wall category not found
     7123!--             Default wall category not found
    71207124                WRITE ( 9, '(A,I5,A,3I5)' ) 'Default wall category', category, ' not found!'
    71217125                FLUSH( 9 )
     
    71367140          ENDIF
    71377141!
    7138 !--       emissivity of the wall
     7142!--       Emissivity of the wall
    71397143          surf_usm_v(l)%emissivity(:,m) = surface_params(iemiss,ip)
    71407144!
    7141 !--       heat conductivity lambda S between air and wall ( W m-2 K-1 )
     7145!--       Heat conductivity lambda S between air and wall ( W m-2 K-1 )
    71427146          surf_usm_v(l)%lambda_surf(m)        = surface_params(ilambdas,ip)
    71437147          surf_usm_v(l)%lambda_surf_window(m) = surface_params(ilambdas,ip)
    71447148          surf_usm_v(l)%lambda_surf_green(m)  = surface_params(ilambdas,ip)
    71457149!
    7146 !--       roughness length
     7150!--       Roughness length
    71477151          surf_usm_v(l)%z0(m)  = surface_params(irough,ip)
    71487152          surf_usm_v(l)%z0h(m) = surface_params(iroughh,ip)
     
    71547158          surf_usm_v(l)%c_surface_green(m)  = surface_params(icsurf,ip)
    71557159!
    7156 !--       wall material parameters:
    7157 !--       thickness of the wall (m)
    7158 !--       missing values are replaced by default value for category
     7160!--       Wall material parameters:
     7161!--       Thickness of the wall (m)
     7162!--       Missing values are replaced by default value for category
    71597163          IF ( surf_usm_v(l)%thickness_wall(m) <= 0.001_wp )  THEN
    71607164               surf_usm_v(l)%thickness_wall(m) = surface_params(ithick,ip)
     
    71677171          ENDIF
    71687172!
    7169 !--       volumetric heat capacity rho*C of the wall ( J m-3 K-1 )
     7173!--       Volumetric heat capacity rho*C of the wall ( J m-3 K-1 )
    71707174          surf_usm_v(l)%rho_c_wall(:,m)   = surface_params(irhoC,ip)
    71717175          surf_usm_v(l)%rho_c_window(:,m) = surface_params(irhoC,ip)
    71727176          surf_usm_v(l)%rho_c_green(:,m)  = surface_params(irhoC,ip)
    71737177!
    7174 !--       thermal conductivity lambda H of the wall (W m-1 K-1 )
     7178!--       Thermal conductivity lambda H of the wall (W m-1 K-1 )
    71757179          surf_usm_v(l)%lambda_h(:,m)        = surface_params(ilambdah,ip)
    71767180          surf_usm_v(l)%lambda_h_window(:,m) = surface_params(ilambdah,ip)
     
    71897193    ENDDO
    71907194!
    7191 !-- apply for all particular surface grids. First for horizontal surfaces
     7195!-- Apply for all particular surface grids. First for horizontal surfaces
    71927196    DO  m = 1, surf_usm_h%ns
    71937197       surf_usm_h%zw(:,m)        = zwn(:) * surf_usm_h%thickness_wall(m)
     
    72647268        IF ( ii == io_group )  THEN
    72657269!
    7266 !--         open wall temperature file
     7270!--         Open wall temperature file
    72677271            OPEN( 152, file = 'WALL_TEMPERATURE' // coupling_char, action = 'read', &
    72687272                       status = 'old', form = 'formatted', err = 15 )
     
    72717275            iline = 1
    72727276            DO
    7273                 rtwall = -9999.0_wp  !< for incomplete lines
     7277                rtwall = -9999.0_wp  !< For incomplete lines
    72747278                READ( 152, *, err = 13, end = 14 )  i, j, k, d, rtsurf, rtwall
    72757279
    7276                 IF ( nxl <= i .AND. i <= nxr .AND. nys <= j .AND. j <= nyn)  THEN  !< local processor
     7280                IF ( nxl <= i .AND. i <= nxr .AND. nys <= j .AND. j <= nyn)  THEN  !< Local processor
    72777281!--                 identify surface id
    72787282                    isurfl = find_surface( i, j, k, d )
     
    72847288                    ENDIF
    72857289!
    7286 !--                 assign temperatures
     7290!--                 Assign temperatures
    72877291                    IF ( d == 0 )  THEN
    72887292                       t_surf_wall_h(isurfl) = rtsurf
     
    74467450       ENDIF
    74477451!
    7448 !--    calculate rho * c_p coefficient at surface layer
     7452!--    Calculate rho * c_p coefficient at surface layer
    74497453       rho_cp  = c_p * hyp(k) / ( r_d * surf_usm_h%pt1(m) * exner(k) )
    74507454
     
    74867490
    74877491!
    7488 !--    factor for shf_eb
     7492!--    Factor for shf_eb
    74897493       f_shf         = rho_cp / surf_usm_h%r_a(m)
    74907494       f_shf_window  = rho_cp / surf_usm_h%r_a_window(m)
     
    74977501!--       ECMWF documentation
    74987502
    7499 !--       f1: correction for incoming shortwave radiation (stomata close at night)
     7503!--       f1: Correction for incoming shortwave radiation (stomata close at night)
    75007504          f1 = MIN( 1.0_wp, ( 0.004_wp * surf_usm_h%rad_sw_in(m) + 0.05_wp ) /                     &
    75017505                    (0.81_wp * ( 0.004_wp * surf_usm_h%rad_sw_in(m) + 1.0_wp ) ) )
    75027506!
    7503 !--       f2: correction for soil moisture availability to plants (the integrated soil moisture must
     7507!--       f2: Correction for soil moisture availability to plants (the integrated soil moisture must
    75047508!--       thus be considered here) f2 = 0 for very dry soils
    75057509          m_total = 0.0_wp
     
    75217525                                           / ( t_surf_green_h(m) - 35.86_wp ) )
    75227526!
    7523 !--       f3: correction for vapour pressure deficit
     7527!--       f3: Correction for vapour pressure deficit
    75247528          IF ( surf_usm_h%g_d(m) /= 0.0_wp )  THEN
    75257529!
     
    75747578       ENDIF
    75757579!
    7576 !--    add LW up so that it can be removed in prognostic equation
     7580!--    Add LW up so that it can be removed in prognostic equation
    75777581       surf_usm_h%rad_net_l(m) = surf_usm_h%rad_sw_in(m)  - surf_usm_h%rad_sw_out(m) +             &
    75787582                                 surf_usm_h%rad_lw_in(m)  - surf_usm_h%rad_lw_out(m)
    75797583!
    7580 !--    numerator of the prognostic equation
     7584!--    Numerator of the prognostic equation
    75817585!--    Todo: Adjust to tile approach. So far, emissivity for wall (element 0) is used
    75827586       coef_1 = surf_usm_h%rad_net_l(m) + ( 3.0_wp + 1.0_wp )                                      &
     
    76037607       ENDIF
    76047608!
    7605 !--    denominator of the prognostic equation
     7609!--    Denominator of the prognostic equation
    76067610       coef_2 = 4.0_wp * surf_usm_h%emissivity(m,ind_veg_wall) * sigma_sb * t_surf_wall_h(m)**3    &
    76077611                + lambda_surface + f_shf / exner(k)
     
    76197623       ENDIF
    76207624!
    7621 !--    implicit solution when the surface layer has no heat capacity, otherwise use RK3 scheme.
     7625!--    Implicit solution when the surface layer has no heat capacity, otherwise use RK3 scheme.
    76227626       t_surf_wall_h_p(m) = ( coef_1 * dt_3d * tsc(2) + surf_usm_h%c_surface(m)                    &
    76237627                              * t_surf_wall_h(m) )                                                 &
     
    76327636                             /  ( surf_usm_h%c_surface_green(m) + coef_green_2 * dt_3d * tsc(2) )
    76337637!
    7634 !--    add RK3 term
     7638!--    Add RK3 term
    76357639       t_surf_wall_h_p(m) = t_surf_wall_h_p(m) + dt_3d * tsc(3) *  surf_usm_h%tt_surface_wall_m(m)
    76367640
     
    76507654       IF ( humidity )  surf_usm_h%vpt_surface(m) = surf_usm_h%pt_surface(m)
    76517655!
    7652 !--    calculate true tendency
     7656!--    Calculate true tendency
    76537657       stend_wall = ( t_surf_wall_h_p(m) - t_surf_wall_h(m) - dt_3d * tsc(3) *                     &
    76547658                      surf_usm_h%tt_surface_wall_m(m) ) / ( dt_3d  * tsc(2) )
     
    76587662                       surf_usm_h%tt_surface_green_m(m) ) / ( dt_3d  * tsc(2) )
    76597663!
    7660 !--    calculate t_surf tendencies for the next Runge-Kutta step
     7664!--    Calculate t_surf tendencies for the next Runge-Kutta step
    76617665       IF ( timestep_scheme(1:5) == 'runge' )  THEN
    76627666          IF ( intermediate_timestep_count == 1 )  THEN
     
    76747678       ENDIF
    76757679!
    7676 !--    in case of fast changes in the skin temperature, it is required to update the radiative
     7680!--    In case of fast changes in the skin temperature, it is required to update the radiative
    76777681!--    fluxes in order to keep the solution stable
    76787682       IF ( ( ( ABS( t_surf_wall_h_p(m)   - t_surf_wall_h(m) )   > 1.0_wp )   .OR.                 &
     
    76837687       ENDIF
    76847688!
    7685 !--    calculate fluxes
    7686 !--    rad_net_l is never used!
     7689!--    Calculate fluxes
     7690!--    Rad_net_l is never used!
    76877691       surf_usm_h%rad_net_l(m) = surf_usm_h%rad_net_l(m) + surf_usm_h%frac(m,ind_veg_wall)         &
    76887692                                 * sigma_sb * surf_usm_h%emissivity(m,ind_veg_wall)                &
     
    77027706
    77037707!
    7704 !--    ground/wall/roof surface heat flux
     7708!--    Ground/wall/roof surface heat flux
    77057709       surf_usm_h%wshf_eb(m)   = - f_shf  * ( surf_usm_h%pt1(m) - t_surf_wall_h_p(m) / exner(k) )  &
    77067710                                 * surf_usm_h%frac(m,ind_veg_wall) - f_shf_window                  &
     
    77107714                                 * surf_usm_h%frac(m,ind_pav_green)
    77117715!
    7712 !--    store kinematic surface heat fluxes for utilization in other processes diffusion_s,
     7716!--    Store kinematic surface heat fluxes for utilization in other processes diffusion_s,
    77137717!--    surface_layer_fluxes,...
    77147718       surf_usm_h%shf(m) = surf_usm_h%wshf_eb(m) / c_p
     
    78627866           ENDIF
    78637867!
    7864 !--        calculate rho * c_p coefficient at wall layer
     7868!--        Calculate rho * c_p coefficient at wall layer
    78657869           rho_cp  = c_p * hyp(k) / ( r_d * surf_usm_v(l)%pt1(m) * exner(k) )
    78667870
     
    78747878!--        Calculation of r_a for vertical surfaces
    78757879!--
    7876 !--        heat transfer coefficient for forced convection along vertical walls follows formulation
     7880!--        Heat transfer coefficient for forced convection along vertical walls follows formulation
    78777881!--        in TUF3d model (Krayenhoff & Voogt, 2006)
    78787882!--
     
    78807884!--        httc = rw * (11.8 + 4.2 * Ueff) - 4.0
    78817885!--
    7882 !--             rw: wall patch roughness relative to 1.0 for concrete
    7883 !--             Ueff: effective wind speed
     7886!--             rw: Wall patch roughness relative to 1.0 for concrete
     7887!--             Ueff: Effective wind speed
    78847888!--             - 4.0 is a reduction of Rowley et al (1930) formulation based on
    78857889!--             Cole and Sturrock (1977)
    78867890!--
    78877891!--             Ucan: Canyon wind speed
    7888 !--             wstar: convective velocity
    7889 !--             Qs: surface heat flux
    7890 !--             zH: height of the convective layer
     7892!--             wstar: Convective velocity
     7893!--             Qs: Surface heat flux
     7894!--             zH: Height of the convective layer
    78917895!--             wstar = (g/Tcan*Qs*zH)**(1./3.)
    78927896!--        Effective velocity components must always be defined at scalar grid point. The wall
     
    79177921                                / (0.81_wp * (0.004_wp * surf_usm_v(l)%rad_sw_in(m) + 1.0_wp) ) )
    79187922!
    7919 !--           f2: correction for soil moisture availability to plants (the integrated soil moisture
     7923!--           f2: Correction for soil moisture availability to plants (the integrated soil moisture
    79207924!--           must thus be considered here) f2 = 0 for very dry soils
    79217925              f2=1.0_wp
     
    79267930                                               / (  t_surf_green_v_p(l)%t(m) - 35.86_wp ) )
    79277931!
    7928 !--           f3: correction for vapour pressure deficit
     7932!--           f3: Correction for vapour pressure deficit
    79297933              IF ( surf_usm_v(l)%g_d(m) /= 0.0_wp )  THEN
    79307934!
     
    79727976
    79737977!
    7974 !--        add LW up so that it can be removed in prognostic equation
     7978!--        Add LW up so that it can be removed in prognostic equation
    79757979           surf_usm_v(l)%rad_net_l(m) = surf_usm_v(l)%rad_sw_in(m) - surf_usm_v(l)%rad_sw_out(m)   &
    79767980                                        + surf_usm_v(l)%rad_lw_in(m)  - surf_usm_v(l)%rad_lw_out(m)
    79777981!
    7978 !--        numerator of the prognostic equation
    7979            coef_1 = surf_usm_v(l)%rad_net_l(m) +                             & ! coef +1 corresponds to -lwout
     7982!--        Numerator of the prognostic equation
     7983           coef_1 = surf_usm_v(l)%rad_net_l(m) +                             & ! Coef +1 corresponds to -lwout
    79807984                                                                               ! included in calculation of radnet_l
    79817985           ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(m,ind_veg_wall) *                        &
     
    79847988                                   lambda_surface * t_wall_v(l)%t(nzb_wall,m)
    79857989           IF ( ( .NOT. during_spinup )  .AND.  ( surf_usm_v(l)%frac(m,ind_wat_win) > 0.0_wp ) ) THEN
    7986               coef_window_1 = surf_usm_v(l)%rad_net_l(m) +                   & ! coef +1 corresponds to -lwout
     7990              coef_window_1 = surf_usm_v(l)%rad_net_l(m) +                   & ! Coef +1 corresponds to -lwout
    79877991                                                                               ! included in calculation of radnet_l
    79887992             ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(m,ind_wat_win) *                       &
     
    79927996           ENDIF
    79937997           IF ( ( humidity )  .AND.  ( surf_usm_v(l)%frac(m,ind_pav_green) > 0.0_wp ) )  THEN
    7994               coef_green_1 = surf_usm_v(l)%rad_net_l(m) +                      & ! coef +1 corresponds to -lwout
     7998              coef_green_1 = surf_usm_v(l)%rad_net_l(m) +                      & ! Coef +1 corresponds to -lwout
    79957999                                                                                 ! included in calculation of radnet_l
    79968000              ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(m,ind_pav_green) * sigma_sb *         &
     
    80008004                                   lambda_surface_green * t_wall_v(l)%t(nzb_wall,m)
    80018005           ELSE
    8002              coef_green_1 = surf_usm_v(l)%rad_net_l(m) +                       & ! coef +1 corresponds to -lwout included
     8006             coef_green_1 = surf_usm_v(l)%rad_net_l(m) +                       & ! Coef +1 corresponds to -lwout included
    80038007                                                                                 ! in calculation of radnet_l
    80048008             ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(m,ind_pav_green) * sigma_sb *          &
     
    80098013
    80108014!
    8011 !--        denominator of the prognostic equation
     8015!--        Denominator of the prognostic equation
    80128016           coef_2 = 4.0_wp * surf_usm_v(l)%emissivity(m,ind_veg_wall) * sigma_sb                   &
    80138017                    * t_surf_wall_v(l)%t(m)**3 + lambda_surface + f_shf / exner(k)
     
    80258029           ENDIF
    80268030!
    8027 !--        implicit solution when the surface layer has no heat capacity, otherwise use RK3 scheme.
     8031!--        Implicit solution when the surface layer has no heat capacity, otherwise use RK3 scheme.
    80288032           t_surf_wall_v_p(l)%t(m) = ( coef_1 * dt_3d * tsc(2) + surf_usm_v(l)%c_surface(m)        &
    80298033                                       * t_surf_wall_v(l)%t(m) ) / ( surf_usm_v(l)%c_surface(m)    &
     
    80428046                                        + coef_green_2 * dt_3d * tsc(2) )
    80438047!
    8044 !--        add RK3 term
     8048!--        Add RK3 term
    80458049           t_surf_wall_v_p(l)%t(m)   = t_surf_wall_v_p(l)%t(m) + dt_3d * tsc(3) *                  &
    80468050                                       surf_usm_v(l)%tt_surface_wall_m(m)
     
    80628066           IF ( humidity )  surf_usm_v(l)%vpt_surface(m) = surf_usm_v(l)%pt_surface(m)
    80638067!
    8064 !--        calculate true tendency
     8068!--        Calculate true tendency
    80658069           stend_wall = ( t_surf_wall_v_p(l)%t(m) - t_surf_wall_v(l)%t(m) - dt_3d * tsc(3) *       &
    80668070                          surf_usm_v(l)%tt_surface_wall_m(m) ) / ( dt_3d  * tsc(2) )
     
    80718075
    80728076!
    8073 !--        calculate t_surf_* tendencies for the next Runge-Kutta step
     8077!--        Calculate t_surf_* tendencies for the next Runge-Kutta step
    80748078           IF ( timestep_scheme(1:5) == 'runge' )  THEN
    80758079              IF ( intermediate_timestep_count == 1 )  THEN
     
    80888092
    80898093!
    8090 !--        in case of fast changes in the skin temperature, it is required to update the radiative
     8094!--        In case of fast changes in the skin temperature, it is required to update the radiative
    80918095!--        fluxes in order to keep the solution stable
    80928096
     
    80998103
    81008104!
    8101 !--        calculate fluxes
    8102 !--        prognostic rad_net_l is used just for output!
     8105!--        Calculate fluxes
     8106!--        Prognostic rad_net_l is used just for output!
    81038107           surf_usm_v(l)%rad_net_l(m) = surf_usm_v(l)%frac(m,ind_veg_wall) *                       &
    81048108                                        ( surf_usm_v(l)%rad_net_l(m) + 3.0_wp * sigma_sb *         &
     
    81248128
    81258129!
    8126 !--        ground/wall/roof surface heat flux
     8130!--        Ground/wall/roof surface heat flux
    81278131           surf_usm_v(l)%wshf_eb(m) = - f_shf  * ( surf_usm_v(l)%pt1(m) - t_surf_wall_v_p(l)%t(m)  &
    81288132                                      / exner(k) ) * surf_usm_v(l)%frac(m,ind_veg_wall)            &
     
    81348138
    81358139!
    8136 !--        store kinematic surface heat fluxes for utilization in other processes diffusion_s,
     8140!--        Store kinematic surface heat fluxes for utilization in other processes diffusion_s,
    81378141!--        surface_layer_fluxes,...
    81388142           surf_usm_v(l)%shf(m) = surf_usm_v(l)%wshf_eb(m) / c_p
     
    82218225!--      TO_DO: activate, if testcase is available
    82228226!--      !$OMP PARALLEL DO PRIVATE (i, j, k, acoef, rho_cp)
    8223 !--      it may also improve performance to move topo_top_ind before the k-loop
     8227!--      It may also improve performance to move topo_top_ind before the k-loop
    82248228         DO i = nxl, nxr
    82258229            DO j = nys, nyn
     
    82278231                  IF ( k > topo_top_ind(j,i,0) )  THEN
    82288232!
    8229 !--                 increase of pt in box i,j,k in time dt_3d given to anthropogenic heat
     8233!--                 Increase of pt in box i,j,k in time dt_3d given to anthropogenic heat
    82308234!--                 aheat*acoef (W*m-2)
    82318235!--                 linear interpolation of coeficient
     
    82368240                     IF ( aheat(k,j,i) > 0.0_wp )  THEN
    82378241!
    8238 !--                    calculate rho * c_p coefficient at layer k
     8242!--                    Calculate rho * c_p coefficient at layer k
    82398243                        rho_cp  = c_p * hyp(k) / ( r_d * pt(k+1,j,i) * exner(k) )
    82408244                        pt(k,j,i) = pt(k,j,i) + aheat(k,j,i) * acoef * dt_3d / (exner(k) * rho_cp  &
     
    83038307!!                                 ( surf_usm_h%ts(m) * surf_usm_h%us(m) + 1.0E-10_wp )
    83048308!!
    8305 !! !-    make sure that the resistance does not drop to zero
     8309!! !-    Make sure that the resistance does not drop to zero
    83068310!!       IF ( ABS(surf_usm_h%r_a_green(m)) < 1.0E-10_wp )  surf_usm_h%r_a_green(m) = 1.0E-10_wp
    83078311!
Note: See TracChangeset for help on using the changeset viewer.