Changeset 2333 for palm/trunk/SOURCE


Ignore:
Timestamp:
Aug 4, 2017 9:08:26 AM (7 years ago)
Author:
maronga
Message:

minor bugfixes in land surface model

File:
1 edited

Legend:

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

    r2332 r2333  
    2525! -----------------
    2626! $Id$
     27! minor bugfixes
     28!
     29! 2332 2017-08-03 21:15:22Z maronga
    2730! bugfix in pavement_pars
    2831!
     
    12671270    ENDDO
    12681271 
     1272!
     1273!-- Calculate grid spacings. Temperature and moisture are defined at
     1274!-- the center of the soil layers, whereas gradients/fluxes are
     1275!-- defined at the edges (_layer)
     1276!
     1277!-- Allocate global 1D arrays
     1278    ALLOCATE ( ddz_soil_center(nzb_soil:nzt_soil) )
     1279    ALLOCATE ( ddz_soil(nzb_soil:nzt_soil+1) )
     1280    ALLOCATE ( dz_soil_center(nzb_soil:nzt_soil) )
     1281    ALLOCATE ( zs(nzb_soil:nzt_soil+1) )
     1282
     1283    zs(nzb_soil) = 0.5_wp * dz_soil(nzb_soil)
     1284    zs_layer(nzb_soil) = dz_soil(nzb_soil)
     1285
     1286    DO  k = nzb_soil+1, nzt_soil
     1287       zs_layer(k) = zs_layer(k-1) + dz_soil(k)
     1288       zs(k) = (zs_layer(k) +  zs_layer(k-1)) * 0.5_wp
     1289    ENDDO
     1290
     1291    dz_soil(nzt_soil+1) = zs_layer(nzt_soil) + dz_soil(nzt_soil)
     1292    zs(nzt_soil+1) = zs_layer(nzt_soil) + 0.5_wp * dz_soil(nzt_soil)
     1293 
     1294    DO  k = nzb_soil, nzt_soil-1
     1295       dz_soil_center(k) = zs(k+1) - zs(k)
     1296       IF ( dz_soil_center(k) == 0.0_wp )  THEN
     1297          message_string = 'invalid soil layer configuration found ' //     &
     1298                           '(dz_soil_center(k) = 0.0)'
     1299          CALL message( 'lsm_read_restart_data', 'PA0140', 1, 2, 0, 6, 0 )
     1300       ENDIF 
     1301    ENDDO
     1302 
     1303    dz_soil_center(nzt_soil) = zs_layer(k-1) + dz_soil(k) - zs(nzt_soil)
     1304       
     1305    ddz_soil_center = 1.0_wp / dz_soil_center
     1306    ddz_soil = 1.0_wp / dz_soil
     1307
     1308
    12691309 END SUBROUTINE lsm_check_parameters
    12701310 
     
    21062146          ENDIF     
    21072147       ENDDO
    2108 
    2109 
    2110 
    2111 !
    2112 !--    Calculate grid spacings. Temperature and moisture are defined at
    2113 !--    the center of the soil layers, whereas gradients/fluxes are
    2114 !--    defined at the edges (_layer)
    2115        zs(nzb_soil) = 0.5_wp * dz_soil(nzb_soil)
    2116        zs_layer(nzb_soil) = dz_soil(nzb_soil)
    2117 
    2118        DO  k = nzb_soil+1, nzt_soil
    2119           zs_layer(k) = zs_layer(k-1) + dz_soil(k)
    2120           zs(k) = (zs_layer(k) +  zs_layer(k-1)) * 0.5_wp
    2121 
    2122        ENDDO
    2123 
    2124        dz_soil(nzt_soil+1) = zs_layer(nzt_soil) + dz_soil(nzt_soil)
    2125        zs(nzt_soil+1) = zs_layer(nzt_soil) + 0.5_wp * dz_soil(nzt_soil)
    2126  
    2127        DO  k = nzb_soil, nzt_soil-1
    2128           dz_soil_center(k) = zs(k+1) - zs(k)
    2129          
    2130           IF ( dz_soil_center(k) == 0.0_wp )  THEN
    2131              message_string = 'invalid soil layer configuration found ' //     &
    2132                               '(dz_soil_center(k) = 0.0)'
    2133              CALL message( 'lsm_read_restart_data', 'PA0140', 1, 2, 0, 6, 0 )
    2134           ENDIF 
    2135        ENDDO
    2136  
    2137        dz_soil_center(nzt_soil) = zs_layer(k-1) + dz_soil(k) - zs(nzt_soil)
    2138 
    2139        IF ( myid == 0 )  THEN
    2140           PRINT*, "zs:", zs
    2141           PRINT*, "zs_layer:", zs_layer
    2142           PRINT*, "dz_soil:", dz_soil
    2143           PRINT*, "dz_soil_center:", dz_soil_center
    2144        ENDIF
    2145 
    2146        
    2147        ddz_soil_center       = 1.0_wp / dz_soil_center
    2148        ddz_soil = 1.0_wp / dz_soil
    2149 
    2150 
    2151 
    2152 
    2153 
    2154 
    2155 !        DO  k = nzb_soil, nzt_soil-1
    2156 !           dz_soil_center(k) = zs(k+1) - zs(k)
    2157 !           
    2158 !           IF ( dz_soil_center(k) == 0.0_wp )  THEN
    2159 !              message_string = 'invalid soil layer configuration found ' //     &
    2160 !                               '(dz_soil_center(k) = 0.0)'
    2161 !              CALL message( 'lsm_read_restart_data', 'PA0140', 1, 2, 0, 6, 0 )
    2162 !           ENDIF
    2163 !           
    2164 !        ENDDO
    2165 !
    2166 !        dz_soil(nzb_soil) = 2.0_wp * zs(nzb_soil)
    2167 !        zs_layer(nzb_soil)      = 2.0_wp * zs(nzb_soil)
    2168 !   
    2169 !        DO  k = nzb_soil+1, nzt_soil
    2170 !           dz_soil(k) = ( zs(k) - zs_layer(k-1) ) * 2.0_wp
    2171 !           zs_layer(k) = zs_layer(k-1) + dz_soil(k)
    2172 !        ENDDO
    2173 !        dz_soil(nzt_soil+1) = 0.5_wp * dz_soil(nzt_soil)
    2174 !        dz_soil_center(nzt_soil) = zs_layer(k-1) + dz_soil(k) - zs(nzt_soil)
    2175 !
    2176 !       
    2177 !        ddz_soil_center       = 1.0_wp / dz_soil_center
    2178 !        ddz_soil = 1.0_wp / dz_soil
    2179 
    2180 
    2181 
    21822148
    21832149!
     
    27372703       INTEGER(iwp) ::  l !< index indicating facing of surface array
    27382704   
    2739 !
    2740 !--    Allocate global 1D arrays
    2741        ALLOCATE ( ddz_soil_center(nzb_soil:nzt_soil) )
    2742        ALLOCATE ( ddz_soil(nzb_soil:nzt_soil+1) )
    2743        ALLOCATE ( dz_soil_center(nzb_soil:nzt_soil) )
    27442705       ALLOCATE ( root_extr(nzb_soil:nzt_soil) )
    2745        ALLOCATE ( zs(nzb_soil:nzt_soil+1) )
    2746 
    27472706       root_extr = 0.0_wp
    27482707       
Note: See TracChangeset for help on using the changeset viewer.