Changeset 3597 for palm/trunk/SOURCE/land_surface_model_mod.f90
- Timestamp:
- Dec 4, 2018 8:40:18 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/land_surface_model_mod.f90
r3486 r3597 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added pt_2m / theta_2m. Removed unncessary _eb strings. 28 ! 29 ! 3486 2018-11-05 06:20:18Z maronga 27 30 ! Bugfix for liquid water treatment on pavements 28 31 ! … … 490 493 491 494 USE basic_constants_and_equations_mod, & 492 ONLY: c_p, g, lv_d_cp, l_v, magnus, rho_l, r_d, r_v, rd_d_rv495 ONLY: c_p, g, lv_d_cp, l_v, kappa, magnus, rho_l, r_d, r_v, rd_d_rv 493 496 494 497 USE calc_mean_profile_mod, & … … 530 533 531 534 USE surface_mod, & 532 ONLY : ind_pav_green, ind_veg_wall, ind_wat_win, surf_lsm_h,&533 surf_lsm_ v, surf_type, surface_restore_elements535 ONLY : ind_pav_green, ind_veg_wall, ind_wat_win, & 536 surf_lsm_h, surf_lsm_v, surf_type, surface_restore_elements 534 537 535 538 IMPLICIT NONE … … 750 753 c_soil_av, & !< average of c_soil 751 754 c_veg_av, & !< average of c_veg 752 lai_av, & !< average of lai 755 lai_av, & !< average of lai 753 756 qsws_liq_av, & !< average of qsws_liq 754 757 qsws_soil_av, & !< average of qsws_soil 755 758 qsws_veg_av, & !< average of qsws_veg 756 759 r_s_av !< average of r_s 757 758 760 759 761 ! 760 762 !-- Predefined Land surface classes (vegetation_type) … … 1000 1002 !-- Public functions 1001 1003 PUBLIC lsm_boundary_condition, lsm_check_data_output, & 1002 lsm_check_data_output_pr, 1004 lsm_check_data_output_pr, lsm_calc_pt_near_surface, & 1003 1005 lsm_check_parameters, lsm_define_netcdf_grid, lsm_3d_data_averaging,& 1004 1006 lsm_data_output_2d, lsm_data_output_3d, lsm_energy_balance, & … … 1021 1023 END INTERFACE lsm_boundary_condition 1022 1024 1025 INTERFACE lsm_calc_pt_near_surface 1026 MODULE PROCEDURE lsm_calc_pt_near_surface 1027 END INTERFACE lsm_calc_pt_near_surface 1028 1023 1029 INTERFACE lsm_check_data_output 1024 1030 MODULE PROCEDURE lsm_check_data_output … … 2340 2346 IF ( horizontal .AND. .NOT. constant_roughness ) CALL calc_z0_water_surface 2341 2347 2348 2342 2349 CONTAINS 2343 2350 !------------------------------------------------------------------------------! … … 2391 2398 2392 2399 ENDDO 2393 2400 2394 2401 END SUBROUTINE calc_q_surface 2395 2396 2397 2402 2398 2403 END SUBROUTINE lsm_energy_balance 2399 2404 2405 2400 2406 2401 2407 !------------------------------------------------------------------------------! … … 4923 4929 ALLOCATE ( surf_lsm_h%r_s(1:surf_lsm_h%ns) ) 4924 4930 ALLOCATE ( surf_lsm_h%r_canopy_min(1:surf_lsm_h%ns) ) 4931 ALLOCATE ( surf_lsm_h%pt_2m(1:surf_lsm_h%ns) ) 4925 4932 ALLOCATE ( surf_lsm_h%vegetation_surface(1:surf_lsm_h%ns) ) 4926 4933 ALLOCATE ( surf_lsm_h%water_surface(1:surf_lsm_h%ns) ) … … 5742 5749 ENDDO 5743 5750 ENDIF 5744 5751 5745 5752 CASE DEFAULT 5746 5753 CONTINUE … … 6090 6097 6091 6098 IF ( mode == 'xy' ) grid = 'zs' 6092 6099 6093 6100 CASE ( 'qsws_liq*_xy' ) ! 2d-array 6094 6101 IF ( av == 0 ) THEN … … 6208 6215 IF ( mode == 'xy' ) grid = 'zs' 6209 6216 6217 6210 6218 CASE DEFAULT 6211 6219 found = .FALSE. … … 6377 6385 WRITE ( 14 ) qsws_veg_av 6378 6386 ENDIF 6379 6387 6380 6388 IF ( ALLOCATED( t_soil_av ) ) THEN 6381 6389 CALL wrd_write_string( 't_soil_av' ) … … 6676 6684 t_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 6677 6685 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 6678 6686 6679 6687 CASE ( 'lsm_start_index_h', 'lsm_start_index_v' ) 6680 6688 IF ( k == 1 ) THEN … … 7196 7204 END SUBROUTINE calc_z0_water_surface 7197 7205 7198 7199 7206 7207 !------------------------------------------------------------------------------! 7208 ! Description: 7209 ! ------------ 7210 !> Calculates 2m temperature for data output at coarse resolution 7211 !------------------------------------------------------------------------------! 7212 SUBROUTINE lsm_calc_pt_near_surface 7213 7214 IMPLICIT NONE 7215 7216 INTEGER(iwp) :: i, j, k, l, m !< running indices 7217 7218 7219 DO m = 1, surf_lsm_h%ns 7220 7221 i = surf_lsm_h%i(m) 7222 j = surf_lsm_h%j(m) 7223 k = surf_lsm_h%k(m) 7224 7225 surf_lsm_h%pt_2m(m) = surf_lsm_h%pt_surface(m) + surf_lsm_h%ts(m) / kappa & 7226 * ( log( 2.0_wp / surf_lsm_h%z0h(m) ) & 7227 - psi_h( 2.0_wp / surf_lsm_h%ol(m) ) & 7228 + psi_h( surf_lsm_h%z0h(m) / surf_lsm_h%ol(m) ) ) 7229 7230 ENDDO 7231 7232 END SUBROUTINE lsm_calc_pt_near_surface 7233 7234 7235 7236 ! 7237 !-- Integrated stability function for heat and moisture 7238 FUNCTION psi_h( zeta ) 7239 7240 USE kinds 7241 7242 IMPLICIT NONE 7243 7244 REAL(wp) :: psi_h !< Integrated similarity function result 7245 REAL(wp) :: zeta !< Stability parameter z/L 7246 REAL(wp) :: x !< dummy variable 7247 7248 REAL(wp), PARAMETER :: a = 1.0_wp !< constant 7249 REAL(wp), PARAMETER :: b = 0.66666666666_wp !< constant 7250 REAL(wp), PARAMETER :: c = 5.0_wp !< constant 7251 REAL(wp), PARAMETER :: d = 0.35_wp !< constant 7252 REAL(wp), PARAMETER :: c_d_d = c / d !< constant 7253 REAL(wp), PARAMETER :: bc_d_d = b * c / d !< constant 7254 7255 7256 IF ( zeta < 0.0_wp ) THEN 7257 x = SQRT( 1.0_wp - 16.0_wp * zeta ) 7258 psi_h = 2.0_wp * LOG( (1.0_wp + x ) / 2.0_wp ) 7259 ELSE 7260 psi_h = - b * ( zeta - c_d_d ) * EXP( -d * zeta ) - (1.0_wp & 7261 + 0.66666666666_wp * a * zeta )**1.5_wp - bc_d_d & 7262 + 1.0_wp 7263 ! 7264 !-- Old version for stable conditions (only valid for z/L < 0.5) 7265 !-- psi_h = - 5.0_wp * zeta 7266 ENDIF 7267 7268 END FUNCTION psi_h 7269 7200 7270 END MODULE land_surface_model_mod
Note: See TracChangeset
for help on using the changeset viewer.