Changeset 1691 for palm/trunk/SOURCE
- Timestamp:
- Oct 26, 2015 4:17:44 PM (9 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 1 added
- 1 deleted
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/Makefile
r1586 r1691 13 13 # PALM. If not, see <http://www.gnu.org/licenses/>. 14 14 # 15 # Copyright 1997-201 4Leibniz Universitaet Hannover15 # Copyright 1997-2015 Leibniz Universitaet Hannover 16 16 #--------------------------------------------------------------------------------# 17 17 # … … 20 20 # Current revisions: 21 21 # ------------------ 22 # 22 # Replaced prandtl_fluxes with surface_layer_fluxes. Added radiation_model to 23 # prognostic_equations 23 24 # 24 25 # Former revisions: … … 239 240 mod_particle_attributes.f90 netcdf.f90 nudging.f90 package_parin.f90 \ 240 241 palm.f90 parin.f90 plant_canopy_model.f90 poisfft.f90 poismg.f90 \ 241 poismg_fast.f90 pr andtl_fluxes.f90 pres.f90 print_1d.f90 production_e.f90 \242 poismg_fast.f90 pres.f90 print_1d.f90 production_e.f90 \ 242 243 prognostic_equations.f90 progress_bar.f90 radiation_model.f90 \ 243 244 random_function.f90 random_gauss.f90 random_generator_parallel.f90 \ … … 245 246 set_slicer_attributes_dvrp.f90 singleton.f90 sor.f90 \ 246 247 subsidence.f90 sum_up_3d_data.f90 \ 247 surface_coupler.f90 s wap_timelevel.f90 temperton_fft.f90 \248 surface_coupler.f90 surface_layer_fluxes.f90 swap_timelevel.f90 temperton_fft.f90 \ 248 249 time_integration.f90 time_to_string.f90 timestep.f90 \ 249 250 timestep_scheme_steering.f90 transpose.f90 tridia_solver.f90 \ … … 356 357 init_3d_model.o: modules.o cpulog.o mod_kinds.o random_function.o advec_ws.o\ 357 358 land_surface_model.o ls_forcing.o lpm_init.o plant_canopy_model.o\ 358 radiation_model.o random_generator_parallel.o359 radiation_model.o random_generator_parallel.o surface_layer_fluxes.o 359 360 init_advec.o: modules.o mod_kinds.o 360 361 init_cloud_physics.o: modules.o mod_kinds.o … … 421 422 poismg.o: modules.o cpulog.o mod_kinds.o 422 423 poismg_fast.o: modules.o cpulog.o mod_kinds.o 423 prandtl_fluxes.o: modules.o mod_kinds.o424 424 pres.o: modules.o cpulog.o mod_kinds.o poisfft.o poismg_fast.o 425 425 print_1d.o: modules.o cpulog.o mod_kinds.o … … 430 430 cpulog.o diffusion_e.o diffusion_s.o diffusion_u.o diffusion_v.o diffusion_w.o \ 431 431 eqn_state_seawater.o impact_of_latent_heat.o mod_kinds.o microphysics.o \ 432 nudging.o plant_canopy_model.o production_e.o subsidence.o user_actions.o 432 nudging.o plant_canopy_model.o production_e.o radiation_model.o \ 433 subsidence.o user_actions.o 433 434 progress_bar.o: modules.o mod_kinds.o 434 435 radiation_model.o : modules.o mod_particle_attributes.o … … 446 447 subsidence.o: modules.o mod_kinds.o 447 448 sum_up_3d_data.o: modules.o cpulog.o mod_kinds.o land_surface_model.o\ 448 radiation_model.o 449 radiation_model.o 449 450 surface_coupler.o: modules.o cpulog.o mod_kinds.o 451 surface_layer_fluxes.o: modules.o mod_kinds.o land_surface_model.o 450 452 swap_timelevel.o: modules.o cpulog.o mod_kinds.o land_surface_model.o 451 453 temperton_fft.o: modules.o mod_kinds.o … … 454 456 ls_forcing.o mod_kinds.o nudging.o production_e.o \ 455 457 prognostic_equations.o progress_bar.o radiation_model.o \ 456 user_actions.o458 user_actions.o surface_layer_fluxes.o 457 459 time_to_string.o: mod_kinds.o 458 460 timestep.o: modules.o cpulog.o mod_kinds.o … … 492 494 radiation_model.o random_function.o\ 493 495 random_generator_parallel.o 494 write_var_list.o: modules.o mod_kinds.o plant_canopy_model.o 496 write_var_list.o: modules.o mod_kinds.o plant_canopy_model.o -
palm/trunk/SOURCE/advec_s_bc.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Formatting corrections 22 22 ! 23 23 ! Former revisions: … … 464 464 IF ( sw(k,i+1) == 1.0_wp ) THEN 465 465 snenn = sk_p(k,j,i) - sk_p(k,j,i+2) 466 IF ( ABS( snenn ) .LT.1E-9_wp ) snenn = 1E-9_wp466 IF ( ABS( snenn ) < 1E-9_wp ) snenn = 1E-9_wp 467 467 sterm = ( sk_p(k,j,i+1) - sk_p(k,j,i+2) ) / snenn 468 468 sterm = MIN( sterm, 0.9999_wp ) … … 760 760 IF ( sw(k,j+1) == 1.0_wp ) THEN 761 761 snenn = sk_p(k,j,i) - sk_p(k,j+2,i) 762 IF ( ABS( snenn ) .LT.1E-9_wp ) snenn = 1E-9_wp762 IF ( ABS( snenn ) < 1E-9_wp ) snenn = 1E-9_wp 763 763 sterm = ( sk_p(k,j+1,i) - sk_p(k,j+2,i) ) / snenn 764 764 sterm = MIN( sterm, 0.9999_wp ) … … 1209 1209 IF ( sw(k+1,j) == 1.0_wp ) THEN 1210 1210 snenn = sk_p(k,j,i) - sk_p(k+2,j,i) 1211 IF ( ABS( snenn ) .LT.1E-9_wp ) snenn = 1E-9_wp1211 IF ( ABS( snenn ) < 1E-9_wp ) snenn = 1E-9_wp 1212 1212 sterm = ( sk_p(k+1,j,i) - sk_p(k+2,j,i) ) / snenn 1213 1213 sterm = MIN( sterm, 0.9999_wp ) -
palm/trunk/SOURCE/average_3d_data.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added output of Obukhov length and radiative heating rates for RRTMG. 22 22 ! 23 23 ! Former revisions: … … 96 96 USE radiation_model_mod, & 97 97 ONLY: rad_net, rad_net_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & 98 rad_lw_out_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & 99 rad_sw_out_av 98 rad_lw_out_av, rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, & 99 rad_lw_hr_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & 100 rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, & 101 rad_sw_hr_av 102 100 103 101 104 IMPLICIT NONE … … 213 216 ENDDO 214 217 218 CASE ( 'ol*' ) 219 DO i = nxlg, nxrg 220 DO j = nysg, nyng 221 ol_av(j,i) = ol_av(j,i) / REAL( average_count_3d, KIND=wp ) 222 ENDDO 223 ENDDO 224 215 225 CASE ( 'p' ) 216 226 DO i = nxlg, nxrg … … 383 393 ENDDO 384 394 395 CASE ( 'rad_lw_cs_hr' ) 396 DO i = nxlg, nxrg 397 DO j = nysg, nyng 398 DO k = nzb, nzt+1 399 rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 400 ENDDO 401 ENDDO 402 ENDDO 403 404 CASE ( 'rad_lw_hr' ) 405 DO i = nxlg, nxrg 406 DO j = nysg, nyng 407 DO k = nzb, nzt+1 408 rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 409 ENDDO 410 ENDDO 411 ENDDO 412 385 413 CASE ( 'rad_sw_in' ) 386 414 DO i = nxlg, nxrg … … 397 425 DO k = nzb, nzt+1 398 426 rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 427 ENDDO 428 ENDDO 429 ENDDO 430 431 CASE ( 'rad_sw_cs_hr' ) 432 DO i = nxlg, nxrg 433 DO j = nysg, nyng 434 DO k = nzb, nzt+1 435 rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 436 ENDDO 437 ENDDO 438 ENDDO 439 440 CASE ( 'rad_sw_hr' ) 441 DO i = nxlg, nxrg 442 DO j = nysg, nyng 443 DO k = nzb, nzt+1 444 rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 399 445 ENDDO 400 446 ENDDO -
palm/trunk/SOURCE/check_parameters.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added output of Obukhov length (ol) and radiative heating rates for RRTMG. 22 ! Added checks for use of radiation / lsm with topography. 22 23 ! 23 24 ! Former revisions: … … 307 308 USE transpose_indices 308 309 310 309 311 IMPLICIT NONE 310 312 … … 650 652 WRITE( action, '(A)' ) 'cloud_droplets = .TRUE.' 651 653 ENDIF 652 IF ( .NOT. prandtl_layer ) THEN653 WRITE( action, '(A)' ) ' prandtl_layer = .FALSE.'654 IF ( .NOT. constant_flux_layer ) THEN 655 WRITE( action, '(A)' ) 'constant_flux_layer = .FALSE.' 654 656 ENDIF 655 657 IF ( action /= ' ' ) THEN … … 1007 1009 ENDIF 1008 1010 1009 IF ( .NOT. prandtl_layer ) THEN1011 IF ( .NOT. constant_flux_layer ) THEN 1010 1012 message_string = 'lsm requires '// & 1011 ' prandtl_layer = .T.'1013 'constant_flux_layer = .T.' 1012 1014 CALL message( 'check_parameters', 'PA0400', 1, 2, 0, 6, 0 ) 1015 ENDIF 1016 1017 IF ( topography /= 'flat' ) THEN 1018 message_string = 'lsm cannot be used ' // & 1019 'in combination with topography /= "flat"' 1020 CALL message( 'check_parameters', 'PA0415', 1, 2, 0, 6, 0 ) 1013 1021 ENDIF 1014 1022 … … 1196 1204 CALL message( 'check_parameters', 'PA0411', 1, 2, 0, 6, 0 ) 1197 1205 ENDIF 1198 1199 ENDIF 1200 1206 IF ( topography /= 'flat' ) THEN 1207 message_string = 'radiation scheme cannot be used ' // & 1208 'in combination with topography /= "flat"' 1209 CALL message( 'check_parameters', 'PA0414', 1, 2, 0, 6, 0 ) 1210 ENDIF 1211 ENDIF 1201 1212 1202 1213 IF ( .NOT. ( loop_optimization == 'cache' .OR. & … … 1729 1740 !-- In case of using a prandtl-layer, calculated (or prescribed) surface 1730 1741 !-- fluxes have to be used in the diffusion-terms 1731 IF ( prandtl_layer ) use_surface_fluxes = .TRUE.1742 IF ( constant_flux_layer ) use_surface_fluxes = .TRUE. 1732 1743 1733 1744 ! … … 1796 1807 ELSEIF ( bc_e_b == '(u*)**2+neumann' ) THEN 1797 1808 ibc_e_b = 2 1798 IF ( .NOT. prandtl_layer ) THEN1809 IF ( .NOT. constant_flux_layer ) THEN 1799 1810 bc_e_b = 'neumann' 1800 1811 ibc_e_b = 1 … … 2003 2014 IF ( surface_waterflux == 9999999.9_wp ) THEN 2004 2015 constant_waterflux = .FALSE. 2005 IF ( large_scale_forcing ) THEN2016 IF ( large_scale_forcing .OR. land_surface ) THEN 2006 2017 IF ( ibc_q_b == 0 ) THEN 2007 2018 constant_waterflux = .FALSE. … … 2045 2056 ELSEIF ( bc_uv_b == 'neumann' ) THEN 2046 2057 ibc_uv_b = 1 2047 IF ( prandtl_layer ) THEN2058 IF ( constant_flux_layer ) THEN 2048 2059 message_string = 'boundary condition: bc_uv_b = "' // & 2049 TRIM( bc_uv_b ) // '" is not allowed with prandtl_layer = .TRUE.' 2060 TRIM( bc_uv_b ) // '" is not allowed with constant_flux_layer' & 2061 // ' = .TRUE.' 2050 2062 CALL message( 'check_parameters', 'PA0075', 1, 2, 0, 6, 0 ) 2051 2063 ENDIF … … 2356 2368 dopr_unit(i) = 'm2/s2' 2357 2369 hom(:,2,12,:) = SPREAD( zw, 2, statistic_regions+1 ) 2358 IF ( prandtl_layer ) hom(nzb,2,12,:) = zu(1)2370 IF ( constant_flux_layer ) hom(nzb,2,12,:) = zu(1) 2359 2371 2360 2372 CASE ( 'w*u*' ) … … 2367 2379 dopr_unit(i) = 'm2/s2' 2368 2380 hom(:,2,14,:) = SPREAD( zw, 2, statistic_regions+1 ) 2369 IF ( prandtl_layer ) hom(nzb,2,14,:) = zu(1)2381 IF ( constant_flux_layer ) hom(nzb,2,14,:) = zu(1) 2370 2382 2371 2383 CASE ( 'w*v*' ) … … 2393 2405 dopr_unit(i) = 'm2/s2' 2394 2406 hom(:,2,19,:) = SPREAD( zw, 2, statistic_regions+1 ) 2395 IF ( prandtl_layer ) hom(nzb,2,19,:) = zu(1)2407 IF ( constant_flux_layer ) hom(nzb,2,19,:) = zu(1) 2396 2408 2397 2409 CASE ( 'wv' ) … … 2399 2411 dopr_unit(i) = 'm2/s2' 2400 2412 hom(:,2,20,:) = SPREAD( zw, 2, statistic_regions+1 ) 2401 IF ( prandtl_layer ) hom(nzb,2,20,:) = zu(1)2413 IF ( constant_flux_layer ) hom(nzb,2,20,:) = zu(1) 2402 2414 2403 2415 CASE ( 'w*pt*BC' ) … … 3153 3165 ENDIF 3154 3166 3167 CASE ( 'rad_lw_cs_hr' ) 3168 IF ( (.NOT. radiation) .OR. radiation_scheme /= 'rrtmg' ) THEN 3169 message_string = 'data_output_pr = ' // & 3170 TRIM( data_output_pr(i) ) // ' is not ava' // & 3171 'lable for radiation = .FALSE. or ' // & 3172 'radiation_scheme /= "rrtmg"' 3173 CALL message( 'check_parameters', 'PA0413', 1, 2, 0, 6, 0 ) 3174 ELSE 3175 dopr_index(i) = 106 3176 dopr_unit(i) = 'K/h' 3177 hom(:,2,106,:) = SPREAD( zu, 2, statistic_regions+1 ) 3178 ENDIF 3179 3180 CASE ( 'rad_lw_hr' ) 3181 IF ( (.NOT. radiation) .OR. radiation_scheme /= 'rrtmg' ) THEN 3182 message_string = 'data_output_pr = ' // & 3183 TRIM( data_output_pr(i) ) // ' is not ava' // & 3184 'lable for radiation = .FALSE. or ' // & 3185 'radiation_scheme /= "rrtmg"' 3186 CALL message( 'check_parameters', 'PA0413', 1, 2, 0, 6, 0 ) 3187 ELSE 3188 dopr_index(i) = 107 3189 dopr_unit(i) = 'K/h' 3190 hom(:,2,107,:) = SPREAD( zu, 2, statistic_regions+1 ) 3191 ENDIF 3192 3193 CASE ( 'rad_sw_cs_hr' ) 3194 IF ( (.NOT. radiation) .OR. radiation_scheme /= 'rrtmg' ) THEN 3195 message_string = 'data_output_pr = ' // & 3196 TRIM( data_output_pr(i) ) // ' is not ava' // & 3197 'lable for radiation = .FALSE. or ' // & 3198 'radiation_scheme /= "rrtmg"' 3199 CALL message( 'check_parameters', 'PA0413', 1, 2, 0, 6, 0 ) 3200 ELSE 3201 dopr_index(i) = 108 3202 dopr_unit(i) = 'K/h' 3203 hom(:,2,108,:) = SPREAD( zu, 2, statistic_regions+1 ) 3204 ENDIF 3205 3206 CASE ( 'rad_sw_hr' ) 3207 IF ( (.NOT. radiation) .OR. radiation_scheme /= 'rrtmg' ) THEN 3208 message_string = 'data_output_pr = ' // & 3209 TRIM( data_output_pr(i) ) // ' is not ava' // & 3210 'lable for radiation = .FALSE. or ' // & 3211 'radiation_scheme /= "rrtmg"' 3212 CALL message( 'check_parameters', 'PA0413', 1, 2, 0, 6, 0 ) 3213 ELSE 3214 dopr_index(i) = 109 3215 dopr_unit(i) = 'K/h' 3216 hom(:,2,109,:) = SPREAD( zu, 2, statistic_regions+1 ) 3217 ENDIF 3218 3155 3219 CASE DEFAULT 3156 3220 … … 3351 3415 unit = 'kg/kg' 3352 3416 3353 3354 CASE ( 'rad_lw_in', 'rad_lw_out', 'rad_sw_in', 'rad_sw_out' )3417 CASE ( 'rad_lw_in', 'rad_lw_out', 'rad_lw_cs_hr', 'rad_lw_hr', & 3418 'rad_sw_in', 'rad_sw_out', 'rad_sw_cs_hr', 'rad_sw_hr' ) 3355 3419 IF ( .NOT. radiation .OR. radiation_scheme /= 'rrtmg' ) THEN 3356 message_string = '"output of "' // TRIM( var ) // '" requi' // 3420 message_string = '"output of "' // TRIM( var ) // '" requi' // & 3357 3421 'res radiation = .TRUE. and ' // & 3358 3422 'radiation_scheme = "rrtmg"' … … 3395 3459 3396 3460 CASE ( 'c_liq*', 'c_soil*', 'c_veg*', 'ghf_eb*', 'lai*', 'lwp*', & 3397 'm_liq_eb*', ' pra*', 'prr*', 'qsws*', 'qsws_eb*',&3461 'm_liq_eb*', 'ol*', 'pra*', 'prr*', 'qsws*', 'qsws_eb*', & 3398 3462 'qsws_liq_eb*', 'qsws_soil_eb*', 'qsws_veg_eb*', 'rad_net*', & 3399 3463 'rrtm_aldif*', 'rrtm_aldir*', 'rrtm_asdif*', 'rrtm_asdir*', & … … 3514 3578 IF ( TRIM( var ) == 'ghf_eb*') unit = 'W/m2' 3515 3579 IF ( TRIM( var ) == 'lai*' ) unit = 'none' 3516 IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/kg*m' 3580 IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/m2' 3581 IF ( TRIM( var ) == 'm_liq_eb*' ) unit = 'm' 3582 IF ( TRIM( var ) == 'ol*' ) unit = 'm' 3517 3583 IF ( TRIM( var ) == 'pra*' ) unit = 'mm' 3518 3584 IF ( TRIM( var ) == 'prr*' ) unit = 'mm/s' … … 3788 3854 constant_diffusion = .TRUE. 3789 3855 3790 IF ( prandtl_layer ) THEN3791 message_string = ' prandtl_layer is not allowed with fixed ' //&3792 'value of km'3856 IF ( constant_flux_layer ) THEN 3857 message_string = 'constant_flux_layer is not allowed with fixed ' & 3858 // 'value of km' 3793 3859 CALL message( 'check_parameters', 'PA0123', 1, 2, 0, 6, 0 ) 3794 3860 ENDIF … … 3816 3882 3817 3883 ! 3818 !-- Check value range for rif3819 IF ( rif_min >= rif_max ) THEN3820 WRITE( message_string, * ) ' rif_min = ', rif_min, ' must be less ',&3821 'than rif_max = ', rif_max3884 !-- Check value range for zeta = z/L 3885 IF ( zeta_min >= zeta_max ) THEN 3886 WRITE( message_string, * ) 'zeta_min = ', zeta_min, ' must be less ', & 3887 'than zeta_max = ', zeta_max 3822 3888 CALL message( 'check_parameters', 'PA0125', 1, 2, 0, 6, 0 ) 3823 3889 ENDIF … … 4235 4301 4236 4302 ! 4303 !-- Check for valid setting of most_method 4304 IF ( TRIM( most_method ) /= 'circular' .AND. & 4305 TRIM( most_method ) /= 'newton' .AND. & 4306 TRIM( most_method ) /= 'lookup' ) THEN 4307 message_string = 'most_method = "' // TRIM( most_method ) // & 4308 '" is unknown' 4309 CALL message( 'check_parameters', 'PA0416', 1, 2, 0, 6, 0 ) 4310 ENDIF 4311 4312 ! 4237 4313 !-- Check &userpar parameters 4238 4314 CALL user_check_parameters -
palm/trunk/SOURCE/data_output_2d.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added output of Obukhov length (ol) and radiative heating rates for RRTMG. 22 ! Formatting corrections. 22 23 ! 23 24 ! Former revisions: … … 112 113 113 114 USE arrays_3d, & 114 ONLY: dzw, e, nr, p, pt, q, qc, ql, ql_c, ql_v, ql_vp, qr, qsws,&115 ONLY: dzw, e, nr, ol, p, pt, q, qc, ql, ql_c, ql_v, ql_vp, qr, qsws, & 115 116 rho, sa, shf, tend, ts, u, us, v, vpt, w, z0, z0h, zu, zw 116 117 … … 162 163 USE radiation_model_mod, & 163 164 ONLY: rad_net, rad_net_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & 164 rad_sw_out_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & 165 rad_lw_out_av 165 rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, & 166 rad_sw_hr_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & 167 rad_lw_out_av, rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, & 168 rad_lw_hr_av 166 169 167 170 IMPLICIT NONE … … 543 546 IF ( mode == 'xy' ) level_z = zu 544 547 548 CASE ( 'ol*_xy' ) ! 2d-array 549 IF ( av == 0 ) THEN 550 DO i = nxlg, nxrg 551 DO j = nysg, nyng 552 local_pf(i,j,nzb+1) = ol(j,i) 553 ENDDO 554 ENDDO 555 ELSE 556 DO i = nxlg, nxrg 557 DO j = nysg, nyng 558 local_pf(i,j,nzb+1) = ol_av(j,i) 559 ENDDO 560 ENDDO 561 ENDIF 562 resorted = .TRUE. 563 two_d = .TRUE. 564 level_z(nzb+1) = zu(nzb+1) 565 545 566 CASE ( 'p_xy', 'p_xz', 'p_yz' ) 546 567 IF ( av == 0 ) THEN … … 937 958 ENDIF 938 959 960 CASE ( 'rad_lw_cs_hr_xy', 'rad_lw_cs_hr_xz', 'rad_lw_cs_hr_yz' ) 961 IF ( av == 0 ) THEN 962 to_be_resorted => rad_lw_cs_hr 963 ELSE 964 to_be_resorted => rad_lw_cs_hr_av 965 ENDIF 966 967 CASE ( 'rad_lw_hr_xy', 'rad_lw_hr_xz', 'rad_lw_hr_yz' ) 968 IF ( av == 0 ) THEN 969 to_be_resorted => rad_lw_hr 970 ELSE 971 to_be_resorted => rad_lw_hr_av 972 ENDIF 973 939 974 CASE ( 'rad_sw_in_xy', 'rad_sw_in_xz', 'rad_sw_in_yz' ) 940 975 IF ( av == 0 ) THEN … … 949 984 ELSE 950 985 to_be_resorted => rad_sw_out_av 986 ENDIF 987 988 CASE ( 'rad_sw_cs_hr_xy', 'rad_sw_cs_hr_xz', 'rad_sw_cs_hr_yz' ) 989 IF ( av == 0 ) THEN 990 to_be_resorted => rad_sw_cs_hr 991 ELSE 992 to_be_resorted => rad_sw_cs_hr_av 993 ENDIF 994 995 CASE ( 'rad_sw_hr_xy', 'rad_sw_hr_xz', 'rad_sw_hr_yz' ) 996 IF ( av == 0 ) THEN 997 to_be_resorted => rad_sw_hr 998 ELSE 999 to_be_resorted => rad_sw_hr_av 951 1000 ENDIF 952 1001 … … 1227 1276 !-- Exit the loop for layers beyond the data output domain 1228 1277 !-- (used for soil model) 1229 IF ( layer_xy .GT.nzt_do ) THEN1278 IF ( layer_xy > nzt_do ) THEN 1230 1279 EXIT loop1 1231 1280 ENDIF -
palm/trunk/SOURCE/data_output_3d.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Added output of radiative heating rates for RRTMG 22 22 ! 23 23 ! Former revisions: … … 138 138 USE radiation_model_mod, & 139 139 ONLY: rad_lw_in, rad_lw_in_av, rad_lw_out, rad_lw_out_av, & 140 rad_sw_in, rad_sw_in_av, rad_sw_out, rad_sw_out_av 140 rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, rad_lw_hr_av, & 141 rad_sw_in, rad_sw_in_av, rad_sw_out, rad_sw_out_av, & 142 rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, rad_sw_hr_av 141 143 142 144 … … 495 497 ENDIF 496 498 499 CASE ( 'rad_sw_cs_hr' ) 500 IF ( av == 0 ) THEN 501 to_be_resorted => rad_sw_cs_hr 502 ELSE 503 to_be_resorted => rad_sw_cs_hr_av 504 ENDIF 505 506 CASE ( 'rad_sw_hr' ) 507 IF ( av == 0 ) THEN 508 to_be_resorted => rad_sw_hr 509 ELSE 510 to_be_resorted => rad_sw_hr_av 511 ENDIF 512 497 513 CASE ( 'rad_lw_in' ) 498 514 IF ( av == 0 ) THEN … … 507 523 ELSE 508 524 to_be_resorted => rad_lw_out_av 525 ENDIF 526 527 CASE ( 'rad_lw_cs_hr' ) 528 IF ( av == 0 ) THEN 529 to_be_resorted => rad_lw_cs_hr 530 ELSE 531 to_be_resorted => rad_lw_cs_hr_av 532 ENDIF 533 534 CASE ( 'rad_lw_hr' ) 535 IF ( av == 0 ) THEN 536 to_be_resorted => rad_lw_hr 537 ELSE 538 to_be_resorted => rad_lw_hr_av 509 539 ENDIF 510 540 -
palm/trunk/SOURCE/data_output_mask.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added output of radiative heating rates for RRTMG 22 22 ! 23 23 ! Former revisions: … … 119 119 USE radiation_model_mod, & 120 120 ONLY: rad_lw_in, rad_lw_in_av, rad_lw_out, rad_lw_out_av, & 121 rad_sw_in, rad_sw_in_av, rad_sw_out, rad_sw_out_av 121 rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, rad_lw_hr_av, & 122 rad_sw_in, rad_sw_in_av, rad_sw_out, rad_sw_out_av, & 123 rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, rad_sw_hr_av 124 122 125 123 126 IMPLICIT NONE … … 405 408 ENDIF 406 409 410 CASE ( 'rad_lw_in' ) 411 IF ( av == 0 ) THEN 412 to_be_resorted => rad_lw_in 413 ELSE 414 to_be_resorted => rad_lw_in_av 415 ENDIF 416 417 CASE ( 'rad_lw_out' ) 418 IF ( av == 0 ) THEN 419 to_be_resorted => rad_lw_out 420 ELSE 421 to_be_resorted => rad_lw_out_av 422 ENDIF 423 424 CASE ( 'rad_lw_cs_hr' ) 425 IF ( av == 0 ) THEN 426 to_be_resorted => rad_lw_cs_hr 427 ELSE 428 to_be_resorted => rad_lw_cs_hr_av 429 ENDIF 430 431 CASE ( 'rad_lw_hr' ) 432 IF ( av == 0 ) THEN 433 to_be_resorted => rad_lw_hr 434 ELSE 435 to_be_resorted => rad_lw_hr_av 436 ENDIF 437 407 438 CASE ( 'rad_sw_in' ) 408 439 IF ( av == 0 ) THEN … … 419 450 ENDIF 420 451 421 CASE ( 'rad_ lw_in' )422 IF ( av == 0 ) THEN 423 to_be_resorted => rad_ lw_in424 ELSE 425 to_be_resorted => rad_ lw_in_av426 ENDIF 427 428 CASE ( 'rad_ lw_out' )429 IF ( av == 0 ) THEN 430 to_be_resorted => rad_ lw_out431 ELSE 432 to_be_resorted => rad_ lw_out_av452 CASE ( 'rad_sw_cs_hr' ) 453 IF ( av == 0 ) THEN 454 to_be_resorted => rad_sw_cs_hr 455 ELSE 456 to_be_resorted => rad_sw_cs_hr_av 457 ENDIF 458 459 CASE ( 'rad_sw_hr' ) 460 IF ( av == 0 ) THEN 461 to_be_resorted => rad_sw_hr 462 ELSE 463 to_be_resorted => rad_sw_hr_av 433 464 ENDIF 434 465 -
palm/trunk/SOURCE/diffusion_s.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Formatting corrections. 22 22 ! 23 23 ! Former revisions: … … 144 144 ! 145 145 !-- Apply prescribed horizontal wall heatflux where necessary 146 IF ( ( wall_w_x(j,i) .NE. 0.0_wp ) .OR. ( wall_w_y(j,i) .NE. 0.0_wp )) &147 THEN146 IF ( ( wall_w_x(j,i) /= 0.0_wp ) .OR. ( wall_w_y(j,i) /= 0.0_wp ) & 147 ) THEN 148 148 DO k = nzb_s_inner(j,i)+1, nzb_s_outer(j,i) 149 149 … … 400 400 ! 401 401 !-- Apply prescribed horizontal wall heatflux where necessary 402 IF ( ( wall_w_x(j,i) .NE. 0.0_wp ) .OR. ( wall_w_y(j,i) .NE. 0.0_wp ) )&402 IF ( ( wall_w_x(j,i) /= 0.0_wp ) .OR. ( wall_w_y(j,i) /= 0.0_wp ) ) & 403 403 THEN 404 404 DO k = nzb_s_inner(j,i)+1, nzb_s_outer(j,i) -
palm/trunk/SOURCE/diffusion_u.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Formatting corrections. 22 22 ! 23 23 ! Former revisions: … … 508 508 ! 509 509 !-- Wall functions at the north and south walls, respectively 510 IF ( wall_u(j,i) .NE.0.0_wp ) THEN510 IF ( wall_u(j,i) /= 0.0_wp ) THEN 511 511 512 512 ! -
palm/trunk/SOURCE/flow_statistics.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Revised calculation of Obukhov length. Added output of radiative heating > 22 ! rates for RRTMG. 22 23 ! 23 24 ! Former revisions: … … 161 162 162 163 USE arrays_3d, & 163 ONLY: ddzu, ddzw, e, hyp, km, kh, nr, p, prho, pt, q, qc, ql, qr, qs, &164 qs ws, qswst, rho, sa, saswsb, saswst, shf, td_lsa_lpt, td_lsa_q,&165 td_ sub_lpt, td_sub_q, time_vert, ts, tswst, u, ug, us, usws, &166 usws t, vsws, v, vg, vpt, vswst, w, w_subs, zw164 ONLY: ddzu, ddzw, e, hyp, km, kh, nr, ol, p, prho, pt, q, qc, ql, qr, & 165 qs, qsws, qswst, rho, sa, saswsb, saswst, shf, td_lsa_lpt, & 166 td_lsa_q, td_sub_lpt, td_sub_q, time_vert, ts, tswst, u, ug, us,& 167 usws, uswst, vsws, v, vg, vpt, vswst, w, w_subs, zw 167 168 168 169 USE cloud_parameters, & … … 172 173 ONLY: average_count_pr, cloud_droplets, cloud_physics, do_sum, & 173 174 dt_3d, g, humidity, icloud_scheme, kappa, large_scale_forcing, & 174 large_scale_subsidence, max_pr_user, message_string, ocean,&175 passive_scalar, precipitation, simulated_time,&175 large_scale_subsidence, max_pr_user, message_string, neutral, & 176 ocean, passive_scalar, precipitation, simulated_time, & 176 177 use_subsidence_tendencies, use_surface_fluxes, use_top_fluxes, & 177 178 ws_scheme_mom, ws_scheme_sca … … 199 200 USE radiation_model_mod, & 200 201 ONLY: dots_rad, radiation, radiation_scheme, rad_net, & 201 rad_lw_in, rad_lw_out, rad_sw_in, rad_sw_out 202 rad_lw_in, rad_lw_out, rad_lw_cs_hr, rad_lw_hr, & 203 rad_sw_in, rad_sw_out, rad_sw_cs_hr, rad_sw_hr 202 204 203 205 #if defined ( __rrtmg ) … … 207 209 208 210 USE statistics 211 209 212 210 213 IMPLICIT NONE … … 240 243 CALL cpu_log( log_point(10), 'flow_statistics', 'start' ) 241 244 242 !$acc update host( km, kh, e, pt, qs, qsws, rif, shf, ts, u, usws, v, vsws, w )245 !$acc update host( km, kh, e, ol, pt, qs, qsws, shf, ts, u, usws, v, vsws, w ) 243 246 244 247 ! … … 744 747 ! 745 748 !-- Formula does not work if ql(nzb) /= 0.0 746 sums_l(nzb,51,tn) = sums_l(nzb,51,tn) + & ! w"q" (w"qv")747 qsws(j,i) * rmask(j,i,sr) 749 sums_l(nzb,51,tn) = sums_l(nzb,51,tn) + & 750 qsws(j,i) * rmask(j,i,sr) ! w"q" (w"qv") 748 751 ENDIF 749 752 ENDIF 750 753 IF ( passive_scalar ) THEN 751 sums_l(nzb,48,tn) = sums_l(nzb,48,tn) + &752 qsws(j,i) * rmask(j,i,sr) 754 sums_l(nzb,48,tn) = sums_l(nzb,48,tn) + & 755 qsws(j,i) * rmask(j,i,sr) ! w"q" (w"qv") 753 756 ENDIF 754 757 ENDIF 758 759 IF ( .NOT. neutral ) THEN 760 sums_l(nzb,114,tn) = sums_l(nzb,114,tn) + & 761 ol(j,i) * rmask(j,i,sr) ! L 762 ENDIF 763 755 764 756 765 IF ( land_surface ) THEN … … 774 783 #if defined ( __rrtmg ) 775 784 IF ( radiation_scheme == 'rrtmg' ) THEN 776 sums_l(nzb,1 06,tn) = sums_l(nzb,106,tn) + rrtm_aldif(0,j,i)777 sums_l(nzb,1 07,tn) = sums_l(nzb,107,tn) + rrtm_aldir(0,j,i)778 sums_l(nzb,1 08,tn) = sums_l(nzb,108,tn) + rrtm_asdif(0,j,i)779 sums_l(nzb,1 09,tn) = sums_l(nzb,109,tn) + rrtm_asdir(0,j,i)785 sums_l(nzb,110,tn) = sums_l(nzb,110,tn) + rrtm_aldif(0,j,i) 786 sums_l(nzb,111,tn) = sums_l(nzb,111,tn) + rrtm_aldir(0,j,i) 787 sums_l(nzb,112,tn) = sums_l(nzb,112,tn) + rrtm_asdif(0,j,i) 788 sums_l(nzb,113,tn) = sums_l(nzb,113,tn) + rrtm_asdir(0,j,i) 780 789 ENDIF 781 790 #endif … … 997 1006 !-- First calculate the products, then the divergence. 998 1007 !-- Calculation is time consuming. Do it only, if profiles shall be plotted. 999 IF ( hom(nzb+1,2,55,0) /= 0.0_wp .OR. hom(nzb+1,2,68,0) /= 0.0_wp ) THEN1000 1008 IF ( hom(nzb+1,2,55,0) /= 0.0_wp .OR. hom(nzb+1,2,68,0) /= 0.0_wp ) & 1009 THEN 1001 1010 sums_ll = 0.0_wp ! local array 1002 1011 … … 1037 1046 ! 1038 1047 !-- Divergence of vertical flux of SGS TKE and the flux itself (69) 1039 IF ( hom(nzb+1,2,57,0) /= 0.0_wp .OR. hom(nzb+1,2,69,0) /= 0.0_wp ) THEN1040 1048 IF ( hom(nzb+1,2,57,0) /= 0.0_wp .OR. hom(nzb+1,2,69,0) /= 0.0_wp ) & 1049 THEN 1041 1050 !$OMP DO 1042 1051 DO i = nxl, nxr … … 1109 1118 !-- Collect current large scale advection and subsidence tendencies for 1110 1119 !-- data output 1111 IF ( large_scale_forcing .AND. ( simulated_time .GT.0.0_wp ) ) THEN1120 IF ( large_scale_forcing .AND. ( simulated_time > 0.0_wp ) ) THEN 1112 1121 ! 1113 1122 !-- Interpolation in time of LSF_DATA … … 1156 1165 DO j = nys, nyn 1157 1166 DO k = nzb_soil, nzt_soil 1158 sums_l(k,89,tn) = sums_l(k,89,tn) + t_soil(k,j,i) * rmask(j,i,sr) 1159 sums_l(k,91,tn) = sums_l(k,91,tn) + m_soil(k,j,i) * rmask(j,i,sr) 1167 sums_l(k,89,tn) = sums_l(k,89,tn) + t_soil(k,j,i) & 1168 * rmask(j,i,sr) 1169 sums_l(k,91,tn) = sums_l(k,91,tn) + m_soil(k,j,i) & 1170 * rmask(j,i,sr) 1160 1171 ENDDO 1161 1172 ENDDO … … 1168 1179 DO j = nys, nyn 1169 1180 DO k = nzb_s_inner(j,i)+1, nzt+1 1170 sums_l(k,102,tn) = sums_l(k,102,tn) + rad_lw_in(k,j,i) * rmask(j,i,sr) 1171 sums_l(k,103,tn) = sums_l(k,103,tn) + rad_lw_out(k,j,i) * rmask(j,i,sr) 1172 sums_l(k,104,tn) = sums_l(k,104,tn) + rad_sw_in(k,j,i) * rmask(j,i,sr) 1173 sums_l(k,105,tn) = sums_l(k,105,tn) + rad_sw_out(k,j,i) * rmask(j,i,sr) 1181 sums_l(k,102,tn) = sums_l(k,102,tn) + rad_lw_in(k,j,i) & 1182 * rmask(j,i,sr) 1183 sums_l(k,103,tn) = sums_l(k,103,tn) + rad_lw_out(k,j,i) & 1184 * rmask(j,i,sr) 1185 sums_l(k,104,tn) = sums_l(k,104,tn) + rad_sw_in(k,j,i) & 1186 * rmask(j,i,sr) 1187 sums_l(k,105,tn) = sums_l(k,105,tn) + rad_sw_out(k,j,i) & 1188 * rmask(j,i,sr) 1189 sums_l(k,106,tn) = sums_l(k,106,tn) + rad_lw_cs_hr(k,j,i) & 1190 * rmask(j,i,sr) 1191 sums_l(k,107,tn) = sums_l(k,107,tn) + rad_lw_hr(k,j,i) & 1192 * rmask(j,i,sr) 1193 sums_l(k,108,tn) = sums_l(k,108,tn) + rad_sw_cs_hr(k,j,i) & 1194 * rmask(j,i,sr) 1195 sums_l(k,109,tn) = sums_l(k,108,tn) + rad_sw_hr(k,j,i) & 1196 * rmask(j,i,sr) 1174 1197 ENDDO 1175 1198 ENDDO … … 1374 1397 hom(:,1,105,sr) = sums(:,105) ! rad_sw_out 1375 1398 1399 IF ( radiation_scheme == 'rrtmg' ) THEN 1400 hom(:,1,106,sr) = sums(:,106) ! rad_lw_cs_hr 1401 hom(:,1,107,sr) = sums(:,107) ! rad_lw_hr 1402 hom(:,1,108,sr) = sums(:,108) ! rad_sw_cs_hr 1403 hom(:,1,109,sr) = sums(:,109) ! rad_sw_hr 1404 1376 1405 #if defined ( __rrtmg ) 1377 IF ( radiation_scheme == 'rrtmg' ) THEN1378 hom(:,1,1 06,sr) = sums(:,106) ! rrtm_aldif1379 hom(:,1,1 07,sr) = sums(:,107) ! rrtm_aldir1380 hom(:,1,1 08,sr) = sums(:,108) ! rrtm_asdif1381 hom(:,1,109,sr) = sums(:,109) ! rrtm_asdir 1406 hom(:,1,110,sr) = sums(:,110) ! rrtm_aldif 1407 hom(:,1,111,sr) = sums(:,111) ! rrtm_aldir 1408 hom(:,1,112,sr) = sums(:,112) ! rrtm_asdif 1409 hom(:,1,113,sr) = sums(:,113) ! rrtm_asdir 1410 #endif 1382 1411 ENDIF 1383 #endif 1384 1385 ENDIF 1412 1413 1414 ENDIF 1415 1416 hom(:,1,114,sr) = sums(:,114) !: L 1386 1417 1387 1418 hom(:,1,pr_palm-1,sr) = sums(:,pr_palm-1) … … 1520 1551 ts_value(20,sr) = hom(nzb+2,1,pr_palm,sr) ! v'w' at k=0 1521 1552 ts_value(21,sr) = hom(nzb,1,48,sr) ! w"q" at k=0 1522 1553 1554 ! 1555 !-- Calculate obukhov length 1523 1556 IF ( ts_value(5,sr) /= 0.0_wp ) THEN 1524 ts_value(22,sr) = ts_value(4,sr)**2 / & 1525 ( kappa * g * ts_value(5,sr) / ts_value(18,sr) ) ! L 1557 ! IF ( most_method == 'circular' ) THEN 1558 ! ts_value(22,sr) = ts_value(4,sr)**2 / & 1559 ! ( kappa * g * ts_value(5,sr) / ts_value(18,sr) ) 1560 ! ELSE 1561 ts_value(22,sr) = hom(nzb,1,114,sr) 1562 ! ENDIF 1526 1563 ELSE 1527 1564 ts_value(22,sr) = 10000.0_wp … … 1553 1590 #if defined ( __rrtmg ) 1554 1591 IF ( radiation_scheme == 'rrtmg' ) THEN 1555 ts_value(dots_rad+5,sr) = hom(nzb,1,1 06,sr) ! rrtm_aldif1556 ts_value(dots_rad+6,sr) = hom(nzb,1,1 07,sr) ! rrtm_aldir1557 ts_value(dots_rad+7,sr) = hom(nzb,1,1 08,sr) ! rrtm_asdif1558 ts_value(dots_rad+8,sr) = hom(nzb,1,1 09,sr) ! rrtm_asdir1592 ts_value(dots_rad+5,sr) = hom(nzb,1,110,sr) ! rrtm_aldif 1593 ts_value(dots_rad+6,sr) = hom(nzb,1,111,sr) ! rrtm_aldir 1594 ts_value(dots_rad+7,sr) = hom(nzb,1,112,sr) ! rrtm_asdif 1595 ts_value(dots_rad+8,sr) = hom(nzb,1,113,sr) ! rrtm_asdir 1559 1596 ENDIF 1560 1597 #endif … … 1642 1679 #if defined ( __rrtmg ) 1643 1680 USE radiation_model_mod, & 1644 ONLY: rrtm_aldif, rrtm_aldir, rrtm_asdif, rrtm_asdir 1681 ONLY: rrtm_aldif, rrtm_aldir, rrtm_asdif, rrtm_asdir, rad_lw_cs_hr, & 1682 rad_lw_hr, rad_sw_cs_hr, rad_sw_hr 1645 1683 #endif 1646 1684 … … 3063 3101 !-- Collect current large scale advection and subsidence tendencies for 3064 3102 !-- data output 3065 IF ( large_scale_forcing .AND. ( simulated_time .GT.0.0_wp ) ) THEN3103 IF ( large_scale_forcing .AND. ( simulated_time > 0.0_wp ) ) THEN 3066 3104 ! 3067 3105 !-- Interpolation in time of LSF_DATA … … 3110 3148 DO j = nys, nyn 3111 3149 DO k = nzb_soil, nzt_soil 3112 sums_l(k,89,tn) = sums_l(k,89,tn) + t_soil(k,j,i) * rmask(j,i,sr) 3113 sums_l(k,91,tn) = sums_l(k,91,tn) + m_soil(k,j,i) * rmask(j,i,sr) 3150 sums_l(k,89,tn) = sums_l(k,89,tn) + t_soil(k,j,i) & 3151 * rmask(j,i,sr) 3152 sums_l(k,91,tn) = sums_l(k,91,tn) + m_soil(k,j,i) & 3153 * rmask(j,i,sr) 3114 3154 ENDDO 3115 3155 ENDDO … … 3123 3163 DO j = nys, nyn 3124 3164 DO k = nzb_s_inner(j,i)+1, nzt+1 3125 sums_l(k,102,tn) = sums_l(k,102,tn) + rad_lw_in(k,j,i) * rmask(j,i,sr) 3126 sums_l(k,103,tn) = sums_l(k,103,tn) + rad_lw_out(k,j,i) * rmask(j,i,sr) 3127 sums_l(k,104,tn) = sums_l(k,104,tn) + rad_sw_in(k,j,i) * rmask(j,i,sr) 3128 sums_l(k,105,tn) = sums_l(k,105,tn) + rad_sw_out(k,j,i) * rmask(j,i,sr) 3165 sums_l(k,102,tn) = sums_l(k,102,tn) + rad_lw_in(k,j,i) & 3166 * rmask(j,i,sr) 3167 sums_l(k,103,tn) = sums_l(k,103,tn) + rad_lw_out(k,j,i) & 3168 * rmask(j,i,sr) 3169 sums_l(k,104,tn) = sums_l(k,104,tn) + rad_sw_in(k,j,i) & 3170 * rmask(j,i,sr) 3171 sums_l(k,105,tn) = sums_l(k,105,tn) + rad_sw_out(k,j,i) & 3172 * rmask(j,i,sr) 3173 #if defined ( __rrtmg ) 3174 sums_l(k,106,tn) = sums_l(k,106,tn) + rad_lw_cs_hr(k,j,i) & 3175 * rmask(j,i,sr) 3176 sums_l(k,107,tn) = sums_l(k,107,tn) + rad_lw_hr(k,j,i) & 3177 * rmask(j,i,sr) 3178 sums_l(k,108,tn) = sums_l(k,108,tn) + rad_sw_cs_hr(k,j,i) & 3179 * rmask(j,i,sr) 3180 sums_l(k,109,tn) = sums_l(k,109,tn) + rad_sw_hr(k,j,i) & 3181 * rmask(j,i,sr) 3182 #endif 3129 3183 ENDDO 3130 3184 ENDDO … … 3193 3247 sums(k,70:80) = sums(k,70:80) / ngp_2dh_s_inner(k,sr) 3194 3248 sums(k,81:88) = sums(k,81:88) / ngp_2dh(sr) 3195 sums(k,89:105) = sums(k,89:105) / ngp_2dh(sr) 3196 sums(k,106:pr_palm-2) = sums(k,106:pr_palm-2)/ ngp_2dh_s_inner(k,sr) 3249 sums(k,89:114) = sums(k,89:114) / ngp_2dh(sr) 3250 sums(k,115:pr_palm-2) = sums(k,115:pr_palm-2)/ ngp_2dh_s_inner(k,sr) 3251 3197 3252 ENDDO 3198 3253 … … 3446 3501 3447 3502 IF ( ts_value(5,sr) /= 0.0_wp ) THEN 3448 ts_value(22,sr) = ts_value(4,sr)**2_wp / & 3449 ( kappa * g * ts_value(5,sr) / ts_value(18,sr) ) ! L 3503 ts_value(22,sr) = hom(nzb,1,114,sr) 3450 3504 ELSE 3451 3505 ts_value(22,sr) = 10000.0_wp -
palm/trunk/SOURCE/header.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Renamed prandtl_layer to constant_flux_layer, renames rif_min/rif_max to 22 ! zeta_min/zeta_max. 22 23 ! 23 24 ! Former revisions: … … 1118 1119 ENDIF 1119 1120 1120 IF ( prandtl_layer ) THEN1121 WRITE ( io, 305 ) (zu(1)-zu(0)), roughness_length, &1122 z0h_factor*roughness_length, kappa, &1123 rif_min, rif_max1121 IF ( constant_flux_layer ) THEN 1122 WRITE ( io, 305 ) (zu(1)-zu(0)), roughness_length, & 1123 z0h_factor*roughness_length, kappa, & 1124 zeta_min, zeta_max 1124 1125 IF ( .NOT. constant_heatflux ) WRITE ( io, 308 ) 1125 1126 IF ( humidity .AND. .NOT. constant_waterflux ) THEN … … 1131 1132 ELSE 1132 1133 IF ( INDEX(initializing_actions, 'set_1d-model_profiles') /= 0 ) THEN 1133 WRITE ( io, 310 ) rif_min, rif_max1134 WRITE ( io, 310 ) zeta_min, zeta_max 1134 1135 ENDIF 1135 1136 ENDIF -
palm/trunk/SOURCE/init_1d_model.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Renamed prandtl_layer to constant_flux_layer. rif is replaced by ol and zeta. 22 22 ! 23 23 ! Former revisions: … … 72 72 !> of the wind profile is being computed. 73 73 !> All subroutines required can be found within this file. 74 !> 75 !> @todo harmonize code with new surface_layer_fluxes module 74 76 !------------------------------------------------------------------------------! 75 77 SUBROUTINE init_1d_model … … 90 92 91 93 USE control_parameters, & 92 ONLY: constant_diffusion, f, humidity, kappa, km_constant, & 93 mixing_length_1d, passive_scalar, prandtl_layer, & 94 prandtl_number, roughness_length, simulated_time_chr, & 95 z0h_factor 94 ONLY: constant_diffusion, constant_flux_layer, f, humidity, kappa, & 95 km_constant, mixing_length_1d, passive_scalar, prandtl_number, & 96 roughness_length, simulated_time_chr, z0h_factor 96 97 97 98 IMPLICIT NONE … … 166 167 ! 167 168 !-- For u*, theta* and the momentum fluxes plausible values are set 168 IF ( prandtl_layer ) THEN169 IF ( constant_flux_layer ) THEN 169 170 us1d = 0.1_wp ! without initial friction the flow would not change 170 171 ELSE … … 213 214 214 215 USE control_parameters, & 215 ONLY: constant_diffusion, dissipation_1d, humidity,&216 intermediate_timestep_count, intermediate_timestep_count_max,&217 f, g, ibc_e_b, kappa, mixing_length_1d, passive_scalar, &218 prandtl_layer, rif_max, rif_min, simulated_time_chr,&219 timestep_scheme, tsc216 ONLY: constant_diffusion, constant_flux_layer, dissipation_1d, & 217 humidity, intermediate_timestep_count, & 218 intermediate_timestep_count_max, f, g, ibc_e_b, kappa, & 219 mixing_length_1d, passive_scalar, & 220 simulated_time_chr, timestep_scheme, tsc, zeta_max, zeta_min 220 221 221 222 USE indices, & … … 334 335 !-- Finite differences of the momentum fluxes are computed using half the 335 336 !-- normal grid length (2.0*ddzw(k)) for the sake of enhanced accuracy 336 IF ( prandtl_layer ) THEN337 IF ( constant_flux_layer ) THEN 337 338 338 339 k = nzb+1 … … 465 466 ! 466 467 !-- First compute the vertical fluxes in the Prandtl-layer 467 IF ( prandtl_layer ) THEN468 IF ( constant_flux_layer ) THEN 468 469 ! 469 470 !-- Compute theta* using Rif numbers of the previous time step … … 498 499 ENDIF 499 500 500 ENDIF ! prandtl_layer501 ENDIF ! constant_flux_layer 501 502 502 503 ! … … 506 507 !-- the rif-numbers of the previous time step are used. 507 508 508 IF ( prandtl_layer ) THEN509 IF ( constant_flux_layer ) THEN 509 510 IF ( .NOT. humidity ) THEN 510 511 pt_0 = pt_init(nzb+1) … … 547 548 !-- range. It is exceeded excessively for very small velocities 548 549 !-- (u,v --> 0). 549 WHERE ( rif1d < rif_min ) rif1d = rif_min550 WHERE ( rif1d > rif_max ) rif1d = rif_max550 WHERE ( rif1d < zeta_min ) rif1d = zeta_min 551 WHERE ( rif1d > zeta_max ) rif1d = zeta_max 551 552 552 553 ! 553 554 !-- Compute u* from the absolute velocity value 554 IF ( prandtl_layer ) THEN555 IF ( constant_flux_layer ) THEN 555 556 uv_total = SQRT( u1d(nzb+1)**2 + v1d(nzb+1)**2 ) 556 557 … … 639 640 ENDIF 640 641 641 ENDIF ! prandtl_layer642 ENDIF ! constant_flux_layer 642 643 643 644 ! … … 673 674 !-- computed via the adiabatic mixing length, for the unstability has 674 675 !-- already been taken account of via the TKE (cf. also Diss.). 675 IF ( prandtl_layer ) THEN676 IF ( constant_flux_layer ) THEN 676 677 IF ( rif1d(nzb+1) >= 0.0_wp ) THEN 677 678 km1d(nzb+1) = us1d * kappa * zu(nzb+1) / & … … 805 806 806 807 uv_total = SQRT( u1d(nzb+1)**2 + v1d(nzb+1)**2 ) 807 IF ( ABS( v1d(nzb+1) ) .LT.1.0E-5_wp ) THEN808 IF ( ABS( v1d(nzb+1) ) < 1.0E-5_wp ) THEN 808 809 alpha = ACOS( SIGN( 1.0_wp , u1d(nzb+1) ) ) 809 810 ELSE -
palm/trunk/SOURCE/init_3d_model.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Call to init_surface_layer added. rif is replaced by ol and zeta. 22 22 ! 23 23 ! Former revisions: … … 266 266 sums_l_l, sums_up_fraction_l, sums_wsts_bc_l, ts_value, & 267 267 var_d, weight_pres, weight_substep 268 268 269 USE surface_layer_fluxes_mod, & 270 ONLY: init_surface_layer_fluxes 271 269 272 USE transpose_indices 270 273 … … 313 316 ALLOCATE( ptdf_x(nxlg:nxrg), ptdf_y(nysg:nyng) ) 314 317 315 ALLOCATE( rif(nysg:nyng,nxlg:nxrg), shf(nysg:nyng,nxlg:nxrg),&318 ALLOCATE( ol(nysg:nyng,nxlg:nxrg), shf(nysg:nyng,nxlg:nxrg), & 316 319 ts(nysg:nyng,nxlg:nxrg), tswst(nysg:nyng,nxlg:nxrg), & 317 320 us(nysg:nyng,nxlg:nxrg), usws(nysg:nyng,nxlg:nxrg), & … … 714 717 hom(:,1,25,:) = SPREAD( l1d, 2, statistic_regions+1 ) 715 718 716 IF ( prandtl_layer ) THEN717 rif =rif1d(nzb+1)719 IF ( constant_flux_layer ) THEN 720 ol = ( zu(nzb+1) - zw(nzb) ) / rif1d(nzb+1) 718 721 ts = 0.0_wp ! could actually be computed more accurately in the 719 722 ! 1D model. Update when opportunity arises. … … 723 726 ELSE 724 727 ts = 0.0_wp ! must be set, because used in 725 rif = 0.0_wp! flowste728 ol = ( zu(nzb+1) - zw(nzb) ) / zeta_min ! flowste 726 729 us = 0.0_wp 727 730 usws = 0.0_wp … … 731 734 ELSE 732 735 e = 0.0_wp ! must be set, because used in 733 rif = 0.0_wp! flowste736 ol = ( zu(nzb+1) - zw(nzb) ) / zeta_min ! flowste 734 737 ts = 0.0_wp 735 738 us = 0.0_wp … … 886 889 e = 0.0_wp 887 890 ENDIF 888 rif = 0.0_wp891 ol = ( zu(nzb+1) - zw(nzb) ) / zeta_min 889 892 ts = 0.0_wp 890 893 us = 0.0_wp … … 1095 1098 ! 1096 1099 !-- Initialize Prandtl layer quantities 1097 IF ( prandtl_layer ) THEN1100 IF ( constant_flux_layer ) THEN 1098 1101 1099 1102 z0 = roughness_length … … 1103 1106 ! 1104 1107 !-- Surface temperature is prescribed. Here the heat flux cannot be 1105 !-- simply estimated, because therefore rif, u* and theta* would have1108 !-- simply estimated, because therefore ol, u* and theta* would have 1106 1109 !-- to be computed by iteration. This is why the heat flux is assumed 1107 1110 !-- to be zero before the first time step. It approaches its correct … … 1624 1627 CALL location_message( 'initializing land surface model', .FALSE. ) 1625 1628 CALL init_lsm 1629 CALL location_message( 'finished', .TRUE. ) 1630 ENDIF 1631 1632 ! 1633 !-- Initialize surface layer (done after LSM as roughness length are required 1634 !-- for initialization 1635 IF ( constant_flux_layer ) THEN 1636 CALL location_message( 'initializing surface layer', .FALSE. ) 1637 CALL init_surface_layer_fluxes 1626 1638 CALL location_message( 'finished', .TRUE. ) 1627 1639 ENDIF -
palm/trunk/SOURCE/init_cloud_physics.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Removed typo 22 22 ! 23 23 ! Former revisions: … … 117 117 dpirho_l = 1.0_wp / pirho_l 118 118 ! 119 !-- constant fo tthe sedimentation of cloud water (2-moment cloud physics)119 !-- constant for the sedimentation of cloud water (2-moment cloud physics) 120 120 sed_qc_const = k_st * ( 3.0_wp / ( 4.0_wp * pi * rho_l ) & 121 121 )**( 2.0_wp / 3.0_wp ) * & -
palm/trunk/SOURCE/init_grid.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Renamed prandtl_layer to constant_flux_layer. 22 22 ! 23 23 ! Former revisions: … … 144 144 building_length_y, building_wall_left, building_wall_south, & 145 145 canyon_height, canyon_wall_left, canyon_wall_south, & 146 canyon_width_x, canyon_width_y, coupling_char, dp_level_ind_b, & 147 dz, dz_max, dz_stretch_factor, dz_stretch_level, & 148 dz_stretch_level_index, ibc_uv_b, io_blocks, io_group, & 149 inflow_l, inflow_n, inflow_r, inflow_s, masking_method, & 150 maximum_grid_level, message_string, momentum_advec, ocean, & 151 outflow_l, outflow_n, outflow_r, outflow_s, prandtl_layer, & 152 psolver, scalar_advec, topography, topography_grid_convention, & 153 use_surface_fluxes, use_top_fluxes, wall_adjustment_factor 146 canyon_width_x, canyon_width_y, constant_flux_layer, & 147 coupling_char, dp_level_ind_b, dz, dz_max, dz_stretch_factor, & 148 dz_stretch_level, dz_stretch_level_index, ibc_uv_b, io_blocks, & 149 io_group, inflow_l, inflow_n, inflow_r, inflow_s, & 150 masking_method, maximum_grid_level, message_string, & 151 momentum_advec, ocean, outflow_l, outflow_n, outflow_r, & 152 outflow_s, psolver, scalar_advec, topography, & 153 topography_grid_convention, use_surface_fluxes, use_top_fluxes, & 154 wall_adjustment_factor 154 155 155 156 USE grid_variables, & … … 477 478 !-- Define vertical gridpoint from (or to) which on the usual finite difference 478 479 !-- form (which does not use surface fluxes) is applied 479 IF ( prandtl_layer .OR. use_surface_fluxes ) THEN480 IF ( constant_flux_layer .OR. use_surface_fluxes ) THEN 480 481 nzb_diff = nzb + 2 481 482 ELSE … … 955 956 !-- the usual finite difference form (which does not use surface fluxes) is 956 957 !-- applied 957 IF ( prandtl_layer .OR. use_surface_fluxes ) THEN958 IF ( constant_flux_layer .OR. use_surface_fluxes ) THEN 958 959 nzb_diff_u = nzb_u_inner + 2 959 960 nzb_diff_v = nzb_v_inner + 2 -
palm/trunk/SOURCE/land_surface_model.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added skip_time_do_lsm to allow for spin-ups without LSM. Various bugfixes: 22 ! Soil temperatures are now defined at the edges of the layers, calculation of 23 ! shb_eb corrected, prognostic equation for skin temperature corrected. Surface 24 ! fluxes are now directly transfered to atmosphere 22 25 ! 23 26 ! Former revisions: … … 73 76 !> DALES and UCLA-LES models. 74 77 !> 75 !> @todo Check dewfall parametrization for fog simulations. 76 !> @todo Consider partial absorption of the net shortwave radiation by the surface layer. 77 !> @todo Allow for water surfaces, check performance for bare soils. 78 !> @todo Invert indices (running from -3 to 0. Currently: nzb_soil=0, nzt_soil=3)). 79 !> @todo Implement surface runoff model (required when performing long-term LES with 80 !> considerable precipitation. 78 !> @todo Consider partial absorption of the net shortwave radiation by the 79 !> surface layer. 80 !> @todo Allow for water surfaces 81 !> @todo Invert indices (running from -3 to 0. Currently: nzb_soil=0, 82 !> nzt_soil=3)). 83 !> @todo Implement surface runoff model (required when performing long-term LES 84 !> with considerable precipitation. 81 85 !> 82 !> @note No time step criterion is required as long as the soil layers do not become83 !> too thin.86 !> @note No time step criterion is required as long as the soil layers do not 87 !> become too thin. 84 88 !------------------------------------------------------------------------------! 85 89 MODULE land_surface_model_mod 86 90 87 USE arrays_3d,&88 ONLY: pt, pt_p, q_p, qsws, rif, shf, ts, us, z0, z0h89 90 USE cloud_parameters,&91 ONLY: cp, l_d_r, l_v, precipitation_rate, rho_l, r_d, r_v92 93 USE control_parameters,&94 ONLY: cloud_physics, dt_3d, humidity, intermediate_timestep_count,&95 initializing_actions, intermediate_timestep_count_max,&96 max_masks, precipitation, pt_surface, rho_surface,&97 roughness_length, surface_pressure, timestep_scheme, tsc,&98 99 100 USE indices,&101 102 103 91 USE arrays_3d, & 92 ONLY: hyp, pt, pt_p, q, q_p, ql, qsws, rif, shf, ts, us, vpt, z0, z0h 93 94 USE cloud_parameters, & 95 ONLY: cp, hyrho, l_d_cp, l_d_r, l_v, prr, pt_d_t, rho_l, r_d, r_v 96 97 USE control_parameters, & 98 ONLY: cloud_physics, dt_3d, humidity, intermediate_timestep_count, & 99 initializing_actions, intermediate_timestep_count_max, & 100 max_masks, precipitation, pt_surface, rho_surface, & 101 roughness_length, surface_pressure, timestep_scheme, tsc, & 102 z0h_factor, time_since_reference_point 103 104 USE indices, & 105 ONLY: nbgp, nxlg, nxrg, nyng, nysg, nzb, nzb_s_inner 106 107 USE kinds 104 108 105 109 USE netcdf_control, & 106 110 ONLY: dots_label, dots_num, dots_unit 107 111 108 USE radiation_model_mod, & 109 ONLY: radiation_scheme, rad_net, rad_sw_in, sigma_sb 110 111 USE statistics, & 112 ONLY: hom, statistic_regions 112 USE pegrid 113 114 USE radiation_model_mod, & 115 ONLY: force_radiation_call, radiation_scheme, rad_net, rad_sw_in, & 116 rad_lw_out, sigma_sb 117 118 #if defined ( __rrtmg ) 119 USE radiation_model_mod, & 120 ONLY: rrtm_lwuflx_dt, rrtm_idrv 121 #endif 122 123 USE statistics, & 124 ONLY: hom, statistic_regions 113 125 114 126 IMPLICIT NONE … … 144 156 soil_type = 3 !< soil type, 0: user-defined, 1-6: generic (see list) 145 157 146 LOGICAL :: conserve_water_content = .TRUE., & !< open or closed bottom surface for the soil model 147 dewfall = .TRUE., & !< allow/inhibit dewfall 148 land_surface = .FALSE. !< flag parameter indicating wheather the lsm is used 158 LOGICAL :: conserve_water_content = .TRUE., & !< open or closed bottom surface for the soil model 159 dewfall = .TRUE., & !< allow/inhibit dewfall 160 force_radiation_call_l = .FALSE., & !< flag parameter for unscheduled radiation model calls 161 land_surface = .FALSE. !< flag parameter indicating wheather the lsm is used 149 162 150 163 ! value 9999999.9_wp -> generic available or user-defined value must be set … … 160 173 hydraulic_conductivity = 9999999.9_wp, & !< NAMELIST gamma_w_sat 161 174 ke = 0.0_wp, & !< Kersten number 175 lambda_h_sat = 0.0_wp, & !< heat conductivity for saturated soil 162 176 lambda_surface_stable = 9999999.9_wp, & !< NAMELIST lambda_surface_s 163 177 lambda_surface_unstable = 9999999.9_wp, & !< NAMELIST lambda_surface_u … … 174 188 rd_d_rv, & !< r_d / r_v 175 189 saturation_moisture = 9999999.9_wp, & !< NAMELIST m_sat 190 skip_time_do_lsm = 0.0_wp, & !< LSM is not called before this time 176 191 vegetation_coverage = 9999999.9_wp, & !< NAMELIST c_veg 177 192 wilting_point = 9999999.9_wp, & !< NAMELIST m_wilt 178 193 z0_eb = 9999999.9_wp, & !< NAMELIST z0 (lsm_par) 179 z0h_eb = 9999999.9_wp !< NAMELIST z0h (lsm_par)194 z0h_eb = 9999999.9_wp !< NAMELIST z0h (lsm_par) 180 195 181 196 REAL(wp), DIMENSION(nzb_soil:nzt_soil) :: & 182 ddz_soil, & !< 1/dz_soil 183 ddz_soil_stag, & !< 1/dz_soil_stag 184 dz_soil, & !< soil grid spacing (center-center) 185 dz_soil_stag, & !< soil grid spacing (edge-edge) 186 root_extr = 0.0_wp, & !< root extraction 197 ddz_soil_stag, & !< 1/dz_soil_stag 198 dz_soil_stag, & !< soil grid spacing (center-center) 199 root_extr = 0.0_wp, & !< root extraction 187 200 root_fraction = (/9999999.9_wp, 9999999.9_wp, & 188 201 9999999.9_wp, 9999999.9_wp /), & !< distribution of root surface area to the individual soil layers … … 191 204 192 205 REAL(wp), DIMENSION(nzb_soil:nzt_soil+1) :: & 193 soil_temperature = (/290.0_wp, 287.0_wp, 285.0_wp, 283.0_wp, & 194 283.0_wp /) !< soil temperature (K) 206 soil_temperature = (/290.0_wp, 287.0_wp, 285.0_wp, 283.0_wp, & !< soil temperature (K) 207 283.0_wp /), & 208 ddz_soil, & !< 1/dz_soil 209 dz_soil !< soil grid spacing (edge-edge) 195 210 196 211 #if defined( __nopointer ) … … 218 233 ! 219 234 !-- Energy balance variables 220 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: 235 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: & 221 236 alpha_vg, & !< coef. of Van Genuchten 222 237 c_liq, & !< liquid water coverage (of vegetated area) … … 232 247 lai, & !< leaf area index 233 248 lai_av, & !< average of lai 234 lambda_h_sat, & !< heat conductivity for dry soil 235 lambda_surface_s, & !< coupling between surface and soil (depends on vegetation type) 236 lambda_surface_u, & !< coupling between surface and soil (depends on vegetation type) 249 lambda_surface_s, & !< coupling between surface and soil (depends on vegetation type) 250 lambda_surface_u, & !< coupling between surface and soil (depends on vegetation type) 237 251 l_vg, & !< coef. of Van Genuchten 238 252 m_fc, & !< soil moisture at field capacity (m3/m3) … … 253 267 r_a_av, & !< avergae of r_a 254 268 r_canopy, & !< canopy resistance 255 r_soil, & !< soil resi tance269 r_soil, & !< soil resistance 256 270 r_soil_min, & !< minimum soil resistance 257 271 r_s, & !< total surface resistance (combination of r_soil and r_canopy) 258 r_s_av, & !< aver gae of r_s272 r_s_av, & !< average of r_s 259 273 r_canopy_min, & !< minimum canopy (stomatal) resistance 260 274 shf_eb, & !< surface flux of sensible heat 261 275 shf_eb_av !< average of shf_eb 276 262 277 263 278 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: & … … 472 487 lsm_swap_timelevel, l_vangenuchten, min_canopy_resistance, & 473 488 min_soil_resistance, n_vangenuchten, residual_moisture, rho_cp, & 474 rho_lv, root_fraction, saturation_moisture, soil_moisture, & 475 soil_temperature, soil_type, soil_type_name, vegetation_coverage, & 476 veg_type, veg_type_name, wilting_point, z0_eb, z0h_eb 489 rho_lv, root_fraction, saturation_moisture, skip_time_do_lsm, & 490 soil_moisture, soil_temperature, soil_type, soil_type_name, & 491 vegetation_coverage, veg_type, veg_type_name, wilting_point, z0_eb, & 492 z0h_eb 477 493 478 494 ! … … 483 499 zs 484 500 485 486 501 ! 487 502 !-- Public 2D output variables … … 490 505 qsws_soil_eb, qsws_soil_eb_av, qsws_veg_eb, qsws_veg_eb_av, & 491 506 r_a, r_a_av, r_s, r_s_av, shf_eb, shf_eb_av 492 493 507 494 508 ! … … 565 579 ALLOCATE ( lai(nysg:nyng,nxlg:nxrg) ) 566 580 ALLOCATE ( l_vg(nysg:nyng,nxlg:nxrg) ) 567 ALLOCATE ( lambda_h_sat(nysg:nyng,nxlg:nxrg) )568 581 ALLOCATE ( lambda_surface_u(nysg:nyng,nxlg:nxrg) ) 569 582 ALLOCATE ( lambda_surface_s(nysg:nyng,nxlg:nxrg) ) … … 612 625 INTEGER(iwp) :: k !< running index 613 626 627 REAL(wp) :: pt_1 !< potential temperature at first grid level 628 614 629 615 630 ! 616 631 !-- Calculate Exner function 617 exn 632 exn = ( surface_pressure / 1000.0_wp )**0.286_wp 618 633 619 634 … … 674 689 ! 675 690 !-- Calculate grid spacings. Temperature and moisture are defined at 676 !-- the center of the soil layers, whereas gradients/fluxes are defined677 !-- at the edges (_stag)678 dz_soil _stag(nzb_soil) = zs(nzb_soil)679 680 DO k = nzb_soil+1, nzt_soil681 dz_soil _stag(k) = zs(k) - zs(k-1)691 !-- the edges of the soil layers (_stag), whereas gradients/fluxes are defined 692 !-- at the centers 693 dz_soil(nzb_soil) = zs(nzb_soil) 694 695 DO k = nzb_soil+1, nzt_soil 696 dz_soil(k) = zs(k) - zs(k-1) 682 697 ENDDO 683 684 DO k = nzb_soil, nzt_soil-1 685 dz_soil(k) = 0.5 * (dz_soil_stag(k+1) + dz_soil_stag(k)) 698 dz_soil(nzt_soil+1) = dz_soil(nzt_soil) 699 700 DO k = nzb_soil, nzt_soil-1 701 dz_soil_stag(k) = 0.5_wp * (dz_soil(k+1) + dz_soil(k)) 686 702 ENDDO 687 dz_soil (nzt_soil) = dz_soil_stag(nzt_soil)703 dz_soil_stag(nzt_soil) = dz_soil(nzt_soil) 688 704 689 705 ddz_soil = 1.0_wp / dz_soil … … 752 768 !-- (make sure that the soil moisture does not drop below the permanent 753 769 !-- wilting point) -> problems with devision by zero) 754 DO k = nzb_soil, nzt_soil770 DO k = nzb_soil, nzt_soil 755 771 t_soil(k,:,:) = soil_temperature(k) 756 772 m_soil(k,:,:) = MAX(soil_moisture(k),m_wilt(:,:)) … … 761 777 ! 762 778 !-- Calculate surface temperature 763 t_surface = pt_surface * exn 779 t_surface = pt_surface * exn 780 t_surface_p = t_surface 764 781 765 782 ! … … 770 787 k = nzb_s_inner(j,i) 771 788 789 IF ( cloud_physics ) THEN 790 pt_1 = pt(k+1,j,i) + l_d_cp * pt_d_t(k+1) * ql(k+1,j,i) 791 ELSE 792 pt_1 = pt(k+1,j,i) 793 ENDIF 794 772 795 ! 773 796 !-- Assure that r_a cannot be zero at model start 774 IF ( pt(k+1,j,i) == pt(k,j,i) ) pt(k+1,j,i) = pt(k+1,j,i) & 775 + 1.0E-10_wp 776 777 us(j,i) = 0.1_wp 778 ts(j,i) = (pt(k+1,j,i) - pt(k,j,i)) / r_a(j,i) 797 IF ( pt_1 == pt(k,j,i) ) pt_1 = pt_1 + 1.0E-10_wp 798 799 us(j,i) = 0.1_wp 800 ts(j,i) = (pt_1 - pt(k,j,i)) / r_a(j,i) 779 801 shf(j,i) = - us(j,i) * ts(j,i) 780 802 ENDDO … … 794 816 ENDIF 795 817 796 ! 797 !-- Calculate saturation soil heat conductivity 798 lambda_h_sat(:,:) = lambda_h_sm ** (1.0_wp - m_sat(:,:)) * & 799 lambda_h_water ** m_sat(:,:) 800 801 802 803 804 DO k = nzb_soil, nzt_soil 818 DO k = nzb_soil, nzt_soil 805 819 root_fr(k,:,:) = root_fraction(k) 806 820 ENDDO … … 838 852 839 853 IF ( ANY( root_fraction == 9999999.9_wp ) ) THEN 840 DO k = nzb_soil, nzt_soil854 DO k = nzb_soil, nzt_soil 841 855 root_fr(k,:,:) = root_distribution(k,veg_type) 842 856 root_fraction(k) = root_distribution(k,veg_type) … … 886 900 887 901 ! 888 !-- Calculate humidity at the surface889 IF ( humidity ) THEN890 CALL calc_q_surface891 ENDIF892 893 894 895 !896 902 !-- Add timeseries for land surface model 897 898 dots_label(dots_num+1) = "ghf_eb"899 dots_label(dots_num+2) = "shf_eb"900 dots_label(dots_num+3) = "qsws_eb"901 dots_label(dots_num+4) = "qsws_liq_eb"902 dots_label(dots_num+5) = "qsws_soil_eb"903 dots_label(dots_num+6) = "qsws_veg_eb"904 dots_unit(dots_num+1:dots_num+6) = "W/m2"905 906 dots_label(dots_num+7) = "r_a"907 dots_label(dots_num+8) = "r_s"908 dots_unit(dots_num+7:dots_num+8) = "s/m"909 910 903 dots_soil = dots_num + 1 911 904 dots_num = dots_num + 8 905 906 dots_label(dots_soil) = "ghf_eb" 907 dots_label(dots_soil+1) = "shf_eb" 908 dots_label(dots_soil+2) = "qsws_eb" 909 dots_label(dots_soil+3) = "qsws_liq_eb" 910 dots_label(dots_soil+4) = "qsws_soil_eb" 911 dots_label(dots_soil+5) = "qsws_veg_eb" 912 dots_label(dots_soil+6) = "r_a" 913 dots_label(dots_soil+7) = "r_s" 914 915 dots_unit(dots_soil:dots_soil+5) = "W/m2" 916 dots_unit(dots_soil+6:dots_soil+7) = "s/m" 912 917 913 918 RETURN … … 921 926 ! ------------ 922 927 !> Solver for the energy balance at the surface. 923 !> @note Surface fluxes are calculated in the land surface model, but these are924 !> not used in the atmospheric code. The fluxes are calculated afterwards in925 !> prandtl_fluxes using the surface values of temperature and humidity as926 !> provided by the land surface model. In this way, the fluxes in the land927 !> surface model are not equal to the ones calculated in prandtl_fluxes928 928 !------------------------------------------------------------------------------! 929 929 SUBROUTINE lsm_energy_balance … … 940 940 f3, & !< resistance correction term 3 941 941 m_min, & !< minimum soil moisture 942 T_1, & !< actual temperature at first grid point943 942 e, & !< water vapour pressure 944 943 e_s, & !< water vapour saturation pressure … … 954 953 f_shf, & !< factor for shf_eb 955 954 lambda_surface, & !< Current value of lambda_surface 956 m_liq_eb_max !< maxmimum value of the liq. water reservoir 957 955 m_liq_eb_max, & !< maxmimum value of the liq. water reservoir 956 pt_1, & !< potential temperature at first grid level 957 qv_1 !< specific humidity at first grid level 958 958 959 959 ! … … 961 961 exn = ( surface_pressure / 1000.0_wp )**0.286_wp 962 962 963 964 965 DO i = nxlg, nxrg 966 DO j = nysg, nyng 963 DO i = nxlg, nxrg 964 DO j = nysg, nyng 967 965 k = nzb_s_inner(j,i) 968 966 … … 980 978 !-- time step is used here. Note that this formulation is the 981 979 !-- equivalent to the ECMWF formulation using drag coefficients 982 r_a(j,i) = (pt(k+1,j,i) - pt(k,j,i)) / (ts(j,i) * us(j,i) + & 983 1.0E-20_wp) 980 IF ( cloud_physics ) THEN 981 pt_1 = pt(k+1,j,i) + l_d_cp * pt_d_t(k+1) * ql(k+1,j,i) 982 qv_1 = q(k+1,j,i) - ql(k+1,j,i) 983 ELSE 984 pt_1 = pt(k+1,j,i) 985 qv_1 = q(k+1,j,i) 986 ENDIF 987 988 r_a(j,i) = (pt_1 - pt(k,j,i)) / (ts(j,i) * us(j,i) + 1.0E-20_wp) 984 989 985 990 ! … … 1002 1007 !-- f2 = 0 for very dry soils 1003 1008 m_total = 0.0_wp 1004 DO ks = nzb_soil, nzt_soil1009 DO ks = nzb_soil, nzt_soil 1005 1010 m_total = m_total + root_fr(ks,j,i) & 1006 1011 * MAX(m_soil(ks,j,i),m_wilt(j,i)) 1007 1012 ENDDO 1008 1013 1009 IF ( m_total .GT. m_wilt(j,i) .AND. m_total .LT.m_fc(j,i) ) THEN1014 IF ( m_total > m_wilt(j,i) .AND. m_total < m_fc(j,i) ) THEN 1010 1015 f2 = ( m_total - m_wilt(j,i) ) / (m_fc(j,i) - m_wilt(j,i) ) 1011 ELSEIF ( m_total .GE.m_fc(j,i) ) THEN1016 ELSEIF ( m_total >= m_fc(j,i) ) THEN 1012 1017 f2 = 1.0_wp 1013 1018 ELSE … … 1025 1030 ! 1026 1031 !-- Calculate vapour pressure 1027 e = q _p(k+1,j,i)* surface_pressure / 0.622_wp1032 e = qv_1 * surface_pressure / 0.622_wp 1028 1033 f3 = EXP ( -g_d(j,i) * (e_s - e) ) 1029 1034 ELSE … … 1067 1072 !-- In case of dewfall, set evapotranspiration to zero 1068 1073 !-- All super-saturated water is then removed from the air 1069 IF ( humidity .AND. dewfall .AND. q_s .LE. q_p(k+1,j,i)) THEN1074 IF ( humidity .AND. q_s <= qv_1 ) THEN 1070 1075 r_canopy(j,i) = 0.0_wp 1071 1076 r_soil(j,i) = 0.0_wp 1072 ENDIF 1077 ENDIF 1073 1078 1074 1079 ! … … 1085 1090 !-- If soil moisture is below wilting point, plants do no longer 1086 1091 !-- transpirate. 1087 ! IF ( m_soil(k,j,i) .LT.m_wilt(j,i) ) THEN1092 ! IF ( m_soil(k,j,i) < m_wilt(j,i) ) THEN 1088 1093 ! f_qsws_veg = 0.0_wp 1089 1094 ! ENDIF … … 1094 1099 !-- air. 1095 1100 IF ( humidity ) THEN 1096 IF ( q_s .LE. q_p(k+1,j,i)) THEN1101 IF ( q_s <= qv_1 ) THEN 1097 1102 IF ( .NOT. dewfall ) THEN 1098 1103 f_qsws_veg = 0.0_wp … … 1114 1119 dq_s_dt = 0.622_wp * e_s_dt / surface_pressure 1115 1120 1116 T_1 = pt_p(k+1,j,i) * exn1117 1118 1121 ! 1119 1122 !-- Add LW up so that it can be removed in prognostic equation 1120 rad_net_l(j,i) = rad_net(j,i) + sigma_sb * t_surface(j,i) ** 4 1123 rad_net_l(j,i) = rad_net(j,i) + rad_lw_out(nzb,j,i) 1124 1121 1125 1122 1126 IF ( humidity ) THEN 1123 1127 #if defined ( __rrtmg ) 1124 1128 ! 1125 1129 !-- Numerator of the prognostic equation 1126 coef_1 = rad_net_l(j,i) + 3.0_wp * sigma_sb * t_surface(j,i) ** 4& 1127 + f_shf / exn * T_1 + f_qsws * ( q_p(k+1,j,i) - q_s & 1130 coef_1 = rad_net_l(j,i) + rrtm_lwuflx_dt(0,nzb) & 1131 * t_surface(j,i) - rad_lw_out(nzb,j,i) & 1132 + f_shf * pt_1 + f_qsws * ( qv_1 - q_s & 1128 1133 + dq_s_dt * t_surface(j,i) ) + lambda_surface & 1129 1134 * t_soil(nzb_soil,j,i) … … 1131 1136 ! 1132 1137 !-- Denominator of the prognostic equation 1133 coef_2 = 4.0_wp * sigma_sb * t_surface(j,i) ** 3 + f_qsws & 1134 * dq_s_dt + lambda_surface + f_shf / exn 1135 1138 coef_2 = rrtm_lwuflx_dt(0,nzb) + f_qsws * dq_s_dt & 1139 + lambda_surface + f_shf / exn 1140 #else 1141 1142 ! 1143 !-- Numerator of the prognostic equation 1144 coef_1 = rad_net_l(j,i) + 3.0_wp * sigma_sb & 1145 * t_surface(j,i) ** 4 & 1146 + f_shf * pt_1 + f_qsws * ( qv_1 & 1147 - q_s + dq_s_dt * t_surface(j,i) ) & 1148 + lambda_surface * t_soil(nzb_soil,j,i) 1149 1150 ! 1151 !-- Denominator of the prognostic equation 1152 coef_2 = 4.0_wp * sigma_sb * t_surface(j,i) ** 3 + f_qsws & 1153 * dq_s_dt + lambda_surface + f_shf / exn 1154 1155 #endif 1136 1156 ELSE 1137 1157 1158 #if defined ( __rrtmg ) 1138 1159 ! 1139 1160 !-- Numerator of the prognostic equation 1140 coef_1 = rad_net_l(j,i) + 3.0_wp * sigma_sb * t_surface(j,i) ** 4& 1141 + f_shf / exn * T_1 + lambda_surface & 1161 coef_1 = rad_net_l(j,i) + rrtm_lwuflx_dt(0,nzb) & 1162 * t_surface(j,i) - rad_lw_out(nzb,j,i) & 1163 + f_shf * pt_1 + lambda_surface & 1142 1164 * t_soil(nzb_soil,j,i) 1165 1166 ! 1167 !-- Denominator of the prognostic equation 1168 coef_2 = rrtm_lwuflx_dt(0,nzb) + lambda_surface + f_shf / exn 1169 #else 1170 1171 ! 1172 !-- Numerator of the prognostic equation 1173 coef_1 = rad_net_l(j,i) + 3.0_wp * sigma_sb & 1174 * t_surface(j,i) ** 4 + f_shf * pt_1 & 1175 + lambda_surface * t_soil(nzb_soil,j,i) 1143 1176 1144 1177 ! … … 1146 1179 coef_2 = 4.0_wp * sigma_sb * t_surface(j,i) ** 3 & 1147 1180 + lambda_surface + f_shf / exn 1148 1149 ENDIF 1181 #endif 1182 ENDIF 1183 1150 1184 1151 1185 tend = 0.0_wp … … 1159 1193 ! 1160 1194 !-- Add RK3 term 1161 t_surface_p(j,i) = t_surface_p(j,i) + dt_3d * tsc(3) & 1162 * tt_surface_m(j,i) 1163 1164 ! 1165 !-- Calculate true tendency 1166 tend = (t_surface_p(j,i) - t_surface(j,i) - dt_3d * tsc(3) & 1167 * tt_surface_m(j,i)) / (dt_3d * tsc(2)) 1168 ! 1169 !-- Calculate t_surface tendencies for the next Runge-Kutta step 1170 IF ( timestep_scheme(1:5) == 'runge' ) THEN 1171 IF ( intermediate_timestep_count == 1 ) THEN 1172 tt_surface_m(j,i) = tend 1173 ELSEIF ( intermediate_timestep_count < & 1174 intermediate_timestep_count_max ) THEN 1175 tt_surface_m(j,i) = -9.5625_wp * tend + 5.3125_wp & 1176 * tt_surface_m(j,i) 1195 IF ( c_surface /= 0.0_wp ) THEN 1196 1197 t_surface_p(j,i) = t_surface_p(j,i) + dt_3d * tsc(3) & 1198 * tt_surface_m(j,i) 1199 1200 ! 1201 !-- Calculate true tendency 1202 tend = (t_surface_p(j,i) - t_surface(j,i) - dt_3d * tsc(3) & 1203 * tt_surface_m(j,i)) / (dt_3d * tsc(2)) 1204 ! 1205 !-- Calculate t_surface tendencies for the next Runge-Kutta step 1206 IF ( timestep_scheme(1:5) == 'runge' ) THEN 1207 IF ( intermediate_timestep_count == 1 ) THEN 1208 tt_surface_m(j,i) = tend 1209 ELSEIF ( intermediate_timestep_count < & 1210 intermediate_timestep_count_max ) THEN 1211 tt_surface_m(j,i) = -9.5625_wp * tend + 5.3125_wp & 1212 * tt_surface_m(j,i) 1213 ENDIF 1177 1214 ENDIF 1178 ENDIF 1179 1180 pt_p(k,j,i) = t_surface_p(j,i) / exn 1215 1216 ENDIF 1217 1218 ! 1219 !-- In case of fast changes in the skin temperature, it is required to 1220 !-- update the radiative fluxes in order to keep the solution stable 1221 IF ( ABS( t_surface_p(j,i) - t_surface(j,i) ) > 0.2_wp ) THEN 1222 force_radiation_call_l = .TRUE. 1223 ENDIF 1224 1225 pt(k,j,i) = t_surface_p(j,i) / exn 1226 1181 1227 ! 1182 1228 !-- Calculate fluxes 1183 rad_net_l(j,i) = rad_net_l(j,i) + 3.0_wp * sigma_sb & 1184 * t_surface(j,i)**4 - 4.0_wp * sigma_sb & 1185 * t_surface(j,i)**3 * t_surface_p(j,i) 1229 #if defined ( __rrtmg ) 1230 rad_net_l(j,i) = rad_net_l(j,i) + rrtm_lwuflx_dt(0,nzb) & 1231 * t_surface(j,i) - rad_lw_out(nzb,j,i) & 1232 - rrtm_lwuflx_dt(0,nzb) * t_surface_p(j,i) 1233 1234 IF ( rrtm_idrv == 1 ) THEN 1235 rad_net(j,i) = rad_net_l(j,i) 1236 rad_lw_out(nzb,j,i) = rad_lw_out(nzb,j,i) & 1237 + rrtm_lwuflx_dt(0,nzb) & 1238 * ( t_surface_p(j,i) - t_surface(j,i) ) 1239 ENDIF 1240 #else 1241 rad_net_l(j,i) = rad_net_l(j,i) + 3.0_wp * sigma_sb & 1242 * t_surface(j,i)**4 - 4.0_wp * sigma_sb & 1243 * t_surface(j,i)**3 * t_surface_p(j,i) 1244 rad_net(j,i) = rad_net_l(j,i) 1245 #endif 1246 1186 1247 ghf_eb(j,i) = lambda_surface * (t_surface_p(j,i) & 1187 1248 - t_soil(nzb_soil,j,i)) 1188 shf_eb(j,i) = - f_shf * ( pt_p(k+1,j,i) - pt_p(k,j,i) ) 1249 1250 shf_eb(j,i) = - f_shf * ( pt_1 - pt(k,j,i) ) 1251 1252 shf(j,i) = shf_eb(j,i) / rho_cp 1189 1253 1190 1254 IF ( humidity ) THEN 1191 qsws_eb(j,i) = - f_qsws * ( q _p(k+1,j,i) - q_s + dq_s_dt&1255 qsws_eb(j,i) = - f_qsws * ( qv_1 - q_s + dq_s_dt & 1192 1256 * t_surface(j,i) - dq_s_dt * t_surface_p(j,i) ) 1193 1257 1194 qsws_veg_eb(j,i) = - f_qsws_veg * ( q_p(k+1,j,i) - q_s & 1258 qsws(j,i) = qsws_eb(j,i) / rho_lv 1259 1260 qsws_veg_eb(j,i) = - f_qsws_veg * ( qv_1 - q_s & 1195 1261 + dq_s_dt * t_surface(j,i) - dq_s_dt & 1196 1262 * t_surface_p(j,i) ) 1197 1263 1198 qsws_soil_eb(j,i) = - f_qsws_soil * ( q _p(k+1,j,i) - q_s&1264 qsws_soil_eb(j,i) = - f_qsws_soil * ( qv_1 - q_s & 1199 1265 + dq_s_dt * t_surface(j,i) - dq_s_dt & 1200 1266 * t_surface_p(j,i) ) 1201 1267 1202 qsws_liq_eb(j,i) = - f_qsws_liq * ( q _p(k+1,j,i) - q_s&1268 qsws_liq_eb(j,i) = - f_qsws_liq * ( qv_1 - q_s & 1203 1269 + dq_s_dt * t_surface(j,i) - dq_s_dt & 1204 1270 * t_surface_p(j,i) ) 1205 1271 ENDIF 1206 1207 1272 ! 1208 1273 !-- Calculate the true surface resistance 1209 IF ( qsws_eb(j,i) .EQ.0.0_wp ) THEN1274 IF ( qsws_eb(j,i) == 0.0_wp ) THEN 1210 1275 r_s(j,i) = 1.0E10_wp 1211 1276 ELSE 1212 r_s(j,i) = - rho_lv * ( q _p(k+1,j,i) - q_s + dq_s_dt&1277 r_s(j,i) = - rho_lv * ( qv_1 - q_s + dq_s_dt & 1213 1278 * t_surface(j,i) - dq_s_dt * t_surface_p(j,i) ) & 1214 1279 / qsws_eb(j,i) - r_a(j,i) … … 1228 1293 !-- Add precipitation to liquid water reservoir, if possible. 1229 1294 !-- Otherwise, add the water to bare soil fraction. 1230 IF ( m_liq_eb(j,i) .EQ.m_liq_eb_max ) THEN1295 IF ( m_liq_eb(j,i) /= m_liq_eb_max ) THEN 1231 1296 qsws_liq_eb(j,i) = qsws_liq_eb(j,i) & 1232 + c_veg(j,i) * pr ecipitation_rate(j,i)&1297 + c_veg(j,i) * prr(k,j,i) * hyrho(k) & 1233 1298 * 0.001_wp * rho_l * l_v 1234 1299 ELSE 1235 1300 qsws_soil_eb(j,i) = qsws_soil_eb(j,i) & 1236 + c_veg(j,i) * pr ecipitation_rate(j,i)&1301 + c_veg(j,i) * prr(k,j,i) * hyrho(k) & 1237 1302 * 0.001_wp * rho_l * l_v 1238 1303 ENDIF … … 1241 1306 !-- coverage. 1242 1307 qsws_soil_eb(j,i) = qsws_soil_eb(j,i) * (1.0_wp & 1243 - c_veg(j,i)) * pr ecipitation_rate(j,i)&1308 - c_veg(j,i)) * prr(k,j,i) * hyrho(k) & 1244 1309 * 0.001_wp * rho_l * l_v 1245 1310 ENDIF 1311 1246 1312 ! 1247 1313 !-- If the air is saturated, check the reservoir water level 1248 IF ( q_s .LE. q_p(k+1,j,i)) THEN 1314 IF ( qsws_eb(j,i) < 0.0_wp ) THEN 1315 1249 1316 ! 1250 1317 !-- Check if reservoir is full (avoid values > m_liq_eb_max) … … 1252 1319 !-- case qsws_veg_eb is zero anyway (because c_liq = 1), 1253 1320 !-- so that tend is zero and no further check is needed 1254 IF ( m_liq_eb(j,i) .EQ.m_liq_eb_max ) THEN1321 IF ( m_liq_eb(j,i) == m_liq_eb_max ) THEN 1255 1322 qsws_soil_eb(j,i) = qsws_soil_eb(j,i) & 1256 1323 + qsws_liq_eb(j,i) … … 1262 1329 !-- let the water enter the liquid water reservoir as dew on the 1263 1330 !-- plant 1264 IF ( qsws_veg_eb(j,i) .LT.0.0_wp ) THEN1331 IF ( qsws_veg_eb(j,i) < 0.0_wp ) THEN 1265 1332 qsws_liq_eb(j,i) = qsws_liq_eb(j,i) + qsws_veg_eb(j,i) 1266 1333 qsws_veg_eb(j,i) = 0.0_wp … … 1301 1368 ENDDO 1302 1369 1370 #if defined( __parallel ) 1371 ! 1372 !-- Make a logical OR for all processes. Force radiation call if at 1373 !-- least one processor 1374 IF ( intermediate_timestep_count == intermediate_timestep_count_max-1 )& 1375 THEN 1376 1377 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 1378 CALL MPI_ALLREDUCE( force_radiation_call_l, force_radiation_call, & 1379 1, MPI_LOGICAL, MPI_LOR, comm2d, ierr ) 1380 #else 1381 force_radiation_call = force_radiation_call_l 1382 #endif 1383 force_radiation_call_l = .FALSE. 1384 ENDIF 1385 1386 1303 1387 END SUBROUTINE lsm_energy_balance 1304 1388 … … 1322 1406 1323 1407 REAL(wp), DIMENSION(nzb_soil:nzt_soil) :: gamma_temp, & !< temp. gamma 1324 lambda_temp, & !< temp. lambda1325 tend !< tendency1326 1327 DO i = nxlg, nxrg1328 DO j = nysg, nyng1329 DO k = nzb_soil, nzt_soil1408 lambda_temp, & !< temp. lambda 1409 tend !< tendency 1410 1411 DO i = nxlg, nxrg 1412 DO j = nysg, nyng 1413 DO k = nzb_soil, nzt_soil 1330 1414 ! 1331 1415 !-- Calculate volumetric heat capacity of the soil, taking into … … 1335 1419 1336 1420 ! 1337 !-- Calculate soil heat conductivity at the center of the soil 1421 !-- Calculate soil heat conductivity at the center of the soil 1338 1422 !-- layers 1423 lambda_h_sat = lambda_h_sm ** (1.0_wp - m_sat(j,i)) * & 1424 lambda_h_water ** m_soil(k,j,i) 1425 1339 1426 ke = 1.0_wp + LOG10(MAX(0.1_wp,m_soil(k,j,i) / m_sat(j,i))) 1340 lambda_temp(k) = ke * (lambda_h_sat(j,i) + lambda_h_dry) + & 1427 1428 lambda_temp(k) = ke * (lambda_h_sat - lambda_h_dry) + & 1341 1429 lambda_h_dry 1342 1430 … … 1346 1434 !-- Calculate soil heat conductivity (lambda_h) at the _stag level 1347 1435 !-- using linear interpolation 1348 DO k = nzb_soil, nzt_soil-1 1349 1350 lambda_h(k,j,i) = lambda_temp(k) + & 1351 ( lambda_temp(k+1) - lambda_temp(k) ) & 1352 * 0.5 * dz_soil_stag(k) * ddz_soil(k+1) 1353 1436 DO k = nzb_soil, nzt_soil-1 1437 lambda_h(k,j,i) = ( lambda_temp(k+1) + lambda_temp(k) ) * 0.5_wp 1354 1438 ENDDO 1355 1439 lambda_h(nzt_soil,j,i) = lambda_temp(nzt_soil) … … 1358 1442 !-- Prognostic equation for soil temperature t_soil 1359 1443 tend(:) = 0.0_wp 1360 tend( 0) = (1.0_wp/rho_c_total(nzb_soil,j,i)) *&1444 tend(nzb_soil) = (1.0_wp/rho_c_total(nzb_soil,j,i)) * & 1361 1445 ( lambda_h(nzb_soil,j,i) * ( t_soil(nzb_soil+1,j,i) & 1362 - t_soil(nzb_soil,j,i) ) * ddz_soil(nzb_soil )&1446 - t_soil(nzb_soil,j,i) ) * ddz_soil(nzb_soil+1) & 1363 1447 + ghf_eb(j,i) ) * ddz_soil_stag(nzb_soil) 1364 1448 1365 DO k = 1, nzt_soil 1449 1450 1451 1452 DO k = nzb_soil+1, nzt_soil 1366 1453 tend(k) = (1.0_wp/rho_c_total(k,j,i)) & 1367 1454 * ( lambda_h(k,j,i) & 1368 1455 * ( t_soil(k+1,j,i) - t_soil(k,j,i) ) & 1369 * ddz_soil(k )&1456 * ddz_soil(k+1) & 1370 1457 - lambda_h(k-1,j,i) & 1371 1458 * ( t_soil(k,j,i) - t_soil(k-1,j,i) ) & 1372 * ddz_soil(k -1)&1459 * ddz_soil(k) & 1373 1460 ) * ddz_soil_stag(k) 1374 1461 ENDDO … … 1396 1483 1397 1484 1398 DO k = nzb_soil, nzt_soil1485 DO k = nzb_soil, nzt_soil 1399 1486 1400 1487 ! … … 1414 1501 / (n_vg(j,i)-1.0_wp)) - 1.0_wp & 1415 1502 )**(1.0_wp/n_vg(j,i)) / alpha_vg(j,i) 1503 1416 1504 1417 1505 gamma_temp(k) = gamma_w_sat(j,i) * ( ( (1.0_wp + & … … 1438 1526 !-- using linear interpolation. To do: replace this with 1439 1527 !-- ECMWF-IFS Eq. 8.81 1440 DO k = nzb_soil, nzt_soil-11528 DO k = nzb_soil, nzt_soil-1 1441 1529 1442 lambda_w(k,j,i) = lambda_temp(k) + & 1443 ( lambda_temp(k+1) - lambda_temp(k) ) & 1444 * 0.5_wp * dz_soil_stag(k) * ddz_soil(k+1) 1445 gamma_w(k,j,i) = gamma_temp(k) + & 1446 ( gamma_temp(k+1) - gamma_temp(k) ) & 1447 * 0.5_wp * dz_soil_stag(k) * ddz_soil(k+1) 1530 lambda_w(k,j,i) = ( lambda_temp(k+1) + lambda_temp(k) ) & 1531 * 0.5_wp 1532 gamma_w(k,j,i) = ( gamma_temp(k+1) + gamma_temp(k) ) & 1533 * 0.5_wp 1448 1534 1449 1535 ENDDO … … 1457 1543 gamma_w(nzt_soil,j,i) = 0.0_wp 1458 1544 ELSE 1459 gamma_w(nzt_soil,j,i) = lambda_temp(nzt_soil)1545 gamma_w(nzt_soil,j,i) = gamma_temp(nzt_soil) 1460 1546 ENDIF 1461 1547 … … 1470 1556 1471 1557 ! 1472 !-- Calculate the root extraction (ECMWF 7.69, modified so that the 1473 !-- sum of root_extr = 1). The energy balance solver guarantees a 1474 !-- positive transpiration, so that there is no need for an 1475 !-- additional check. 1476 1477 m_total = 0.0_wp 1478 DO k = nzb_soil, nzt_soil 1479 IF ( m_soil(k,j,i) .GT. m_wilt(j,i) ) THEN 1558 !-- Calculate the root extraction (ECMWF 7.69, the sum of root_extr 1559 !-- = 1). The energy balance solver guarantees a positive 1560 !-- transpiration, so that there is no need for an additional check. 1561 DO k = nzb_soil, nzt_soil 1562 IF ( m_soil(k,j,i) > m_wilt(j,i) ) THEN 1480 1563 m_total = m_total + root_fr(k,j,i) * m_soil(k,j,i) 1481 1564 ENDIF 1482 1565 ENDDO 1483 1566 1484 DO k = nzb_soil, nzt_soil 1485 IF ( m_soil(k,j,i) .GT. m_wilt(j,i) ) THEN 1486 root_extr(k) = root_fr(k,j,i) * m_soil(k,j,i) / m_total 1487 ELSE 1488 root_extr(k) = 0.0_wp 1489 ENDIF 1490 ENDDO 1567 IF ( m_total > 0.0_wp ) THEN 1568 DO k = nzb_soil, nzt_soil 1569 IF ( m_soil(k,j,i) > m_wilt(j,i) ) THEN 1570 root_extr(k) = root_fr(k,j,i) * m_soil(k,j,i) / m_total 1571 ELSE 1572 root_extr(k) = 0.0_wp 1573 ENDIF 1574 ENDDO 1575 ENDIF 1491 1576 1492 1577 ! … … 1495 1580 tend(nzb_soil) = ( lambda_w(nzb_soil,j,i) * ( & 1496 1581 m_soil(nzb_soil+1,j,i) - m_soil(nzb_soil,j,i) ) & 1497 * ddz_soil(nzb_soil ) - gamma_w(nzb_soil,j,i) - (&1582 * ddz_soil(nzb_soil+1) - gamma_w(nzb_soil,j,i) - ( & 1498 1583 root_extr(nzb_soil) * qsws_veg_eb(j,i) & 1499 1584 + qsws_soil_eb(j,i) ) * drho_l_lv ) & … … 1502 1587 DO k = nzb_soil+1, nzt_soil-1 1503 1588 tend(k) = ( lambda_w(k,j,i) * ( m_soil(k+1,j,i) & 1504 - m_soil(k,j,i) ) * ddz_soil(k) - gamma_w(k,j,i)&1505 - lambda_w(k-1,j,i) * (m_soil(k,j,i) -&1506 m_soil(k-1,j,i)) * ddz_soil(k-1)&1507 + gamma_w(k-1,j,i) - (root_extr(k)&1508 * qsws_veg_eb(j,i) * drho_l_lv)&1589 - m_soil(k,j,i) ) * ddz_soil(k+1) - gamma_w(k,j,i)& 1590 - lambda_w(k-1,j,i) * (m_soil(k,j,i) - & 1591 m_soil(k-1,j,i)) * ddz_soil(k) & 1592 + gamma_w(k-1,j,i) - (root_extr(k) & 1593 * qsws_veg_eb(j,i) * drho_l_lv) & 1509 1594 ) * ddz_soil_stag(k) 1510 1595 … … 1514 1599 * (m_soil(nzt_soil,j,i) & 1515 1600 - m_soil(nzt_soil-1,j,i)) & 1516 * ddz_soil(nzt_soil -1)&1601 * ddz_soil(nzt_soil) & 1517 1602 + gamma_w(nzt_soil-1,j,i) - ( & 1518 1603 root_extr(nzt_soil) & … … 1573 1658 REAL(wp) :: resistance !< aerodynamic and soil resistance term 1574 1659 1575 DO i = nxlg, nxrg1576 DO j = nysg, nyng1660 DO i = nxlg, nxrg 1661 DO j = nysg, nyng 1577 1662 k = nzb_s_inner(j,i) 1578 1663 1579 1664 ! 1580 1665 !-- Calculate water vapour pressure at saturation 1581 e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp * ( t_surface(j,i) & 1582 - 273.16_wp ) / ( t_surface(j,i) & 1583 - 35.86_wp ) ) 1666 e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp * ( t_surface_p(j,i) & 1667 - 273.16_wp ) / ( t_surface_p(j,i) - 35.86_wp ) ) 1584 1668 1585 1669 ! … … 1587 1671 q_s = 0.622_wp * e_s / surface_pressure 1588 1672 1589 1590 1673 resistance = r_a(j,i) / (r_a(j,i) + r_s(j,i)) 1591 1674 1592 1675 ! 1593 1676 !-- Calculate specific humidity at surface 1594 q_p(k,j,i) = resistance * q_s + (1.0_wp - resistance) & 1595 * q_p(k+1,j,i) 1677 IF ( cloud_physics ) THEN 1678 q(k,j,i) = resistance * q_s + (1.0_wp - resistance) & 1679 * ( q(k+1,j,i) - ql(k+1,j,i) ) 1680 ELSE 1681 q(k,j,i) = resistance * q_s + (1.0_wp - resistance) & 1682 * q(k+1,j,i) 1683 ENDIF 1684 1685 ! 1686 !-- Update virtual potential temperature 1687 vpt(k,j,i) = pt(k,j,i) * ( 1.0_wp + 0.61_wp * q(k,j,i) ) 1596 1688 1597 1689 ENDDO -
palm/trunk/SOURCE/lpm_advec.f90
r1686 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Renamed prandtl_layer to constant_flux_layer. 22 22 ! 23 23 ! Former revisions: … … 83 83 84 84 USE control_parameters, & 85 ONLY: atmos_ocean_sign, cloud_droplets, dt_3d, dt_3d_reached_l, dz, &86 g, kappa, molecular_viscosity, prandtl_layer, topography,&85 ONLY: atmos_ocean_sign, cloud_droplets, constant_flux_layer, dt_3d, & 86 dt_3d_reached_l, dz, g, kappa, molecular_viscosity, topography, & 87 87 u_gtrans, v_gtrans, simulated_time 88 88 … … 224 224 !-- First, check if particle is located below first vertical grid level 225 225 !-- (Prandtl-layer height) 226 IF ( prandtl_layer .AND. particles(n)%z < z_p ) THEN226 IF ( constant_flux_layer .AND. particles(n)%z < z_p ) THEN 227 227 ! 228 228 !-- Resolved-scale horizontal particle velocity is zero below z0. … … 294 294 DO n = start_index(nb), end_index(nb) 295 295 296 IF ( prandtl_layer .AND. particles(n)%z < z_p ) THEN296 IF ( constant_flux_layer .AND. particles(n)%z < z_p ) THEN 297 297 298 298 IF ( particles(n)%z < z0_av_global ) THEN -
palm/trunk/SOURCE/lpm_exchange_horiz.f90
r1686 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Formatting corrections. 22 22 ! 23 23 ! Former revisions: … … 1208 1208 ENDDO 1209 1209 1210 IF ( n_start .GE.0 ) THEN1210 IF ( n_start >= 0 ) THEN 1211 1211 pack_done = .FALSE. 1212 1212 DO n = n_start, np_old_cell -
palm/trunk/SOURCE/lpm_init.f90
r1686 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Renamed prandtl_layer to constant_flux_layer. 22 22 ! 23 23 ! Former revisions: … … 100 100 101 101 USE control_parameters, & 102 ONLY: cloud_droplets, c urrent_timestep_number, dz,&103 initializing_actions, message_string, netcdf_data_format,&104 ocean, prandtl_layer,simulated_time102 ONLY: cloud_droplets, constant_flux_layer, current_timestep_number, & 103 dz, initializing_actions, message_string, netcdf_data_format, & 104 ocean, simulated_time 105 105 106 106 USE dvrp_variables, & … … 295 295 !-- To obtain exact height levels of particles, linear interpolation is applied 296 296 !-- (see lpm_advec.f90). 297 IF ( prandtl_layer ) THEN297 IF ( constant_flux_layer ) THEN 298 298 299 299 ALLOCATE ( log_z_z0(0:number_of_sublayers) ) -
palm/trunk/SOURCE/microphysics.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Added new routine calc_precipitation_amount. The routine now allows to account 22 ! for precipitation due to sedimenation of cloud (fog) droplets 22 23 ! 23 24 ! Former revisions: … … 130 131 END INTERFACE sedimentation_rain 131 132 133 INTERFACE calc_precipitation_amount 134 MODULE PROCEDURE calc_precipitation_amount 135 MODULE PROCEDURE calc_precipitation_amount_ij 136 END INTERFACE calc_precipitation_amount 137 138 132 139 CONTAINS 133 140 … … 208 215 209 216 IF ( drizzle ) CALL sedimentation_cloud 217 218 IF ( precipitation ) THEN 219 CALL calc_precipitation_amount 220 ENDIF 210 221 211 222 END SUBROUTINE microphysics_control … … 726 737 727 738 USE cloud_parameters, & 728 ONLY: eps_sb, hyrho, l_d_cp, nc_const, p t_d_t, sed_qc_const739 ONLY: eps_sb, hyrho, l_d_cp, nc_const, prr, pt_d_t, sed_qc_const 729 740 730 741 USE constants, & … … 732 743 733 744 USE control_parameters, & 734 ONLY: dt_do2d_xy, dt_micro, intermediate_timestep_count 745 ONLY: call_microphysics_at_all_substeps, dt_micro, & 746 intermediate_timestep_count, precipitation 735 747 736 748 USE cpulog, & … … 741 753 742 754 USE kinds 743 755 756 USE statistics, & 757 ONLY: weight_substep 758 759 744 760 IMPLICIT NONE 745 761 … … 777 793 pt_d_t(k) * dt_micro 778 794 795 ! 796 !-- Compute the precipitation rate due to cloud (fog) droplets 797 IF ( precipitation ) THEN 798 IF ( call_microphysics_at_all_substeps ) THEN 799 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) & 800 * weight_substep(intermediate_timestep_count) 801 ELSE 802 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) 803 ENDIF 804 ENDIF 805 779 806 ENDDO 780 807 ENDDO … … 799 826 USE cloud_parameters, & 800 827 ONLY: a_term, b_term, c_term, cof, dpirho_l, eps_sb, hyrho, & 801 limiter_sedimentation, l_d_cp, precipitation_amount, prr, & 802 pt_d_t, stp 828 limiter_sedimentation, l_d_cp, prr, pt_d_t, stp 803 829 804 830 USE control_parameters, & 805 ONLY: call_microphysics_at_all_substeps, dt_do2d_xy, dt_micro, & 806 dt_3d, intermediate_timestep_count, & 807 intermediate_timestep_count_max, & 808 precipitation_amount_interval, time_do2d_xy 809 831 ONLY: call_microphysics_at_all_substeps, dt_micro, & 832 intermediate_timestep_count 810 833 USE cpulog, & 811 834 ONLY: cpu_log, log_point_s … … 1005 1028 !-- Compute the rain rate 1006 1029 IF ( call_microphysics_at_all_substeps ) THEN 1007 prr(k,j,i) = prr(k,j,i) + sed_qr(k) / hyrho(k) *&1008 weight_substep(intermediate_timestep_count)1030 prr(k,j,i) = prr(k,j,i) + sed_qr(k) / hyrho(k) & 1031 * weight_substep(intermediate_timestep_count) 1009 1032 ELSE 1010 prr(k,j,i) = sed_qr(k) / hyrho(k)1033 prr(k,j,i) = prr(k,j,i) + sed_qr(k) / hyrho(k) 1011 1034 ENDIF 1012 1035 … … 1015 1038 ENDDO 1016 1039 1017 ! 1018 !-- Precipitation amount 1019 IF ( intermediate_timestep_count == intermediate_timestep_count_max & 1020 .AND. ( dt_do2d_xy - time_do2d_xy ) < & 1021 precipitation_amount_interval ) THEN 1040 CALL cpu_log( log_point_s(60), 'sed_rain', 'stop' ) 1041 1042 END SUBROUTINE sedimentation_rain 1043 1044 1045 !------------------------------------------------------------------------------! 1046 ! Description: 1047 ! ------------ 1048 !> Computation of the precipitation amount due to gravitational settling of 1049 !> rain and cloud (fog) droplets 1050 !------------------------------------------------------------------------------! 1051 SUBROUTINE calc_precipitation_amount 1052 1053 USE cloud_parameters, & 1054 ONLY: hyrho, precipitation_amount, prr 1055 1056 USE control_parameters, & 1057 ONLY: call_microphysics_at_all_substeps, dt_do2d_xy, dt_3d, & 1058 intermediate_timestep_count, intermediate_timestep_count_max,& 1059 precipitation_amount_interval, time_do2d_xy 1060 1061 USE indices, & 1062 ONLY: nxl, nxr, nys, nyn, nzb_s_inner 1063 1064 USE kinds 1065 1066 IMPLICIT NONE 1067 1068 INTEGER(iwp) :: i !: 1069 INTEGER(iwp) :: j !: 1070 1071 1072 IF ( ( dt_do2d_xy - time_do2d_xy ) < precipitation_amount_interval .AND.& 1073 ( .NOT. call_microphysics_at_all_substeps .OR. & 1074 intermediate_timestep_count == intermediate_timestep_count_max ) ) & 1075 THEN 1076 1022 1077 DO i = nxl, nxr 1023 1078 DO j = nys, nyn 1079 1024 1080 precipitation_amount(j,i) = precipitation_amount(j,i) + & 1025 1081 prr(nzb_s_inner(j,i)+1,j,i) * & 1026 1082 hyrho(nzb_s_inner(j,i)+1) * dt_3d 1083 1027 1084 ENDDO 1028 1085 ENDDO 1029 1086 ENDIF 1030 1087 1031 CALL cpu_log( log_point_s(60), 'sed_rain', 'stop' ) 1032 1033 END SUBROUTINE sedimentation_rain 1088 END SUBROUTINE calc_precipitation_amount 1034 1089 1035 1090 … … 1121 1176 1122 1177 IF ( drizzle ) CALL sedimentation_cloud( i,j ) 1178 1179 IF ( precipitation ) THEN 1180 CALL calc_precipitation_amount( i,j ) 1181 ENDIF 1123 1182 1124 1183 ! … … 1591 1650 1592 1651 USE cloud_parameters, & 1593 ONLY: eps_sb, hyrho, l_d_cp, p t_d_t, sed_qc_const1652 ONLY: eps_sb, hyrho, l_d_cp, prr, pt_d_t, sed_qc_const 1594 1653 1595 1654 USE constants, & … … 1597 1656 1598 1657 USE control_parameters, & 1599 ONLY: dt_do2d_xy, dt_micro, intermediate_timestep_count 1658 ONLY: call_microphysics_at_all_substeps, dt_do2d_xy, dt_micro, & 1659 intermediate_timestep_count, precipitation 1600 1660 1601 1661 USE indices, & … … 1604 1664 USE kinds 1605 1665 1666 USE statistics, & 1667 ONLY: weight_substep 1668 1606 1669 IMPLICIT NONE 1607 1670 … … 1632 1695 pt_1d(k) = pt_1d(k) - ( sed_qc(k+1) - sed_qc(k) ) * ddzu(k+1) / & 1633 1696 hyrho(k) * l_d_cp * pt_d_t(k) * dt_micro 1697 1698 ! 1699 !-- Compute the precipitation rate of cloud (fog) droplets 1700 IF ( precipitation ) THEN 1701 IF ( call_microphysics_at_all_substeps ) THEN 1702 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) * & 1703 weight_substep(intermediate_timestep_count) 1704 ELSE 1705 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) 1706 ENDIF 1707 ENDIF 1634 1708 1635 1709 ENDDO … … 1837 1911 !-- Compute the rain rate 1838 1912 IF ( call_microphysics_at_all_substeps ) THEN 1839 prr(k,j,i) = prr(k,j,i) + sed_qr(k) / hyrho(k) *&1840 weight_substep(intermediate_timestep_count)1913 prr(k,j,i) = prr(k,j,i) + sed_qr(k) / hyrho(k) & 1914 * weight_substep(intermediate_timestep_count) 1841 1915 ELSE 1842 prr(k,j,i) = sed_qr(k) / hyrho(k)1916 prr(k,j,i) = prr(k,j,i) + sed_qr(k) / hyrho(k) 1843 1917 ENDIF 1844 1918 1845 1919 ENDDO 1846 1920 1847 ! 1848 !-- Precipitation amount 1849 IF ( intermediate_timestep_count == intermediate_timestep_count_max & 1850 .AND. ( dt_do2d_xy - time_do2d_xy ) < & 1851 precipitation_amount_interval ) THEN 1921 END SUBROUTINE sedimentation_rain_ij 1922 1923 1924 !------------------------------------------------------------------------------! 1925 ! Description: 1926 ! ------------ 1927 !> This subroutine computes the precipitation amount due to gravitational 1928 !> settling of rain and cloud (fog) droplets 1929 !------------------------------------------------------------------------------! 1930 SUBROUTINE calc_precipitation_amount_ij( i, j ) 1931 1932 USE cloud_parameters, & 1933 ONLY: hyrho, precipitation_amount, prr 1934 1935 USE control_parameters, & 1936 ONLY: call_microphysics_at_all_substeps, dt_do2d_xy, dt_3d, & 1937 intermediate_timestep_count, intermediate_timestep_count_max,& 1938 precipitation_amount_interval, & 1939 time_do2d_xy 1940 1941 USE indices, & 1942 ONLY: nzb_s_inner 1943 1944 USE kinds 1945 1946 IMPLICIT NONE 1947 1948 INTEGER(iwp) :: i !: 1949 INTEGER(iwp) :: j !: 1950 1951 1952 IF ( ( dt_do2d_xy - time_do2d_xy ) < precipitation_amount_interval .AND.& 1953 ( .NOT. call_microphysics_at_all_substeps .OR. & 1954 intermediate_timestep_count == intermediate_timestep_count_max ) ) & 1955 THEN 1852 1956 1853 1957 precipitation_amount(j,i) = precipitation_amount(j,i) + & … … 1856 1960 ENDIF 1857 1961 1858 END SUBROUTINE sedimentation_rain_ij 1859 1860 1962 END SUBROUTINE calc_precipitation_amount_ij 1963 1861 1964 !------------------------------------------------------------------------------! 1862 1965 ! Description: -
palm/trunk/SOURCE/modules.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Renamed Obukhov length. Added ol, removed rif. Increased number of profiles 22 ! (pr_palm). Changed default values for dissipation_1d to 'detering' and 23 ! (mixing_length_1d to 'blackadar'. Added most_method. rif_min and rif_max 24 ! renamed to zeta_min and zeta_max and new values assigned. 22 25 ! 23 26 ! Former revisions: … … 300 303 ! 301 304 ! 305 !------------------------------------------------------------------------------! 306 ! Description: 307 ! ------------ 308 !> Definition of all variables 309 !> 310 !> @todo Add description for each variable 311 !------------------------------------------------------------------------------! 312 313 314 !------------------------------------------------------------------------------! 302 315 ! Description: 303 316 ! ------------ … … 338 351 flux_s_e, flux_s_nr, flux_s_pt, flux_s_q, flux_s_qr, flux_s_sa, & 339 352 flux_s_u, flux_s_v, flux_s_w, f1_mg, f2_mg, f3_mg, & 340 mean_inflow_profiles, nrs, nrsws, nrswst, ptnudge, pt_slope_ref, & 353 mean_inflow_profiles, nrs, nrsws, nrswst, & 354 ol, & !< Obukhov length 355 ptnudge, pt_slope_ref, & 341 356 qnudge, qs, qsws, qswst, qswst_remote, qrs, qrsws, qrswst, rif, & 342 357 saswsb, saswst, shf, tnudge, td_lsa_lpt, td_lsa_q, td_sub_lpt, & … … 390 405 USE kinds 391 406 392 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: lwp_av, precipitation_rate_av, & 393 qsws_av, shf_av,ts_av, us_av, z0_av, & 394 z0h_av 407 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: lwp_av, & !> Avg. liquid water path 408 precipitation_rate_av, & !> Avg. of precipitation rate 409 ol_av, & !> Avg. of Obukhov length 410 qsws_av, & !> Avg. of surface moisture flux 411 shf_av, & !> Avg. of surface heat flux 412 ts_av, & !> Avg. of characteristic temperature scale 413 us_av, & !> Avg. of friction velocity 414 z0_av, & !> Avg. of roughness length for momentum 415 z0h_av !> Avg. of roughness length for heat and moisture 395 416 396 417 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: & … … 541 562 CHARACTER (LEN=2) :: coupling_char = '' 542 563 CHARACTER (LEN=5) :: write_binary = 'false' 543 CHARACTER (LEN=8) :: run_date, run_time 564 CHARACTER (LEN=8) :: most_method = 'lookup', & !< NAMELIST parameter defining method to be used to calculate Okukhov length, 565 run_date, & !< 566 run_time !< 544 567 CHARACTER (LEN=9) :: simulated_time_chr 545 568 CHARACTER (LEN=11) :: topography_grid_convention = ' ' … … 563 586 coupling_mode = 'uncoupled', & 564 587 coupling_mode_remote = 'uncoupled', & 565 dissipation_1d = ' as_in_3d_model', &588 dissipation_1d = 'detering', & 566 589 fft_method = 'system-specific', & 567 mixing_length_1d = ' as_in_3d_model', &590 mixing_length_1d = 'blackadar', & 568 591 random_generator = 'numerical-recipes', & 569 592 reference_state = 'initial_profile', & … … 653 676 cloud_top_radiation = .FALSE., & 654 677 conserve_volume_flow = .FALSE., constant_diffusion = .FALSE., & 678 constant_flux_layer = .TRUE., & 655 679 constant_heatflux = .TRUE., constant_top_heatflux = .TRUE., & 656 680 constant_top_momentumflux = .FALSE., & … … 679 703 outflow_l = .FALSE., outflow_n = .FALSE., outflow_r = .FALSE., & 680 704 outflow_s = .FALSE., passive_scalar = .FALSE., & 681 prandtl_layer = .TRUE., &682 705 precipitation = .FALSE., & 683 706 random_heatflux = .FALSE., recycling_yshift = .FALSE.,& … … 745 768 recycling_width = 9999999.9_wp, residual_limit = 1.0E-4_wp, & 746 769 restart_time = 9999999.9_wp, rho_reference, rho_surface, & 747 r if_max = 1.0_wp, rif_min = -5.0_wp, roughness_length = 0.1_wp, &770 roughness_length = 0.1_wp, & 748 771 sa_surface = 35.0_wp, & 749 772 simulated_time = 0.0_wp, simulated_time_at_begin, sin_alpha_surface, & … … 768 791 vg_surface = 0.0_wp, vpt_reference = 9999999.9_wp, & 769 792 v_bulk = 0.0_wp, v_gtrans = 0.0_wp, wall_adjustment_factor = 1.8_wp, & 793 zeta_max = 20.0_wp, & !< Maximum value of zeta = z/L 794 zeta_min = -9990.0_wp, & !< Minimum value of zeta = z/L 770 795 z_max_do2d = -1.0_wp, z0h_factor = 1.0_wp 771 796 … … 1149 1174 'wpt ', 'pt(0) ', 'pt(zp) ', & 1150 1175 'w"u"0 ', 'w"v"0 ', 'w"q"0 ', & 1151 ' mo_L', 'q* ', &1176 'ol ', 'q* ', & 1152 1177 ( 'unknown ', i9 = 1, dots_max-23 ) /) 1153 1178 … … 1429 1454 1430 1455 CHARACTER (LEN=40) :: region(0:9) 1431 INTEGER(iwp) :: pr_palm = 1 20, statistic_regions = 01456 INTEGER(iwp) :: pr_palm = 130, statistic_regions = 0 1432 1457 INTEGER(iwp) :: u_max_ijk(3) = -1, v_max_ijk(3) = -1, w_max_ijk(3) = -1 1433 1458 LOGICAL :: flow_statistics_called = .FALSE. -
palm/trunk/SOURCE/netcdf.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Added output of radiative heating rates for RRTMG. Corrected output of 22 ! radiative fluxes 22 23 ! 23 24 ! Former revisions: … … 116 117 #if defined( __netcdf ) 117 118 118 USE arrays_3d, 119 USE arrays_3d, & 119 120 ONLY: zu, zw 120 121 121 USE constants, 122 USE constants, & 122 123 ONLY: pi 123 124 124 USE control_parameters, & 125 ONLY: averaging_interval, averaging_interval_pr, averaging_interval_sp,& 126 data_output_pr, domask, dopr_n,dopr_time_count, dopts_time_count, & 127 dots_time_count, dosp_time_count, do2d, do2d_xz_time_count, do3d, & 128 do2d_yz_time_count, mask_size, do2d_xy_time_count, do3d_time_count, & 129 domask_time_count, mask_i_global, mask_j_global,mask_k_global, & 130 message_string, mid, netcdf_data_format, netcdf_precision, ntdim_2d_xy, & 131 ntdim_2d_xz, ntdim_2d_yz, ntdim_3d, nz_do3d, prt_time_count, & 132 run_description_header, section, simulated_time, topography 133 134 USE grid_variables, & 125 USE control_parameters, & 126 ONLY: averaging_interval, averaging_interval_pr, & 127 averaging_interval_sp, data_output_pr, domask, dopr_n, & 128 dopr_time_count, dopts_time_count, dots_time_count, & 129 dosp_time_count, do2d, do2d_xz_time_count, do3d, & 130 do2d_yz_time_count, mask_size, do2d_xy_time_count, & 131 do3d_time_count, domask_time_count, mask_i_global, & 132 mask_j_global, mask_k_global, message_string, mid, & 133 netcdf_data_format, netcdf_precision, ntdim_2d_xy, & 134 ntdim_2d_xz, ntdim_2d_yz, ntdim_3d, nz_do3d, prt_time_count, & 135 run_description_header, section, simulated_time, topography 136 137 USE grid_variables, & 135 138 ONLY: dx, dy, zu_s_inner, zw_w_inner 136 139 137 USE indices, 140 USE indices, & 138 141 ONLY: nx, ny, nz ,nzb, nzt 139 142 … … 150 153 USE pegrid 151 154 152 USE particle_attributes, 155 USE particle_attributes, & 153 156 ONLY: maximum_number_of_particles, number_of_particle_groups 154 157 155 USE profil_parameter, & 156 ONLY: crmax, cross_profiles, dopr_index,profile_columns, profile_rows 157 158 USE radiation_model_mod, & 159 ONLY: rad_lw_in, rad_lw_out, rad_sw_in, rad_sw_out 160 161 USE spectrum, & 158 USE profil_parameter, & 159 ONLY: crmax, cross_profiles, dopr_index, profile_columns, profile_rows 160 161 USE radiation_model_mod, & 162 ONLY: rad_lw_in, rad_lw_out, rad_lw_cs_hr, rad_lw_hr, & 163 rad_sw_in, rad_sw_out, rad_sw_cs_hr, rad_sw_hr 164 165 166 USE spectrum, & 162 167 ONLY: comp_spectra_level, data_output_sp, spectra_direction 163 168 164 USE statistics, 169 USE statistics, & 165 170 ONLY: hom, statistic_regions 166 171 … … 531 536 ! 532 537 !-- Most variables are defined on the scalar grid 533 CASE ( 'e', 'lpt', 'nr', 'p', 'pc', 'pr', 'prr', 'pt', 'q', &534 'qc', 'ql', 'ql_c', 'ql_v', 'ql_vp', 'qr', 'qv', &535 'r ho', 's', 'sa', 'vpt', 'rad_lw_in', 'rad_lw_out',&536 'rad_sw_ in', 'rad_sw_out')538 CASE ( 'e', 'lpt', 'nr', 'p', 'pc', 'pr', 'prr', 'pt', 'q', & 539 'qc', 'ql', 'ql_c', 'ql_v', 'ql_vp', 'qr', 'qv', & 540 'rad_lw_cs_hr', 'rad_lw_hr', 'rad_sw_cs_hr', & 541 'rad_sw_hr', 'rho', 's', 'sa', 'vpt' ) 537 542 538 543 grid_x = 'x' … … 555 560 ! 556 561 !-- w grid 557 CASE ( 'w' ) 562 CASE ( 'rad_lw_in', 'rad_lw_out', 'rad_sw_in', 'rad_sw_out', & 563 'w' ) 558 564 559 565 grid_x = 'x' … … 562 568 ! 563 569 !-- soil grid 564 CASE ( ' t_soil', 'm_soil' )570 CASE ( 'm_soil', 't_soil' ) 565 571 566 572 grid_x = 'x' … … 1112 1118 ! 1113 1119 !-- Most variables are defined on the scalar grid 1114 CASE ( 'e', 'lpt', 'nr', 'p', 'pc', 'pr', 'prr', 'pt', 'q', &1115 'qc', 'ql', 'ql_c', 'ql_v', 'ql_vp', 'qr', 'qv', 'rho', &1116 's', 'sa', 'vpt' , 'rad_lw_ in', 'rad_lw_out',&1117 'rad_sw_ in', 'rad_sw_out' )1120 CASE ( 'e', 'lpt', 'nr', 'p', 'pc', 'pr', 'prr', 'pt', 'q', & 1121 'qc', 'ql', 'ql_c', 'ql_v', 'ql_vp', 'qr', 'qv', 'rho', & 1122 's', 'sa', 'vpt' , 'rad_lw_cs_hr', 'rad_lw_hr', & 1123 'rad_sw_cs_hr', 'rad_sw_hr' ) 1118 1124 1119 1125 grid_x = 'x' … … 1136 1142 ! 1137 1143 !-- w grid 1138 CASE ( 'w' ) 1144 CASE ( 'rad_lw_in', 'rad_lw_out', 'rad_sw_in', 'rad_sw_out', & 1145 'w' ) 1139 1146 1140 1147 grid_x = 'x' … … 1143 1150 ! 1144 1151 !-- soil grid 1145 CASE ( ' t_soil', 'm_soil' )1152 CASE ( 'm_soil', 't_soil' ) 1146 1153 1147 1154 grid_x = 'x' … … 1765 1772 ! 1766 1773 !-- Most variables are defined on the zu grid 1767 CASE ( 'e_xy', 'lpt_xy', 'nr_xy', 'p_xy', 'pc_xy', 'pr_xy',& 1768 'prr_xy', 'pt_xy', 'q_xy', 'qc_xy', 'ql_xy', & 1769 'ql_c_xy', 'ql_v_xy', 'ql_vp_xy', 'qr_xy', 'qv_xy', & 1770 'rho_xy', 's_xy', 'sa_xy', 'vpt_xy', 'rad_lw_in_xy',& 1771 'rad_lw_out_xy', 'rad_sw_in_xy', 'rad_sw_out_xy' ) 1774 CASE ( 'e_xy', 'lpt_xy', 'nr_xy', 'p_xy', 'pc_xy', & 1775 'pr_xy', 'prr_xy', 'pt_xy', 'q_xy', 'qc_xy', & 1776 'ql_xy', 'ql_c_xy', 'ql_v_xy', 'ql_vp_xy', & 1777 'qr_xy', 'qv_xy', 'rad_lw_cs_hr_xy', & 1778 'rad_lw_hr_xy', 'rad_sw_cs_hr_xy', 'rad_sw_hr_xy',& 1779 'rho_xy', 's_xy', 'sa_xy', 'vpt_xy' ) 1772 1780 1773 1781 grid_x = 'x' … … 1790 1798 ! 1791 1799 !-- w grid 1792 CASE ( 'w_xy' ) 1800 CASE ( 'rad_lw_in_xy', 'rad_lw_out_xy', 'rad_sw_in_xy', & 1801 'rad_sw_out_xy' , 'w_xy' ) 1793 1802 1794 1803 grid_x = 'x' … … 1797 1806 ! 1798 1807 !-- soil grid 1799 CASE ( ' t_soil_xy', 'm_soil_xy' )1808 CASE ( 'm_soil_xy', 't_soil_xy' ) 1800 1809 grid_x = 'x' 1801 1810 grid_y = 'y' … … 2452 2461 'prr_xz', 'pt_xz', 'q_xz', 'qc_xz', 'ql_xz', & 2453 2462 'ql_c_xz', 'ql_v_xz', 'ql_vp_xz', 'qr_xz', 'qv_xz', & 2454 'rho_xz', 's_xz', 'sa_xz', 'vpt_xz' , 'rad_lw_in_xz',& 2455 'rad_lw_out_xz', 'rad_sw_in_xz', 'rad_sw_out_xz' ) 2463 'rad_lw_cs_hr_xz', 'rad_lw_hr_xz', & 2464 'rad_sw_cs_hr_xz', 'rad_sw_hr_xz''rho_xz', 's_xz', & 2465 'sa_xz', 'vpt_xz' ) 2456 2466 2457 2467 grid_x = 'x' … … 2474 2484 ! 2475 2485 !-- w grid 2476 CASE ( 'w_xz' ) 2486 CASE ( 'rad_lw_in_xz', 'rad_lw_out_xz', 'rad_sw_in_xz', & 2487 'rad_sw_out_xz', 'w_xz' ) 2477 2488 2478 2489 grid_x = 'x' … … 2482 2493 ! 2483 2494 !-- soil grid 2484 CASE ( ' t_soil_xz', 'm_soil_xz' )2495 CASE ( 'm_soil_xz', 't_soil_xz' ) 2485 2496 2486 2497 grid_x = 'x' … … 3126 3137 ! 3127 3138 !-- Most variables are defined on the zu grid 3128 CASE ( 'e_yz', 'lpt_yz', 'nr_yz', 'p_yz', 'pc_yz', 'pr_yz',& 3129 'prr_yz', 'pt_yz', 'q_yz', 'qc_yz', 'ql_yz', & 3130 'ql_c_yz', 'ql_v_yz', 'ql_vp_yz', 'qr_yz', 'qv_yz', & 3131 'rho_yz', 's_yz', 'sa_yz', 'vpt_yz', 'rad_lw_in_yz',& 3132 'rad_lw_out_yz', 'rad_sw_in_yz', 'rad_sw_out_yz' ) 3139 CASE ( 'e_yz', 'lpt_yz', 'nr_yz', 'p_yz', 'pc_yz', 'pr_yz', & 3140 'prr_yz', 'pt_yz', 'q_yz', 'qc_yz', 'ql_yz', & 3141 'ql_c_yz', 'ql_v_yz', 'ql_vp_yz', 'qr_yz', 'qv_yz', & 3142 'rad_lw_cs_hr_yz', 'rad_lw_hr_yz', & 3143 'rad_sw_cs_hr_yz', 'rad_sw_hr_yz''rho_yz', 's_yz', & 3144 'sa_yz', 'vpt_yz' ) 3133 3145 3134 3146 grid_x = 'x' … … 3151 3163 ! 3152 3164 !-- w grid 3153 CASE ( 'w_yz' ) 3165 CASE ( 'rad_lw_in_yz', 'rad_lw_out_yz', 'rad_sw_in_yz', & 3166 'rad_sw_out_yz', 'w_yz' ) 3154 3167 3155 3168 grid_x = 'x' … … 3158 3171 ! 3159 3172 !-- soil grid 3160 CASE ( ' t_soil_yz', 'm_soil_yz' )3173 CASE ( 'm_soil_yz', 't_soil_yz' ) 3161 3174 3162 3175 grid_x = 'x' -
palm/trunk/SOURCE/package_parin.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added skip_time_do_lsm, skip_time_do_radiation, and emissivity 22 22 ! 23 23 ! Former revisions: … … 92 92 !> This subroutine reads from the NAMELIST file variables controling model 93 93 !> software packages which are used optionally in the run. 94 !> 95 !> @todo Perform all actions in the respective submodules and remove 96 !> package_parin 94 97 !------------------------------------------------------------------------------! 95 98 SUBROUTINE package_parin … … 117 120 USE land_surface_model_mod, & 118 121 ONLY: alpha_vangenuchten, c_surface, canopy_resistance_coefficient, & 119 conserve_water_content, dewfall, f _shortwave_incoming,&120 hydraulic_conductivity, lambda_surface_stable,&121 lambda_surface_ unstable,&122 l eaf_area_index, land_surface, l_vangenuchten,&123 min_ canopy_resistance, min_soil_resistance, field_capacity,&124 r esidual_moisture, saturation_moisture, wilting_point,&125 n_vangenuchten, root_fraction, soil_moisture, soil_temperature,&126 soil_type, vegetation_coverage, veg_type, z0_eb, z0h_eb, zs122 conserve_water_content, dewfall, field_capacity, & 123 f_shortwave_incoming, hydraulic_conductivity, & 124 lambda_surface_stable, lambda_surface_unstable, leaf_area_index, & 125 land_surface, l_vangenuchten, min_canopy_resistance, & 126 min_soil_resistance, n_vangenuchten, residual_moisture, & 127 root_fraction, saturation_moisture, wilting_point, & 128 skip_time_do_lsm, soil_moisture, soil_temperature, soil_type, & 129 vegetation_coverage, veg_type, zs, z0_eb, z0h_eb 127 130 128 131 USE kinds … … 152 155 USE radiation_model_mod, & 153 156 ONLY: albedo, albedo_type, albedo_lw_dif, albedo_lw_dir, albedo_sw_dif,& 154 albedo_sw_dir, day_init, constant_albedo, dt_radiation, lambda, & 155 lw_radiation, net_radiation, radiation, radiation_scheme, & 156 sw_radiation, time_utc_init 157 albedo_sw_dir, constant_albedo, day_init, dt_radiation, & 158 emissivity, lambda, lw_radiation, net_radiation, radiation, & 159 radiation_scheme, skip_time_do_radiation, sw_radiation, & 160 time_utc_init 157 161 158 162 … … 200 204 min_soil_resistance, n_vangenuchten, & 201 205 residual_moisture, root_fraction, & 202 saturation_moisture, s oil_moisture,&203 soil_ temperature, soil_type,&206 saturation_moisture, skip_time_do_lsm, & 207 soil_moisture, soil_temperature, soil_type, & 204 208 vegetation_coverage, veg_type, wilting_point,& 205 209 zs, z0_eb, z0h_eb … … 234 238 constant_albedo, day_init, dt_radiation, & 235 239 lambda, lw_radiation, net_radiation, & 236 radiation_scheme, sw_radiation, time_utc_init 240 radiation_scheme, skip_time_do_radiation, & 241 sw_radiation, time_utc_init 237 242 238 243 NAMELIST /spectra_par/ averaging_interval_sp, comp_spectra_level, & -
palm/trunk/SOURCE/parin.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added parameter most_method. Renamed prandtl_layer to constant_flux_layer. 22 22 ! 23 23 ! Former revisions: … … 185 185 cloud_droplets, cloud_physics, cloud_scheme, & 186 186 cloud_top_radiation, conserve_volume_flow, & 187 conserve_volume_flow_mode, coupling_start_time, & 187 conserve_volume_flow_mode, constant_flux_layer, & 188 coupling_start_time, & 188 189 create_disturbances, cycle_mg, data_output, data_output_masks, & 189 190 data_output_pr, data_output_2d_on_each_pe, & … … 210 211 maximum_parallel_io_streams, max_pr_user, message_string, & 211 212 mg_cycles, mg_switch_to_pe0_level, mixing_length_1d, & 212 momentum_advec, netcdf_data_format, netcdf_precision, neutral, & 213 ngsrb, normalizing_region, nsor, nsor_ini, nudging, ocean, & 213 momentum_advec, most_method, netcdf_data_format, & 214 netcdf_precision, neutral, ngsrb, normalizing_region, nsor, & 215 nsor_ini, nudging, ocean, & 214 216 omega, omega_sor, passive_scalar, phi, nz_do3d, & 215 prandtl_ layer, prandtl_number, precipitation,&217 prandtl_number, precipitation, & 216 218 precipitation_amount_interval, psolver, pt_damping_factor, & 217 219 pt_damping_width, pt_reference, pt_surface, & … … 224 226 reference_state, residual_limit, & 225 227 restart_time, return_addres, return_username, & 226 revision, r if_max, rif_min, roughness_length, runnr,&228 revision, roughness_length, runnr, & 227 229 run_identifier, sa_surface, sa_vertical_gradient, & 228 230 sa_vertical_gradient_level, scalar_advec, & … … 246 248 vg_vertical_gradient_level, v_bulk, v_profile, & 247 249 wall_adjustment, wall_heatflux, wall_humidityflux, & 248 wall_scalarflux, write_binary, z0h_factor, z_max_do2d 250 wall_scalarflux, write_binary, zeta_max, zeta_min, z0h_factor, & 251 z_max_do2d 249 252 250 253 USE cpulog, & … … 274 277 USE statistics, & 275 278 ONLY: hom, hom_sum, pr_palm, region, statistic_regions 279 276 280 277 281 IMPLICIT NONE … … 291 295 cloud_physics, cloud_scheme, cloud_top_radiation, & 292 296 collective_wait, conserve_volume_flow, & 293 conserve_volume_flow_mode, coupling_start_time, & 297 conserve_volume_flow_mode, constant_flux_layer, & 298 coupling_start_time, & 294 299 curvature_solution_effects, cycle_mg, damp_level_1d, & 295 300 dissipation_1d, & … … 306 311 loop_optimization, masking_method, mg_cycles, & 307 312 mg_switch_to_pe0_level, mixing_length_1d, momentum_advec, & 308 nc_const, netcdf_precision, neutral, ngsrb,&313 most_method, nc_const, netcdf_precision, neutral, ngsrb, & 309 314 nsor, nsor_ini, nudging, nx, ny, nz, ocean, omega, omega_sor, & 310 passive_scalar, phi, prandtl_layer,&315 passive_scalar, phi, & 311 316 prandtl_number, precipitation, psolver, pt_damping_factor, & 312 317 pt_damping_width, pt_reference, pt_surface, & … … 318 323 recycling_width, recycling_yshift, & 319 324 reference_state, residual_limit, & 320 r if_max, rif_min, roughness_length, sa_surface,&325 roughness_length, sa_surface, & 321 326 sa_vertical_gradient, sa_vertical_gradient_level, scalar_advec, & 322 327 scalar_rayleigh_damping, & … … 335 340 vg_vertical_gradient_level, v_bulk, v_profile, ventilation_effect,& 336 341 wall_adjustment, wall_heatflux, wall_humidityflux, & 337 wall_scalarflux, z 0h_factor342 wall_scalarflux, zeta_max, zeta_min, z0h_factor 338 343 339 344 NAMELIST /d3par/ averaging_interval, averaging_interval_pr, & -
palm/trunk/SOURCE/production_e.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Renamed prandtl_layer to constant_flux_layer. 22 22 ! 23 23 ! Former revisions: … … 78 78 ! ------------ 79 79 !> Production terms (shear + buoyancy) of the TKE. 80 !> @warning The case with prandtl_layer = F and use_surface_fluxes = T is80 !> @warning The case with constant_flux_layer = F and use_surface_fluxes = T is 81 81 !> not considered well! 82 82 !------------------------------------------------------------------------------! … … 128 128 129 129 USE control_parameters, & 130 ONLY: cloud_droplets, cloud_physics, g, humidity, kappa, neutral,&131 ocean, prandtl_layer, pt_reference, rho_reference,&132 use_single_reference_value, use_surface_fluxes,&133 use_ top_fluxes130 ONLY: cloud_droplets, cloud_physics, constant_flux_layer, g, & 131 humidity, kappa, neutral, ocean, pt_reference, & 132 rho_reference, use_single_reference_value, & 133 use_surface_fluxes, use_top_fluxes 134 134 135 135 USE grid_variables, & … … 217 217 ENDDO 218 218 219 IF ( prandtl_layer ) THEN219 IF ( constant_flux_layer ) THEN 220 220 221 221 ! … … 734 734 735 735 USE control_parameters, & 736 ONLY: cloud_droplets, cloud_physics, g, humidity, kappa, neutral,&737 ocean, prandtl_layer, pt_reference, rho_reference,&738 topography, use_single_reference_value, use_surface_fluxes,&739 use_ top_fluxes736 ONLY: cloud_droplets, cloud_physics, constant_flux_layer, g, & 737 humidity, kappa, neutral, ocean, pt_reference, & 738 rho_reference, topography, use_single_reference_value, & 739 use_surface_fluxes, use_top_fluxes 740 740 741 741 USE grid_variables, & … … 832 832 ENDDO 833 833 834 IF ( prandtl_layer ) THEN834 IF ( constant_flux_layer ) THEN 835 835 836 836 ! … … 1402 1402 1403 1403 USE control_parameters, & 1404 ONLY: cloud_droplets, cloud_physics, g, humidity, kappa, neutral,&1405 ocean, prandtl_layer, pt_reference, rho_reference,&1406 use_single_reference_value, use_surface_fluxes,&1407 use_ top_fluxes1404 ONLY: cloud_droplets, cloud_physics, constant_flux_layer, g, & 1405 humidity, kappa, neutral, ocean, pt_reference, & 1406 rho_reference, use_single_reference_value, & 1407 use_surface_fluxes, use_top_fluxes 1408 1408 1409 1409 USE grid_variables, & … … 1473 1473 ENDDO 1474 1474 1475 IF ( prandtl_layer ) THEN1475 IF ( constant_flux_layer ) THEN 1476 1476 1477 1477 IF ( ( wall_e_x(j,i) /= 0.0_wp ) .OR. ( wall_e_y(j,i) /= 0.0_wp ) ) THEN … … 1924 1924 1925 1925 USE control_parameters, & 1926 ONLY: kappa, prandtl_layer1926 ONLY: constant_flux_layer, kappa 1927 1927 1928 1928 USE indices, & … … 1937 1937 INTEGER(iwp) :: kv !< 1938 1938 1939 IF ( prandtl_layer ) THEN1939 IF ( constant_flux_layer ) THEN 1940 1940 1941 1941 IF ( first_call ) THEN -
palm/trunk/SOURCE/prognostic_equations.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Added optional model spin-up without radiation / land surface model calls. 22 ! Formatting corrections. 22 23 ! 23 24 ! Former revisions: … … 286 287 287 288 USE radiation_model_mod, & 288 ONLY: radiation, radiation_scheme, radiation_tendency 289 ONLY: radiation, radiation_scheme, radiation_tendency, & 290 skip_time_do_radiation 289 291 290 292 USE statistics, & … … 410 412 ! 411 413 !-- Nudging 412 IF ( nudging ) CALL nudge( i, j, simulated_time, 'u' ) 414 IF ( nudging ) CALL nudge( i, j, simulated_time, 'u' ) 413 415 414 416 CALL user_actions( i, j, 'u-tendency' ) … … 469 471 ! 470 472 !-- Nudging 471 IF ( nudging ) CALL nudge( i, j, simulated_time, 'v' ) 473 IF ( nudging ) CALL nudge( i, j, simulated_time, 'v' ) 472 474 473 475 CALL user_actions( i, j, 'v-tendency' ) … … 610 612 ! 611 613 !-- If required, add tendency due to radiative heating/cooling 612 IF ( radiation .AND. radiation_scheme == 'rrtmg' ) THEN 614 IF ( radiation .AND. radiation_scheme == 'rrtmg' .AND. & 615 simulated_time > skip_time_do_radiation ) THEN 613 616 CALL radiation_tendency ( i, j, tend ) 614 617 ENDIF … … 718 721 ENDIF 719 722 CALL diffusion_s( i, j, q, qsws, qswst, wall_qflux ) 720 723 721 724 ! 722 725 !-- If required compute decrease of total water content due to … … 724 727 IF ( cloud_physics .AND. icloud_scheme == 1 .AND. & 725 728 precipitation ) THEN 726 CALL calc_precipitation( i, j ) 727 ENDIF 729 CALL calc_precipitation( i, j ) 730 ENDIF 731 728 732 ! 729 733 !-- Sink or source of scalar concentration due to canopy elements … … 1009 1013 ! 1010 1014 !-- Nudging 1011 IF ( nudging ) CALL nudge( simulated_time, 'u' ) 1015 IF ( nudging ) CALL nudge( simulated_time, 'u' ) 1012 1016 1013 1017 CALL user_actions( 'u-tendency' ) … … 1085 1089 ! 1086 1090 !-- Nudging 1087 IF ( nudging ) CALL nudge( simulated_time, 'v' ) 1091 IF ( nudging ) CALL nudge( simulated_time, 'v' ) 1088 1092 1089 1093 CALL user_actions( 'v-tendency' ) … … 1274 1278 ! 1275 1279 !-- If required, add tendency due to radiative heating/cooling 1276 IF ( radiation .AND. radiation_scheme == 'rrtmg' ) THEN 1277 CALL radiation_tendency ( tend ) 1280 IF ( radiation .AND. radiation_scheme == 'rrtmg' .AND. & 1281 simulated_time > skip_time_do_radiation ) THEN 1282 CALL radiation_tendency ( tend ) 1278 1283 ENDIF 1279 1284 … … 1859 1864 ! 1860 1865 !-- Nudging 1861 IF ( nudging ) CALL nudge( simulated_time, 'u' ) 1866 IF ( nudging ) CALL nudge( simulated_time, 'u' ) 1862 1867 1863 1868 CALL user_actions( 'u-tendency' ) … … 1926 1931 ! 1927 1932 !-- Nudging 1928 IF ( nudging ) CALL nudge( simulated_time, 'v' ) 1933 IF ( nudging ) CALL nudge( simulated_time, 'v' ) 1929 1934 1930 1935 CALL user_actions( 'v-tendency' ) … … 2096 2101 ENDIF 2097 2102 2103 IF ( radiation .AND. radiation_scheme == 'rrtmg' .AND. & 2104 simulated_time > skip_time_do_radiation ) THEN 2105 CALL radiation_tendency ( tend ) 2106 ENDIF 2107 2098 2108 CALL user_actions( 'pt-tendency' ) 2099 2109 -
palm/trunk/SOURCE/radiation_model.f90
r1683 r1691 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added option for spin-up runs without radiation (skip_time_do_radiation). Bugfix 22 ! in calculation of pressure profiles. Bugfix in calculation of trace gas profiles. 23 ! Added output of radiative heating rates. 22 24 ! 23 25 ! Former revisions: … … 61 63 !> @todo Output of other rrtm arrays (such as volume mixing ratios) 62 64 !> @todo Adapt for use with topography 63 !> @todo Remove 3D dummy arrays (such as clear-sky output)64 65 !> 65 66 !> @note Many variables have a leading dummy dimension (0:0) in order to … … 70 71 71 72 USE arrays_3d, & 72 ONLY: hyp, pt, q, ql, zw73 ONLY: dzw, hyp, pt, q, ql, zw 73 74 74 75 USE cloud_parameters, & 75 ONLY: cp, l_ v, nc_const, rho_l, sigma_gc76 ONLY: cp, l_d_cp, nc_const, rho_l, sigma_gc 76 77 77 78 USE constants, & … … 80 81 USE control_parameters, & 81 82 ONLY: cloud_droplets, cloud_physics, g, initializing_actions, & 82 large_scale_forcing, lsf_surf, phi, pt_surface, 83 large_scale_forcing, lsf_surf, phi, pt_surface, rho_surface, & 83 84 surface_pressure, time_since_reference_point 84 85 … … 153 154 154 155 155 LOGICAL :: constant_albedo = .FALSE., & !< flag parameter indicating whether the albedo may change depending on zenith 156 lw_radiation = .TRUE., & !< flag parameter indicing whether longwave radiation shall be calculated 157 radiation = .FALSE., & !< flag parameter indicating whether the radiation model is used 158 sun_up = .TRUE., & !< flag parameter indicating whether the sun is up or down 159 sw_radiation = .TRUE. !< flag parameter indicing whether shortwave radiation shall be calculated 160 161 REAL(wp), PARAMETER :: sigma_sb = 5.67E-8_wp, & !< Stefan-Boltzmann constant 162 solar_constant = 1368.0_wp !< solar constant at top of atmosphere 163 164 REAL(wp) :: albedo = 9999999.9_wp, & !< NAMELIST alpha 165 albedo_lw_dif = 9999999.9_wp, & !< NAMELIST aldif 166 albedo_lw_dir = 9999999.9_wp, & !< NAMELIST aldir 167 albedo_sw_dif = 9999999.9_wp, & !< NAMELIST asdif 168 albedo_sw_dir = 9999999.9_wp, & !< NAMELIST asdir 169 dt_radiation = 0.0_wp, & !< radiation model timestep 170 emissivity = 0.95_wp, & !< NAMELIST surface emissivity 171 exn, & !< Exner function 172 lon = 0.0_wp, & !< longitude in radians 173 lat = 0.0_wp, & !< latitude in radians 174 decl_1, & !< declination coef. 1 175 decl_2, & !< declination coef. 2 176 decl_3, & !< declination coef. 3 177 time_utc, & !< current time in UTC 178 time_utc_init = 43200.0_wp, & !< UTC time at model start (noon) 179 lambda = 0.0_wp, & !< longitude in degrees 180 net_radiation = 0.0_wp, & !< net radiation at surface 181 time_radiation = 0.0_wp, & !< time since last call of radiation code 182 sky_trans !< sky transmissivity 183 156 LOGICAL :: constant_albedo = .FALSE., & !< flag parameter indicating whether the albedo may change depending on zenith 157 force_radiation_call = .FALSE., & !< flag parameter for unscheduled radiation calls 158 lw_radiation = .TRUE., & !< flag parameter indicing whether longwave radiation shall be calculated 159 radiation = .FALSE., & !< flag parameter indicating whether the radiation model is used 160 sun_up = .TRUE., & !< flag parameter indicating whether the sun is up or down 161 sw_radiation = .TRUE. !< flag parameter indicing whether shortwave radiation shall be calculated 162 163 164 REAL(wp), PARAMETER :: d_seconds_hour = 0.000277777777778_wp, & !< inverse of seconds per hour (1/3600) 165 d_hours_day = 0.0416666666667_wp, & !< inverse of hours per day (1/24) 166 sigma_sb = 5.67037321E-8_wp, & !< Stefan-Boltzmann constant 167 solar_constant = 1368.0_wp !< solar constant at top of atmosphere 168 169 REAL(wp) :: albedo = 9999999.9_wp, & !< NAMELIST alpha 170 albedo_lw_dif = 9999999.9_wp, & !< NAMELIST aldif 171 albedo_lw_dir = 9999999.9_wp, & !< NAMELIST aldir 172 albedo_sw_dif = 9999999.9_wp, & !< NAMELIST asdif 173 albedo_sw_dir = 9999999.9_wp, & !< NAMELIST asdir 174 decl_1, & !< declination coef. 1 175 decl_2, & !< declination coef. 2 176 decl_3, & !< declination coef. 3 177 dt_radiation = 0.0_wp, & !< radiation model timestep 178 emissivity = 0.98_wp, & !< NAMELIST surface emissivity 179 lambda = 0.0_wp, & !< longitude in degrees 180 lon = 0.0_wp, & !< longitude in radians 181 lat = 0.0_wp, & !< latitude in radians 182 net_radiation = 0.0_wp, & !< net radiation at surface 183 skip_time_do_radiation = 0.0_wp, & !< Radiation model is not called before this time 184 sky_trans, & !< sky transmissivity 185 time_radiation = 0.0_wp, & !< time since last call of radiation code 186 time_utc, & !< current time in UTC 187 time_utc_init = 43200.0_wp !< UTC time at model start (noon) 184 188 185 189 REAL(wp), DIMENSION(0:0) :: zenith !< solar zenith angle … … 213 217 214 218 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: & 219 rad_lw_cs_hr, & !< longwave clear sky radiation heating rate (K/s) 220 rad_lw_cs_hr_av, & !< average of rad_lw_cs_hr 221 rad_lw_hr, & !< longwave radiation heating rate (K/s) 222 rad_lw_hr_av, & !< average of rad_sw_hr 223 rad_lw_in, & !< incoming longwave radiation (W/m2) 224 rad_lw_in_av, & !< average of rad_lw_in 225 rad_lw_out, & !< outgoing longwave radiation (W/m2) 226 rad_lw_out_av, & !< average of rad_lw_out 227 rad_sw_cs_hr, & !< shortwave clear sky radiation heating rate (K/s) 228 rad_sw_cs_hr_av, & !< average of rad_sw_cs_hr 229 rad_sw_hr, & !< shortwave radiation heating rate (K/s) 230 rad_sw_hr_av, & !< average of rad_sw_hr 215 231 rad_sw_in, & !< incoming shortwave radiation (W/m2) 216 232 rad_sw_in_av, & !< average of rad_sw_in 217 233 rad_sw_out, & !< outgoing shortwave radiation (W/m2) 218 rad_sw_out_av, & !< average of rad_sw_out 219 rad_lw_in, & !< incoming longwave radiation (W/m2) 220 rad_lw_in_av, & !< average of rad_lw_in 221 rad_lw_out, & !< outgoing longwave radiation (W/m2) 222 rad_lw_out_av !< average of rad_lw_out 234 rad_sw_out_av !< average of rad_sw_out 235 223 236 224 237 ! … … 244 257 rrtm_icld = 0, & !< cloud flag (0: clear sky column, 1: cloudy column) 245 258 rrtm_iaer = 0, & !< aerosol option flag (0: no aerosol layers, for lw only: 6 (requires setting of rrtm_sw_ecaer), 10: one or more aerosol layers (not implemented) 246 rrtm_idrv = 0!< longwave upward flux calculation option (0,1)259 rrtm_idrv = 1 !< longwave upward flux calculation option (0,1) 247 260 248 261 LOGICAL :: snd_exists = .FALSE. !< flag parameter to check whether a user-defined input files exists 249 262 250 REAL(wp), PARAMETER :: mol_ weight_air_d_wv = 1.607793_wp !< molecular weight dry air / water vapor263 REAL(wp), PARAMETER :: mol_mass_air_d_wv = 1.607793_wp !< molecular weight dry air / water vapor 251 264 252 265 REAL(wp), DIMENSION(:), ALLOCATABLE :: hyp_snd, & !< hypostatic pressure from sounding data (hPa) … … 255 268 t_snd !< actual temperature from sounding data (hPa) 256 269 257 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: aldif, & !< longwave diffuse albedo solar angle of 60° 258 aldir, & !< longwave direct albedo solar angle of 60° 259 asdif, & !< shortwave diffuse albedo solar angle of 60° 260 asdir, & !< shortwave direct albedo solar angle of 60° 261 rrtm_ccl4vmr, & !< CCL4 volume mixing ratio (g/mol) 262 rrtm_cfc11vmr, & !< CFC11 volume mixing ratio (g/mol) 263 rrtm_cfc12vmr, & !< CFC12 volume mixing ratio (g/mol) 264 rrtm_cfc22vmr, & !< CFC22 volume mixing ratio (g/mol) 265 rrtm_ch4vmr, & !< CH4 volume mixing ratio 266 rrtm_cicewp, & !< in-cloud ice water path (g/m²) 267 rrtm_cldfr, & !< cloud fraction (0,1) 268 rrtm_cliqwp, & !< in-cloud liquid water path (g/m²) 269 rrtm_co2vmr, & !< CO2 volume mixing ratio (g/mol) 270 rrtm_emis, & !< surface emissivity (0-1) 271 rrtm_h2ovmr, & !< H2O volume mixing ratio 272 rrtm_n2ovmr, & !< N2O volume mixing ratio 273 rrtm_o2vmr, & !< O2 volume mixing ratio 274 rrtm_o3vmr, & !< O3 volume mixing ratio 275 rrtm_play, & !< pressure layers (hPa, zu-grid) 276 rrtm_plev, & !< pressure layers (hPa, zw-grid) 277 rrtm_reice, & !< cloud ice effective radius (microns) 278 rrtm_reliq, & !< cloud water drop effective radius (microns) 279 rrtm_tlay, & !< actual temperature (K, zu-grid) 280 rrtm_tlev, & !< actual temperature (K, zw-grid) 281 rrtm_lwdflx, & !< RRTM output of incoming longwave radiation flux (W/m2) 282 rrtm_lwuflx, & !< RRTM output of outgoing longwave radiation flux (W/m2) 283 rrtm_lwhr, & !< RRTM output of longwave radiation heating rate (K/d) 284 rrtm_lwuflxc, & !< RRTM output of incoming clear sky longwave radiation flux (W/m2) 285 rrtm_lwdflxc, & !< RRTM output of outgoing clear sky longwave radiation flux (W/m2) 286 rrtm_lwhrc, & !< RRTM output of incoming longwave clear sky radiation heating rate (K/d) 287 rrtm_swdflx, & !< RRTM output of incoming shortwave radiation flux (W/m2) 288 rrtm_swuflx, & !< RRTM output of outgoing shortwave radiation flux (W/m2) 289 rrtm_swhr, & !< RRTM output of shortwave radiation heating rate (K/d) 290 rrtm_swuflxc, & !< RRTM output of incoming clear sky shortwave radiation flux (W/m2) 291 rrtm_swdflxc, & !< RRTM output of outgoing clear sky shortwave radiation flux (W/m2) 292 rrtm_swhrc !< RRTM output of incoming shortwave clear sky radiation heating rate (K/d) 270 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: aldif, & !< longwave diffuse albedo solar angle of 60° 271 aldir, & !< longwave direct albedo solar angle of 60° 272 asdif, & !< shortwave diffuse albedo solar angle of 60° 273 asdir, & !< shortwave direct albedo solar angle of 60° 274 rrtm_ccl4vmr, & !< CCL4 volume mixing ratio (g/mol) 275 rrtm_cfc11vmr, & !< CFC11 volume mixing ratio (g/mol) 276 rrtm_cfc12vmr, & !< CFC12 volume mixing ratio (g/mol) 277 rrtm_cfc22vmr, & !< CFC22 volume mixing ratio (g/mol) 278 rrtm_ch4vmr, & !< CH4 volume mixing ratio 279 rrtm_cicewp, & !< in-cloud ice water path (g/m²) 280 rrtm_cldfr, & !< cloud fraction (0,1) 281 rrtm_cliqwp, & !< in-cloud liquid water path (g/m²) 282 rrtm_co2vmr, & !< CO2 volume mixing ratio (g/mol) 283 rrtm_emis, & !< surface emissivity (0-1) 284 rrtm_h2ovmr, & !< H2O volume mixing ratio 285 rrtm_n2ovmr, & !< N2O volume mixing ratio 286 rrtm_o2vmr, & !< O2 volume mixing ratio 287 rrtm_o3vmr, & !< O3 volume mixing ratio 288 rrtm_play, & !< pressure layers (hPa, zu-grid) 289 rrtm_plev, & !< pressure layers (hPa, zw-grid) 290 rrtm_reice, & !< cloud ice effective radius (microns) 291 rrtm_reliq, & !< cloud water drop effective radius (microns) 292 rrtm_tlay, & !< actual temperature (K, zu-grid) 293 rrtm_tlev, & !< actual temperature (K, zw-grid) 294 rrtm_lwdflx, & !< RRTM output of incoming longwave radiation flux (W/m2) 295 rrtm_lwdflxc, & !< RRTM output of outgoing clear sky longwave radiation flux (W/m2) 296 rrtm_lwuflx, & !< RRTM output of outgoing longwave radiation flux (W/m2) 297 rrtm_lwuflxc, & !< RRTM output of incoming clear sky longwave radiation flux (W/m2) 298 rrtm_lwuflx_dt, & !< RRTM output of incoming clear sky longwave radiation flux (W/m2) 299 rrtm_lwuflxc_dt,& !< RRTM output of outgoing clear sky longwave radiation flux (W/m2) 300 rrtm_lwhr, & !< RRTM output of longwave radiation heating rate (K/d) 301 rrtm_lwhrc, & !< RRTM output of incoming longwave clear sky radiation heating rate (K/d) 302 rrtm_swdflx, & !< RRTM output of incoming shortwave radiation flux (W/m2) 303 rrtm_swdflxc, & !< RRTM output of outgoing clear sky shortwave radiation flux (W/m2) 304 rrtm_swuflx, & !< RRTM output of outgoing shortwave radiation flux (W/m2) 305 rrtm_swuflxc, & !< RRTM output of incoming clear sky shortwave radiation flux (W/m2) 306 rrtm_swhr, & !< RRTM output of shortwave radiation heating rate (K/d) 307 rrtm_swhrc !< RRTM output of incoming shortwave clear sky radiation heating rate (K/d) 293 308 294 309 ! … … 296 311 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: rad_lw_cs_in, & !< incoming clear sky longwave radiation (W/m2) (not used) 297 312 rad_lw_cs_out, & !< outgoing clear sky longwave radiation (W/m2) (not used) 298 rad_lw_cs_hr, & !< longwave clear sky radiation heating rate (K/d) (not used)299 rad_lw_hr, & !< longwave radiation heating rate (K/d)300 313 rad_sw_cs_in, & !< incoming clear sky shortwave radiation (W/m2) (not used) 301 314 rad_sw_cs_out, & !< outgoing clear sky shortwave radiation (W/m2) (not used) 302 rad_sw_cs_hr, & !< shortwave clear sky radiation heating rate (K/d) (not used)303 rad_sw_hr, & !< shortwave radiation heating rate (K/d)304 315 rrtm_aldif, & !< surface albedo for longwave diffuse radiation 305 316 rrtm_aldir, & !< surface albedo for longwave direct radiation … … 316 327 rrtm_sw_asmaer, & !< sw aerosol asymmetry parameter 317 328 rrtm_sw_ecaer !< sw aerosol optical detph at 0.55 microns (rrtm_iaer = 6 only) 329 318 330 #endif 319 331 … … 341 353 PUBLIC albedo, albedo_type, albedo_type_name, albedo_lw_dif, albedo_lw_dir,& 342 354 albedo_sw_dif, albedo_sw_dir, constant_albedo, day_init, dots_rad, & 343 dt_radiation, init_radiation, lambda, lw_radiation, net_radiation, & 344 rad_net, rad_net_av, radiation, radiation_clearsky, & 345 radiation_rrtmg, radiation_scheme, radiation_tendency, rad_lw_in, & 346 rad_lw_in_av, rad_lw_out, rad_lw_out_av, rad_sw_in, rad_sw_in_av, & 347 rad_sw_out, rad_sw_out_av, sigma_sb, sw_radiation, time_radiation, & 348 time_utc_init 355 dt_radiation, emissivity, force_radiation_call, init_radiation, & 356 lambda, lw_radiation, net_radiation, rad_net, rad_net_av, radiation,& 357 radiation_clearsky, radiation_rrtmg, radiation_scheme, & 358 radiation_tendency, rad_lw_in, rad_lw_in_av, rad_lw_out, & 359 rad_lw_out_av, rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, & 360 rad_lw_hr_av, rad_sw_in, rad_sw_in_av, rad_sw_out, rad_sw_out_av, & 361 rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, rad_sw_hr_av, sigma_sb, & 362 skip_time_do_radiation, sw_radiation, time_radiation, time_utc_init 363 349 364 350 365 #if defined ( __rrtmg ) 351 PUBLIC rrtm_aldif, rrtm_aldir, rrtm_asdif, rrtm_asdir 366 PUBLIC rrtm_aldif, rrtm_aldir, rrtm_asdif, rrtm_asdir, rrtm_idrv, & 367 rrtm_lwuflx_dt 352 368 #endif 353 369 … … 483 499 ! 484 500 !-- Allocate 3d arrays of radiative fluxes and heating rates 485 ALLOCATE ( rad_sw_hr(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) )486 ALLOCATE ( rad_sw_cs_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )487 ALLOCATE ( rad_sw_cs_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )488 ALLOCATE ( rad_sw_cs_hr(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) )489 490 501 IF ( .NOT. ALLOCATED ( rad_sw_in ) ) THEN 491 502 ALLOCATE ( rad_sw_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 492 503 rad_sw_in = 0.0_wp 493 494 504 ENDIF 495 505 496 506 IF ( .NOT. ALLOCATED ( rad_sw_in_av ) ) THEN 497 507 ALLOCATE ( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 498 rad_sw_out = 0.0_wp499 508 ENDIF 500 509 501 510 IF ( .NOT. ALLOCATED ( rad_sw_out ) ) THEN 502 511 ALLOCATE ( rad_sw_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 512 rad_sw_out = 0.0_wp 503 513 ENDIF 504 514 … … 507 517 ENDIF 508 518 509 ALLOCATE ( rad_lw_hr(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 510 ALLOCATE ( rad_lw_cs_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 511 ALLOCATE ( rad_lw_cs_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 512 ALLOCATE ( rad_lw_cs_hr(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 519 IF ( .NOT. ALLOCATED ( rad_sw_hr ) ) THEN 520 ALLOCATE ( rad_sw_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 521 rad_sw_hr = 0.0_wp 522 ENDIF 523 524 IF ( .NOT. ALLOCATED ( rad_sw_hr_av ) ) THEN 525 ALLOCATE ( rad_sw_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 526 rad_sw_hr_av = 0.0_wp 527 ENDIF 528 529 IF ( .NOT. ALLOCATED ( rad_sw_cs_hr ) ) THEN 530 ALLOCATE ( rad_sw_cs_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 531 rad_sw_cs_hr = 0.0_wp 532 ENDIF 533 534 IF ( .NOT. ALLOCATED ( rad_sw_cs_hr_av ) ) THEN 535 ALLOCATE ( rad_sw_cs_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 536 rad_sw_cs_hr_av = 0.0_wp 537 ENDIF 513 538 514 539 IF ( .NOT. ALLOCATED ( rad_lw_in ) ) THEN … … 530 555 ENDIF 531 556 532 rad_sw_hr = 0.0_wp 557 IF ( .NOT. ALLOCATED ( rad_lw_hr ) ) THEN 558 ALLOCATE ( rad_lw_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 559 rad_lw_hr = 0.0_wp 560 ENDIF 561 562 IF ( .NOT. ALLOCATED ( rad_lw_hr_av ) ) THEN 563 ALLOCATE ( rad_lw_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 564 rad_lw_hr_av = 0.0_wp 565 ENDIF 566 567 IF ( .NOT. ALLOCATED ( rad_lw_cs_hr ) ) THEN 568 ALLOCATE ( rad_lw_cs_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 569 rad_lw_cs_hr = 0.0_wp 570 ENDIF 571 572 IF ( .NOT. ALLOCATED ( rad_lw_cs_hr_av ) ) THEN 573 ALLOCATE ( rad_lw_cs_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 574 rad_lw_cs_hr_av = 0.0_wp 575 ENDIF 576 577 ALLOCATE ( rad_sw_cs_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 578 ALLOCATE ( rad_sw_cs_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 533 579 rad_sw_cs_in = 0.0_wp 534 580 rad_sw_cs_out = 0.0_wp 535 rad_sw_cs_hr = 0.0_wp 536 537 rad_lw_hr = 0.0_wp581 582 ALLOCATE ( rad_lw_cs_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 583 ALLOCATE ( rad_lw_cs_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 538 584 rad_lw_cs_in = 0.0_wp 539 585 rad_lw_cs_out = 0.0_wp 540 rad_lw_cs_hr = 0.0_wp541 586 542 587 ! … … 578 623 !-- Add timeseries for radiation model 579 624 dots_rad = dots_num + 1 580 dots_label(dots_num+1) = "rad_net" 581 dots_label(dots_num+2) = "rad_lw_in" 582 dots_label(dots_num+3) = "rad_lw_out" 583 dots_label(dots_num+4) = "rad_sw_in" 584 dots_label(dots_num+5) = "rad_sw_out" 585 dots_unit(dots_num+1:dots_num+5) = "W/m2" 586 dots_num = dots_num + 5 625 dots_num = dots_num + 5 626 627 dots_label(dots_rad+1) = "rad_net" 628 dots_label(dots_rad+2) = "rad_lw_in" 629 dots_label(dots_rad+3) = "rad_lw_out" 630 dots_label(dots_rad+4) = "rad_sw_in" 631 dots_label(dots_rad+5) = "rad_sw_out" 632 dots_unit(dots_rad:dots_rad+4) = "W/m2" 587 633 588 634 ! 589 635 !-- Output of albedos is only required for RRTMG 590 636 IF ( radiation_scheme == 'rrtmg' ) THEN 591 dots_label(dots_num+1) = "rrtm_aldif"592 dots_label(dots_num+2) = "rrtm_aldir"593 dots_label(dots_num+3) = "rrtm_asdif"594 dots_label(dots_num+4) = "rrtm_asdir"595 dots_unit(dots_num+1:dots_num+4) = ""596 637 dots_num = dots_num + 4 638 dots_label(dots_rad+5) = "rrtm_aldif" 639 dots_label(dots_rad+6) = "rrtm_aldir" 640 dots_label(dots_rad+7) = "rrtm_asdif" 641 dots_label(dots_rad+8) = "rrtm_asdir" 642 dots_unit(dots_num+5:dots_num+8) = "" 643 597 644 ENDIF 598 645 … … 624 671 IMPLICIT NONE 625 672 626 INTEGER(iwp) :: i, j, k 673 INTEGER(iwp) :: i, j, k !< loop indices 674 REAL(wp) :: exn, & !< Exner functions at surface 675 exn_1, & !< Exner functions at first grid level 676 pt_1 !< potential temperature at first grid level 627 677 628 678 ! … … 643 693 DO j = nys, nyn 644 694 k = nzb_s_inner(j,i) 695 696 exn_1 = (hyp(k+1) / 100000.0_wp )**0.286_wp 697 645 698 rad_sw_in(0,j,i) = solar_constant * sky_trans * zenith(0) 646 699 rad_sw_out(0,j,i) = alpha(j,i) * rad_sw_in(0,j,i) 647 rad_lw_out(0,j,i) = sigma_sb * (pt(k,j,i) * exn)**4 648 rad_lw_in(0,j,i) = 0.8_wp * sigma_sb * (pt(k+1,j,i) * exn)**4 649 rad_net(j,i) = rad_sw_in(0,j,i) - rad_sw_out(0,j,i) & 650 + rad_lw_in(0,j,i) - rad_lw_out(0,j,i) 700 rad_lw_out(0,j,i) = emissivity * sigma_sb * (pt(k,j,i) * exn)**4 701 702 IF ( cloud_physics ) THEN 703 pt_1 = pt(k+1,j,i) + l_d_cp / exn_1 * ql(k+1,j,i) 704 rad_lw_in(0,j,i) = 0.8_wp * sigma_sb * (pt_1 * exn_1)**4 705 ELSE 706 rad_lw_in(0,j,i) = 0.8_wp * sigma_sb * (pt(k+1,j,i) * exn_1)**4 707 ENDIF 708 709 rad_net(j,i) = rad_sw_in(0,j,i) - rad_sw_out(0,j,i) & 710 + rad_lw_in(0,j,i) - rad_lw_out(0,j,i) 651 711 652 712 ENDDO … … 682 742 #if defined ( __rrtmg ) 683 743 684 INTEGER(iwp) :: i, j, k, n !<685 686 REAL(wp) :: s_r2 687 REAL(wp) ::s_r3 !< weighted sum over all droplets with r^3744 INTEGER(iwp) :: i, j, k, n !< loop indices 745 746 REAL(wp) :: s_r2, & !< weighted sum over all droplets with r^2 747 s_r3 !< weighted sum over all droplets with r^3 688 748 689 749 ! … … 703 763 !-- profile. nzt_rad might be modified by these calls and all required arrays 704 764 !-- will then be re-allocated 705 IF ( large_scale_forcing .AND. lsf_surf ) THEN765 IF ( large_scale_forcing .AND. lsf_surf ) THEN 706 766 CALL read_sounding_data 707 767 CALL read_trace_gas_data … … 714 774 ! 715 775 !-- Prepare profiles of temperature and H2O volume mixing ratio 716 rrtm_tlev(0,nzb+1) = pt(nzb,j,i) 776 rrtm_tlev(0,nzb+1) = pt(nzb,j,i) * ( surface_pressure & 777 / 1000.0_wp )**0.286_wp 717 778 718 779 DO k = nzb+1, nzt+1 719 780 rrtm_tlay(0,k) = pt(k,j,i) * ( (hyp(k) ) / 100000.0_wp & 720 )**0.286_wp + ( l_v / cp )* ql(k,j,i)721 rrtm_h2ovmr(0,k) = mol_ weight_air_d_wv * (q(k,j,i) - ql(k,j,i))781 )**0.286_wp + l_d_cp * ql(k,j,i) 782 rrtm_h2ovmr(0,k) = mol_mass_air_d_wv * (q(k,j,i) - ql(k,j,i)) 722 783 723 784 ENDDO … … 754 815 rrtm_reliq = 0.0_wp 755 816 rrtm_cliqwp = 0.0_wp 817 rrtm_icld = 0 756 818 757 819 DO k = nzb+1, nzt+1 758 rrtm_cliqwp(0,k) = ql(k,j,i) * 1000.0_wp * & 759 (rrtm_plev(0,k) - rrtm_plev(0,k+1)) * 100.0_wp / g 760 761 IF ( rrtm_cliqwp(0,k) .GT. 0 ) THEN 820 rrtm_cliqwp(0,k) = ql(k,j,i) * 1000.0_wp * & 821 (rrtm_plev(0,k) - rrtm_plev(0,k+1)) & 822 * 100.0_wp / g 823 824 IF ( rrtm_cliqwp(0,k) > 0.0_wp ) THEN 762 825 rrtm_cldfr(0,k) = 1.0_wp 763 rrtm_icld = 1826 IF ( rrtm_icld == 0 ) rrtm_icld = 1 764 827 765 828 ! 766 829 !-- Calculate cloud droplet effective radius 767 830 IF ( cloud_physics ) THEN 768 rrtm_reliq(0,k) = 1.0E6_wp * ( 3.0_wp * ql(k,j,i) & 769 / ( 4.0_wp * pi * nc_const * rho_l ) & 770 )**0.33333333333333_wp & 771 * EXP( LOG( sigma_gc )**2 ) 831 rrtm_reliq(0,k) = 1.0E6_wp * ( 3.0_wp * ql(k,j,i) & 832 * rho_surface & 833 / ( 4.0_wp * pi * nc_const * rho_l ) & 834 )**0.33333333333333_wp & 835 * EXP( LOG( sigma_gc )**2 ) 772 836 773 837 ELSEIF ( cloud_droplets ) THEN … … 794 858 ! 795 859 !-- Limit effective radius 796 IF ( rrtm_reliq(0,k) .GT.0.0_wp ) THEN860 IF ( rrtm_reliq(0,k) > 0.0_wp ) THEN 797 861 rrtm_reliq(0,k) = MAX(rrtm_reliq(0,k),2.5_wp) 798 862 rrtm_reliq(0,k) = MIN(rrtm_reliq(0,k),60.0_wp) 799 863 ENDIF 800 ELSE801 rrtm_icld = 0802 864 ENDIF 803 865 ENDDO … … 817 879 rrtm_reliq , rrtm_lw_tauaer, & 818 880 rrtm_lwuflx , rrtm_lwdflx , rrtm_lwhr , & 819 rrtm_lwuflxc , rrtm_lwdflxc , rrtm_lwhrc ) 820 881 rrtm_lwuflxc , rrtm_lwdflxc , rrtm_lwhrc , & 882 rrtm_lwuflx_dt , rrtm_lwuflxc_dt ) 883 884 ! 885 !-- Save fluxes 821 886 DO k = nzb, nzt+1 822 887 rad_lw_in(k,j,i) = rrtm_lwdflx(0,k) … … 824 889 ENDDO 825 890 891 ! 892 !-- Save heating rates (convert from K/d to K/h) 893 DO k = nzb+1, nzt+1 894 rad_lw_hr(k,j,i) = rrtm_lwhr(0,k) * d_hours_day 895 rad_lw_cs_hr(k,j,i) = rrtm_lwhrc(0,k) * d_hours_day 896 ENDDO 826 897 827 898 ENDIF … … 841 912 rrtm_swuflxc , rrtm_swdflxc , rrtm_swhrc ) 842 913 914 ! 915 !-- Save fluxes 843 916 DO k = nzb, nzt+1 844 917 rad_sw_in(k,j,i) = rrtm_swdflx(0,k) 845 918 rad_sw_out(k,j,i) = rrtm_swuflx(0,k) 846 919 ENDDO 920 921 ! 922 !-- Save heating rates (convert from K/d to K/s) 923 DO k = nzb+1, nzt+1 924 rad_sw_hr(k,j,i) = rrtm_swhr(0,k) * d_hours_day 925 rad_sw_cs_hr(k,j,i) = rrtm_swhrc(0,k) * d_hours_day 926 ENDDO 927 847 928 ENDIF 848 929 … … 857 938 CALL exchange_horiz( rad_lw_in, nbgp ) 858 939 CALL exchange_horiz( rad_lw_out, nbgp ) 940 CALL exchange_horiz( rad_lw_hr, nbgp ) 941 CALL exchange_horiz( rad_lw_cs_hr, nbgp ) 942 859 943 CALL exchange_horiz( rad_sw_in, nbgp ) 860 944 CALL exchange_horiz( rad_sw_out, nbgp ) 945 CALL exchange_horiz( rad_sw_hr, nbgp ) 946 CALL exchange_horiz( rad_sw_cs_hr, nbgp ) 947 861 948 CALL exchange_horiz_2d( rad_net, nbgp ) 862 949 #endif … … 897 984 ! 898 985 !-- Check if the sun is up (otheriwse shortwave calculations can be skipped) 899 IF ( zenith(0) .GT.0.0_wp ) THEN986 IF ( zenith(0) > 0.0_wp ) THEN 900 987 sun_up = .TRUE. 901 988 ELSE … … 996 1083 IMPLICIT NONE 997 1084 998 INTEGER(iwp) :: id, id_dim_zrad, id_var, k, nz_snd, nz_snd_start, nz_snd_end 999 1000 REAL(wp) :: t_surface 1001 1002 REAL(wp), DIMENSION(:), ALLOCATABLE :: hyp_snd_tmp, t_snd_tmp 1085 INTEGER(iwp) :: id, & !< NetCDF id of input file 1086 id_dim_zrad, & !< pressure level id in the NetCDF file 1087 id_var, & !< NetCDF variable id 1088 k, & !< loop index 1089 nz_snd, & !< number of vertical levels in the sounding data 1090 nz_snd_start, & !< start vertical index for sounding data to be used 1091 nz_snd_end !< end vertical index for souding data to be used 1092 1093 REAL(wp) :: t_surface !< actual surface temperature 1094 1095 REAL(wp), DIMENSION(:), ALLOCATABLE :: hyp_snd_tmp, & !< temporary hydrostatic pressure profile (sounding) 1096 t_snd_tmp !< temporary temperature profile (sounding) 1003 1097 1004 1098 ! … … 1014 1108 DEALLOCATE ( rrtm_tlay ) 1015 1109 DEALLOCATE ( rrtm_tlev ) 1110 1016 1111 DEALLOCATE ( rrtm_h2ovmr ) 1017 1112 DEALLOCATE ( rrtm_cicewp ) … … 1022 1117 DEALLOCATE ( rrtm_lw_taucld ) 1023 1118 DEALLOCATE ( rrtm_lw_tauaer ) 1119 1024 1120 DEALLOCATE ( rrtm_lwdflx ) 1121 DEALLOCATE ( rrtm_lwdflxc ) 1025 1122 DEALLOCATE ( rrtm_lwuflx ) 1123 DEALLOCATE ( rrtm_lwuflxc ) 1124 DEALLOCATE ( rrtm_lwuflx_dt ) 1125 DEALLOCATE ( rrtm_lwuflxc_dt ) 1026 1126 DEALLOCATE ( rrtm_lwhr ) 1027 DEALLOCATE ( rrtm_lwuflxc )1028 DEALLOCATE ( rrtm_lwdflxc )1029 1127 DEALLOCATE ( rrtm_lwhrc ) 1128 1030 1129 DEALLOCATE ( rrtm_sw_taucld ) 1031 1130 DEALLOCATE ( rrtm_sw_ssacld ) … … 1035 1134 DEALLOCATE ( rrtm_sw_ssaaer ) 1036 1135 DEALLOCATE ( rrtm_sw_asmaer ) 1037 DEALLOCATE ( rrtm_sw_ecaer ) 1136 DEALLOCATE ( rrtm_sw_ecaer ) 1137 1038 1138 DEALLOCATE ( rrtm_swdflx ) 1139 DEALLOCATE ( rrtm_swdflxc ) 1039 1140 DEALLOCATE ( rrtm_swuflx ) 1141 DEALLOCATE ( rrtm_swuflxc ) 1040 1142 DEALLOCATE ( rrtm_swhr ) 1041 DEALLOCATE ( rrtm_swuflxc )1042 DEALLOCATE ( rrtm_swdflxc )1043 1143 DEALLOCATE ( rrtm_swhrc ) 1144 1044 1145 ENDIF 1045 1146 … … 1063 1164 !-- Read pressure from file 1064 1165 nc_stat = NF90_INQ_VARID( id, "Pressure", id_var ) 1065 nc_stat = NF90_GET_VAR( id, id_var, hyp_snd_tmp(:), start = (/1/), &1166 nc_stat = NF90_GET_VAR( id, id_var, hyp_snd_tmp(:), start = (/1/), & 1066 1167 count = (/nz_snd/) ) 1067 1168 CALL handle_netcdf_error( 'netcdf', 552 ) … … 1075 1176 !-- Read temperature from file 1076 1177 nc_stat = NF90_INQ_VARID( id, "ReferenceTemperature", id_var ) 1077 nc_stat = NF90_GET_VAR( id, id_var, t_snd_tmp(:), start = (/1/), &1178 nc_stat = NF90_GET_VAR( id, id_var, t_snd_tmp(:), start = (/1/), & 1078 1179 count = (/nz_snd/) ) 1079 1180 CALL handle_netcdf_error( 'netcdf', 553 ) … … 1088 1189 !-- in Pa, hyp_snd in hPa). 1089 1190 DO k = 1, nz_snd 1090 IF ( hyp_snd_tmp(k) .LT. (hyp(nzt+1) - 1000.0_wp) * 0.01_wp ) THEN1191 IF ( hyp_snd_tmp(k) < ( hyp(nzt+1) - 1000.0_wp) * 0.01_wp ) THEN 1091 1192 nz_snd_start = k 1092 1193 EXIT … … 1094 1195 END DO 1095 1196 1096 IF ( nz_snd_start .LE.nz_snd ) THEN1197 IF ( nz_snd_start <= nz_snd ) THEN 1097 1198 nz_snd_end = nz_snd - 1 1098 1199 END IF … … 1128 1229 ALLOCATE ( rrtm_plev(0:0,nzb+1:nzt_rad+2) ) 1129 1230 1130 t_surface = pt_surface * ( surface_pressure / 1000.0_wp )**0.286_wp1231 t_surface = pt_surface * ( surface_pressure / 1000.0_wp )**0.286_wp 1131 1232 DO k = nzb+1, nzt+1 1132 1233 rrtm_play(0,k) = hyp(k) * 0.01_wp … … 1160 1261 rrtm_h2ovmr(0,k) = q_snd(k) 1161 1262 ENDDO 1162 rrtm_tlay(0,nzt_rad+1) = 2.0_wp * rrtm_tlay(0,nzt_rad)&1163 1263 rrtm_tlay(0,nzt_rad+1) = 2.0_wp * rrtm_tlay(0,nzt_rad) & 1264 - rrtm_tlay(0,nzt_rad-1) 1164 1265 DO k = nzt+9, nzt_rad+1 1165 1266 rrtm_tlev(0,k) = rrtm_tlay(0,k-1) + (rrtm_tlay(0,k) & … … 1237 1338 rrtm_lwhrc = 0.0_wp 1238 1339 1340 ALLOCATE ( rrtm_lwuflx_dt(0:0,nzb:nzt_rad+1) ) 1341 ALLOCATE ( rrtm_lwuflxc_dt(0:0,nzb:nzt_rad+1) ) 1342 1343 rrtm_lwuflxc_dt = 0.0_wp 1344 rrtm_lwuflxc_dt = 0.0_wp 1239 1345 1240 1346 END SUBROUTINE read_sounding_data … … 1253 1359 IMPLICIT NONE 1254 1360 1255 INTEGER(iwp), PARAMETER :: num_trace_gases = 9 !< number of trace gases 1256 1257 CHARACTER(LEN=5), DIMENSION(num_trace_gases), PARAMETER :: & 1361 INTEGER(iwp), PARAMETER :: num_trace_gases = 9 !< number of trace gases (absorbers) 1362 1363 CHARACTER(LEN=5), DIMENSION(num_trace_gases), PARAMETER :: & !< trace gas names 1258 1364 trace_names = (/'O3 ', 'CO2 ', 'CH4 ', 'N2O ', 'O2 ', & 1259 1365 'CFC11', 'CFC12', 'CFC22', 'CCL4 '/) 1260 1366 1261 INTEGER(iwp) :: id, k, m, n, nabs, np, id_abs, id_dim, id_var 1367 INTEGER(iwp) :: id, & !< NetCDF id 1368 k, & !< loop index 1369 m, & !< loop index 1370 n, & !< loop index 1371 nabs, & !< number of absorbers 1372 np, & !< number of pressure levels 1373 id_abs, & !< NetCDF id of the respective absorber 1374 id_dim, & !< NetCDF id of asborber's dimension 1375 id_var !< NetCDf id ot the absorber 1262 1376 1263 1377 REAL(wp) :: p_mls_l, p_mls_u, p_wgt_l, p_wgt_u, p_mls_m … … 1380 1494 !-- When the pressure level is higher than the trace gas pressure 1381 1495 !-- level, assume that 1382 IF ( rrtm_plev_tmp(k-1) .GT.p_mls(1) ) THEN1496 IF ( rrtm_plev_tmp(k-1) > p_mls(1) ) THEN 1383 1497 1384 1498 trace_mls_path(k,m) = trace_mls_path(k,m) + trace_mls(m,1) & … … 1399 1513 MAX( rrtm_plev_tmp(k), p_mls(n-1) ) ) 1400 1514 1401 IF ( p_mls_l .GT.p_mls_u ) THEN1515 IF ( p_mls_l > p_mls_u ) THEN 1402 1516 1403 1517 ! … … 1412 1526 + ( p_wgt_u * trace_mls(m,n) & 1413 1527 + p_wgt_l * trace_mls(m,n-1) ) & 1414 * (p_mls_l +p_mls_u) / g1528 * (p_mls_l - p_mls_u) / g 1415 1529 ENDIF 1416 1530 ENDDO 1417 1531 1418 IF ( rrtm_plev_tmp(k) .LT.p_mls(np) ) THEN1532 IF ( rrtm_plev_tmp(k) < p_mls(np) ) THEN 1419 1533 trace_mls_path(k,m) = trace_mls_path(k,m) + trace_mls(m,np) & 1420 1534 * ( MIN( rrtm_plev_tmp(k-1), p_mls(np) ) & … … 1503 1617 SUBROUTINE radiation_tendency_ij ( i, j, tend ) 1504 1618 1505 USE arrays_3d, &1506 ONLY: dzw1507 1508 1619 USE cloud_parameters, & 1509 ONLY: pt_d_t, cp 1510 1511 USE control_parameters, & 1512 ONLY: rho_surface 1620 ONLY: pt_d_t 1513 1621 1514 1622 IMPLICIT NONE 1515 1623 1516 INTEGER(iwp) :: i, j, k 1517 1518 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: tend 1624 INTEGER(iwp) :: i, j, k !< loop indices 1625 1626 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: tend !< pt tendency term 1519 1627 1520 1628 #if defined ( __rrtmg ) 1521 1522 REAL(wp) :: rad_sw_net_l, rad_sw_net_u, rad_lw_net_l, rad_lw_net_u 1523 1524 rad_sw_net_l = 0.0_wp 1525 rad_sw_net_u = 0.0_wp 1526 rad_lw_net_l = 0.0_wp 1527 rad_lw_net_u = 0.0_wp 1528 1529 ! 1530 !-- Calculate radiative flux divergence 1629 ! 1630 !-- Calculate tendency based on heating rate 1531 1631 DO k = nzb+1, nzt+1 1532 1533 rad_sw_net_l = rad_sw_in(k-1,j,i) - rad_sw_out(k-1,j,i) 1534 rad_sw_net_u = rad_sw_in(k,j,i) - rad_sw_out(k,j,i) 1535 rad_lw_net_l = rad_lw_in(k-1,j,i) - rad_lw_out(k-1,j,i) 1536 rad_lw_net_u = rad_lw_in(k,j,i) - rad_lw_out(k,j,i) 1537 1538 tend(k,j,i) = tend(k,j,i) + ( rad_sw_net_u - rad_sw_net_l & 1539 + rad_lw_net_u - rad_lw_net_l ) / & 1540 ( dzw(k) * cp * rho_surface ) * pt_d_t(k) 1632 tend(k,j,i) = tend(k,j,i) + (rad_lw_hr(k,j,i) + rad_sw_hr(k,j,i)) & 1633 * pt_d_t(k) * d_seconds_hour 1541 1634 ENDDO 1542 1635 … … 1554 1647 SUBROUTINE radiation_tendency ( tend ) 1555 1648 1556 USE arrays_3d, &1557 ONLY: dzw1558 1559 1649 USE cloud_parameters, & 1560 ONLY: pt_d_t , cp1650 ONLY: pt_d_t 1561 1651 1562 1652 USE indices, & 1563 1653 ONLY: nxl, nxr, nyn, nys 1564 1654 1565 USE control_parameters, &1566 ONLY: rho_surface1567 1568 1655 IMPLICIT NONE 1569 1656 1570 INTEGER(iwp) :: i, j, k 1571 1572 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: tend 1657 INTEGER(iwp) :: i, j, k !< loop indices 1658 1659 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: tend !< pt tendency term 1573 1660 1574 1661 #if defined ( __rrtmg ) 1575 1576 REAL(wp) :: rad_sw_net_l, rad_sw_net_u, rad_lw_net_l, rad_lw_net_u 1577 1578 rad_sw_net_l = 0.0_wp 1579 rad_sw_net_u = 0.0_wp 1580 rad_lw_net_l = 0.0_wp 1581 rad_lw_net_u = 0.0_wp 1582 1662 ! 1663 !-- Calculate tendency based on heating rate 1583 1664 DO i = nxl, nxr 1584 1665 DO j = nys, nyn 1585 1586 !1587 !-- Calculate radiative flux divergence1588 1666 DO k = nzb+1, nzt+1 1589 1590 rad_sw_net_l = rad_sw_in(k-1,j,i) - rad_sw_out(k-1,j,i) 1591 rad_sw_net_u = rad_sw_in(k ,j,i) - rad_sw_out(k ,j,i) 1592 rad_lw_net_l = rad_lw_in(k-1,j,i) - rad_lw_out(k-1,j,i) 1593 rad_lw_net_u = rad_lw_in(k ,j,i) - rad_lw_out(k ,j,i) 1594 1595 tend(k,j,i) = tend(k,j,i) + ( rad_sw_net_u - rad_sw_net_l & 1596 + rad_lw_net_u - rad_lw_net_l ) / & 1597 ( dzw(k) * cp * rho_surface ) * pt_d_t(k) 1667 tend(k,j,i) = tend(k,j,i) + ( rad_lw_hr(k,j,i) & 1668 + rad_sw_hr(k,j,i) ) * pt_d_t(k) & 1669 * d_seconds_hour 1598 1670 ENDDO 1599 1671 ENDDO -
palm/trunk/SOURCE/read_3d_binary.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added output of radiative heating rates and Obukhov length. Removed output of 22 ! rif. 22 23 ! 23 24 ! Former revisions: … … 83 84 84 85 USE arrays_3d, & 85 ONLY: e, kh, km, p, pt, q, ql, qc, nr, nrs, nrsws, nrswst, qr, qrs,&86 qrs ws, qrswst, qs, qsws, qswst, sa, saswsb, saswst, rif, &86 ONLY: e, kh, km, ol, p, pt, q, ql, qc, nr, nrs, nrsws, nrswst, qr, & 87 qrs, qrsws, qrswst, qs, qsws, qswst, sa, saswsb, saswst, & 87 88 rif_wall, shf, ts, tswst, u, u_m_l, u_m_n, u_m_r, u_m_s, us, & 88 89 usws, uswst, v, v_m_l, v_m_n, v_m_r, v_m_s, vpt, vsws, vswst, & … … 119 120 USE radiation_model_mod, & 120 121 ONLY: rad_net, rad_net_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & 121 rad_lw_out_av, rad_sw_in, rad_sw_in_av, rad_sw_out, rad_sw_out_av 122 rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, rad_lw_hr_av, & 123 rad_lw_out_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & 124 rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, & 125 rad_sw_hr_av 122 126 123 127 USE random_function_mod, & … … 595 599 nrswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 596 600 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 601 CASE ( 'ol' ) 602 IF ( k == 1 ) READ ( 13 ) tmp_2d 603 ol(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 604 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 597 605 598 606 CASE ( 'p' ) … … 867 875 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 868 876 877 CASE ( 'rad_lw_cs_hr' ) 878 IF ( .NOT. ALLOCATED( rad_lw_cs_hr ) ) THEN 879 ALLOCATE( rad_lw_cs_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 880 ENDIF 881 IF ( k == 1 ) READ ( 13 ) tmp_3d 882 rad_lw_cs_hr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 883 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 884 885 CASE ( 'rad_lw_cs_hr_av' ) 886 IF ( .NOT. ALLOCATED( rad_lw_out_av ) ) THEN 887 ALLOCATE( rad_lw_cs_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 888 ENDIF 889 IF ( k == 1 ) READ ( 13 ) tmp_3d 890 rad_lw_cs_hr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 891 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 892 893 CASE ( 'rad_lw_hr' ) 894 IF ( .NOT. ALLOCATED( rad_lw_hr ) ) THEN 895 ALLOCATE( rad_lw_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 896 ENDIF 897 IF ( k == 1 ) READ ( 13 ) tmp_3d 898 rad_lw_hr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 899 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 900 901 CASE ( 'rad_lw_hr_av' ) 902 IF ( .NOT. ALLOCATED( rad_lw_hr_av ) ) THEN 903 ALLOCATE( rad_lw_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 904 ENDIF 905 IF ( k == 1 ) READ ( 13 ) tmp_3d 906 rad_lw_hr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 907 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 908 869 909 CASE ( 'rad_sw_in' ) 870 910 IF ( .NOT. ALLOCATED( rad_sw_in ) ) THEN … … 898 938 rad_sw_out_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 899 939 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 940 941 CASE ( 'rad_sw_cs_hr' ) 942 IF ( .NOT. ALLOCATED( rad_sw_cs_hr ) ) THEN 943 ALLOCATE( rad_sw_cs_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 944 ENDIF 945 IF ( k == 1 ) READ ( 13 ) tmp_3d 946 rad_sw_cs_hr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 947 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 948 949 CASE ( 'rad_sw_cs_hr_av' ) 950 IF ( .NOT. ALLOCATED( rad_sw_out_av ) ) THEN 951 ALLOCATE( rad_sw_cs_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 952 ENDIF 953 IF ( k == 1 ) READ ( 13 ) tmp_3d 954 rad_sw_cs_hr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 955 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 956 957 CASE ( 'rad_sw_hr' ) 958 IF ( .NOT. ALLOCATED( rad_sw_hr ) ) THEN 959 ALLOCATE( rad_sw_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 960 ENDIF 961 IF ( k == 1 ) READ ( 13 ) tmp_3d 962 rad_sw_hr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 963 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 964 965 CASE ( 'rad_sw_hr_av' ) 966 IF ( .NOT. ALLOCATED( rad_sw_hr_av ) ) THEN 967 ALLOCATE( rad_sw_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 968 ENDIF 969 IF ( k == 1 ) READ ( 13 ) tmp_3d 970 rad_lw_hr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 971 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 900 972 901 973 CASE ( 'random_iv' ) ! still unresolved issue … … 914 986 rho_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 915 987 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 916 917 CASE ( 'rif' )918 IF ( k == 1 ) READ ( 13 ) tmp_2d919 rif(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &920 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)921 988 922 989 CASE ( 'rif_wall' ) -
palm/trunk/SOURCE/read_var_list.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Added output of most_method, constant_flux_layer, zeta_min, zeta_max. Removed 22 ! output of prandtl_layer and rif_min, rif_max. 22 23 ! 23 24 ! Former revisions: … … 179 180 ONLY: statistic_regions, hom, hom_sum, pr_palm, u_max, u_max_ijk, & 180 181 v_max, v_max_ijk, w_max, w_max_ijk 182 181 183 182 184 IMPLICIT NONE … … 356 358 CASE ( 'conserve_volume_flow_mode' ) 357 359 READ ( 13 ) conserve_volume_flow_mode 360 CASE ( 'constant_flux_layer' ) 361 READ ( 13 ) constant_flux_layer 358 362 CASE ( 'coupling_start_time' ) 359 363 READ ( 13 ) coupling_start_time … … 460 464 CASE ( 'momentum_advec' ) 461 465 READ ( 13 ) momentum_advec 466 CASE ( 'most_method' ) 467 READ ( 13 ) most_method 462 468 CASE ( 'nc_const' ) 463 469 READ ( 13 ) nc_const … … 494 500 CASE ( 'phi' ) 495 501 READ ( 13 ) phi 496 CASE ( 'prandtl_layer' )497 READ ( 13 ) prandtl_layer498 502 CASE ( 'prandtl_number' ) 499 503 READ ( 13 ) prandtl_number … … 552 556 CASE ( 'residual_limit' ) 553 557 READ ( 13 ) residual_limit 554 CASE ( 'rif_max' )555 READ ( 13 ) rif_max556 CASE ( 'rif_min' )557 READ ( 13 ) rif_min558 558 CASE ( 'roughness_length' ) 559 559 READ ( 13 ) roughness_length … … 714 714 CASE ( 'w_max_ijk' ) 715 715 READ ( 13 ) w_max_ijk 716 CASE ( 'zeta_max' ) 717 READ ( 13 ) zeta_max 718 CASE ( 'zeta_min' ) 719 READ ( 13 ) zeta_min 716 720 CASE ( 'z0h_factor' ) 717 721 READ ( 13 ) z0h_factor -
palm/trunk/SOURCE/sum_up_3d_data.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added output of Obukhov length and radiative heating rates for RRTMG. 22 ! Corrected output of LWC. 22 23 ! 23 24 ! Former revisions: … … 84 85 85 86 USE arrays_3d, & 86 ONLY: dzw, e, nr, p, pt, q, qc, ql, ql_c, ql_v, qr, qsws, rho, sa,&87 ONLY: dzw, e, nr, ol, p, pt, q, qc, ql, ql_c, ql_v, qr, qsws, rho, sa,& 87 88 shf, ts, u, us, v, vpt, w, z0, z0h 88 89 89 90 USE averaging, & 90 ONLY: e_av, lpt_av, lwp_av, nr_av, p_av, pc_av, pr_av, prr_av,&91 ONLY: e_av, lpt_av, lwp_av, nr_av, ol_av, p_av, pc_av, pr_av, prr_av, & 91 92 precipitation_rate_av, pt_av, q_av, qc_av, ql_av, ql_c_av, & 92 93 ql_v_av, ql_vp_av, qr_av, qsws_av, qv_av, rho_av, s_av, sa_av, & … … 97 98 98 99 USE control_parameters, & 99 ONLY: average_count_3d, cloud_physics, doav, doav_n 100 ONLY: average_count_3d, cloud_physics, doav, doav_n, rho_surface 100 101 101 102 USE cpulog, & … … 120 121 USE radiation_model_mod, & 121 122 ONLY: rad_net, rad_net_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & 122 rad_sw_out_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & 123 rad_lw_out_av 123 rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, & 124 rad_sw_hr_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & 125 rad_lw_out_av, rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, & 126 rad_lw_hr_av 127 124 128 125 129 IMPLICIT NONE … … 215 219 nr_av = 0.0_wp 216 220 221 CASE ( 'ol*' ) 222 IF ( .NOT. ALLOCATED( ol_av ) ) THEN 223 ALLOCATE( ol_av(nysg:nyng,nxlg:nxrg) ) 224 ENDIF 225 ol_av = 0.0_wp 226 217 227 CASE ( 'p' ) 218 228 IF ( .NOT. ALLOCATED( p_av ) ) THEN … … 347 357 rad_lw_out_av = 0.0_wp 348 358 359 CASE ( 'rad_lw_cs_hr' ) 360 IF ( .NOT. ALLOCATED( rad_lw_cs_hr_av ) ) THEN 361 ALLOCATE( rad_lw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 362 ENDIF 363 rad_lw_cs_hr_av = 0.0_wp 364 365 CASE ( 'rad_lw_hr' ) 366 IF ( .NOT. ALLOCATED( rad_lw_hr_av ) ) THEN 367 ALLOCATE( rad_lw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 368 ENDIF 369 rad_lw_hr_av = 0.0_wp 370 349 371 CASE ( 'rad_sw_in' ) 350 372 IF ( .NOT. ALLOCATED( rad_sw_in_av ) ) THEN … … 359 381 rad_sw_out_av = 0.0_wp 360 382 383 CASE ( 'rad_sw_cs_hr' ) 384 IF ( .NOT. ALLOCATED( rad_sw_cs_hr_av ) ) THEN 385 ALLOCATE( rad_sw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 386 ENDIF 387 rad_sw_cs_hr_av = 0.0_wp 388 389 CASE ( 'rad_sw_hr' ) 390 IF ( .NOT. ALLOCATED( rad_sw_hr_av ) ) THEN 391 ALLOCATE( rad_sw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 392 ENDIF 393 rad_sw_hr_av = 0.0_wp 394 361 395 CASE ( 'rho' ) 362 396 IF ( .NOT. ALLOCATED( rho_av ) ) THEN … … 530 564 DO i = nxlg, nxrg 531 565 DO j = nysg, nyng 532 lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) *&533 dzw(1:nzt+1) )566 lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) & 567 * dzw(1:nzt+1) ) * rho_surface 534 568 ENDDO 535 569 ENDDO … … 557 591 nr_av(k,j,i) = nr_av(k,j,i) + nr(k,j,i) 558 592 ENDDO 593 ENDDO 594 ENDDO 595 596 CASE ( 'ol*' ) 597 DO i = nxlg, nxrg 598 DO j = nysg, nyng 599 ol_av(j,i) = ol_av(j,i) + ol(j,i) 559 600 ENDDO 560 601 ENDDO … … 777 818 ENDDO 778 819 820 CASE ( 'rad_lw_cs_hr' ) 821 DO i = nxlg, nxrg 822 DO j = nysg, nyng 823 DO k = nzb, nzt+1 824 rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) + rad_lw_cs_hr(k,j,i) 825 ENDDO 826 ENDDO 827 ENDDO 828 829 CASE ( 'rad_lw_hr' ) 830 DO i = nxlg, nxrg 831 DO j = nysg, nyng 832 DO k = nzb, nzt+1 833 rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) + rad_lw_hr(k,j,i) 834 ENDDO 835 ENDDO 836 ENDDO 779 837 780 838 CASE ( 'rad_sw_in' ) … … 792 850 DO k = nzb, nzt+1 793 851 rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) + rad_sw_out(k,j,i) 852 ENDDO 853 ENDDO 854 ENDDO 855 856 CASE ( 'rad_sw_cs_hr' ) 857 DO i = nxlg, nxrg 858 DO j = nysg, nyng 859 DO k = nzb, nzt+1 860 rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) + rad_sw_cs_hr(k,j,i) 861 ENDDO 862 ENDDO 863 ENDDO 864 865 CASE ( 'rad_sw_hr' ) 866 DO i = nxlg, nxrg 867 DO j = nysg, nyng 868 DO k = nzb, nzt+1 869 rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) + rad_sw_hr(k,j,i) 794 870 ENDDO 795 871 ENDDO -
palm/trunk/SOURCE/time_integration.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Added option for spin-ups without land surface and radiation models. Moved calls 22 ! for radiation and lan surface schemes. 22 23 ! 23 24 ! Former revisions: … … 170 171 averaging_interval_sp, bc_lr_cyc, bc_ns_cyc, bc_pt_t_val, & 171 172 bc_q_t_val, call_psolver_at_all_substeps, cloud_droplets, & 172 cloud_physics, constant_ heatflux, create_disturbances, dopr_n,&173 c onstant_diffusion, coupling_mode, coupling_start_time,&174 c urrent_timestep_number, disturbance_created, &175 disturbance_ energy_limit, dist_range, do_sum, dt_3d,&176 d t_averaging_input, dt_averaging_input_pr, dt_coupling,&177 dt_ data_output_av, dt_disturb, dt_do2d_xy, dt_do2d_xz,&178 dt_do2d_ yz, dt_do3d, dt_domask,dt_dopts, dt_dopr,&173 cloud_physics, constant_flux_layer, constant_heatflux, & 174 create_disturbances, dopr_n, constant_diffusion, coupling_mode, & 175 coupling_start_time, current_timestep_number, & 176 disturbance_created, disturbance_energy_limit, dist_range, & 177 do_sum, dt_3d, dt_averaging_input, dt_averaging_input_pr, & 178 dt_coupling, dt_data_output_av, dt_disturb, dt_do2d_xy, & 179 dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_domask,dt_dopts, dt_dopr, & 179 180 dt_dopr_listing, dt_dosp, dt_dots, dt_dvrp, dt_run_control, & 180 181 end_time, first_call_lpm, galilei_transformation, humidity, & … … 183 184 loop_optimization, lsf_surf, lsf_vert, masks, mid, & 184 185 netcdf_data_format, neutral, nr_timesteps_this_run, nudging, & 185 ocean, on_device, passive_scalar, pr andtl_layer, precipitation,&186 ocean, on_device, passive_scalar, precipitation, & 186 187 prho_reference, pt_reference, pt_slope_offset, random_heatflux, & 187 188 run_coupled, simulated_time, simulated_time_chr, & … … 213 214 214 215 USE land_surface_model_mod, & 215 ONLY: land_surface, lsm_energy_balance, lsm_soil_model 216 ONLY: land_surface, lsm_energy_balance, lsm_soil_model, & 217 skip_time_do_lsm 216 218 217 219 USE ls_forcing_mod, & … … 238 240 239 241 USE radiation_model_mod, & 240 ONLY: dt_radiation, radiation, radiation_clearsky, & 241 radiation_rrtmg, radiation_scheme, time_radiation 242 ONLY: dt_radiation, force_radiation_call, radiation, & 243 radiation_clearsky, radiation_rrtmg, radiation_scheme, & 244 skip_time_do_radiation, time_radiation 242 245 243 246 USE statistics, & 244 247 ONLY: flow_statistics_called, hom, pr_palm, sums_ls_l 248 249 USE surface_layer_fluxes_mod, & 250 ONLY: surface_layer_fluxes 245 251 246 252 USE user_actions_mod, & … … 374 380 ENDIF 375 381 376 IF ( radiation .AND. intermediate_timestep_count &377 == intermediate_timestep_count_max ) THEN378 379 time_radiation = time_radiation + dt_3d380 381 IF ( time_radiation >= dt_radiation ) THEN382 383 CALL cpu_log( log_point(50), 'radiation', 'start' )384 385 time_radiation = time_radiation - dt_radiation386 IF ( radiation_scheme == 'clear-sky' ) THEN387 CALL radiation_clearsky388 ELSEIF ( radiation_scheme == 'rrtmg' ) THEN389 CALL radiation_rrtmg390 ENDIF391 392 CALL cpu_log( log_point(50), 'radiation', 'stop' )393 ENDIF394 ENDIF395 382 ! 396 383 !-- Solve the prognostic equations. A fast cache optimized version with … … 631 618 !-- velocities at the outflow in case of a non-cyclic lateral wall) 632 619 CALL boundary_conds 633 634 !635 !-- When using the land surface model:636 !-- 1) solve energy balance equation to calculate new skin temperature637 !-- 2) run soil model638 IF ( land_surface ) THEN639 640 CALL cpu_log( log_point(54), 'land_surface', 'start' )641 642 CALL lsm_energy_balance643 CALL lsm_soil_model644 645 CALL cpu_log( log_point(54), 'land_surface', 'stop' )646 647 ENDIF648 620 649 621 ! … … 731 703 732 704 ! 733 !-- First the vertical fluxes in the Prandtl layer are being computed 734 IF ( prandtl_layer ) THEN 735 CALL cpu_log( log_point(19), 'prandtl_fluxes', 'start' ) 736 CALL prandtl_fluxes 737 CALL cpu_log( log_point(19), 'prandtl_fluxes', 'stop' ) 738 ENDIF 739 705 !-- First the vertical fluxes in the surface (constant flux) layer are computed 706 IF ( constant_flux_layer ) THEN 707 CALL cpu_log( log_point(19), 'surface_layer_fluxes', 'start' ) 708 CALL surface_layer_fluxes 709 CALL cpu_log( log_point(19), 'surface_layer_fluxes', 'stop' ) 710 ENDIF 711 712 ! 713 !-- If required, solve the energy balance for the surface and run soil 714 !-- model 715 IF ( land_surface .AND. simulated_time > skip_time_do_lsm) THEN 716 717 CALL cpu_log( log_point(54), 'land_surface', 'start' ) 718 CALL lsm_energy_balance 719 CALL lsm_soil_model 720 CALL cpu_log( log_point(54), 'land_surface', 'stop' ) 721 ENDIF 740 722 ! 741 723 !-- Compute the diffusion coefficients … … 752 734 CALL cpu_log( log_point(17), 'diffusivities', 'stop' ) 753 735 736 ENDIF 737 738 ! 739 !-- If required, calculate radiative fluxes and heating rates 740 IF ( radiation .AND. intermediate_timestep_count & 741 == intermediate_timestep_count_max .AND. simulated_time > & 742 skip_time_do_radiation ) THEN 743 744 time_radiation = time_radiation + dt_3d 745 746 IF ( time_radiation >= dt_radiation .OR. force_radiation_call ) & 747 THEN 748 749 CALL cpu_log( log_point(50), 'radiation', 'start' ) 750 751 IF ( .NOT. force_radiation_call ) THEN 752 time_radiation = time_radiation - dt_radiation 753 ELSE 754 WRITE(9,*) "Unscheduled radiation call at ", simulated_time 755 CALL LOCAL_FLUSH ( 9 ) 756 ENDIF 757 758 IF ( radiation_scheme == 'clear-sky' ) THEN 759 CALL radiation_clearsky 760 ELSEIF ( radiation_scheme == 'rrtmg' ) THEN 761 CALL radiation_rrtmg 762 ENDIF 763 764 CALL cpu_log( log_point(50), 'radiation', 'stop' ) 765 ENDIF 754 766 ENDIF 755 767 -
palm/trunk/SOURCE/wall_fluxes.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Renamed rif_min and rif_max with zeta_min and zeta_max, respectively. 22 22 ! 23 23 ! Former revisions: … … 69 69 !> it gives slightly different results from the ij-version for some unknown 70 70 !> reason. 71 !> 72 !> @todo Rename rif to zeta throughout the routine 71 73 !------------------------------------------------------------------------------! 72 74 MODULE wall_fluxes_mod … … 107 109 108 110 USE control_parameters, & 109 ONLY: g, kappa, rif_max, rif_min111 ONLY: g, kappa, zeta_max, zeta_min 110 112 111 113 USE grid_variables, & … … 234 236 !-- shear stresses and very small momentum fluxes (both are 235 237 !-- generally unrealistic). 236 IF ( rifs < rif_min ) rifs = rif_min237 IF ( rifs > rif_max ) rifs = rif_max238 IF ( rifs < zeta_min ) rifs = zeta_min 239 IF ( rifs > zeta_max ) rifs = zeta_max 238 240 239 241 ! … … 291 293 292 294 USE control_parameters, & 293 ONLY: g, kappa, rif_max, rif_min295 ONLY: g, kappa, zeta_max, zeta_min 294 296 295 297 USE grid_variables, & … … 428 430 !-- shear stresses and very small momentum fluxes (both are 429 431 !-- generally unrealistic). 430 IF ( rifs < rif_min ) rifs = rif_min431 IF ( rifs > rif_max ) rifs = rif_max432 IF ( rifs < zeta_min ) rifs = zeta_min 433 IF ( rifs > zeta_max ) rifs = zeta_max 432 434 433 435 ! … … 485 487 486 488 USE control_parameters, & 487 ONLY: g, kappa, rif_max, rif_min489 ONLY: g, kappa, zeta_max, zeta_min 488 490 489 491 USE grid_variables, & … … 596 598 !-- consequence would result in very large shear stresses and very 597 599 !-- small momentum fluxes (both are generally unrealistic). 598 IF ( rifs < rif_min ) rifs = rif_min599 IF ( rifs > rif_max ) rifs = rif_max600 IF ( rifs < zeta_min ) rifs = zeta_min 601 IF ( rifs > zeta_max ) rifs = zeta_max 600 602 601 603 ! -
palm/trunk/SOURCE/write_3d_binary.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added output of radiative heating rates for RRTMG. Added output of ol. Removed 22 ! output of rif. 22 23 ! 23 24 ! Former revisions: … … 79 80 80 81 USE arrays_3d, & 81 ONLY: e, kh, km, p, pt, q, ql, qc, nr, nrs, nrsws, nrswst, qr, qrs,&82 qrs ws, qrswst, qs, qsws, qswst, sa, saswsb, saswst, rif, &82 ONLY: e, kh, km, ol, p, pt, q, ql, qc, nr, nrs, nrsws, nrswst, qr, & 83 qrs, qrsws, qrswst, qs, qsws, qswst, sa, saswsb, saswst, & 83 84 rif_wall, shf, ts, tswst, u, u_m_l, u_m_n, u_m_r, u_m_s, us, & 84 85 usws, uswst, v, v_m_l, v_m_n, v_m_r, v_m_s, vpt, vsws, vswst, & … … 110 111 USE radiation_model_mod, & 111 112 ONLY: radiation, rad_net, rad_net_av, rad_lw_in, rad_lw_in_av, & 112 rad_lw_out, rad_lw_out_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & 113 rad_sw_out_av 113 rad_lw_out, rad_lw_out_av, rad_lw_cs_hr, rad_lw_cs_hr_av, & 114 rad_lw_hr, rad_lw_hr_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & 115 rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, & 116 rad_sw_hr_av 114 117 115 118 USE random_function_mod, & … … 190 193 ENDIF 191 194 ENDIF 195 WRITE ( 14 ) 'ol '; WRITE ( 14 ) ol 192 196 WRITE ( 14 ) 'p '; WRITE ( 14 ) p 193 197 IF ( ALLOCATED( p_av ) ) THEN … … 290 294 WRITE ( 14 ) 'rad_lw_out_av '; WRITE ( 14 ) rad_lw_out_av 291 295 ENDIF 296 IF ( ALLOCATED( rad_lw_cs_hr ) ) THEN 297 WRITE ( 14 ) 'rad_lw_cs_hr '; WRITE ( 14 ) rad_lw_cs_hr 298 ENDIF 299 IF ( ALLOCATED( rad_lw_cs_hr_av ) ) THEN 300 WRITE ( 14 ) 'rad_lw_cs_hr_av '; WRITE ( 14 ) rad_lw_cs_hr_av 301 ENDIF 302 IF ( ALLOCATED( rad_lw_hr ) ) THEN 303 WRITE ( 14 ) 'rad_lw_hr '; WRITE ( 14 ) rad_lw_hr 304 ENDIF 305 IF ( ALLOCATED( rad_lw_hr_av ) ) THEN 306 WRITE ( 14 ) 'rad_lw_hr_av '; WRITE ( 14 ) rad_lw_hr_av 307 ENDIF 292 308 IF ( ALLOCATED( rad_sw_in ) ) THEN 293 309 WRITE ( 14 ) 'rad_sw_in '; WRITE ( 14 ) rad_sw_in … … 302 318 WRITE ( 14 ) 'rad_sw_out_av '; WRITE ( 14 ) rad_sw_out_av 303 319 ENDIF 320 IF ( ALLOCATED( rad_sw_cs_hr ) ) THEN 321 WRITE ( 14 ) 'rad_sw_cs_hr '; WRITE ( 14 ) rad_sw_cs_hr 322 ENDIF 323 IF ( ALLOCATED( rad_sw_cs_hr_av ) ) THEN 324 WRITE ( 14 ) 'rad_sw_cs_hr_av '; WRITE ( 14 ) rad_sw_cs_hr_av 325 ENDIF 326 IF ( ALLOCATED( rad_sw_hr ) ) THEN 327 WRITE ( 14 ) 'rad_sw_hr '; WRITE ( 14 ) rad_sw_hr 328 ENDIF 329 IF ( ALLOCATED( rad_sw_hr_av ) ) THEN 330 WRITE ( 14 ) 'rad_sw_hr_av '; WRITE ( 14 ) rad_sw_hr_av 331 ENDIF 304 332 ENDIF 305 333 IF ( ocean ) THEN … … 338 366 WRITE ( 14 ) seq_random_array 339 367 ENDIF 340 WRITE ( 14 ) 'rif '; WRITE ( 14 ) rif341 368 IF ( topography /= 'flat' ) THEN 342 369 WRITE ( 14 ) 'rif_wall '; WRITE ( 14 ) rif_wall -
palm/trunk/SOURCE/write_var_list.f90
r1683 r1691 14 14 ! PALM. If not, see <http://www.gnu.org/licenses/>. 15 15 ! 16 ! Copyright 1997-201 4Leibniz Universitaet Hannover16 ! Copyright 1997-2015 Leibniz Universitaet Hannover 17 17 !--------------------------------------------------------------------------------! 18 18 ! 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added output of most_method, constant_flux_layer, zeta_min, zeta_max. Removed 22 ! output of prandtl_layer and rif_min, rif_max. 22 23 ! 23 24 ! Former revisions: … … 161 162 ONLY: statistic_regions, hom, hom_sum, u_max, u_max_ijk, v_max, & 162 163 v_max_ijk, w_max, w_max_ijk 164 163 165 164 166 IMPLICIT NONE … … 167 169 168 170 169 binary_version = ' 3.9b'171 binary_version = '4.0' 170 172 171 173 WRITE ( 14 ) binary_version … … 273 275 WRITE ( 14 ) conserve_volume_flow_mode 274 276 WRITE ( 14 ) 'coupling_start_time ' 277 WRITE ( 14 ) 'constant_flux_layer ' 278 WRITE ( 14 ) constant_flux_layer 275 279 WRITE ( 14 ) coupling_start_time 276 280 WRITE ( 14 ) 'current_timestep_number ' … … 374 378 WRITE ( 14 ) 'momentum_advec ' 375 379 WRITE ( 14 ) momentum_advec 380 WRITE ( 14 ) 'most_method ' 381 WRITE ( 14 ) most_method 376 382 WRITE ( 14 ) 'nc_const ' 377 383 WRITE ( 14 ) nc_const … … 406 412 WRITE ( 14 ) 'phi ' 407 413 WRITE ( 14 ) phi 408 WRITE ( 14 ) 'prandtl_layer '409 WRITE ( 14 ) prandtl_layer410 414 WRITE ( 14 ) 'prandtl_number ' 411 415 WRITE ( 14 ) prandtl_number … … 462 466 WRITE ( 14 ) 'residual_limit ' 463 467 WRITE ( 14 ) residual_limit 464 WRITE ( 14 ) 'rif_max '465 WRITE ( 14 ) rif_max466 WRITE ( 14 ) 'rif_min '467 WRITE ( 14 ) rif_min468 468 WRITE ( 14 ) 'roughness_length ' 469 469 WRITE ( 14 ) roughness_length … … 624 624 WRITE ( 14 ) 'w_max_ijk ' 625 625 WRITE ( 14 ) w_max_ijk 626 WRITE ( 14 ) 'zeta_max ' 627 WRITE ( 14 ) zeta_max 628 WRITE ( 14 ) 'zeta_min ' 629 WRITE ( 14 ) zeta_min 626 630 WRITE ( 14 ) 'z0h_factor ' 627 631 WRITE ( 14 ) z0h_factor
Note: See TracChangeset
for help on using the changeset viewer.