Changeset 3182
- Timestamp:
- Jul 27, 2018 1:36:03 PM (6 years ago)
- Location:
- palm/trunk
- Files:
-
- 2 added
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/advec_ws.f90
r3022 r3182 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Rename variables for boundary-condition flags and for offline nesting mode 23 23 ! 24 24 ! Former revisions: … … 460 460 461 461 USE control_parameters, & 462 ONLY: force_bound_l, force_bound_n, force_bound_r, force_bound_s, & 463 inflow_l, inflow_n, inflow_r, inflow_s, momentum_advec, & 464 nest_bound_l, nest_bound_n, nest_bound_r, nest_bound_s, & 465 outflow_l, outflow_n, outflow_r, outflow_s, scalar_advec 462 ONLY: bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 463 bc_dirichlet_s, bc_radiation_l, bc_radiation_n, & 464 bc_radiation_r, bc_radiation_s, momentum_advec, scalar_advec 466 465 467 466 USE indices, & … … 501 500 .OR. .NOT. BTEST(wall_flags_0(k,j,i+2),0) & 502 501 .OR. .NOT. BTEST(wall_flags_0(k,j,i-1),0) ) & 503 .OR. ( ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR.& 504 force_bound_l ) & 502 .OR. ( ( bc_dirichlet_l .OR. bc_radiation_l ) & 505 503 .AND. i == nxl ) & 506 .OR. ( ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR.& 507 force_bound_r ) & 504 .OR. ( ( bc_dirichlet_r .OR. bc_radiation_r ) & 508 505 .AND. i == nxr ) ) & 509 506 THEN … … 520 517 ) & 521 518 .OR. & 522 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR.& 523 force_bound_r ) & 519 ( ( bc_dirichlet_r .OR. bc_radiation_r ) & 524 520 .AND. i == nxr-1 ) .OR. & 525 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR.& 526 force_bound_l ) & 521 ( ( bc_dirichlet_l .OR. bc_radiation_l ) & 527 522 .AND. i == nxlu ) ) & ! why not nxl+1 528 523 THEN … … 542 537 .OR. .NOT. BTEST(wall_flags_0(k,j+2,i),0) & 543 538 .OR. .NOT. BTEST(wall_flags_0(k,j-1,i),0)) & 544 .OR. ( ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR.& 545 force_bound_s ) & 539 .OR. ( ( bc_dirichlet_s .OR. bc_radiation_s ) & 546 540 .AND. j == nys ) & 547 .OR. ( ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR.& 548 force_bound_n ) & 541 .OR. ( ( bc_dirichlet_n .OR. bc_radiation_n ) & 549 542 .AND. j == nyn ) ) & 550 543 THEN … … 563 556 ) & 564 557 .OR. & 565 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR.& 566 force_bound_s ) & 558 ( ( bc_dirichlet_s .OR. bc_radiation_s ) & 567 559 .AND. j == nysv ) .OR. & ! why not nys+1 568 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR.& 569 force_bound_n ) & 560 ( ( bc_dirichlet_n .OR. bc_radiation_n ) & 570 561 .AND. j == nyn-1 ) ) & 571 562 THEN … … 655 646 !-- WS1 (9), WS3 (10), WS5 (11) 656 647 IF ( .NOT. BTEST(wall_flags_0(k,j,i+1),1) .OR. & 657 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR.& 658 force_bound_l ) & 648 ( ( bc_dirichlet_l .OR. bc_radiation_l ) & 659 649 .AND. i <= nxlu ) .OR. & 660 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR.& 661 force_bound_r ) & 650 ( ( bc_dirichlet_r .OR. bc_radiation_r ) & 662 651 .AND. i == nxr ) ) & 663 652 THEN … … 667 656 .NOT. BTEST(wall_flags_0(k,j,i-1),1) ) & 668 657 .OR. & 669 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR.& 670 force_bound_r ) & 658 ( ( bc_dirichlet_r .OR. bc_radiation_r ) & 671 659 .AND. i == nxr-1 ) .OR. & 672 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR.& 673 force_bound_l ) & 660 ( ( bc_dirichlet_l .OR. bc_radiation_l ) & 674 661 .AND. i == nxlu+1) ) & 675 662 THEN … … 691 678 !-- WS1 (12), WS3 (13), WS5 (14) 692 679 IF ( .NOT. BTEST(wall_flags_0(k,j+1,i),1) .OR. & 693 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR.& 694 force_bound_s ) & 680 ( ( bc_dirichlet_s .OR. bc_radiation_s ) & 695 681 .AND. j == nys ) .OR. & 696 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR.& 697 force_bound_n ) & 682 ( ( bc_dirichlet_n .OR. bc_radiation_n ) & 698 683 .AND. j == nyn ) ) & 699 684 THEN … … 703 688 .NOT. BTEST(wall_flags_0(k,j-1,i),1) ) & 704 689 .OR. & 705 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR.& 706 force_bound_s ) & 690 ( ( bc_dirichlet_s .OR. bc_radiation_s ) & 707 691 .AND. j == nysv ) .OR. & 708 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR.& 709 force_bound_n ) & 692 ( ( bc_dirichlet_n .OR. bc_radiation_n ) & 710 693 .AND. j == nyn-1 ) ) & 711 694 THEN … … 789 772 !-- WS1 (18), WS3 (19), WS5 (20) 790 773 IF ( .NOT. BTEST(wall_flags_0(k,j,i+1),2) .OR. & 791 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR.& 792 force_bound_l ) & 774 ( ( bc_dirichlet_l .OR. bc_radiation_l ) & 793 775 .AND. i == nxl ) .OR. & 794 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR.& 795 force_bound_r ) & 776 ( ( bc_dirichlet_r .OR. bc_radiation_r ) & 796 777 .AND. i == nxr ) ) & 797 778 THEN … … 803 784 .NOT. BTEST(wall_flags_0(k,j,i-1),2) & 804 785 .OR. & 805 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR.& 806 force_bound_r ) & 786 ( ( bc_dirichlet_r .OR. bc_radiation_r ) & 807 787 .AND. i == nxr-1 ) .OR. & 808 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR.& 809 force_bound_l ) & 788 ( ( bc_dirichlet_l .OR. bc_radiation_l ) & 810 789 .AND. i == nxlu ) ) & 811 790 THEN … … 827 806 !-- WS1 (21), WS3 (22), WS5 (23) 828 807 IF ( .NOT. BTEST(wall_flags_0(k,j+1,i),2) .OR. & 829 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR.& 830 force_bound_s ) & 808 ( ( bc_dirichlet_s .OR. bc_radiation_s ) & 831 809 .AND. j <= nysv ) .OR. & 832 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR.& 833 force_bound_n ) & 810 ( ( bc_dirichlet_n .OR. bc_radiation_n ) & 834 811 .AND. j == nyn ) ) & 835 812 THEN … … 839 816 .NOT. BTEST(wall_flags_0(k,j-1,i),2) ) & 840 817 .OR. & 841 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR.& 842 force_bound_s ) & 818 ( ( bc_dirichlet_s .OR. bc_radiation_s ) & 843 819 .AND. j == nysv+1) .OR. & 844 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR.& 845 force_bound_n ) & 820 ( ( bc_dirichlet_n .OR. bc_radiation_n ) & 846 821 .AND. j == nyn-1 ) ) & 847 822 THEN … … 924 899 !-- WS1 (27), WS3 (28), WS5 (29) 925 900 IF ( .NOT. BTEST(wall_flags_0(k,j,i+1),3) .OR. & 926 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR.& 927 force_bound_l ) & 901 ( ( bc_dirichlet_l .OR. bc_radiation_l ) & 928 902 .AND. i == nxl ) .OR. & 929 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR.& 930 force_bound_r ) & 903 ( ( bc_dirichlet_r .OR. bc_radiation_r ) & 931 904 .AND. i == nxr ) ) & 932 905 THEN … … 936 909 .NOT. BTEST(wall_flags_0(k,j,i-1),3) ) & 937 910 .OR. & 938 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR.& 939 force_bound_r ) & 911 ( ( bc_dirichlet_r .OR. bc_radiation_r ) & 940 912 .AND. i == nxr-1 ) .OR. & 941 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR.& 942 force_bound_l ) & 913 ( ( bc_dirichlet_l .OR. bc_radiation_l ) & 943 914 .AND. i == nxlu ) ) & 944 915 THEN … … 960 931 !-- WS1 (30), WS3 (31), WS5 (32) 961 932 IF ( .NOT. BTEST(wall_flags_0(k,j+1,i),3) .OR. & 962 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR.& 963 force_bound_s ) & 933 ( ( bc_dirichlet_s .OR. bc_radiation_s ) & 964 934 .AND. j == nys ) .OR. & 965 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR.& 966 force_bound_n ) & 935 ( ( bc_dirichlet_n .OR. bc_radiation_n ) & 967 936 .AND. j == nyn ) ) & 968 937 THEN … … 972 941 .NOT. BTEST(wall_flags_0(k,j-1,i),3) ) & 973 942 .OR. & 974 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR.& 975 force_bound_s ) & 943 ( ( bc_dirichlet_s .OR. bc_radiation_s ) & 976 944 .AND. j == nysv ) .OR. & 977 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR.& 978 force_bound_n ) & 945 ( ( bc_dirichlet_n .OR. bc_radiation_n ) & 979 946 .AND. j == nyn-1 ) ) & 980 947 THEN … … 1067 1034 !-- Set boundary flags at inflow and outflow boundary in case of 1068 1035 !-- non-cyclic boundary conditions. 1069 IF ( inflow_l .OR. outflow_l .OR. & 1070 nest_bound_l .OR. force_bound_l ) THEN 1036 IF ( bc_dirichlet_l .OR. bc_radiation_l ) THEN 1071 1037 advc_flags_1(:,:,nxl-1) = advc_flags_1(:,:,nxl) 1072 1038 advc_flags_2(:,:,nxl-1) = advc_flags_2(:,:,nxl) 1073 1039 ENDIF 1074 1040 1075 IF ( inflow_r .OR. outflow_r .OR. & 1076 nest_bound_r .OR. force_bound_r ) THEN 1041 IF ( bc_dirichlet_r .OR. bc_radiation_r ) THEN 1077 1042 advc_flags_1(:,:,nxr+1) = advc_flags_1(:,:,nxr) 1078 1043 advc_flags_2(:,:,nxr+1) = advc_flags_2(:,:,nxr) 1079 1044 ENDIF 1080 1045 1081 IF ( inflow_n .OR. outflow_n .OR. & 1082 nest_bound_n .OR. force_bound_n ) THEN 1046 IF ( bc_dirichlet_n .OR. bc_radiation_n ) THEN 1083 1047 advc_flags_1(:,nyn+1,:) = advc_flags_1(:,nyn,:) 1084 1048 advc_flags_2(:,nyn+1,:) = advc_flags_2(:,nyn,:) 1085 1049 ENDIF 1086 1050 1087 IF ( inflow_s .OR. outflow_s .OR. & 1088 nest_bound_s .OR. force_bound_s ) THEN 1051 IF ( bc_dirichlet_s .OR. bc_radiation_s ) THEN 1089 1052 advc_flags_1(:,nys-1,:) = advc_flags_1(:,nys,:) 1090 1053 advc_flags_2(:,nys-1,:) = advc_flags_2(:,nys,:) -
palm/trunk/SOURCE/boundary_conds.f90
r3129 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Rename some variables concerning LES-LES as well as offline nesting 23 23 ! 24 24 ! Former revisions: … … 186 186 USE arrays_3d, & 187 187 ONLY: c_u, c_u_m, c_u_m_l, c_v, c_v_m, c_v_m_l, c_w, c_w_m, c_w_m_l, & 188 diss, diss_p, dzu, e_p, nc_p, nr_p, pt, pt_p, q, q_p, qc_p, qr_p, s, & 188 diss, diss_p, dzu, e_p, nc_p, nr_p, pt, pt_p, q, q_p, qc_p, & 189 qr_p, s, & 189 190 s_p, sa, sa_p, u, ug, u_init, u_m_l, u_m_n, u_m_r, u_m_s, u_p, & 190 191 v, vg, v_init, v_m_l, v_m_n, v_m_r, v_m_s, v_p, & … … 195 196 196 197 USE control_parameters, & 197 ONLY: air_chemistry, bc_ pt_t_val, bc_q_t_val, bc_s_t_val,&198 constant_diffusion, cloud_physics, coupling_mode, dt_3d,&199 force_bound_l, force_bound_s, forcing, humidity,&200 ibc_pt_b, ibc_pt_t, ibc_q_b, ibc_q_t, ibc_s_b, ibc_s_t,&201 ibc_sa_t, ibc_uv_b, ibc_uv_t, inflow_l, inflow_n, inflow_r,&202 i nflow_s, intermediate_timestep_count, kappa,&203 microphysics_morrison, microphysics_seifert, nest_domain,&204 nest_bound_l, nest_bound_n, nest_bound_r, nest_bound_s, nudging,&205 ocean, outflow_l, outflow_n, outflow_r, outflow_s,&206 passive_scalar, rans_mode, rans_tke_e, tsc, use_cmax198 ONLY: air_chemistry, bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 199 bc_dirichlet_s, bc_radiation_l, bc_radiation_n, bc_radiation_r, & 200 bc_radiation_s, bc_pt_t_val, bc_q_t_val, bc_s_t_val, & 201 child_domain, constant_diffusion, cloud_physics, coupling_mode, & 202 dt_3d, humidity, ibc_pt_b, ibc_pt_t, ibc_q_b, ibc_q_t, ibc_s_b, & 203 ibc_s_t,ibc_sa_t, ibc_uv_b, ibc_uv_t, & 204 intermediate_timestep_count, kappa, & 205 microphysics_morrison, microphysics_seifert, & 206 nesting_offline, nudging, & 207 ocean, passive_scalar, rans_mode, rans_tke_e, tsc, use_cmax 207 208 208 209 USE grid_variables, & … … 275 276 ! 276 277 !-- Vertical nesting: Vertical velocity not zero at the top of the fine grid 277 IF ( .NOT. nest_domain .AND.&278 IF ( .NOT. child_domain .AND. & 278 279 TRIM(coupling_mode) /= 'vnested_fine' ) THEN 279 280 w_p(nzt:nzt+1,:,:) = 0.0_wp !< nzt is not a prognostic level (but cf. pres) … … 409 410 ENDIF 410 411 411 IF ( .NOT. nest_domain ) THEN412 IF ( .NOT. child_domain ) THEN 412 413 e_p(nzt+1,:,:) = e_p(nzt,:,:) 413 414 ! … … 421 422 IF ( rans_mode_parent .AND. .NOT. rans_mode ) THEN 422 423 423 424 425 424 e_p(nzt+1,:,:) = e_p(nzt,:,:) 426 IF ( nest_bound_l ) e_p(:,:,nxl-1) = e_p(:,:,nxl)427 IF ( nest_bound_r ) e_p(:,:,nxr+1) = e_p(:,:,nxr)428 IF ( nest_bound_s ) e_p(:,nys-1,:) = e_p(:,nys,:)429 IF ( nest_bound_n ) e_p(:,nyn+1,:) = e_p(:,nyn,:)425 IF ( bc_dirichlet_l ) e_p(:,:,nxl-1) = e_p(:,:,nxl) 426 IF ( bc_dirichlet_r ) e_p(:,:,nxr+1) = e_p(:,:,nxr) 427 IF ( bc_dirichlet_s ) e_p(:,nys-1,:) = e_p(:,nys,:) 428 IF ( bc_dirichlet_n ) e_p(:,nyn+1,:) = e_p(:,nyn,:) 430 429 431 430 ENDIF … … 510 509 ENDDO 511 510 512 IF ( .NOT. nest_domain ) THEN511 IF ( .NOT. child_domain ) THEN 513 512 diss_p(nzt+1,:,:) = diss_p(nzt,:,:) 514 513 ENDIF … … 697 696 !-- have to be restored here. 698 697 !-- For the SGS-TKE, Neumann boundary conditions are used at the inflow. 699 IF ( inflow_s ) THEN698 IF ( bc_dirichlet_s ) THEN 700 699 v_p(:,nys,:) = v_p(:,nys-1,:) 701 700 IF ( .NOT. constant_diffusion ) e_p(:,nys-1,:) = e_p(:,nys,:) 702 ELSEIF ( inflow_n ) THEN701 ELSEIF ( bc_dirichlet_n ) THEN 703 702 IF ( .NOT. constant_diffusion ) e_p(:,nyn+1,:) = e_p(:,nyn,:) 704 ELSEIF ( inflow_l ) THEN703 ELSEIF ( bc_dirichlet_l ) THEN 705 704 u_p(:,:,nxl) = u_p(:,:,nxl-1) 706 705 IF ( .NOT. constant_diffusion ) e_p(:,:,nxl-1) = e_p(:,:,nxl) 707 ELSEIF ( inflow_r ) THEN706 ELSEIF ( bc_dirichlet_r ) THEN 708 707 IF ( .NOT. constant_diffusion ) e_p(:,:,nxr+1) = e_p(:,:,nxr) 709 708 ENDIF … … 712 711 !-- The same restoration for u at i=nxl and v at j=nys as above must be made 713 712 !-- in case of nest boundaries. This must not be done in case of vertical nesting 714 !-- mode as in that case the lateral boundaries are actually cyclic. 715 IF ( nesting_mode /= 'vertical' .OR. forcing ) THEN 716 IF ( nest_bound_s .OR. force_bound_s ) THEN 713 !-- mode as in that case the lateral boundaries are actually cyclic. 714 !-- @todo: Is this really needed? Boundary values will be overwritten in 715 !-- coupler or by Inifor data. 716 IF ( nesting_mode /= 'vertical' .OR. nesting_offline ) THEN 717 IF ( bc_dirichlet_s ) THEN 717 718 v_p(:,nys,:) = v_p(:,nys-1,:) 718 719 ENDIF 719 IF ( nest_bound_l .OR. force_bound_l ) THEN720 IF ( bc_dirichlet_l ) THEN 720 721 u_p(:,:,nxl) = u_p(:,:,nxl-1) 721 722 ENDIF … … 724 725 ! 725 726 !-- Lateral boundary conditions for scalar quantities at the outflow 726 IF ( outflow_s ) THEN727 IF ( bc_radiation_s ) THEN 727 728 pt_p(:,nys-1,:) = pt_p(:,nys,:) 728 729 IF ( .NOT. constant_diffusion ) e_p(:,nys-1,:) = e_p(:,nys,:) … … 740 741 ENDIF 741 742 IF ( passive_scalar ) s_p(:,nys-1,:) = s_p(:,nys,:) 742 ELSEIF ( outflow_n ) THEN743 ELSEIF ( bc_radiation_n ) THEN 743 744 pt_p(:,nyn+1,:) = pt_p(:,nyn,:) 744 745 IF ( .NOT. constant_diffusion ) e_p(:,nyn+1,:) = e_p(:,nyn,:) … … 756 757 ENDIF 757 758 IF ( passive_scalar ) s_p(:,nyn+1,:) = s_p(:,nyn,:) 758 ELSEIF ( outflow_l ) THEN759 ELSEIF ( bc_radiation_l ) THEN 759 760 pt_p(:,:,nxl-1) = pt_p(:,:,nxl) 760 761 IF ( .NOT. constant_diffusion ) e_p(:,:,nxl-1) = e_p(:,:,nxl) … … 772 773 ENDIF 773 774 IF ( passive_scalar ) s_p(:,:,nxl-1) = s_p(:,:,nxl) 774 ELSEIF ( outflow_r ) THEN775 ELSEIF ( bc_radiation_r ) THEN 775 776 pt_p(:,:,nxr+1) = pt_p(:,:,nxr) 776 777 IF ( .NOT. constant_diffusion ) e_p(:,:,nxr+1) = e_p(:,:,nxr) … … 799 800 !-- ensures numerical stability (CFL-condition) or calculated after 800 801 !-- Orlanski(1976) and averaged along the outflow boundary. 801 IF ( outflow_s ) THEN802 IF ( bc_radiation_s ) THEN 802 803 803 804 IF ( use_cmax ) THEN … … 938 939 ENDIF 939 940 940 IF ( outflow_n ) THEN941 IF ( bc_radiation_n ) THEN 941 942 942 943 IF ( use_cmax ) THEN … … 1077 1078 ENDIF 1078 1079 1079 IF ( outflow_l ) THEN1080 IF ( bc_radiation_l ) THEN 1080 1081 1081 1082 IF ( use_cmax ) THEN … … 1216 1217 ENDIF 1217 1218 1218 IF ( outflow_r ) THEN1219 IF ( bc_radiation_r ) THEN 1219 1220 1220 1221 IF ( use_cmax ) THEN -
palm/trunk/SOURCE/check_parameters.f90
r3129 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Rename boundary conditions in offline nesting 23 23 ! 24 24 ! Former revisions: … … 1069 1069 !-- Check turbulence closure setup 1070 1070 CALL tcm_check_parameters 1071 1071 1072 ! 1072 1073 !-- Check approximation … … 1437 1438 CALL MPI_ALLREDUCE( dt_spinup, dt_spinup_max, 1, MPI_REAL, & 1438 1439 MPI_MAX, MPI_COMM_WORLD, ierr ) 1440 1439 1441 IF ( spinup_time /= spinup_time_max .OR. dt_spinup /= dt_spinup_max ) & 1440 1442 THEN … … 1781 1783 ! 1782 1784 !-- Overwrite latitude if necessary and compute Coriolis parameter. 1783 !-- Todo - move initialization of f and fs to coriolis_mod.1785 !-- @todo - move initialization of f and fs to coriolis_mod. 1784 1786 IF ( input_pids_static ) THEN 1785 1787 latitude = init_model%latitude … … 1976 1978 !-- TO_DO: later set bc_p_t to neumann before, in case of nested domain 1977 1979 ELSEIF ( bc_p_t == 'neumann' .OR. bc_p_t == 'nested' .OR. & 1978 bc_p_t == ' forcing' ) THEN1980 bc_p_t == 'nesting_offline' ) THEN 1979 1981 ibc_p_t = 1 1980 1982 ELSE … … 2006 2008 ELSEIF ( bc_pt_t == 'initial_gradient' ) THEN 2007 2009 ibc_pt_t = 2 2008 ELSEIF ( bc_pt_t == 'nested' .OR. bc_pt_t == ' forcing' ) THEN2010 ELSEIF ( bc_pt_t == 'nested' .OR. bc_pt_t == 'nesting_offline' ) THEN 2009 2011 ibc_pt_t = 3 2010 2012 ELSE … … 2234 2236 ELSEIF ( bc_uv_t == 'neumann' ) THEN 2235 2237 ibc_uv_t = 1 2236 ELSEIF ( bc_uv_t == 'nested' .OR. bc_uv_t == ' forcing' ) THEN2238 ELSEIF ( bc_uv_t == 'nested' .OR. bc_uv_t == 'nesting_offline' ) THEN 2237 2239 ibc_uv_t = 3 2238 2240 ELSE … … 3926 3928 dist_nxl = MAX( inflow_disturbance_begin, nxl ) 3927 3929 dist_nxr(1) = MIN( inflow_disturbance_end, nxr ) 3928 ELSEIF ( bc_lr == 'nested' .OR. bc_lr == ' forcing' ) THEN3930 ELSEIF ( bc_lr == 'nested' .OR. bc_lr == 'nesting_offline' ) THEN 3929 3931 dist_nxl = MAX( inflow_disturbance_begin, nxl ) 3930 3932 dist_nxr = MIN( nx - inflow_disturbance_begin, nxr ) … … 3936 3938 dist_nys = MAX( inflow_disturbance_begin, nys ) 3937 3939 dist_nyn(1) = MIN( inflow_disturbance_end, nyn ) 3938 ELSEIF ( bc_ns == 'nested' .OR. bc_ns == ' forcing' ) THEN3940 ELSEIF ( bc_ns == 'nested' .OR. bc_ns == 'nesting_offline' ) THEN 3939 3941 dist_nys = MAX( inflow_disturbance_begin, nys ) 3940 3942 dist_nyn = MIN( ny - inflow_disturbance_begin, nyn ) … … 3949 3951 dist_nxl = inflow_disturbance_begin 3950 3952 dist_nxr(1) = inflow_disturbance_end 3951 ELSEIF ( bc_lr == 'nested' .OR. bc_lr == ' forcing' ) THEN3953 ELSEIF ( bc_lr == 'nested' .OR. bc_lr == 'nesting_offline' ) THEN 3952 3954 dist_nxr = nx - inflow_disturbance_begin 3953 3955 dist_nxl = inflow_disturbance_begin … … 3959 3961 dist_nys = inflow_disturbance_begin 3960 3962 dist_nyn(1) = inflow_disturbance_end 3961 ELSEIF ( bc_ns == 'nested' .OR. bc_ns == ' forcing' ) THEN3963 ELSEIF ( bc_ns == 'nested' .OR. bc_ns == 'nesting_offline' ) THEN 3962 3964 dist_nyn = ny - inflow_disturbance_begin 3963 3965 dist_nys = inflow_disturbance_begin … … 4403 4405 ELSEIF ( bc_t == 'initial_gradient' ) THEN 4404 4406 ibc_t = 2 4405 ELSEIF ( bc_t == 'nested' .OR. bc_t == ' forcing' ) THEN4407 ELSEIF ( bc_t == 'nested' .OR. bc_t == 'nesting_offline' ) THEN 4406 4408 ibc_t = 3 4407 4409 ELSE -
palm/trunk/SOURCE/chemistry_model_mod.f90
r3173 r3182 22 22 ! Current revisions: 23 23 ! ----------------- 24 ! 24 ! Rename flags indicating outflow boundary conditions 25 25 ! 26 26 ! Former revisions: … … 291 291 292 292 USE control_parameters, & 293 ONLY: air_chemistry, outflow_l, outflow_n, outflow_r, outflow_s 293 ONLY: air_chemistry, bc_radiation_l, bc_radiation_n, bc_radiation_r, & 294 bc_radiation_s 294 295 USE indices, & 295 ONLY: nxl, nxr, nxlg, nxrg, nyng, nysg, nzt296 ONLY: nxl, nxr, nxlg, nxrg, nyng, nysg, nzt 296 297 297 298 ! USE prognostic_equations_mod, & 298 299 299 300 USE arrays_3d, & 300 ONLY: dzu301 ONLY: dzu 301 302 USE surface_mod, & 302 ONLY: bc_h303 ONLY: bc_h 303 304 304 305 CHARACTER (len=*), INTENT(IN) :: mode … … 420 421 !-- Lateral boundary conditions for chem species at outflow boundary 421 422 422 IF ( outflow_s ) THEN423 IF ( bc_radiation_s ) THEN 423 424 DO lsp = 1, nspec 424 425 chem_species(lsp)%conc_p(:,nys-1,:) = chem_species(lsp)%conc_p(:,nys,:) 425 426 ENDDO 426 ELSEIF ( outflow_n ) THEN427 ELSEIF ( bc_radiation_n ) THEN 427 428 DO lsp = 1, nspec 428 429 chem_species(lsp)%conc_p(:,nyn+1,:) = chem_species(lsp)%conc_p(:,nyn,:) 429 430 ENDDO 430 ELSEIF ( outflow_l ) THEN431 ELSEIF ( bc_radiation_l ) THEN 431 432 DO lsp = 1, nspec 432 433 chem_species(lsp)%conc_p(:,:,nxl-1) = chem_species(lsp)%conc_p(:,:,nxl) 433 434 ENDDO 434 ELSEIF ( outflow_r ) THEN435 ELSEIF ( bc_radiation_r ) THEN 435 436 DO lsp = 1, nspec 436 437 chem_species(lsp)%conc_p(:,:,nxr+1) = chem_species(lsp)%conc_p(:,:,nxr) -
palm/trunk/SOURCE/coriolis.f90
r2718 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Remove masking of geostrophic wind forcing in offline nesting case 23 23 ! 24 24 ! Former revisions: … … 109 109 110 110 USE control_parameters, & 111 ONLY: f, f orcing, fs, message_string111 ONLY: f, fs, message_string, nesting_offline 112 112 113 113 USE indices, & … … 123 123 INTEGER(iwp) :: k !< running index z direction 124 124 125 REAL(wp) :: flag !< flag to mask topography 126 REAL(wp) :: flag_force !< flag to mask large-scale pressure gradient in case larger-scale forcing is applied 127 128 flag_force = MERGE( 0.0_wp, 1.0_wp, forcing ) 125 REAL(wp) :: flag !< flag to mask topography 126 129 127 ! 130 128 !-- Compute Coriolis terms for the three velocity components … … 144 142 tend(k,j,i) = tend(k,j,i) + f * ( 0.25_wp * & 145 143 ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) + & 146 v(k,j+1,i) ) - vg(k) * flag_force & 147 ) * flag & 144 v(k,j+1,i) ) - vg(k) ) * flag & 148 145 - fs * ( 0.25_wp * & 149 146 ( w(k-1,j,i-1) + w(k-1,j,i) + w(k,j,i-1) + & … … 167 164 tend(k,j,i) = tend(k,j,i) - f * ( 0.25_wp * & 168 165 ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) + & 169 u(k,j,i+1) ) - ug(k) * flag_force & 170 ) * flag 166 u(k,j,i+1) ) - ug(k) ) * flag 171 167 ENDDO 172 168 ENDDO … … 212 208 213 209 USE control_parameters, & 214 ONLY: f, f orcing, fs, message_string210 ONLY: f, fs, message_string, nesting_offline 215 211 216 212 USE indices, & … … 227 223 228 224 REAL(wp) :: flag !< flag to mask topography 229 REAL(wp) :: flag_force !< flag to mask large-scale pressure gradient in case larger-scale forcing is applied 230 231 flag_force = MERGE( 0.0_wp, 1.0_wp, forcing ) 225 232 226 ! 233 227 !-- Compute Coriolis terms for the three velocity components … … 244 238 tend(k,j,i) = tend(k,j,i) + f * ( 0.25_wp * & 245 239 ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) + & 246 v(k,j+1,i) ) - vg(k) * flag_force&240 v(k,j+1,i) ) - vg(k) & 247 241 ) * flag & 248 242 - fs * ( 0.25_wp * & … … 261 255 tend(k,j,i) = tend(k,j,i) - f * ( 0.25_wp * & 262 256 ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) + & 263 u(k,j,i+1) ) - ug(k) * flag_force & 264 ) * flag 257 u(k,j,i+1) ) - ug(k) ) * flag 265 258 ENDDO 266 259 -
palm/trunk/SOURCE/exchange_horiz_2d.f90
r2718 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Rename variables in offline nesting mode and flags indicating lateral 23 ! boundary conditions 23 24 ! 24 25 ! Former revisions: … … 84 85 85 86 USE control_parameters, & 86 ONLY : bc_lr_cyc, bc_ns_cyc, force_bound_l, force_bound_n, & 87 force_bound_r, force_bound_s, & 88 inflow_l, inflow_n, inflow_r, inflow_s, & 89 nest_bound_l, nest_bound_n, nest_bound_r, nest_bound_s, & 90 outflow_l, outflow_n, outflow_r, outflow_s 87 ONLY : bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 88 bc_dirichlet_s, bc_lr_cyc, bc_ns_cyc, bc_radiation_l, & 89 bc_radiation_n, bc_radiation_r, bc_radiation_s 91 90 92 91 USE cpulog, & … … 184 183 !-- Neumann-conditions at inflow/outflow/nested boundaries 185 184 IF ( nesting_mode /= 'vertical' ) THEN 186 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l ) & 187 THEN 185 IF ( bc_dirichlet_l .OR. bc_radiation_l ) THEN 188 186 DO i = nbgp, 1, -1 189 187 ar(:,nxl-i) = ar(:,nxl) 190 188 ENDDO 191 189 ENDIF 192 IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. force_bound_r ) & 193 THEN 190 IF ( bc_dirichlet_r .OR. bc_radiation_r ) THEN 194 191 DO i = 1, nbgp 195 192 ar(:,nxr+i) = ar(:,nxr) 196 193 ENDDO 197 194 ENDIF 198 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s ) & 199 THEN 195 IF ( bc_dirichlet_s .OR. bc_radiation_s ) THEN 200 196 DO i = nbgp, 1, -1 201 197 ar(nys-i,:) = ar(nys,:) 202 198 ENDDO 203 199 ENDIF 204 IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. force_bound_n ) & 205 THEN 200 IF ( bc_dirichlet_n .OR. bc_radiation_n ) THEN 206 201 DO i = 1, nbgp 207 202 ar(nyn+i,:) = ar(nyn,:) … … 227 222 228 223 USE control_parameters, & 229 ONLY: bc_ lr_cyc, bc_ns_cyc, grid_level, force_bound_l, force_bound_n,&230 force_bound_r, force_bound_s, nest_bound_l, nest_bound_n,&231 nest_bound_r, nest_bound_s224 ONLY: bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 225 bc_dirichlet_s, bc_lr_cyc, bc_ns_cyc, bc_radiation_l, & 226 bc_radiation_n, bc_radiation_r, bc_radiation_s, grid_level 232 227 233 228 USE cpulog, & … … 326 321 ! 327 322 !-- Neumann-conditions at inflow/outflow/nested boundaries 328 IF ( nest_bound_l .OR. force_bound_l ) THEN323 IF ( bc_dirichlet_l ) THEN 329 324 DO i = nbgp_local, 1, -1 330 325 ar(:,nxl_l-i) = ar(:,nxl_l) 331 326 ENDDO 332 327 ENDIF 333 IF ( nest_bound_r .OR. force_bound_r ) THEN328 IF ( bc_dirichlet_r ) THEN 334 329 DO i = 1, nbgp_local 335 330 ar(:,nxr_l+i) = ar(:,nxr_l) 336 331 ENDDO 337 332 ENDIF 338 IF ( nest_bound_s .OR. force_bound_s ) THEN333 IF ( bc_dirichlet_s ) THEN 339 334 DO i = nbgp_local, 1, -1 340 335 ar(nys_l-i,:) = ar(nys_l,:) 341 336 ENDDO 342 337 ENDIF 343 IF ( nest_bound_n .OR. force_bound_n ) THEN338 IF ( bc_dirichlet_n ) THEN 344 339 DO i = 1, nbgp_local 345 340 ar(nyn_l+i,:) = ar(nyn_l,:) -
palm/trunk/SOURCE/init_3d_model.f90
r3159 r3182 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Revise Inifor initialization 23 23 ! 24 24 ! Former revisions: … … 535 535 536 536 USE netcdf_data_input_mod, & 537 ONLY: init_3d, netcdf_data_input_in terpolate, netcdf_data_input_init_3d537 ONLY: init_3d, netcdf_data_input_init_3d 538 538 539 539 USE particle_attributes, & … … 611 611 REAL(wp) :: t_surface !< air temperature at the surface 612 612 613 REAL(wp), DIMENSION(:), ALLOCATABLE :: init_l !< dummy array used for averaging 3D data to obtain inital profiles 613 614 REAL(wp), DIMENSION(:), ALLOCATABLE :: p_hydrostatic !< hydrostatic pressure 614 615 … … 1006 1007 !-- Arrays to store velocity data from t-dt and the phase speeds which 1007 1008 !-- are needed for radiation boundary conditions 1008 IF ( outflow_l ) THEN1009 IF ( bc_radiation_l ) THEN 1009 1010 ALLOCATE( u_m_l(nzb:nzt+1,nysg:nyng,1:2), & 1010 1011 v_m_l(nzb:nzt+1,nysg:nyng,0:1), & 1011 1012 w_m_l(nzb:nzt+1,nysg:nyng,0:1) ) 1012 1013 ENDIF 1013 IF ( outflow_r ) THEN1014 IF ( bc_radiation_r ) THEN 1014 1015 ALLOCATE( u_m_r(nzb:nzt+1,nysg:nyng,nx-1:nx), & 1015 1016 v_m_r(nzb:nzt+1,nysg:nyng,nx-1:nx), & 1016 1017 w_m_r(nzb:nzt+1,nysg:nyng,nx-1:nx) ) 1017 1018 ENDIF 1018 IF ( outflow_l .OR. outflow_r ) THEN1019 IF ( bc_radiation_l .OR. bc_radiation_r ) THEN 1019 1020 ALLOCATE( c_u(nzb:nzt+1,nysg:nyng), c_v(nzb:nzt+1,nysg:nyng), & 1020 1021 c_w(nzb:nzt+1,nysg:nyng) ) 1021 1022 ENDIF 1022 IF ( outflow_s ) THEN1023 IF ( bc_radiation_s ) THEN 1023 1024 ALLOCATE( u_m_s(nzb:nzt+1,0:1,nxlg:nxrg), & 1024 1025 v_m_s(nzb:nzt+1,1:2,nxlg:nxrg), & 1025 1026 w_m_s(nzb:nzt+1,0:1,nxlg:nxrg) ) 1026 1027 ENDIF 1027 IF ( outflow_n ) THEN1028 IF ( bc_radiation_n ) THEN 1028 1029 ALLOCATE( u_m_n(nzb:nzt+1,ny-1:ny,nxlg:nxrg), & 1029 1030 v_m_n(nzb:nzt+1,ny-1:ny,nxlg:nxrg), & 1030 1031 w_m_n(nzb:nzt+1,ny-1:ny,nxlg:nxrg) ) 1031 1032 ENDIF 1032 IF ( outflow_s .OR. outflow_n ) THEN1033 IF ( bc_radiation_s .OR. bc_radiation_n ) THEN 1033 1034 ALLOCATE( c_u(nzb:nzt+1,nxlg:nxrg), c_v(nzb:nzt+1,nxlg:nxrg), & 1034 1035 c_w(nzb:nzt+1,nxlg:nxrg) ) 1035 1036 ENDIF 1036 IF ( outflow_l .OR. outflow_r .OR. outflow_s .OR. outflow_n ) THEN 1037 IF ( bc_radiation_l .OR. bc_radiation_r .OR. bc_radiation_s .OR. & 1038 bc_radiation_n ) THEN 1037 1039 ALLOCATE( c_u_m_l(nzb:nzt+1), c_v_m_l(nzb:nzt+1), c_w_m_l(nzb:nzt+1) ) 1038 1040 ALLOCATE( c_u_m(nzb:nzt+1), c_v_m(nzb:nzt+1), c_w_m(nzb:nzt+1) ) … … 1152 1154 sums_l_l = 0.0_wp 1153 1155 sums_wsts_bc_l = 0.0_wp 1154 1155 1156 1156 1157 1157 ! 1158 1158 !-- Initialize model variables … … 1169 1169 CALL netcdf_data_input_init_3d 1170 1170 ! 1171 !-- Please note, at the moment INIFOR assumes only an equidistant vertical 1172 !-- grid. In case of vertical grid stretching, input of inital data 1173 !-- need to be inter- and/or extrapolated. 1174 !-- Therefore, check if zu grid on file is identical to numeric zw grid. 1175 !-- Please note 1176 IF ( ANY( zu(1:nzt+1) /= init_3d%zu_atmos(1:init_3d%nzu) ) ) THEN 1177 1178 IF( init_3d%lod_u == 1 ) & 1179 CALL netcdf_data_input_interpolate( & 1180 init_3d%u_init(nzb+1:nzt+1), & 1181 zu(nzb+1:nzt+1), & 1182 init_3d%zu_atmos ) 1183 1184 IF( init_3d%lod_v == 1 ) & 1185 CALL netcdf_data_input_interpolate( & 1186 init_3d%v_init(nzb+1:nzt+1), & 1187 zu(nzb+1:nzt+1), & 1188 init_3d%zu_atmos ) 1189 1190 ! CALL netcdf_data_input_interpolate( init_3d%w_init(nzb+1:nzt), & 1191 ! zw(nzb+1:nzt), & 1192 ! init_3d%zw_atmos ) 1193 1194 IF ( .NOT. neutral .AND. init_3d%lod_pt == 1 ) & 1195 CALL netcdf_data_input_interpolate( & 1196 init_3d%pt_init(nzb+1:nzt+1), & 1197 zu(nzb+1:nzt+1), & 1198 init_3d%zu_atmos ) 1199 1200 IF ( humidity .AND. init_3d%lod_q == 1 ) & 1201 CALL netcdf_data_input_interpolate( & 1202 init_3d%q_init(nzb+1:nzt+1), & 1203 zu(nzb+1:nzt+1), & 1204 init_3d%zu_atmos ) 1205 ENDIF 1206 ! 1207 !-- In case of LOD=1, initialize 1D profiles and 3D data. 1208 IF( init_3d%lod_u == 1 ) u_init = init_3d%u_init 1209 IF( init_3d%lod_v == 1 ) v_init = init_3d%v_init 1210 IF( .NOT. neutral .AND. init_3d%lod_pt == 1 ) & 1211 pt_init = init_3d%pt_init 1212 IF( humidity .AND. init_3d%lod_q == 1 ) & 1213 q_init = init_3d%q_init 1214 1215 ! 1216 !-- Please note, Inifor provides data from nzb+1 to nzt+1. 1217 !-- Initialize pt and q with Neumann condition at nzb. 1218 IF( .NOT. neutral ) pt_init(nzb) = pt_init(nzb+1) 1219 IF( humidity ) q_init(nzb) = q_init(nzb+1) 1171 !-- Please note, Inifor provides data from nzb+1 to nzt. 1172 !-- Bottom and top boundary conditions for Inifor profiles are already 1173 !-- set (just after reading), so that this is not necessary here. 1174 !-- Depending on the provided level-of-detail, initial Inifor data is 1175 !-- either stored on data type (lod=1), or directly on 3D arrays (lod=2). 1176 !-- In order to obtain also initial profiles in case of lod=2 (which 1177 !-- is required for e.g. damping), average over 3D data. 1178 IF( init_3d%lod_u == 1 ) THEN 1179 u_init = init_3d%u_init 1180 ELSEIF( init_3d%lod_u == 2 ) THEN 1181 ALLOCATE( init_l(nzb:nzt+1) ) 1182 DO k = nzb, nzt+1 1183 init_l(k) = SUM( u(k,nys:nyn,nxl:nxr) ) 1184 ENDDO 1185 init_l = init_l / REAL( ( nx + 1 ) * ( ny + 1 ), KIND = wp ) 1186 1187 #if defined( __parallel ) 1188 CALL MPI_ALLREDUCE( init_l, u_init, nzt+1-nzb+1, & 1189 MPI_REAL, MPI_SUM, comm2d, ierr ) 1190 #else 1191 u_init = init_l 1192 #endif 1193 DEALLOCATE( init_l ) 1194 1195 ENDIF 1196 1197 IF( init_3d%lod_v == 1 ) THEN 1198 v_init = init_3d%v_init 1199 ELSEIF( init_3d%lod_v == 2 ) THEN 1200 ALLOCATE( init_l(nzb:nzt+1) ) 1201 DO k = nzb, nzt+1 1202 init_l(k) = SUM( v(k,nys:nyn,nxl:nxr) ) 1203 ENDDO 1204 init_l = init_l / REAL( ( nx + 1 ) * ( ny + 1 ), KIND = wp ) 1205 1206 #if defined( __parallel ) 1207 CALL MPI_ALLREDUCE( init_l, v_init, nzt+1-nzb+1, & 1208 MPI_REAL, MPI_SUM, comm2d, ierr ) 1209 #else 1210 v_init = init_l 1211 #endif 1212 DEALLOCATE( init_l ) 1213 ENDIF 1214 IF( .NOT. neutral ) THEN 1215 IF( init_3d%lod_pt == 1 ) THEN 1216 pt_init = init_3d%pt_init 1217 ELSEIF( init_3d%lod_pt == 2 ) THEN 1218 ALLOCATE( init_l(nzb:nzt+1) ) 1219 DO k = nzb, nzt+1 1220 init_l(k) = SUM( pt(k,nys:nyn,nxl:nxr) ) 1221 ENDDO 1222 init_l = init_l / REAL( ( nx + 1 ) * ( ny + 1 ), KIND = wp ) 1223 1224 #if defined( __parallel ) 1225 CALL MPI_ALLREDUCE( init_l, pt_init, nzt+1-nzb+1, & 1226 MPI_REAL, MPI_SUM, comm2d, ierr ) 1227 #else 1228 pt_init = init_l 1229 #endif 1230 DEALLOCATE( init_l ) 1231 ENDIF 1232 ENDIF 1233 1234 1235 IF( humidity ) THEN 1236 IF( init_3d%lod_q == 1 ) THEN 1237 q_init = init_3d%q_init 1238 ELSEIF( init_3d%lod_q == 2 ) THEN 1239 ALLOCATE( init_l(nzb:nzt+1) ) 1240 DO k = nzb, nzt+1 1241 init_l(k) = SUM( q(k,nys:nyn,nxl:nxr) ) 1242 ENDDO 1243 init_l = init_l / REAL( ( nx + 1 ) * ( ny + 1 ), KIND = wp ) 1244 1245 #if defined( __parallel ) 1246 CALL MPI_ALLREDUCE( init_l, q_init, nzt+1-nzb+1, & 1247 MPI_REAL, MPI_SUM, comm2d, ierr ) 1248 #else 1249 q_init = init_l 1250 #endif 1251 DEALLOCATE( init_l ) 1252 ENDIF 1253 ENDIF 1254 1255 ! 1256 !-- Write initial profiles onto 3D arrays. Note, only in case of lod = 1, 1257 !-- for lod = 2 data is already on 3D arrays. 1220 1258 DO i = nxlg, nxrg 1221 1259 DO j = nysg, nyng … … 1224 1262 IF( .NOT. neutral .AND. init_3d%lod_pt == 1 ) & 1225 1263 pt(:,j,i) = pt_init(:) 1226 IF( humidity .AND. init_3d%lod_q == 1 ) & 1227 q(:,j,i) = q_init(:) 1264 IF( humidity .AND. init_3d%lod_q == 1 ) q(:,j,i) = q_init(:) 1228 1265 ENDDO 1229 1266 ENDDO 1230 1267 ! 1231 !-- MS: What about the geostrophic wind profiles? Actually these 1232 !-- are not identical to the initial wind profiles in this case. 1233 !-- This need to be further revised. 1268 !-- Exchange ghost points in case of level-of-detail = 2 1269 IF( init_3d%lod_u == 2 ) CALL exchange_horiz( u, nbgp ) 1270 IF( init_3d%lod_v == 2 ) CALL exchange_horiz( v, nbgp ) 1271 IF( init_3d%lod_w == 2 ) CALL exchange_horiz( w, nbgp ) 1272 IF( .NOT. neutral .AND. init_3d%lod_pt == 2 ) & 1273 CALL exchange_horiz( pt, nbgp ) 1274 IF( humidity .AND. init_3d%lod_q == 2 ) & 1275 CALL exchange_horiz( q, nbgp ) 1276 ! 1277 !-- Set geostrophic wind components. 1234 1278 IF ( init_3d%from_file_ug ) THEN 1235 1279 ug(:) = init_3d%ug_init(:) … … 1238 1282 vg(:) = init_3d%vg_init(:) 1239 1283 ENDIF 1240 1284 1241 1285 ug(nzt+1) = ug(nzt) 1242 1286 vg(nzt+1) = vg(nzt) 1243 1244 1287 ! 1245 1288 !-- Set inital w to 0 … … 1815 1858 !-- Use these mean profiles at the inflow (provided that Dirichlet 1816 1859 !-- conditions are used) 1817 IF ( inflow_l ) THEN1860 IF ( bc_dirichlet_l ) THEN 1818 1861 DO j = nysg, nyng 1819 1862 DO k = nzb, nzt+1 … … 1963 2006 ! 1964 2007 !-- Initialize old timelevels needed for radiation boundary conditions 1965 IF ( outflow_l ) THEN2008 IF ( bc_radiation_l ) THEN 1966 2009 u_m_l(:,:,:) = u(:,:,1:2) 1967 2010 v_m_l(:,:,:) = v(:,:,0:1) 1968 2011 w_m_l(:,:,:) = w(:,:,0:1) 1969 2012 ENDIF 1970 IF ( outflow_r ) THEN2013 IF ( bc_radiation_r ) THEN 1971 2014 u_m_r(:,:,:) = u(:,:,nx-1:nx) 1972 2015 v_m_r(:,:,:) = v(:,:,nx-1:nx) 1973 2016 w_m_r(:,:,:) = w(:,:,nx-1:nx) 1974 2017 ENDIF 1975 IF ( outflow_s ) THEN2018 IF ( bc_radiation_s ) THEN 1976 2019 u_m_s(:,:,:) = u(:,0:1,:) 1977 2020 v_m_s(:,:,:) = v(:,1:2,:) 1978 2021 w_m_s(:,:,:) = w(:,0:1,:) 1979 2022 ENDIF 1980 IF ( outflow_n ) THEN2023 IF ( bc_radiation_n ) THEN 1981 2024 u_m_n(:,:,:) = u(:,ny-1:ny,:) 1982 2025 v_m_n(:,:,:) = v(:,ny-1:ny,:) … … 2301 2344 !-- Initialize nudging if required 2302 2345 IF ( nudging ) CALL nudge_init 2303 2304 2346 ! 2305 2347 !-- Initialize 1D/3D offline-nesting with COSMO model and read data from 2306 2348 !-- external file. 2307 IF ( large_scale_forcing .OR. forcing ) CALL lsf_init 2308 2349 IF ( large_scale_forcing .OR. nesting_offline ) CALL lsf_init 2309 2350 ! 2310 2351 !-- Initialize surface forcing corresponding to large-scale forcing. Therein, -
palm/trunk/SOURCE/init_grid.f90
r3142 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Rename variables in mesoscale-offline nesting mode 23 23 ! 24 24 ! Former revisions: … … 342 342 343 343 USE control_parameters, & 344 ONLY: bc_lr_cyc, bc_ns_cyc, building_height, building_length_x, & 344 ONLY: bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 345 bc_dirichlet_s, bc_lr_cyc, bc_ns_cyc, bc_radiation_l, & 346 bc_radiation_n, bc_radiation_r, bc_radiation_s, & 347 building_height, building_length_x, & 345 348 building_length_y, building_wall_left, building_wall_south, & 346 349 canyon_height, canyon_wall_left, canyon_wall_south, & … … 350 353 dz_stretch_level_end_index, dz_stretch_level_start_index, & 351 354 dz_stretch_level_start, grid_level, & 352 force_bound_l, force_bound_r, force_bound_n, force_bound_s, & 353 ibc_uv_b, inflow_l, inflow_n, inflow_r, inflow_s, & 354 masking_method, maximum_grid_level, message_string, & 355 momentum_advec, nest_domain, nest_bound_l, & 356 nest_bound_n, nest_bound_r, nest_bound_s, & 357 number_stretch_level_end, number_stretch_level_start, ocean, & 358 outflow_l, outflow_n, outflow_r, outflow_s, psolver, & 359 scalar_advec, topography, topography_grid_convention, & 360 tunnel_height, tunnel_length, tunnel_width_x, tunnel_width_y, & 355 ibc_uv_b, masking_method, maximum_grid_level, message_string, & 356 momentum_advec, number_stretch_level_end, & 357 number_stretch_level_start,ocean, psolver, scalar_advec, & 358 topography, topography_grid_convention, tunnel_height, & 359 tunnel_length, tunnel_width_x, tunnel_width_y, & 361 360 tunnel_wall_depth, use_surface_fluxes, use_top_fluxes, & 362 361 wall_adjustment_factor … … 386 385 IMPLICIT NONE 387 386 388 INTEGER(iwp) :: i !< index variable along x 389 INTEGER(iwp) :: j !< index variable along y 390 INTEGER(iwp) :: k !< index variable along z 391 INTEGER(iwp) :: k_top !< topography top index on local PE 392 INTEGER(iwp) :: n !< loop variable for stretching 393 INTEGER(iwp) :: number_dz !< number of user-specified dz values 394 INTEGER(iwp) :: nzb_local_max !< vertical grid index of maximum topography height 395 INTEGER(iwp) :: nzb_local_min !< vertical grid index of minimum topography height 387 INTEGER(iwp) :: i !< index variable along x 388 INTEGER(iwp) :: j !< index variable along y 389 INTEGER(iwp) :: k !< index variable along z 390 INTEGER(iwp) :: k_top !< topography top index on local PE 391 INTEGER(iwp) :: l !< loop variable 392 INTEGER(iwp) :: n !< loop variable for stretching 393 INTEGER(iwp) :: number_dz !< number of user-specified dz values 394 INTEGER(iwp) :: nzb_local_max !< vertical grid index of maximum topography height 395 INTEGER(iwp) :: nzb_local_min !< vertical grid index of minimum topography height 396 396 397 397 INTEGER(iwp), DIMENSION(:,:), ALLOCATABLE :: nzb_local !< index for topography top at cell-center … … 834 834 nzb_max = k_top + 1 835 835 #endif 836 IF ( inflow_l .OR. outflow_l .OR. force_bound_l .OR. nest_bound_l .OR.&837 inflow_r .OR. outflow_r .OR. force_bound_r .OR. nest_bound_r .OR.&838 inflow_n .OR. outflow_n .OR. force_bound_n .OR. nest_bound_n .OR.&839 inflow_s .OR. outflow_s .OR. force_bound_s .OR. nest_bound_s )&836 IF ( bc_dirichlet_l .OR. bc_radiation_l .OR. & 837 bc_dirichlet_r .OR. bc_radiation_r .OR. & 838 bc_dirichlet_n .OR. bc_radiation_n .OR. & 839 bc_dirichlet_s .OR. bc_radiation_s ) & 840 840 nzb_max = nzt 841 841 ! 842 842 !-- Finally, if topography extents up to the model top, limit nzb_max to nzt. 843 nzb_max = MIN( nzb_max, nzt ) 843 nzb_max = MIN( nzb_max, nzt ) 844 844 ! 845 845 !-- Determine minimum index of topography. Usually, this will be nzb. In case … … 857 857 !-- Initialize boundary conditions via surface type 858 858 CALL init_bc 859 859 860 ! 860 861 !-- Allocate and set topography height arrays required for data output … … 926 927 #if defined( __parallel ) 927 928 CALL MPI_ALLREDUCE( MAXVAL( get_topography_top_index( 's' ) ), & 928 nzb_local_max, 1, MPI_INTEGER, MPI_MAX, comm2d, ierr ) 929 nzb_local_max, 1, MPI_INTEGER, MPI_MAX, comm2d, ierr ) 929 930 #else 930 931 nzb_local_max = MAXVAL( get_topography_top_index( 's' ) ) -
palm/trunk/SOURCE/init_pegrid.f90
r3058 r3182 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Rename variables and boundary conditions in mesoscale-offline nesting mode 23 23 ! 24 24 ! Former revisions: … … 239 239 240 240 USE control_parameters, & 241 ONLY: bc_lr, bc_ns, coupling_mode, coupling_mode_remote, & 242 coupling_topology, force_bound_l, force_bound_n, force_bound_r, & 243 force_bound_s, gathered_size, grid_level, & 244 grid_level_count, inflow_l, inflow_n, inflow_r, inflow_s, & 245 maximum_grid_level, message_string, & 246 mg_switch_to_pe0_level, momentum_advec, nest_bound_l, & 247 nest_bound_n, nest_bound_r, nest_bound_s, nest_domain, neutral, & 248 psolver, outflow_l, outflow_n, outflow_r, outflow_s, & 249 outflow_source_plane, recycling_width, scalar_advec, & 241 ONLY: bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, bc_dirichlet_s, & 242 bc_lr, bc_ns, bc_radiation_l, bc_radiation_n, bc_radiation_r, & 243 bc_radiation_s, coupling_mode, coupling_mode_remote, & 244 coupling_topology, gathered_size, grid_level, & 245 grid_level_count, maximum_grid_level, message_string, & 246 mg_switch_to_pe0_level, momentum_advec, neutral, & 247 psolver, outflow_source_plane, recycling_width, scalar_advec, & 250 248 subdomain_size, turbulent_outflow, y_shift 251 249 … … 1232 1230 !-- Setting of flags for inflow/outflow/nesting conditions. 1233 1231 IF ( pleft == MPI_PROC_NULL ) THEN 1234 IF ( bc_lr == 'dirichlet/radiation' ) THEN 1235 inflow_l = .TRUE. 1232 IF ( bc_lr == 'dirichlet/radiation' .OR. bc_lr == 'nested' .OR. & 1233 bc_lr == 'nesting_offline' ) THEN 1234 bc_dirichlet_l = .TRUE. 1236 1235 ELSEIF ( bc_lr == 'radiation/dirichlet' ) THEN 1237 outflow_l = .TRUE. 1238 ELSEIF ( bc_lr == 'nested' ) THEN 1239 nest_bound_l = .TRUE. 1240 ELSEIF ( bc_lr == 'forcing' ) THEN 1241 force_bound_l = .TRUE. 1236 bc_radiation_l = .TRUE. 1242 1237 ENDIF 1243 1238 ENDIF … … 1245 1240 IF ( pright == MPI_PROC_NULL ) THEN 1246 1241 IF ( bc_lr == 'dirichlet/radiation' ) THEN 1247 outflow_r = .TRUE. 1248 ELSEIF ( bc_lr == 'radiation/dirichlet' ) THEN 1249 inflow_r = .TRUE. 1250 ELSEIF ( bc_lr == 'nested' ) THEN 1251 nest_bound_r = .TRUE. 1252 ELSEIF ( bc_lr == 'forcing' ) THEN 1253 force_bound_r = .TRUE. 1242 bc_radiation_r = .TRUE. 1243 ELSEIF ( bc_lr == 'radiation/dirichlet' .OR. bc_lr == 'nested' .OR. & 1244 bc_lr == 'nesting_offline' ) THEN 1245 bc_dirichlet_r = .TRUE. 1254 1246 ENDIF 1255 1247 ENDIF … … 1257 1249 IF ( psouth == MPI_PROC_NULL ) THEN 1258 1250 IF ( bc_ns == 'dirichlet/radiation' ) THEN 1259 outflow_s = .TRUE. 1251 bc_radiation_s = .TRUE. 1252 ELSEIF ( bc_ns == 'radiation/dirichlet' .OR. bc_ns == 'nested' .OR. & 1253 bc_ns == 'nesting_offline' ) THEN 1254 bc_dirichlet_s = .TRUE. 1255 ENDIF 1256 ENDIF 1257 1258 IF ( pnorth == MPI_PROC_NULL ) THEN 1259 IF ( bc_ns == 'dirichlet/radiation' .OR. bc_ns == 'nested' .OR. & 1260 bc_ns == 'nesting_offline' ) THEN 1261 bc_dirichlet_n = .TRUE. 1260 1262 ELSEIF ( bc_ns == 'radiation/dirichlet' ) THEN 1261 inflow_s = .TRUE. 1262 ELSEIF ( bc_ns == 'nested' ) THEN 1263 nest_bound_s = .TRUE. 1264 ELSEIF ( bc_ns == 'forcing' ) THEN 1265 force_bound_s = .TRUE. 1266 ENDIF 1267 ENDIF 1268 1269 IF ( pnorth == MPI_PROC_NULL ) THEN 1270 IF ( bc_ns == 'dirichlet/radiation' ) THEN 1271 inflow_n = .TRUE. 1272 ELSEIF ( bc_ns == 'radiation/dirichlet' ) THEN 1273 outflow_n = .TRUE. 1274 ELSEIF ( bc_ns == 'nested' ) THEN 1275 nest_bound_n = .TRUE. 1276 ELSEIF ( bc_ns == 'forcing' ) THEN 1277 force_bound_n = .TRUE. 1263 bc_radiation_n = .TRUE. 1278 1264 ENDIF 1279 1265 ENDIF … … 1283 1269 !-- only at the left lateral boundary. 1284 1270 IF ( use_syn_turb_gen ) THEN 1285 IF ( force_bound_l .OR. nest_bound_l .OR. inflow_l ) THEN1271 IF ( bc_dirichlet_l ) THEN 1286 1272 id_stg_left_l = myidx 1287 1273 ELSE 1288 1274 id_stg_left_l = 0 1289 1275 ENDIF 1290 IF ( force_bound_r .OR. nest_bound_r ) THEN1276 IF ( bc_dirichlet_r ) THEN 1291 1277 id_stg_right_l = myidx 1292 1278 ELSE 1293 1279 id_stg_right_l = 0 1294 1280 ENDIF 1295 IF ( force_bound_s .OR. nest_bound_s ) THEN1281 IF ( bc_dirichlet_s ) THEN 1296 1282 id_stg_south_l = myidy 1297 1283 ELSE 1298 1284 id_stg_south_l = 0 1299 1285 ENDIF 1300 IF ( force_bound_n .OR. nest_bound_n ) THEN1286 IF ( bc_dirichlet_n ) THEN 1301 1287 id_stg_north_l = myidy 1302 1288 ELSE … … 1324 1310 ! 1325 1311 !-- Broadcast the id of the inflow PE 1326 IF ( inflow_l ) THEN1312 IF ( bc_dirichlet_l ) THEN 1327 1313 id_inflow_l = myidx 1328 1314 ELSE … … 1350 1336 IF ( turbulent_outflow ) THEN 1351 1337 1352 IF ( outflow_r ) THEN1338 IF ( bc_radiation_r ) THEN 1353 1339 id_outflow_l = myidx 1354 1340 ELSE … … 1375 1361 #else 1376 1362 IF ( bc_lr == 'dirichlet/radiation' ) THEN 1377 inflow_l= .TRUE.1378 outflow_r = .TRUE.1363 bc_dirichlet_l = .TRUE. 1364 bc_radiation_r = .TRUE. 1379 1365 ELSEIF ( bc_lr == 'radiation/dirichlet' ) THEN 1380 outflow_l = .TRUE.1381 inflow_r= .TRUE.1366 bc_radiation_l = .TRUE. 1367 bc_dirichlet_r = .TRUE. 1382 1368 ENDIF 1383 1369 1384 1370 IF ( bc_ns == 'dirichlet/radiation' ) THEN 1385 inflow_n= .TRUE.1386 outflow_s = .TRUE.1371 bc_dirichlet_n = .TRUE. 1372 bc_radiation_s = .TRUE. 1387 1373 ELSEIF ( bc_ns == 'radiation/dirichlet' ) THEN 1388 outflow_n = .TRUE.1389 inflow_s= .TRUE.1374 bc_radiation_n = .TRUE. 1375 bc_dirichlet_s = .TRUE. 1390 1376 ENDIF 1391 1377 #endif … … 1394 1380 !-- At the inflow or outflow, u or v, respectively, have to be calculated for 1395 1381 !-- one more grid point. 1396 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l ) THEN1382 IF ( bc_dirichlet_l .OR. bc_radiation_l ) THEN 1397 1383 nxlu = nxl + 1 1398 1384 ELSE 1399 1385 nxlu = nxl 1400 1386 ENDIF 1401 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s ) THEN1387 IF ( bc_dirichlet_s .OR. bc_radiation_s ) THEN 1402 1388 nysv = nys + 1 1403 1389 ELSE -
palm/trunk/SOURCE/large_scale_forcing_nudging_mod.f90
r3049 r3182 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! * Adjustment to new Inifor version: 23 ! - No vertical interpolation/extrapolation of lateral boundary data required 24 ! any more (Inifor can treat grid stretching now 25 ! - Revise initialization in case of COSMO forcing 26 ! * Rename variables and subroutines for offline nesting 23 27 ! 24 28 ! Former revisions: … … 69 73 70 74 USE arrays_3d, & 71 ONLY: dzw, e, heatflux_input_conversion, pt, pt_init, q, q_init, s,&72 tend, u, u_init, ug, v, v_init, vg, w, w_subs,&75 ONLY: dzw, e, diss, heatflux_input_conversion, pt, pt_init, q, & 76 q_init, s, tend, u, u_init, ug, v, v_init, vg, w, w_subs, & 73 77 waterflux_input_conversion, zu, zw 74 78 75 79 USE control_parameters, & 76 ONLY: bc_lr, bc_ns, bc_pt_b, bc_q_b, constant_diffusion, & 80 ONLY: bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, bc_dirichlet_s, & 81 bc_lr, bc_ns, bc_pt_b, bc_q_b, constant_diffusion, & 77 82 constant_heatflux, constant_waterflux, & 78 data_output_pr, dt_3d, end_time, forcing, & 79 force_bound_l, force_bound_n, force_bound_r, force_bound_s, & 83 data_output_pr, dt_3d, end_time, & 80 84 humidity, initializing_actions, intermediate_timestep_count, & 81 85 ibc_pt_b, ibc_q_b, & 82 86 large_scale_forcing, large_scale_subsidence, lsf_surf, lsf_vert,& 83 lsf_exception, message_string, ne utral, nudging, passive_scalar,&84 pt_surface, ocean, q_surface, surface_heatflux,&85 surface_ pressure, surface_waterflux, topography,&86 use_subsidence_tendencies87 lsf_exception, message_string, nesting_offline, neutral, & 88 nudging, passive_scalar, pt_surface, ocean, q_surface, & 89 surface_heatflux, surface_pressure, surface_waterflux, & 90 topography, use_subsidence_tendencies 87 91 88 92 USE grid_variables 89 90 USE pegrid91 93 92 94 USE indices, & … … 96 98 USE kinds 97 99 100 USE netcdf_data_input_mod, & 101 ONLY: nest_offl 102 103 USE pegrid 104 98 105 USE surface_mod, & 99 106 ONLY: surf_def_h, surf_lsm_h, surf_usm_h … … 101 108 USE statistics, & 102 109 ONLY: hom, statistic_regions, sums_ls_l, weight_substep 103 104 USE netcdf_data_input_mod, &105 ONLY: force, netcdf_data_input_interpolate106 110 107 111 INTEGER(iwp) :: nlsf = 1000 !< maximum number of profiles in LSF_DATA (large scale forcing) … … 140 144 ! 141 145 !-- Public subroutines 142 PUBLIC ls_forcing_surf, ls_forcing_vert, ls_advec, lsf_init,&146 PUBLIC calc_tnudge, ls_forcing_surf, ls_forcing_vert, ls_advec, lsf_init, & 143 147 lsf_nudging_check_parameters, nudge_init, & 144 148 lsf_nudging_check_data_output_pr, lsf_nudging_header, & 145 calc_tnudge, nudge, nudge_ref, forcing_bc_mass_conservation, & 146 forcing_bc 149 lsf_nesting_offline, lsf_nesting_offline_mass_conservation, & 150 nudge, nudge_ref 151 147 152 ! 148 153 !-- Public variables 149 154 PUBLIC qsws_surf, shf_surf, td_lsa_lpt, td_lsa_q, td_sub_lpt, & 150 td_sub_q, time_vert , force155 td_sub_q, time_vert 151 156 152 157 … … 167 172 ! Description: 168 173 ! ------------ 169 !> @todo Missing subroutine description. 170 !------------------------------------------------------------------------------! 171 SUBROUTINE forcing_bc_mass_conservation 174 !> In this subroutine a constant mass within the model domain is guaranteed. 175 !> Larger-scale models may be based on a compressible equation system, which is 176 !> not consistent with PALMs incompressible equation system. In order to avoid 177 !> a decrease or increase of mass during the simulation, non-divergent flow 178 !> through the lateral and top boundaries is compensated by the vertical wind 179 !> component at the top boundary. 180 !------------------------------------------------------------------------------! 181 SUBROUTINE lsf_nesting_offline_mass_conservation 172 182 173 183 USE control_parameters, & … … 176 186 IMPLICIT NONE 177 187 178 INTEGER(iwp) :: i !< 179 INTEGER(iwp) :: j !< 180 INTEGER(iwp) :: k !< 181 182 REAL(wp) :: w_correct !<183 REAL(wp), DIMENSION(1:3) :: volume_flow_l !< 188 INTEGER(iwp) :: i !< grid index in x-direction 189 INTEGER(iwp) :: j !< grid index in y-direction 190 INTEGER(iwp) :: k !< grid index in z-direction 191 192 REAL(wp) :: w_correct !< vertical velocity increment required to compensate non-divergent flow through the boundaries 193 REAL(wp), DIMENSION(1:3) :: volume_flow_l !< local volume flow 184 194 185 195 volume_flow = 0.0_wp … … 188 198 d_area_t = 1.0_wp / ( ( nx + 1 ) * dx * ( ny + 1 ) * dy ) 189 199 190 IF ( force_bound_l ) THEN200 IF ( bc_dirichlet_l ) THEN 191 201 i = nxl 192 202 DO j = nys, nyn … … 198 208 ENDDO 199 209 ENDIF 200 IF ( force_bound_r ) THEN210 IF ( bc_dirichlet_r ) THEN 201 211 i = nxr+1 202 212 DO j = nys, nyn … … 208 218 ENDDO 209 219 ENDIF 210 IF ( force_bound_s ) THEN220 IF ( bc_dirichlet_s ) THEN 211 221 j = nys 212 222 DO i = nxl, nxr … … 218 228 ENDDO 219 229 ENDIF 220 IF ( force_bound_n ) THEN230 IF ( bc_dirichlet_n ) THEN 221 231 j = nyn+1 222 232 DO i = nxl, nxr … … 255 265 ENDDO 256 266 257 write(9,*) "w correction", w_correct 258 flush(9) 259 260 END SUBROUTINE forcing_bc_mass_conservation 267 END SUBROUTINE lsf_nesting_offline_mass_conservation 261 268 262 269 … … 264 271 ! Description: 265 272 ! ------------ 266 !> @todo Missing subroutine description. 267 !------------------------------------------------------------------------------! 268 SUBROUTINE forcing_bc 273 !> Set the lateral and top boundary conditions in case the PALM domain is 274 !> nested offline in a mesoscale model. 275 !------------------------------------------------------------------------------! 276 SUBROUTINE lsf_nesting_offline 269 277 270 278 USE control_parameters, & 271 ONLY: force_bound_l, force_bound_n, force_bound_r, force_bound_s, & 272 humidity, neutral, passive_scalar, simulated_time 273 274 USE netcdf_data_input_mod, & 275 ONLY: force 279 ONLY: bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 280 bc_dirichlet_s, humidity, neutral, passive_scalar, rans_mode,& 281 rans_tke_e, time_since_reference_point 276 282 277 283 IMPLICIT NONE … … 284 290 REAL(wp) :: ddt_lsf !< inverse value of time resolution of forcing data 285 291 REAL(wp) :: t_ref !< time past since last reference step 286 287 ! 288 !-- If required, interpolate and/or extrapolate data vertically. This is 289 !-- required as Inifor outputs only equidistant vertical data. 290 IF ( ANY( zu(1:nzt+1) /= force%zu_atmos(1:force%nzu) ) ) THEN 291 IF ( .NOT. force%interpolated ) THEN 292 293 DO t = 0, 1 294 IF ( force_bound_l ) THEN 295 CALL netcdf_data_input_interpolate( force%u_left(t,:,:), & 296 zu(nzb+1:nzt+1), & 297 force%zu_atmos ) 298 CALL netcdf_data_input_interpolate( force%v_left(t,:,:), & 299 zu(nzb+1:nzt+1), & 300 force%zu_atmos ) 301 CALL netcdf_data_input_interpolate( force%w_left(t,:,:), & 302 zw(nzb+1:nzt+1), & 303 force%zw_atmos ) 304 IF ( .NOT. neutral ) & 305 CALL netcdf_data_input_interpolate( force%pt_left(t,:,:),& 306 zu(nzb+1:nzt+1), & 307 force%zu_atmos ) 308 IF ( humidity ) & 309 CALL netcdf_data_input_interpolate( force%q_left(t,:,:), & 310 zu(nzb+1:nzt+1), & 311 force%zu_atmos ) 312 ENDIF 313 IF ( force_bound_r ) THEN 314 CALL netcdf_data_input_interpolate( force%u_right(t,:,:), & 315 zu(nzb+1:nzt+1), & 316 force%zu_atmos ) 317 CALL netcdf_data_input_interpolate( force%v_right(t,:,:), & 318 zu(nzb+1:nzt+1), & 319 force%zu_atmos ) 320 CALL netcdf_data_input_interpolate( force%w_right(t,:,:), & 321 zw(nzb+1:nzt+1), & 322 force%zw_atmos ) 323 IF ( .NOT. neutral ) & 324 CALL netcdf_data_input_interpolate( force%pt_right(t,:,:),& 325 zu(nzb+1:nzt+1), & 326 force%zu_atmos ) 327 IF ( humidity ) & 328 CALL netcdf_data_input_interpolate( force%q_right(t,:,:),& 329 zu(nzb+1:nzt+1), & 330 force%zu_atmos ) 331 ENDIF 332 IF ( force_bound_n ) THEN 333 CALL netcdf_data_input_interpolate( force%u_north(t,:,:), & 334 zu(nzb+1:nzt+1), & 335 force%zu_atmos ) 336 CALL netcdf_data_input_interpolate( force%v_north(t,:,:), & 337 zu(nzb+1:nzt+1), & 338 force%zu_atmos ) 339 CALL netcdf_data_input_interpolate( force%w_north(t,:,:), & 340 zw(nzb+1:nzt+1), & 341 force%zw_atmos ) 342 IF ( .NOT. neutral ) & 343 CALL netcdf_data_input_interpolate( force%pt_north(t,:,:),& 344 zu(nzb+1:nzt+1), & 345 force%zu_atmos ) 346 IF ( humidity ) & 347 CALL netcdf_data_input_interpolate( force%q_north(t,:,:),& 348 zu(nzb+1:nzt+1), & 349 force%zu_atmos ) 350 ENDIF 351 IF ( force_bound_s ) THEN 352 CALL netcdf_data_input_interpolate( force%u_south(t,:,:), & 353 zu(nzb+1:nzt+1), & 354 force%zu_atmos ) 355 CALL netcdf_data_input_interpolate( force%v_south(t,:,:), & 356 zu(nzb+1:nzt+1), & 357 force%zu_atmos ) 358 CALL netcdf_data_input_interpolate( force%w_south(t,:,:), & 359 zw(nzb+1:nzt+1), & 360 force%zw_atmos ) 361 IF ( .NOT. neutral ) & 362 CALL netcdf_data_input_interpolate( force%pt_south(t,:,:),& 363 zu(nzb+1:nzt+1), & 364 force%zu_atmos ) 365 IF ( humidity ) & 366 CALL netcdf_data_input_interpolate( force%q_south(t,:,:),& 367 zu(nzb+1:nzt+1), & 368 force%zu_atmos ) 369 ENDIF 370 ENDDO 371 ! 372 !-- Note, no interpolation of top boundary. Just use initial value. 373 !-- No physical meaningful extrapolation possible if only one layer is 374 !-- given. 375 376 force%interpolated = .TRUE. 377 ENDIF 378 ENDIF 379 292 380 293 ! 381 294 !-- Calculate time interval of forcing data 382 ddt_lsf = 1.0_wp / ( force%time(force%tind_p) - force%time(force%tind) ) 295 ddt_lsf = 1.0_wp / ( nest_offl%time(nest_offl%tind_p) - & 296 nest_offl%time(nest_offl%tind) ) 383 297 ! 384 298 !-- Calculate reziproke time past since last reference step. Please note, 385 !-- as simulated time is still not updated, the actual time here is 386 !-- simulated time + dt_3d 387 t_ref = simulated_time + dt_3d - force%time(force%tind) 388 389 IF ( force_bound_l ) THEN 390 391 DO j = nys, nyn 392 DO k = nzb+1, nzt+1 393 u(k,j,nxlg:nxl) = force%u_left(0,k,j) + ddt_lsf * t_ref * & 394 ( force%u_left(1,k,j) - force%u_left(0,k,j) ) * & 395 MERGE( 1.0_wp, 0.0_wp, & 396 BTEST( wall_flags_0(k,j,nxlg:nxl), 1 ) ) 397 ENDDO 398 ENDDO 299 !-- the time coordinate is still not updated, so that the actual time need 300 !-- to be incremented by dt_3d. Moreover, note that the simulation time 301 !-- passed since simulation start is time_since_reference_point, not 302 !-- simulated_time! 303 t_ref = time_since_reference_point + dt_3d - & 304 nest_offl%time(nest_offl%tind) 305 306 IF ( bc_dirichlet_l ) THEN 399 307 400 308 DO j = nys, nyn 401 309 DO k = nzb+1, nzt 402 w(k,j,nxlg:nxl-1) = force%w_left(0,k,j) + ddt_lsf * t_ref * & 403 ( force%w_left(1,k,j) - force%w_left(0,k,j) ) * & 404 MERGE( 1.0_wp, 0.0_wp, & 405 BTEST( wall_flags_0(k,j,nxlg:nxl-1), 3 ) ) 310 u(k,j,nxlg:nxl) = nest_offl%u_left(0,k,j) + ddt_lsf * t_ref * & 311 ( nest_offl%u_left(1,k,j) - nest_offl%u_left(0,k,j) ) * & 312 MERGE( 1.0_wp, 0.0_wp, & 313 BTEST( wall_flags_0(k,j,nxlg:nxl), 1 ) ) 314 ENDDO 315 ENDDO 316 317 DO j = nys, nyn 318 DO k = nzb+1, nzt-1 319 w(k,j,nxlg:nxl-1) = nest_offl%w_left(0,k,j) + ddt_lsf * t_ref *& 320 ( nest_offl%w_left(1,k,j) - nest_offl%w_left(0,k,j) ) *& 321 MERGE( 1.0_wp, 0.0_wp, & 322 BTEST( wall_flags_0(k,j,nxlg:nxl-1), 3 ) ) 406 323 ENDDO 407 324 ENDDO 408 325 409 326 DO j = nysv, nyn 410 DO k = nzb+1, nzt +1411 v(k,j,nxlg:nxl-1) = force%v_left(0,k,j) + ddt_lsf * t_ref *&412 ( force%v_left(1,k,j) - force%v_left(0,k,j) ) *&413 MERGE( 1.0_wp, 0.0_wp,&414 327 DO k = nzb+1, nzt 328 v(k,j,nxlg:nxl-1) = nest_offl%v_left(0,k,j) + ddt_lsf * t_ref *& 329 ( nest_offl%v_left(1,k,j) - nest_offl%v_left(0,k,j) ) *& 330 MERGE( 1.0_wp, 0.0_wp, & 331 BTEST( wall_flags_0(k,j,nxlg:nxl-1), 2 ) ) 415 332 ENDDO 416 333 ENDDO … … 418 335 IF ( .NOT. neutral ) THEN 419 336 DO j = nys, nyn 420 DO k = nzb+1, nzt +1421 pt(k,j,nxlg:nxl-1) = force%pt_left(0,k,j) + ddt_lsf *&422 t_ref *&423 ( force%pt_left(1,k,j) - force%pt_left(0,k,j) )337 DO k = nzb+1, nzt 338 pt(k,j,nxlg:nxl-1) = nest_offl%pt_left(0,k,j) + ddt_lsf * & 339 t_ref * & 340 ( nest_offl%pt_left(1,k,j) - nest_offl%pt_left(0,k,j) ) 424 341 425 342 ENDDO … … 429 346 IF ( humidity ) THEN 430 347 DO j = nys, nyn 431 DO k = nzb+1, nzt +1432 q(k,j,nxlg:nxl-1) = force%q_left(0,k,j) + ddt_lsf *&433 t_ref *&434 ( force%q_left(1,k,j) - force%q_left(0,k,j) )348 DO k = nzb+1, nzt 349 q(k,j,nxlg:nxl-1) = nest_offl%q_left(0,k,j) + ddt_lsf * & 350 t_ref * & 351 ( nest_offl%q_left(1,k,j) - nest_offl%q_left(0,k,j) ) 435 352 436 353 ENDDO … … 440 357 ENDIF 441 358 442 IF ( force_bound_r ) THEN 443 444 DO j = nys, nyn 445 DO k = nzb+1, nzt+1 446 u(k,j,nxr+1:nxrg) = force%u_right(0,k,j) + ddt_lsf * t_ref * & 447 ( force%u_right(1,k,j) - force%u_right(0,k,j) ) * & 448 MERGE( 1.0_wp, 0.0_wp, & 449 BTEST( wall_flags_0(k,j,nxr+1:nxrg), 1 ) ) 450 451 ENDDO 452 ENDDO 359 IF ( bc_dirichlet_r ) THEN 360 453 361 DO j = nys, nyn 454 362 DO k = nzb+1, nzt 455 w(k,j,nxr+1:nxrg) = force%w_right(0,k,j) + ddt_lsf * t_ref * & 456 ( force%w_right(1,k,j) - force%w_right(0,k,j) ) * & 457 MERGE( 1.0_wp, 0.0_wp, & 458 BTEST( wall_flags_0(k,j,nxr+1:nxrg), 3 ) ) 363 u(k,j,nxr+1:nxrg) = nest_offl%u_right(0,k,j) + ddt_lsf * t_ref *& 364 ( nest_offl%u_right(1,k,j) - nest_offl%u_right(0,k,j) ) *& 365 MERGE( 1.0_wp, 0.0_wp, & 366 BTEST( wall_flags_0(k,j,nxr+1:nxrg), 1 ) ) 367 368 ENDDO 369 ENDDO 370 DO j = nys, nyn 371 DO k = nzb+1, nzt-1 372 w(k,j,nxr+1:nxrg) = nest_offl%w_right(0,k,j) + ddt_lsf * t_ref *& 373 ( nest_offl%w_right(1,k,j) - nest_offl%w_right(0,k,j) ) *& 374 MERGE( 1.0_wp, 0.0_wp, & 375 BTEST( wall_flags_0(k,j,nxr+1:nxrg), 3 ) ) 459 376 ENDDO 460 377 ENDDO 461 378 462 379 DO j = nysv, nyn 463 DO k = nzb+1, nzt +1464 v(k,j,nxr+1:nxrg) = force%v_right(0,k,j) + ddt_lsf * t_ref *&465 ( force%v_right(1,k,j) - force%v_right(0,k,j) ) *&466 MERGE( 1.0_wp, 0.0_wp,&467 380 DO k = nzb+1, nzt 381 v(k,j,nxr+1:nxrg) = nest_offl%v_right(0,k,j) + ddt_lsf * t_ref *& 382 ( nest_offl%v_right(1,k,j) - nest_offl%v_right(0,k,j) ) *& 383 MERGE( 1.0_wp, 0.0_wp, & 384 BTEST( wall_flags_0(k,j,nxr+1:nxrg), 2 ) ) 468 385 ENDDO 469 386 ENDDO … … 471 388 IF ( .NOT. neutral ) THEN 472 389 DO j = nys, nyn 473 DO k = nzb+1, nzt +1474 pt(k,j,nxr+1:nxrg) = force%pt_right(0,k,j) + ddt_lsf *&475 t_ref *&476 ( force%pt_right(1,k,j) - force%pt_right(0,k,j) )390 DO k = nzb+1, nzt 391 pt(k,j,nxr+1:nxrg) = nest_offl%pt_right(0,k,j) + ddt_lsf * & 392 t_ref * & 393 ( nest_offl%pt_right(1,k,j) - nest_offl%pt_right(0,k,j) ) 477 394 478 395 ENDDO … … 482 399 IF ( humidity ) THEN 483 400 DO j = nys, nyn 484 DO k = nzb+1, nzt +1485 q(k,j,nxr+1:nxrg) = force%q_right(0,k,j) + ddt_lsf *&486 t_ref *&487 ( force%q_right(1,k,j) - force%q_right(0,k,j) )401 DO k = nzb+1, nzt 402 q(k,j,nxr+1:nxrg) = nest_offl%q_right(0,k,j) + ddt_lsf * & 403 t_ref * & 404 ( nest_offl%q_right(1,k,j) - nest_offl%q_right(0,k,j) ) 488 405 489 406 ENDDO … … 493 410 ENDIF 494 411 495 IF ( force_bound_s ) THEN 496 497 DO i = nxl, nxr 498 DO k = nzb+1, nzt+1 499 v(k,nysg:nys,i) = force%v_south(0,k,i) + ddt_lsf * t_ref * & 500 ( force%v_south(1,k,i) - force%v_south(0,k,i) ) * & 501 MERGE( 1.0_wp, 0.0_wp, & 502 BTEST( wall_flags_0(k,nysg:nys,i), 2 ) ) 503 ENDDO 504 ENDDO 412 IF ( bc_dirichlet_s ) THEN 505 413 506 414 DO i = nxl, nxr 507 415 DO k = nzb+1, nzt 508 w(k,nysg:nys-1,i) = force%w_south(0,k,i) + ddt_lsf * t_ref * & 509 ( force%w_south(1,k,i) - force%w_south(0,k,i) ) * & 510 MERGE( 1.0_wp, 0.0_wp, & 416 v(k,nysg:nys,i) = nest_offl%v_south(0,k,i) + ddt_lsf * t_ref *& 417 ( nest_offl%v_south(1,k,i) - nest_offl%v_south(0,k,i) ) *& 418 MERGE( 1.0_wp, 0.0_wp, & 419 BTEST( wall_flags_0(k,nysg:nys,i), 2 ) ) 420 ENDDO 421 ENDDO 422 423 DO i = nxl, nxr 424 DO k = nzb+1, nzt-1 425 w(k,nysg:nys-1,i) = nest_offl%w_south(0,k,i) + ddt_lsf * t_ref *& 426 ( nest_offl%w_south(1,k,i) - nest_offl%w_south(0,k,i) ) *& 427 MERGE( 1.0_wp, 0.0_wp, & 511 428 BTEST( wall_flags_0(k,nysg:nys-1,i), 3 ) ) 512 429 ENDDO … … 514 431 515 432 DO i = nxlu, nxr 516 DO k = nzb+1, nzt +1517 u(k,nysg:nys-1,i) = force%u_south(0,k,i) + ddt_lsf * t_ref *&518 ( force%u_south(1,k,i) - force%u_south(0,k,i) ) *&519 MERGE( 1.0_wp, 0.0_wp, &433 DO k = nzb+1, nzt 434 u(k,nysg:nys-1,i) = nest_offl%u_south(0,k,i) + ddt_lsf * t_ref *& 435 ( nest_offl%u_south(1,k,i) - nest_offl%u_south(0,k,i) ) *& 436 MERGE( 1.0_wp, 0.0_wp, & 520 437 BTEST( wall_flags_0(k,nysg:nys-1,i), 1 ) ) 521 438 ENDDO … … 524 441 IF ( .NOT. neutral ) THEN 525 442 DO i = nxl, nxr 526 DO k = nzb+1, nzt +1527 pt(k,nysg:nys-1,i) = force%pt_south(0,k,i) + ddt_lsf *&528 t_ref *&529 ( force%pt_south(1,k,i) - force%pt_south(0,k,i) )443 DO k = nzb+1, nzt 444 pt(k,nysg:nys-1,i) = nest_offl%pt_south(0,k,i) + ddt_lsf * & 445 t_ref * & 446 ( nest_offl%pt_south(1,k,i) - nest_offl%pt_south(0,k,i) ) 530 447 531 448 ENDDO … … 535 452 IF ( humidity ) THEN 536 453 DO i = nxl, nxr 537 DO k = nzb+1, nzt +1538 q(k,nysg:nys-1,i) = force%q_south(0,k,i) + ddt_lsf *&539 t_ref *&540 ( force%q_south(1,k,i) - force%q_south(0,k,i) )454 DO k = nzb+1, nzt 455 q(k,nysg:nys-1,i) = nest_offl%q_south(0,k,i) + ddt_lsf * & 456 t_ref * & 457 ( nest_offl%q_south(1,k,i) - nest_offl%q_south(0,k,i) ) 541 458 542 459 ENDDO … … 546 463 ENDIF 547 464 548 IF ( force_bound_n ) THEN 549 550 DO i = nxl, nxr 551 DO k = nzb+1, nzt+1 552 v(k,nyn+1:nyng,i) = force%v_north(0,k,i) + ddt_lsf * t_ref * & 553 ( force%v_north(1,k,i) - force%v_north(0,k,i) ) * & 554 MERGE( 1.0_wp, 0.0_wp, & 555 BTEST( wall_flags_0(k,nyn+1:nyng,i), 2 ) ) 556 ENDDO 557 ENDDO 465 IF ( bc_dirichlet_n ) THEN 466 558 467 DO i = nxl, nxr 559 468 DO k = nzb+1, nzt 560 w(k,nyn+1:nyng,i) = force%w_north(0,k,i) + ddt_lsf * t_ref * & 561 ( force%w_north(1,k,i) - force%w_north(0,k,i) ) * & 562 MERGE( 1.0_wp, 0.0_wp, & 469 v(k,nyn+1:nyng,i) = nest_offl%v_north(0,k,i) + ddt_lsf * t_ref *& 470 ( nest_offl%v_north(1,k,i) - nest_offl%v_north(0,k,i) ) *& 471 MERGE( 1.0_wp, 0.0_wp, & 472 BTEST( wall_flags_0(k,nyn+1:nyng,i), 2 ) ) 473 ENDDO 474 ENDDO 475 DO i = nxl, nxr 476 DO k = nzb+1, nzt-1 477 w(k,nyn+1:nyng,i) = nest_offl%w_north(0,k,i) + ddt_lsf * t_ref *& 478 ( nest_offl%w_north(1,k,i) - nest_offl%w_north(0,k,i) ) *& 479 MERGE( 1.0_wp, 0.0_wp, & 563 480 BTEST( wall_flags_0(k,nyn+1:nyng,i), 3 ) ) 564 481 ENDDO … … 566 483 567 484 DO i = nxlu, nxr 568 DO k = nzb+1, nzt +1569 u(k,nyn+1:nyng,i) = force%u_north(0,k,i) + ddt_lsf * t_ref *&570 ( force%u_north(1,k,i) - force%u_north(0,k,i) ) *&571 MERGE( 1.0_wp, 0.0_wp, &485 DO k = nzb+1, nzt 486 u(k,nyn+1:nyng,i) = nest_offl%u_north(0,k,i) + ddt_lsf * t_ref *& 487 ( nest_offl%u_north(1,k,i) - nest_offl%u_north(0,k,i) ) *& 488 MERGE( 1.0_wp, 0.0_wp, & 572 489 BTEST( wall_flags_0(k,nyn+1:nyng,i), 1 ) ) 573 490 … … 577 494 IF ( .NOT. neutral ) THEN 578 495 DO i = nxl, nxr 579 DO k = nzb+1, nzt +1580 pt(k,nyn+1:nyng,i) = force%pt_north(0,k,i) + ddt_lsf *&581 t_ref *&582 ( force%pt_north(1,k,i) - force%pt_north(0,k,i) )496 DO k = nzb+1, nzt 497 pt(k,nyn+1:nyng,i) = nest_offl%pt_north(0,k,i) + ddt_lsf * & 498 t_ref * & 499 ( nest_offl%pt_north(1,k,i) - nest_offl%pt_north(0,k,i) ) 583 500 584 501 ENDDO … … 588 505 IF ( humidity ) THEN 589 506 DO i = nxl, nxr 590 DO k = nzb+1, nzt +1591 q(k,nyn+1:nyng,i) = force%q_north(0,k,i) + ddt_lsf *&592 t_ref *&593 ( force%q_north(1,k,i) - force%q_north(0,k,i) )507 DO k = nzb+1, nzt 508 q(k,nyn+1:nyng,i) = nest_offl%q_north(0,k,i) + ddt_lsf * & 509 t_ref * & 510 ( nest_offl%q_north(1,k,i) - nest_offl%q_north(0,k,i) ) 594 511 595 512 ENDDO … … 600 517 ! 601 518 !-- Top boundary. 602 !-- Please note, only map Inifor data on model top in case the numeric is603 !-- identical to the Inifor grid. At the top boundary an extrapolation is604 !-- not possible.605 519 DO i = nxlu, nxr 606 520 DO j = nys, nyn 607 u(nzt+1,j,i) = force%u_top(0,j,i) + ddt_lsf * t_ref *&608 ( force%u_top(1,j,i) - force%u_top(0,j,i) ) *&609 MERGE( 1.0_wp, 0.0_wp, &521 u(nzt+1,j,i) = nest_offl%u_top(0,j,i) + ddt_lsf * t_ref * & 522 ( nest_offl%u_top(1,j,i) - nest_offl%u_top(0,j,i) ) * & 523 MERGE( 1.0_wp, 0.0_wp, & 610 524 BTEST( wall_flags_0(nzt+1,j,i), 1 ) ) 611 525 ENDDO … … 614 528 DO i = nxl, nxr 615 529 DO j = nysv, nyn 616 v(nzt+1,j,i) = force%v_top(0,j,i) + ddt_lsf * t_ref *&617 ( force%v_top(1,j,i) - force%v_top(0,j,i) ) *&530 v(nzt+1,j,i) = nest_offl%v_top(0,j,i) + ddt_lsf * t_ref * & 531 ( nest_offl%v_top(1,j,i) - nest_offl%v_top(0,j,i) ) * & 618 532 MERGE( 1.0_wp, 0.0_wp, & 619 533 BTEST( wall_flags_0(nzt+1,j,i), 2 ) ) … … 623 537 DO i = nxl, nxr 624 538 DO j = nys, nyn 625 w(nzt:nzt+1,j,i) = force%w_top(0,j,i) + ddt_lsf * t_ref *&626 ( force%w_top(1,j,i) - force%w_top(0,j,i) ) *&539 w(nzt:nzt+1,j,i) = nest_offl%w_top(0,j,i) + ddt_lsf * t_ref * & 540 ( nest_offl%w_top(1,j,i) - nest_offl%w_top(0,j,i) ) * & 627 541 MERGE( 1.0_wp, 0.0_wp, & 628 542 BTEST( wall_flags_0(nzt:nzt+1,j,i), 3 ) ) … … 634 548 DO i = nxl, nxr 635 549 DO j = nys, nyn 636 pt(nzt+1,j,i) = force%pt_top(0,j,i) + ddt_lsf * t_ref *&637 ( force%pt_top(1,j,i) - force%pt_top(0,j,i) )550 pt(nzt+1,j,i) = nest_offl%pt_top(0,j,i) + ddt_lsf * t_ref * & 551 ( nest_offl%pt_top(1,j,i) - nest_offl%pt_top(0,j,i) ) 638 552 ENDDO 639 553 ENDDO … … 643 557 DO i = nxl, nxr 644 558 DO j = nys, nyn 645 q(nzt+1,j,i) = force%q_top(0,j,i) + ddt_lsf * t_ref *&646 ( force%q_top(1,j,i) - force%q_top(0,j,i) )559 q(nzt+1,j,i) = nest_offl%q_top(0,j,i) + ddt_lsf * t_ref * & 560 ( nest_offl%q_top(1,j,i) - nest_offl%q_top(0,j,i) ) 647 561 ENDDO 648 562 ENDDO … … 651 565 !-- At the edges( left-south, left-north, right-south and right-north) set 652 566 !-- data on ghost points. 653 IF ( force_bound_l .AND. force_bound_s ) THEN567 IF ( bc_dirichlet_l .AND. bc_dirichlet_s ) THEN 654 568 DO i = 1, nbgp 655 569 u(:,nys-i,nxlg:nxl) = u(:,nys,nxlg:nxl) 656 570 w(:,nys-i,nxlg:nxl-1) = w(:,nys,nxlg:nxl-1) 657 571 IF ( .NOT. neutral ) pt(:,nys-i,nxlg:nxl-1) = pt(:,nys,nxlg:nxl-1) 658 IF ( humidity )q(:,nys-i,nxlg:nxl-1) = q(:,nys,nxlg:nxl-1)572 IF ( humidity ) q(:,nys-i,nxlg:nxl-1) = q(:,nys,nxlg:nxl-1) 659 573 ENDDO 660 574 DO i = 1, nbgp+1 … … 662 576 ENDDO 663 577 ENDIF 664 IF ( force_bound_l .AND. force_bound_n ) THEN578 IF ( bc_dirichlet_l .AND. bc_dirichlet_n ) THEN 665 579 DO i = 1, nbgp 666 580 u(:,nyn+i,nxlg:nxl) = u(:,nyn,nxlg:nxl) … … 668 582 w(:,nyn+i,nxlg:nxl-1) = w(:,nyn,nxlg:nxl-1) 669 583 IF ( .NOT. neutral ) pt(:,nyn+i,nxlg:nxl-1) = pt(:,nyn,nxlg:nxl-1) 670 IF ( humidity )q(:,nyn+i,nxlg:nxl-1) = q(:,nyn,nxlg:nxl-1)671 ENDDO 672 ENDIF 673 IF ( force_bound_r .AND. force_bound_s ) THEN584 IF ( humidity ) q(:,nyn+i,nxlg:nxl-1) = q(:,nyn,nxlg:nxl-1) 585 ENDDO 586 ENDIF 587 IF ( bc_dirichlet_r .AND. bc_dirichlet_s ) THEN 674 588 DO i = 1, nbgp 675 589 u(:,nys-i,nxr+1:nxrg) = u(:,nys,nxr+1:nxrg) 676 590 w(:,nys-i,nxr+1:nxrg) = w(:,nys,nxr+1:nxrg) 677 591 IF ( .NOT. neutral ) pt(:,nys-i,nxr+1:nxrg) = pt(:,nys,nxr+1:nxrg) 678 IF ( humidity )q(:,nys-i,nxr+1:nxrg) = q(:,nys,nxr+1:nxrg)592 IF ( humidity ) q(:,nys-i,nxr+1:nxrg) = q(:,nys,nxr+1:nxrg) 679 593 ENDDO 680 594 DO i = 1, nbgp+1 … … 682 596 ENDDO 683 597 ENDIF 684 IF ( force_bound_r .AND. force_bound_n ) THEN598 IF ( bc_dirichlet_r .AND. bc_dirichlet_n ) THEN 685 599 DO i = 1, nbgp 686 600 u(:,nyn+i,nxr+1:nxrg) = u(:,nyn,nxr+1:nxrg) … … 688 602 w(:,nyn+i,nxr+1:nxrg) = w(:,nyn,nxr+1:nxrg) 689 603 IF ( .NOT. neutral ) pt(:,nyn+i,nxr+1:nxrg) = pt(:,nyn,nxr+1:nxrg) 690 IF ( humidity ) q(:,nyn+i,nxr+1:nxrg) = q(:,nyn,nxr+1:nxrg) 691 ENDDO 692 ENDIF 693 ! 694 !-- Moreover, set Neumann boundary condition for subgrid-scale TKE and 695 !-- passive scalar 604 IF ( humidity ) q(:,nyn+i,nxr+1:nxrg) = q(:,nyn,nxr+1:nxrg) 605 ENDDO 606 ENDIF 607 ! 608 !-- Moreover, set Neumann boundary condition for subgrid-scale TKE, 609 !-- passive scalar, dissipation, and chemical species if required 610 IF ( rans_mode .AND. rans_tke_e ) THEN 611 IF ( bc_dirichlet_l ) diss(:,:,nxl-1) = diss(:,:,nxl) 612 IF ( bc_dirichlet_r ) diss(:,:,nxr+1) = diss(:,:,nxr) 613 IF ( bc_dirichlet_s ) diss(:,nys-1,:) = diss(:,nys,:) 614 IF ( bc_dirichlet_n ) diss(:,nyn+1,:) = diss(:,nyn,:) 615 ENDIF 696 616 IF ( .NOT. constant_diffusion ) THEN 697 IF ( force_bound_l ) e(:,:,nxl-1) = e(:,:,nxl)698 IF ( force_bound_r ) e(:,:,nxr+1) = e(:,:,nxr)699 IF ( force_bound_s ) e(:,nys-1,:) = e(:,nys,:)700 IF ( force_bound_n ) e(:,nyn+1,:) = e(:,nyn,:)617 IF ( bc_dirichlet_l ) e(:,:,nxl-1) = e(:,:,nxl) 618 IF ( bc_dirichlet_r ) e(:,:,nxr+1) = e(:,:,nxr) 619 IF ( bc_dirichlet_s ) e(:,nys-1,:) = e(:,nys,:) 620 IF ( bc_dirichlet_n ) e(:,nyn+1,:) = e(:,nyn,:) 701 621 e(nzt+1,:,:) = e(nzt,:,:) 702 622 ENDIF 703 623 IF ( passive_scalar ) THEN 704 IF ( force_bound_l ) s(:,:,nxl-1) = s(:,:,nxl) 705 IF ( force_bound_r ) s(:,:,nxr+1) = s(:,:,nxr) 706 IF ( force_bound_s ) s(:,nys-1,:) = s(:,nys,:) 707 IF ( force_bound_n ) s(:,nyn+1,:) = s(:,nyn,:) 708 ENDIF 624 IF ( bc_dirichlet_l ) s(:,:,nxl-1) = s(:,:,nxl) 625 IF ( bc_dirichlet_r ) s(:,:,nxr+1) = s(:,:,nxr) 626 IF ( bc_dirichlet_s ) s(:,nys-1,:) = s(:,nys,:) 627 IF ( bc_dirichlet_n ) s(:,nyn+1,:) = s(:,nyn,:) 628 ENDIF 629 709 630 710 631 … … 720 641 !-- treatment of fluxes. 721 642 !-- For the moment, comment this out! 722 ! surface_pressure = force%surface_pressure(force%tind) + &643 ! surface_pressure = nest_offl%surface_pressure(nest_offl%tind) + & 723 644 ! ddt_lsf * t_ref * & 724 ! ( force%surface_pressure(force%tind_p) &725 ! - force%surface_pressure(force%tind) )726 727 END SUBROUTINE forcing_bc645 ! ( nest_offl%surface_pressure(nest_offl%tind_p) & 646 ! - nest_offl%surface_pressure(nest_offl%tind) ) 647 648 END SUBROUTINE lsf_nesting_offline 728 649 729 650 !------------------------------------------------------------------------------! … … 1040 961 REAL(wp) :: r_dummy !< 1041 962 1042 IF ( forcing) THEN963 IF ( nesting_offline ) THEN 1043 964 ! 1044 965 !-- Allocate arrays for geostrophic wind components. Arrays will … … 1047 968 !-- case of cyclic boundary conditions. 1048 969 IF ( bc_lr_cyc .AND. bc_ns_cyc ) THEN 1049 ALLOCATE( force%ug(0:1,nzb:nzt+1) )1050 ALLOCATE( force%vg(0:1,nzb:nzt+1) )970 ALLOCATE( nest_offl%ug(0:1,nzb:nzt+1) ) 971 ALLOCATE( nest_offl%vg(0:1,nzb:nzt+1) ) 1051 972 ENDIF 1052 973 ! 1053 974 !-- Allocate arrays for reading boundary values. Arrays will incorporate 2 1054 975 !-- time levels in order to interpolate in between. 1055 IF ( force_bound_l ) THEN1056 ALLOCATE( force%u_left(0:1,nzb+1:nzt+1,nys:nyn) )1057 ALLOCATE( force%v_left(0:1,nzb+1:nzt+1,nysv:nyn) )1058 ALLOCATE( force%w_left(0:1,nzb+1:nzt,nys:nyn))1059 IF ( humidity ) ALLOCATE( force%q_left(0:1,nzb+1:nzt+1,nys:nyn) )1060 IF ( .NOT. neutral ) ALLOCATE( force%pt_left(0:1,nzb+1:nzt+1,nys:nyn) )1061 ENDIF 1062 IF ( force_bound_r ) THEN1063 ALLOCATE( force%u_right(0:1,nzb+1:nzt+1,nys:nyn) )1064 ALLOCATE( force%v_right(0:1,nzb+1:nzt+1,nysv:nyn) )1065 ALLOCATE( force%w_right(0:1,nzb+1:nzt,nys:nyn))1066 IF ( humidity ) ALLOCATE( force%q_right(0:1,nzb+1:nzt+1,nys:nyn) )1067 IF ( .NOT. neutral ) ALLOCATE( force%pt_right(0:1,nzb+1:nzt+1,nys:nyn) )1068 ENDIF 1069 IF ( force_bound_n ) THEN1070 ALLOCATE( force%u_north(0:1,nzb+1:nzt+1,nxlu:nxr) )1071 ALLOCATE( force%v_north(0:1,nzb+1:nzt+1,nxl:nxr) )1072 ALLOCATE( force%w_north(0:1,nzb+1:nzt,nxl:nxr))1073 IF ( humidity ) ALLOCATE( force%q_north(0:1,nzb+1:nzt+1,nxl:nxr) )1074 IF ( .NOT. neutral ) ALLOCATE( force%pt_north(0:1,nzb+1:nzt+1,nxl:nxr) )1075 ENDIF 1076 IF ( force_bound_s ) THEN1077 ALLOCATE( force%u_south(0:1,nzb+1:nzt+1,nxlu:nxr) )1078 ALLOCATE( force%v_south(0:1,nzb+1:nzt+1,nxl:nxr) )1079 ALLOCATE( force%w_south(0:1,nzb+1:nzt,nxl:nxr) )1080 IF ( humidity ) ALLOCATE( force%q_south(0:1,nzb+1:nzt+1,nxl:nxr) )1081 IF ( .NOT. neutral ) ALLOCATE( force%pt_south(0:1,nzb+1:nzt+1,nxl:nxr) )976 IF ( bc_dirichlet_l ) THEN 977 ALLOCATE( nest_offl%u_left(0:1,nzb+1:nzt,nys:nyn) ) 978 ALLOCATE( nest_offl%v_left(0:1,nzb+1:nzt,nysv:nyn) ) 979 ALLOCATE( nest_offl%w_left(0:1,nzb+1:nzt-1,nys:nyn) ) 980 IF ( humidity ) ALLOCATE( nest_offl%q_left(0:1,nzb+1:nzt,nys:nyn) ) 981 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_left(0:1,nzb+1:nzt,nys:nyn) ) 982 ENDIF 983 IF ( bc_dirichlet_r ) THEN 984 ALLOCATE( nest_offl%u_right(0:1,nzb+1:nzt,nys:nyn) ) 985 ALLOCATE( nest_offl%v_right(0:1,nzb+1:nzt,nysv:nyn) ) 986 ALLOCATE( nest_offl%w_right(0:1,nzb+1:nzt-1,nys:nyn) ) 987 IF ( humidity ) ALLOCATE( nest_offl%q_right(0:1,nzb+1:nzt,nys:nyn) ) 988 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_right(0:1,nzb+1:nzt,nys:nyn) ) 989 ENDIF 990 IF ( bc_dirichlet_n ) THEN 991 ALLOCATE( nest_offl%u_north(0:1,nzb+1:nzt,nxlu:nxr) ) 992 ALLOCATE( nest_offl%v_north(0:1,nzb+1:nzt,nxl:nxr) ) 993 ALLOCATE( nest_offl%w_north(0:1,nzb+1:nzt-1,nxl:nxr) ) 994 IF ( humidity ) ALLOCATE( nest_offl%q_north(0:1,nzb+1:nzt,nxl:nxr) ) 995 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_north(0:1,nzb+1:nzt,nxl:nxr) ) 996 ENDIF 997 IF ( bc_dirichlet_s ) THEN 998 ALLOCATE( nest_offl%u_south(0:1,nzb+1:nzt,nxlu:nxr) ) 999 ALLOCATE( nest_offl%v_south(0:1,nzb+1:nzt,nxl:nxr) ) 1000 ALLOCATE( nest_offl%w_south(0:1,nzb+1:nzt-1,nxl:nxr) ) 1001 IF ( humidity ) ALLOCATE( nest_offl%q_south(0:1,nzb+1:nzt,nxl:nxr) ) 1002 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_south(0:1,nzb+1:nzt,nxl:nxr) ) 1082 1003 ENDIF 1083 1004 1084 ALLOCATE( force%u_top(0:1,nys:nyn,nxlu:nxr) ) 1085 ALLOCATE( force%v_top(0:1,nysv:nyn,nxl:nxr) ) 1086 ALLOCATE( force%w_top(0:1,nys:nyn,nxl:nxr) ) 1087 IF ( humidity ) ALLOCATE( force%q_top(0:1,nys:nyn,nxl:nxr) ) 1088 IF ( .NOT. neutral ) ALLOCATE( force%pt_top(0:1,nys:nyn,nxl:nxr) ) 1089 1090 ! 1091 !-- Initial call of input. Time array, initial 3D data of u, v, w, 1092 !-- potential temperature, as well as mixing ratio, will be read. 1093 !-- Moreover, data at lateral and top boundary will be read. 1005 ALLOCATE( nest_offl%u_top(0:1,nys:nyn,nxlu:nxr) ) 1006 ALLOCATE( nest_offl%v_top(0:1,nysv:nyn,nxl:nxr) ) 1007 ALLOCATE( nest_offl%w_top(0:1,nys:nyn,nxl:nxr) ) 1008 IF ( humidity ) ALLOCATE( nest_offl%q_top(0:1,nys:nyn,nxl:nxr) ) 1009 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_top(0:1,nys:nyn,nxl:nxr) ) 1010 1011 ! 1012 !-- Read COSMO data at lateral and top boundaries 1094 1013 CALL netcdf_data_input_lsf 1095 1014 ! 1096 !-- Please note, at the moment INIFOR assumes only an equidistant vertical 1097 !-- grid. In case of vertical grid stretching, input of inital 3D data 1098 !-- need to be inter- and/or extrapolated. 1099 !-- Therefore, check if zw grid on file is identical to numeric zw grid. 1100 IF ( ANY( zu(1:nzt+1) /= force%zu_atmos(1:force%nzu) ) ) THEN 1101 ! 1102 !-- Also data at the boundaries need to be inter/extrapolated at both 1103 !-- time levels 1104 DO t = 0, 1 1105 IF ( force_bound_l ) THEN 1106 CALL netcdf_data_input_interpolate( force%u_left(t,:,:), & 1107 zu(1:nzt+1), & 1108 force%zu_atmos ) 1109 CALL netcdf_data_input_interpolate( force%v_left(t,:,:), & 1110 zu(1:nzt+1), & 1111 force%zu_atmos ) 1112 CALL netcdf_data_input_interpolate( force%w_left(t,:,:), & 1113 zw(1:nzt+1), & 1114 force%zw_atmos ) 1115 IF ( .NOT. neutral ) & 1116 CALL netcdf_data_input_interpolate( force%pt_left(t,:,:),& 1117 zu(1:nzt+1), & 1118 force%zu_atmos ) 1119 IF ( humidity ) & 1120 CALL netcdf_data_input_interpolate( force%q_left(t,:,:), & 1121 zu(1:nzt+1), & 1122 force%zu_atmos ) 1123 ENDIF 1124 IF ( force_bound_r ) THEN 1125 CALL netcdf_data_input_interpolate( force%u_right(t,:,:), & 1126 zu(1:nzt+1), & 1127 force%zu_atmos ) 1128 CALL netcdf_data_input_interpolate( force%v_right(t,:,:), & 1129 zu(1:nzt+1), & 1130 force%zu_atmos ) 1131 CALL netcdf_data_input_interpolate( force%w_right(t,:,:), & 1132 zw(1:nzt+1), & 1133 force%zw_atmos ) 1134 IF ( .NOT. neutral ) & 1135 CALL netcdf_data_input_interpolate( force%pt_right(t,:,:),& 1136 zu(1:nzt+1), & 1137 force%zu_atmos ) 1138 IF ( humidity ) & 1139 CALL netcdf_data_input_interpolate( force%q_right(t,:,:),& 1140 zu(1:nzt+1), & 1141 force%zu_atmos ) 1142 ENDIF 1143 IF ( force_bound_n ) THEN 1144 CALL netcdf_data_input_interpolate( force%u_north(t,:,:), & 1145 zu(1:nzt+1), & 1146 force%zu_atmos ) 1147 CALL netcdf_data_input_interpolate( force%v_north(t,:,:), & 1148 zu(1:nzt+1), & 1149 force%zu_atmos ) 1150 CALL netcdf_data_input_interpolate( force%w_north(t,:,:), & 1151 zw(1:nzt+1), & 1152 force%zw_atmos ) 1153 IF ( .NOT. neutral ) & 1154 CALL netcdf_data_input_interpolate( force%pt_north(t,:,:),& 1155 zu(1:nzt+1), & 1156 force%zu_atmos ) 1157 IF ( humidity ) & 1158 CALL netcdf_data_input_interpolate( force%q_north(t,:,:),& 1159 zu(1:nzt+1), & 1160 force%zu_atmos ) 1161 ENDIF 1162 IF ( force_bound_s ) THEN 1163 CALL netcdf_data_input_interpolate( force%u_south(t,:,:), & 1164 zu(1:nzt+1), & 1165 force%zu_atmos ) 1166 CALL netcdf_data_input_interpolate( force%v_south(t,:,:), & 1167 zu(1:nzt+1), & 1168 force%zu_atmos ) 1169 CALL netcdf_data_input_interpolate( force%w_south(t,:,:), & 1170 zw(1:nzt+1), & 1171 force%zw_atmos ) 1172 IF ( .NOT. neutral ) & 1173 CALL netcdf_data_input_interpolate( force%pt_south(t,:,:),& 1174 zu(1:nzt+1), & 1175 force%zu_atmos ) 1176 IF ( humidity ) & 1177 CALL netcdf_data_input_interpolate( force%q_south(t,:,:),& 1178 zu(1:nzt+1), & 1179 force%zu_atmos ) 1180 ENDIF 1181 ENDDO 1182 ENDIF 1183 1184 ! 1185 !-- Exchange ghost points 1186 CALL exchange_horiz( u, nbgp ) 1187 CALL exchange_horiz( v, nbgp ) 1188 CALL exchange_horiz( w, nbgp ) 1189 IF ( .NOT. neutral ) CALL exchange_horiz( pt, nbgp ) 1190 IF ( humidity ) CALL exchange_horiz( q, nbgp ) 1191 ! 1192 !-- At lateral boundaries, set also initial boundary conditions 1193 IF ( force_bound_l ) THEN 1194 u(:,:,nxl) = u(:,:,nxlu) 1195 v(:,:,nxl-1) = v(:,:,nxl) 1196 w(:,:,nxl-1) = w(:,:,nxl) 1197 IF ( .NOT. neutral ) pt(:,:,nxl-1) = pt(:,:,nxl) 1198 IF ( humidity ) q(:,:,nxl-1) = q(:,:,nxl) 1199 ENDIF 1200 IF ( force_bound_r ) THEN 1201 u(:,:,nxr+1) = u(:,:,nxr) 1202 v(:,:,nxr+1) = v(:,:,nxr) 1203 w(:,:,nxr+1) = w(:,:,nxr) 1204 IF ( .NOT. neutral ) pt(:,:,nxr+1) = pt(:,:,nxr) 1205 IF ( humidity ) q(:,:,nxr+1) = q(:,:,nxr) 1206 ENDIF 1207 IF ( force_bound_s ) THEN 1208 u(:,nys-1,:) = u(:,nys,:) 1209 v(:,nys,:) = v(:,nysv,:) 1210 w(:,nys-1,:) = w(:,nys,:) 1211 IF ( .NOT. neutral ) pt(:,nys-1,:) = pt(:,nys,:) 1212 IF ( humidity ) q(:,nys-1,:) = q(:,nys,:) 1213 ENDIF 1214 IF ( force_bound_n ) THEN 1215 u(:,nyn+1,:) = u(:,nyn,:) 1216 v(:,nyn+1,:) = v(:,nyn,:) 1217 w(:,nyn+1,:) = w(:,nyn,:) 1218 IF ( .NOT. neutral ) pt(:,nyn+1,:) = pt(:,nyn,:) 1219 IF ( humidity ) q(:,nyn+1,:) = q(:,nyn,:) 1220 ENDIF 1221 1015 !-- Write COSMO data at lateral and top boundaries 1016 CALL lsf_nesting_offline 1222 1017 ! 1223 1018 !-- After 3D data is initialized, ensure mass conservation 1224 CALL forcing_bc_mass_conservation1019 CALL lsf_nesting_offline_mass_conservation 1225 1020 ! 1226 1021 !-- Initialize surface pressure. Please note, time-dependent surface … … 1228 1023 !-- treatment of fluxes. 1229 1024 !-- For the moment, comment this out! 1230 ! surface_pressure = force%surface_pressure(0)1025 ! surface_pressure = nest_offl%surface_pressure(0) 1231 1026 1232 1027 ELSE -
palm/trunk/SOURCE/modules.f90
r3162 r3182 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Rename offline nesting variables: 23 ! -inflow_l, inflow_n, inflow_r, inflow_s, 24 ! nest_bound_l, nest_bound_n, nest_bound_r, nest_bound_s, nest_domain, forcing, 25 ! force_bound_l, force_bound_n, force_bound_r, force_bound_s, outflow_l, 26 ! outflow_n, outflow_r, outflow_s 27 ! +bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_n, bc_dirichlet_r, 28 ! bc_radiation_l, bc_radiation_n, bc_radiation_n, bc_radiation_r, child_domain 29 ! nesting_offline 23 30 ! 24 31 ! Former revisions: … … 1272 1279 LOGICAL :: agent_time_unlimited = .FALSE. !< namelist parameter 1273 1280 LOGICAL :: air_chemistry = .FALSE. !< chemistry model switch 1281 LOGICAL :: bc_dirichlet_l !< flag indicating dirichlet boundary condition on left model boundary 1282 LOGICAL :: bc_dirichlet_n !< flag indicating dirichlet boundary condition on north model boundary 1283 LOGICAL :: bc_dirichlet_r !< flag indicating dirichlet boundary condition on right model boundary 1284 LOGICAL :: bc_dirichlet_s !< flag indicating dirichlet boundary condition on south model boundary 1274 1285 LOGICAL :: bc_lr_cyc =.TRUE. !< left-right boundary condition cyclic? 1275 1286 LOGICAL :: bc_lr_dirrad = .FALSE. !< left-right boundary condition dirichlet/radiation? … … 1278 1289 LOGICAL :: bc_ns_dirrad = .FALSE. !< north-south boundary condition dirichlet/radiation? 1279 1290 LOGICAL :: bc_ns_raddir = .FALSE. !< north-south boundary condition radiation/dirichlet? 1291 LOGICAL :: bc_radiation_l = .FALSE. !< radiation boundary condition for outflow at left domain boundary 1292 LOGICAL :: bc_radiation_n = .FALSE. !< radiation boundary condition for outflow at north domain boundary 1293 LOGICAL :: bc_radiation_r = .FALSE. !< radiation boundary condition for outflow at right domain boundary 1294 LOGICAL :: bc_radiation_s = .FALSE. !< radiation boundary condition for outflow at south domain boundary 1280 1295 LOGICAL :: calc_soil_moisture_during_spinup = .FALSE. !< namelist parameter 1281 1296 LOGICAL :: call_microphysics_at_all_substeps = .FALSE. !< namelist parameter 1282 1297 LOGICAL :: call_psolver_at_all_substeps = .TRUE. !< namelist parameter 1298 LOGICAL :: child_domain = .FALSE. !< flag indicating that model is nested in a parent domain 1283 1299 LOGICAL :: cloud_droplets = .FALSE. !< namelist parameter 1284 1300 LOGICAL :: cloud_physics = .FALSE. !< namelist parameter … … 1310 1326 LOGICAL :: first_call_mas = .TRUE. !< call mas only once per timestep 1311 1327 LOGICAL :: force_print_header = .FALSE. !< namelist parameter 1312 LOGICAL :: force_bound_l = .FALSE. !< flag indicating domain boundary on left side to set forcing boundary conditions1313 LOGICAL :: force_bound_n = .FALSE. !< flag indicating domain boundary on north side to set forcing boundary conditions1314 LOGICAL :: force_bound_r = .FALSE. !< flag indicating domain boundary on right side to set forcing boundary conditions1315 LOGICAL :: force_bound_s = .FALSE. !< flag indicating domain boundary on south side to set forcing boundary conditions1316 LOGICAL :: forcing = .FALSE. !< flag controlling forcing from large-scale model1317 1328 LOGICAL :: galilei_transformation = .FALSE. !< namelist parameter 1318 1329 LOGICAL :: humidity = .FALSE. !< namelist parameter 1319 1330 LOGICAL :: humidity_remote = .FALSE. !< switch for receiving near-surface humidity flux (atmosphere-ocean coupling) 1320 LOGICAL :: inflow_l = .FALSE. !< left domain boundary has non-cyclic inflow?1321 LOGICAL :: inflow_n = .FALSE. !< north domain boundary has non-cyclic inflow?1322 LOGICAL :: inflow_r = .FALSE. !< right domain boundary has non-cyclic inflow?1323 LOGICAL :: inflow_s = .FALSE. !< south domain boundary has non-cyclic inflow?1324 1331 LOGICAL :: large_scale_forcing = .FALSE. !< namelist parameter 1325 1332 LOGICAL :: large_scale_subsidence = .FALSE. !< namelist parameter … … 1336 1343 LOGICAL :: microphysics_seifert = .FALSE. !< use 2-moment Seifert and Beheng scheme 1337 1344 LOGICAL :: mg_switch_to_pe0 = .FALSE. !< internal multigrid switch for steering the ghost point exchange in case that data has been collected on PE0 1338 LOGICAL :: nest_bound_l = .FALSE. !< flag indicating nested domain boundary on left side 1339 LOGICAL :: nest_bound_n = .FALSE. !< flag indicating nested domain boundary on north side 1340 LOGICAL :: nest_bound_r = .FALSE. !< flag indicating nested domain boundary on right side 1341 LOGICAL :: nest_bound_s = .FALSE. !< flag indicating nested domain boundary on south side 1342 LOGICAL :: nest_domain = .FALSE. !< domain is nested into a parent domain? 1345 LOGICAL :: nesting_offline = .FALSE. !< flag controlling offline nesting in COSMO model 1343 1346 LOGICAL :: neutral = .FALSE. !< namelist parameter 1344 1347 LOGICAL :: nudging = .FALSE. !< namelist parameter 1345 1348 LOGICAL :: ocean = .FALSE. !< namelist parameter 1346 LOGICAL :: outflow_l = .FALSE. !< left domain boundary has non-cyclic outflow?1347 LOGICAL :: outflow_n = .FALSE. !< north domain boundary has non-cyclic outflow?1348 LOGICAL :: outflow_r = .FALSE. !< right domain boundary has non-cyclic outflow?1349 LOGICAL :: outflow_s = .FALSE. !< south domain boundary has non-cyclic outflow?1350 1349 LOGICAL :: passive_scalar = .FALSE. !< namelist parameter 1351 1350 LOGICAL :: plant_canopy = .FALSE. !< switch for use of plant canopy model -
palm/trunk/SOURCE/netcdf_data_input_mod.f90
r3106 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Adjust input of dynamic driver according to revised Inifor version. 23 ! Replace simulated_time by time_since_reference_point. 24 ! Rename variables in mesoscale-offline nesting mode. 23 25 ! 24 26 ! Former revisions: … … 199 201 !-- Define data type for nesting in larger-scale models like COSMO. 200 202 !-- Data type comprises u, v, w, pt, and q at lateral and top boundaries. 201 TYPE force_type203 TYPE nest_offl_type 202 204 203 205 CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE :: var_names … … 206 208 INTEGER(iwp) :: nzu !< number of vertical levels on scalar grid in dynamic input file 207 209 INTEGER(iwp) :: nzw !< number of vertical levels on w grid in dynamic input file 208 INTEGER(iwp) :: tind !< time index for reference time in large-scale forcing data209 INTEGER(iwp) :: tind_p !< time index for following time in large-scale forcing data210 INTEGER(iwp) :: tind !< time index for reference time in mesoscale-offline nesting 211 INTEGER(iwp) :: tind_p !< time index for following time in mesoscale-offline nesting 210 212 211 213 LOGICAL :: init = .FALSE. 212 LOGICAL :: interpolated = .FALSE.213 214 LOGICAL :: from_file = .FALSE. 214 215 … … 251 252 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: pt_top !< potentital temperautre at top boundary 252 253 253 END TYPE force_type254 END TYPE nest_offl_type 254 255 255 256 TYPE init_type … … 474 475 TYPE(dims_xy) :: dim_static !< data structure for x, y-dimension in static input file 475 476 476 TYPE( force_type) :: force !< data structure for data input at lateral and top boundaries (provided by Inifor)477 TYPE(nest_offl_type) :: nest_offl !< data structure for data input at lateral and top boundaries (provided by Inifor) 477 478 478 479 TYPE(init_type) :: init_3d !< data structure for the initialization of the 3D flow and soil fields … … 606 607 !-- Public variables 607 608 PUBLIC albedo_pars_f, albedo_type_f, basal_area_density_f, buildings_f, & 608 building_id_f, building_pars_f, building_type_f, force, init_3d,&609 building_id_f, building_pars_f, building_type_f, init_3d, & 609 610 init_model, input_file_static, input_pids_static, & 610 input_pids_dynamic, leaf_area_density_f, 611 input_pids_dynamic, leaf_area_density_f, nest_offl, & 611 612 pavement_pars_f, pavement_subsurface_pars_f, pavement_type_f, & 612 613 root_area_density_lad_f, root_area_density_lsm_f, soil_pars_f, & … … 719 720 !-- sun-zenith angles. To avoid this, longitude and latitude in each model 720 721 !-- domain will be set to the values of the root model. Please note, this 721 !-- synchronization is required already here. 722 !-- synchronization is required already here. 722 723 #if defined( __parallel ) 723 724 CALL MPI_BCAST( init_model%latitude, 1, MPI_REAL, 0, & … … 726 727 MPI_COMM_WORLD, ierr ) 727 728 #endif 728 729 729 730 730 END SUBROUTINE netcdf_data_input_init … … 2057 2057 2058 2058 USE arrays_3d, & 2059 ONLY: q, pt, u, v, w 2059 ONLY: q, pt, u, v, w, zu, zw 2060 2060 2061 2061 USE control_parameters, & 2062 ONLY: bc_lr_cyc, bc_ns_cyc, forcing, humidity, land_surface,&2063 message_string, neutral, surface_pressure2062 ONLY: bc_lr_cyc, bc_ns_cyc, humidity, land_surface, message_string,& 2063 nesting_offline, neutral, surface_pressure 2064 2064 2065 2065 USE indices, & … … 2119 2119 CALL get_dimension_length( id_dynamic, init_3d%nzu, 'z' ) 2120 2120 CALL get_dimension_length( id_dynamic, init_3d%nzw, 'zw' ) 2121 CALL get_dimension_length( id_dynamic, init_3d%nzs, ' depth' )2121 CALL get_dimension_length( id_dynamic, init_3d%nzs, 'zsoil' ) 2122 2122 ! 2123 2123 !-- Read also the horizontal dimensions. These are used just used fo … … 2142 2142 ENDIF 2143 2143 2144 IF ( init_3d%nzu -1/= nz ) THEN2144 IF ( init_3d%nzu /= nz ) THEN 2145 2145 message_string = 'Number of inifor vertical grid points ' // & 2146 2146 'does not match the number of numeric grid '// & … … 2159 2159 CALL get_variable( id_dynamic, 'zw', init_3d%zw_atmos ) 2160 2160 ENDIF 2161 IF ( check_existence( var_names, ' depth' ) ) THEN2161 IF ( check_existence( var_names, 'zsoil' ) ) THEN 2162 2162 ALLOCATE( init_3d%z_soil(1:init_3d%nzs) ) 2163 CALL get_variable( id_dynamic, 'depth', init_3d%z_soil ) 2164 ENDIF 2165 ! 2166 !-- Read initial geostrophic wind components at t = 0 (index 1 in file). 2167 ! IF ( check_existence( var_names, 'tend_ug' ) ) THEN 2163 CALL get_variable( id_dynamic, 'zsoil', init_3d%z_soil ) 2164 ENDIF 2165 ! 2166 !-- Check for consistency between vertical coordinates in dynamic 2167 !-- driver and numeric grid. 2168 !-- Please note, depending on compiler options both may be 2169 !-- equal up to a certain threshold, and differences between 2170 !-- the numeric grid and vertical coordinate in the driver can built- 2171 !-- up to 10E-1-10E-0 m. For this reason, the check is performed not 2172 !-- for exactly matching values. 2173 IF ( ANY( ABS( zu(1:nzt) - init_3d%zu_atmos(1:init_3d%nzu) ) & 2174 > 10E-1 ) .OR. & 2175 ANY( ABS( zw(1:nzt-1) - init_3d%zw_atmos(1:init_3d%nzw) ) & 2176 > 10E-1 ) ) THEN 2177 message_string = 'Vertical grid in dynamic driver does not '// & 2178 'match the numeric grid.' 2179 CALL message( 'netcdf_data_input_mod', 'NDI003', 1, 2, 0, 6, 0 ) 2180 ENDIF 2181 ! 2182 !-- Read initial geostrophic wind components at 2183 !-- t = 0 (index 1 in file). 2168 2184 IF ( check_existence( var_names, 'ls_forcing_ug' ) ) THEN 2169 2185 ALLOCATE( init_3d%ug_init(nzb:nzt+1) ) 2170 ! CALL get_variable_pr( id_dynamic, 'tend_ug', 1, & 2171 ! init_3d%ug_init ) 2172 CALL get_variable_pr( id_dynamic, 'ls_forcing_ug', 1, & 2173 init_3d%ug_init ) 2186 init_3d%ug_init = 0.0_wp 2187 2188 CALL get_variable_pr( id_dynamic, 'ls_forcing_ug', 1, & 2189 init_3d%ug_init(1:nzt) ) 2190 ! 2191 !-- Set top-boundary condition (Neumann) 2192 init_3d%ug_init(nzt+1) = init_3d%ug_init(nzt) 2193 2174 2194 init_3d%from_file_ug = .TRUE. 2175 2195 ELSE 2176 2196 init_3d%from_file_ug = .FALSE. 2177 2197 ENDIF 2178 ! IF ( check_existence( var_names, 'tend_vg' ) ) THEN2179 2198 IF ( check_existence( var_names, 'ls_forcing_vg' ) ) THEN 2180 2199 ALLOCATE( init_3d%vg_init(nzb:nzt+1) ) 2181 ! CALL get_variable_pr( id_dynamic, 'tend_vg', 1, & 2182 ! init_3d%vg_init ) 2183 CALL get_variable_pr( id_dynamic, 'ls_forcing_vg', 1, & 2184 init_3d%vg_init ) 2200 init_3d%vg_init = 0.0_wp 2201 2202 CALL get_variable_pr( id_dynamic, 'ls_forcing_vg', 1, & 2203 init_3d%vg_init(1:nzt) ) 2204 ! 2205 !-- Set top-boundary condition (Neumann) 2206 init_3d%vg_init(nzt+1) = init_3d%vg_init(nzt) 2207 2185 2208 init_3d%from_file_vg = .TRUE. 2186 2209 ELSE … … 2195 2218 !-- into separate loops. 2196 2219 !-- Read u-component 2197 IF ( check_existence( var_names, 'init_ u' ) ) THEN2220 IF ( check_existence( var_names, 'init_atmosphere_u' ) ) THEN 2198 2221 ! 2199 2222 !-- Read attributes for the fill value and level-of-detail 2200 2223 CALL get_attribute( id_dynamic, char_fill, init_3d%fill_u, & 2201 .FALSE., 'init_ u' )2224 .FALSE., 'init_atmosphere_u' ) 2202 2225 CALL get_attribute( id_dynamic, char_lod, init_3d%lod_u, & 2203 .FALSE., 'init_ u' )2226 .FALSE., 'init_atmosphere_u' ) 2204 2227 ! 2205 2228 !-- level-of-detail 1 - read initialization profile … … 2208 2231 init_3d%u_init = 0.0_wp 2209 2232 2210 CALL get_variable( id_dynamic, 'init_u', & 2211 init_3d%u_init(nzb+1:nzt+1) ) 2233 CALL get_variable( id_dynamic, 'init_atmosphere_u', & 2234 init_3d%u_init(nzb+1:nzt) ) 2235 ! 2236 !-- Set top-boundary condition (Neumann) 2237 init_3d%u_init(nzt+1) = init_3d%u_init(nzt) 2212 2238 ! 2213 2239 !-- level-of-detail 2 - read 3D initialization data 2214 2240 ELSEIF ( init_3d%lod_u == 2 ) THEN 2215 2216 CALL get_variable( id_dynamic, 'init_u', & 2217 u(nzb+1:nzt+1,nys:nyn,nxlu:nxr), & 2241 CALL get_variable( id_dynamic, 'init_atmosphere_u', & 2242 u(nzb+1:nzt,nys:nyn,nxlu:nxr), & 2218 2243 nxlu, nys+1, nzb+1, & 2219 2244 nxr-nxlu+1, nyn-nys+1, init_3d%nzu, & 2220 2245 dynamic_3d ) 2246 ! 2247 !-- Set value at leftmost model grid point nxl = 0. This is because 2248 !-- Inifor provides data only from 1:nx-1 since it assumes non-cyclic 2249 !-- conditions. 2250 IF ( nxl == 0 ) & 2251 u(nzb+1:nzt,nys:nyn,nxl) = u(nzb+1:nzt,nys:nyn,nxlu) 2252 ! 2253 !-- Set bottom and top-boundary 2254 u(nzb,:,:) = u(nzb+1,:,:) 2255 u(nzt+1,:,:) = u(nzt,:,:) 2256 2221 2257 ENDIF 2222 2258 init_3d%from_file_u = .TRUE. … … 2224 2260 ! 2225 2261 !-- Read v-component 2226 IF ( check_existence( var_names, 'init_ v' ) ) THEN2262 IF ( check_existence( var_names, 'init_atmosphere_v' ) ) THEN 2227 2263 ! 2228 2264 !-- Read attributes for the fill value and level-of-detail 2229 2265 CALL get_attribute( id_dynamic, char_fill, init_3d%fill_v, & 2230 .FALSE., 'init_ v' )2266 .FALSE., 'init_atmosphere_v' ) 2231 2267 CALL get_attribute( id_dynamic, char_lod, init_3d%lod_v, & 2232 .FALSE., 'init_ v' )2268 .FALSE., 'init_atmosphere_v' ) 2233 2269 ! 2234 2270 !-- level-of-detail 1 - read initialization profile … … 2237 2273 init_3d%v_init = 0.0_wp 2238 2274 2239 CALL get_variable( id_dynamic, 'init_v', & 2240 init_3d%v_init(nzb+1:nzt+1) ) 2241 2275 CALL get_variable( id_dynamic, 'init_atmosphere_v', & 2276 init_3d%v_init(nzb+1:nzt) ) 2277 ! 2278 !-- Set top-boundary condition (Neumann) 2279 init_3d%v_init(nzt+1) = init_3d%v_init(nzt) 2242 2280 ! 2243 2281 !-- level-of-detail 2 - read 3D initialization data 2244 2282 ELSEIF ( init_3d%lod_v == 2 ) THEN 2245 2246 CALL get_variable( id_dynamic, 'init_ v',&2247 v(nzb+1:nzt +1,nysv:nyn,nxl:nxr),&2283 2284 CALL get_variable( id_dynamic, 'init_atmosphere_v', & 2285 v(nzb+1:nzt,nysv:nyn,nxl:nxr), & 2248 2286 nxl+1, nysv, nzb+1, & 2249 2287 nxr-nxl+1, nyn-nysv+1, init_3d%nzu, & 2250 2288 dynamic_3d ) 2289 ! 2290 !-- Set value at southmost model grid point nys = 0. This is because 2291 !-- Inifor provides data only from 1:ny-1 since it assumes non-cyclic 2292 !-- conditions. 2293 IF ( nys == 0 ) & 2294 v(nzb+1:nzt,nys,nxl:nxr) = v(nzb+1:nzt,nysv,nxl:nxr) 2295 ! 2296 !-- Set bottom and top-boundary 2297 v(nzb,:,:) = v(nzb+1,:,:) 2298 v(nzt+1,:,:) = v(nzt,:,:) 2251 2299 2252 2300 ENDIF … … 2255 2303 ! 2256 2304 !-- Read w-component 2257 IF ( check_existence( var_names, 'init_ w' ) ) THEN2305 IF ( check_existence( var_names, 'init_atmosphere_w' ) ) THEN 2258 2306 ! 2259 2307 !-- Read attributes for the fill value and level-of-detail 2260 2308 CALL get_attribute( id_dynamic, char_fill, init_3d%fill_w, & 2261 .FALSE., 'init_ w' )2309 .FALSE., 'init_atmosphere_w' ) 2262 2310 CALL get_attribute( id_dynamic, char_lod, init_3d%lod_w, & 2263 .FALSE., 'init_ w' )2311 .FALSE., 'init_atmosphere_w' ) 2264 2312 ! 2265 2313 !-- level-of-detail 1 - read initialization profile … … 2268 2316 init_3d%w_init = 0.0_wp 2269 2317 2270 CALL get_variable( id_dynamic, 'init_w', & 2271 init_3d%w_init(nzb+1:nzt) ) 2272 2318 CALL get_variable( id_dynamic, 'init_atmosphere_w', & 2319 init_3d%w_init(nzb+1:nzt-1) ) 2320 ! 2321 !-- Set top-boundary condition (Neumann) 2322 init_3d%w_init(nzt:nzt+1) = init_3d%w_init(nzt-1) 2273 2323 ! 2274 2324 !-- level-of-detail 2 - read 3D initialization data 2275 2325 ELSEIF ( init_3d%lod_w == 2 ) THEN 2276 2326 2277 CALL get_variable( id_dynamic, 'init_ w',&2278 w(nzb+1:nzt ,nys:nyn,nxl:nxr),&2327 CALL get_variable( id_dynamic, 'init_atmosphere_w', & 2328 w(nzb+1:nzt-1,nys:nyn,nxl:nxr), & 2279 2329 nxl+1, nys+1, nzb+1, & 2280 2330 nxr-nxl+1, nyn-nys+1, init_3d%nzw, & 2281 2331 dynamic_3d ) 2332 ! 2333 !-- Set bottom and top-boundary 2334 w(nzb,:,:) = 0.0_wp 2335 w(nzt,:,:) = w(nzt-1,:,:) 2336 w(nzt+1,:,:) = w(nzt-1,:,:) 2282 2337 2283 2338 ENDIF … … 2287 2342 !-- Read potential temperature 2288 2343 IF ( .NOT. neutral ) THEN 2289 IF ( check_existence( var_names, 'init_ pt' ) ) THEN2344 IF ( check_existence( var_names, 'init_atmosphere_pt' ) ) THEN 2290 2345 ! 2291 2346 !-- Read attributes for the fill value and level-of-detail 2292 2347 CALL get_attribute( id_dynamic, char_fill, init_3d%fill_pt, & 2293 .FALSE., 'init_ pt' )2348 .FALSE., 'init_atmosphere_pt' ) 2294 2349 CALL get_attribute( id_dynamic, char_lod, init_3d%lod_pt, & 2295 .FALSE., 'init_ pt' )2350 .FALSE., 'init_atmosphere_pt' ) 2296 2351 ! 2297 2352 !-- level-of-detail 1 - read initialization profile … … 2299 2354 ALLOCATE( init_3d%pt_init(nzb:nzt+1) ) 2300 2355 2301 CALL get_variable( id_dynamic, 'init_pt', & 2302 init_3d%pt_init(nzb+1:nzt+1) ) 2303 ! 2304 !-- Set Neumann surface boundary condition for initial profil 2305 init_3d%pt_init(nzb) = init_3d%pt_init(nzb+1) 2356 CALL get_variable( id_dynamic, 'init_atmosphere_pt', & 2357 init_3d%pt_init(nzb+1:nzt) ) 2358 ! 2359 !-- Set Neumann top and surface boundary condition for initial 2360 !-- profil 2361 init_3d%pt_init(nzb) = init_3d%pt_init(nzb+1) 2362 init_3d%pt_init(nzt+1) = init_3d%pt_init(nzt) 2306 2363 ! 2307 2364 !-- level-of-detail 2 - read 3D initialization data 2308 2365 ELSEIF ( init_3d%lod_pt == 2 ) THEN 2309 2366 2310 CALL get_variable( id_dynamic, 'init_ pt',&2311 pt(nzb+1:nzt +1,nys:nyn,nxl:nxr),&2367 CALL get_variable( id_dynamic, 'init_atmosphere_pt', & 2368 pt(nzb+1:nzt,nys:nyn,nxl:nxr), & 2312 2369 nxl+1, nys+1, nzb+1, & 2313 2370 nxr-nxl+1, nyn-nys+1, init_3d%nzu, & 2314 2371 dynamic_3d ) 2315 2372 2373 ! 2374 !-- Set bottom and top-boundary 2375 pt(nzb,:,:) = pt(nzb+1,:,:) 2376 pt(nzt+1,:,:) = pt(nzt,:,:) 2316 2377 2317 2378 ENDIF … … 2322 2383 !-- Read mixing ratio 2323 2384 IF ( humidity ) THEN 2324 IF ( check_existence( var_names, 'init_ qv' ) ) THEN2385 IF ( check_existence( var_names, 'init_atmosphere_qv' ) ) THEN 2325 2386 ! 2326 2387 !-- Read attributes for the fill value and level-of-detail 2327 2388 CALL get_attribute( id_dynamic, char_fill, init_3d%fill_q, & 2328 .FALSE., 'init_ qv' )2389 .FALSE., 'init_atmosphere_qv' ) 2329 2390 CALL get_attribute( id_dynamic, char_lod, init_3d%lod_q, & 2330 .FALSE., 'init_ qv' )2391 .FALSE., 'init_atmosphere_qv' ) 2331 2392 ! 2332 2393 !-- level-of-detail 1 - read initialization profile … … 2334 2395 ALLOCATE( init_3d%q_init(nzb:nzt+1) ) 2335 2396 2336 CALL get_variable( id_dynamic, 'init_ qv',&2337 init_3d%q_init(nzb+1:nzt+1) )2338 ! 2339 !-- Set Neumann surface boundary condition for initial profil2340 init_3d%q_init(nzb) = init_3d%q_init(nzb+1)2341 2397 CALL get_variable( id_dynamic, 'init_atmosphere_qv', & 2398 init_3d%q_init(nzb+1:nzt) ) 2399 ! 2400 !-- Set bottom and top boundary condition (Neumann) 2401 init_3d%q_init(nzb) = init_3d%q_init(nzb+1) 2402 init_3d%q_init(nzt+1) = init_3d%q_init(nzt) 2342 2403 ! 2343 2404 !-- level-of-detail 2 - read 3D initialization data 2344 2405 ELSEIF ( init_3d%lod_q == 2 ) THEN 2345 2406 2346 CALL get_variable( id_dynamic, 'init_ qv',&2347 q(nzb+1:nzt +1,nys:nyn,nxl:nxr),&2407 CALL get_variable( id_dynamic, 'init_atmosphere_qv', & 2408 q(nzb+1:nzt,nys:nyn,nxl:nxr), & 2348 2409 nxl+1, nys+1, nzb+1, & 2349 2410 nxr-nxl+1, nyn-nys+1, init_3d%nzu, & 2350 2411 dynamic_3d ) 2351 2352 2353 2412 2413 ! 2414 !-- Set bottom and top-boundary 2415 q(nzb,:,:) = q(nzb+1,:,:) 2416 q(nzt+1,:,:) = q(nzt,:,:) 2417 2354 2418 ENDIF 2355 2419 init_3d%from_file_q = .TRUE. … … 2382 2446 2383 2447 CALL get_variable( id_dynamic, 'init_soil_m', & 2384 2385 2448 init_3d%msoil(0:init_3d%nzs-1,nys:nyn,nxl:nxr),& 2449 nxl, nxr, nys, nyn, 0, init_3d%nzs-1 ) 2386 2450 2387 2451 ENDIF … … 2413 2477 2414 2478 CALL get_variable( id_dynamic, 'init_soil_t', & 2415 2416 2479 init_3d%tsoil(0:init_3d%nzs-1,nys:nyn,nxl:nxr),& 2480 nxl, nxr, nys, nyn, 0, init_3d%nzs-1 ) 2417 2481 ENDIF 2418 2482 init_3d%from_file_tsoil = .TRUE. … … 2439 2503 ENDIF 2440 2504 IF ( .NOT. check_passed ) THEN 2441 message_string = 'NetCDF input for u_init must not contain ' //&2442 ' any _FillValues'2505 message_string = 'NetCDF input for init_atmosphere_u must ' // & 2506 'not contain any _FillValues' 2443 2507 CALL message( 'netcdf_data_input_mod', 'NDI004', 2, 2, 0, 6, 0 ) 2444 2508 ENDIF … … 2455 2519 ENDIF 2456 2520 IF ( .NOT. check_passed ) THEN 2457 message_string = 'NetCDF input for v_init must not contain ' //&2458 ' any _FillValues'2521 message_string = 'NetCDF input for init_atmosphere_v must ' // & 2522 'not contain any _FillValues' 2459 2523 CALL message( 'netcdf_data_input_mod', 'NDI005', 2, 2, 0, 6, 0 ) 2460 2524 ENDIF … … 2471 2535 ENDIF 2472 2536 IF ( .NOT. check_passed ) THEN 2473 message_string = 'NetCDF input for w_init must not contain ' //&2474 ' any _FillValues'2537 message_string = 'NetCDF input for init_atmosphere_w must ' // & 2538 'not contain any _FillValues' 2475 2539 CALL message( 'netcdf_data_input_mod', 'NDI006', 2, 2, 0, 6, 0 ) 2476 2540 ENDIF … … 2487 2551 ENDIF 2488 2552 IF ( .NOT. check_passed ) THEN 2489 message_string = 'NetCDF input for pt_init must not contain ' //&2490 ' any _FillValues'2553 message_string = 'NetCDF input for init_atmosphere_pt must ' // & 2554 'not contain any _FillValues' 2491 2555 CALL message( 'netcdf_data_input_mod', 'NDI007', 2, 2, 0, 6, 0 ) 2492 2556 ENDIF … … 2503 2567 ENDIF 2504 2568 IF ( .NOT. check_passed ) THEN 2505 message_string = 'NetCDF input for q_init must not contain ' //&2506 ' any _FillValues'2569 message_string = 'NetCDF input for init_atmosphere_q must ' // & 2570 'not contain any _FillValues' 2507 2571 CALL message( 'netcdf_data_input_mod', 'NDI008', 2, 2, 0, 6, 0 ) 2508 2572 ENDIF … … 2524 2588 2525 2589 USE control_parameters, & 2526 ONLY: bc_ lr_cyc, bc_ns_cyc, force_bound_l, force_bound_n,&2527 force_bound_r, force_bound_s,&2528 forcing, humidity, message_string, neutral, simulated_time2529 2590 ONLY: bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 2591 bc_dirichlet_s, bc_lr_cyc, bc_ns_cyc, humidity, & 2592 message_string, neutral, nesting_offline, & 2593 time_since_reference_point 2530 2594 2531 2595 USE indices, & … … 2533 2597 2534 2598 IMPLICIT NONE 2535 2536 LOGICAL :: dynamic_3d = .TRUE. !< flag indicating that 3D data is read from dynamic file2537 2599 2538 2600 INTEGER(iwp) :: i !< running index along x-direction … … 2545 2607 REAL(wp) :: dum !< dummy variable to skip columns while reading topography file 2546 2608 2547 force%from_file = MERGE( .TRUE., .FALSE., input_pids_dynamic )2609 nest_offl%from_file = MERGE( .TRUE., .FALSE., input_pids_dynamic ) 2548 2610 ! 2549 2611 !-- Skip input if no forcing from larger-scale models is applied. 2550 IF ( .NOT. forcing) RETURN2612 IF ( .NOT. nesting_offline ) RETURN 2551 2613 2552 2614 ! … … 2560 2622 TRIM( coupling_char ), id_dynamic ) 2561 2623 ! 2562 !-- Initialize INIFOR forcing. 2563 IF ( .NOT. force%init ) THEN2624 !-- Initialize INIFOR forcing. 2625 IF ( .NOT. nest_offl%init ) THEN 2564 2626 ! 2565 2627 !-- At first, inquire all variable names. … … 2567 2629 ! 2568 2630 !-- Allocate memory to store variable names. 2569 ALLOCATE( force%var_names(1:num_vars) )2570 CALL inquire_variable_names( id_dynamic, force%var_names )2631 ALLOCATE( nest_offl%var_names(1:num_vars) ) 2632 CALL inquire_variable_names( id_dynamic, nest_offl%var_names ) 2571 2633 ! 2572 2634 !-- Read time dimension, allocate memory and finally read time array 2573 CALL get_dimension_length( id_dynamic, force%nt, 'time' )2574 2575 IF ( check_existence( force%var_names, 'time' ) ) THEN2576 ALLOCATE( force%time(0:force%nt-1) )2577 CALL get_variable( id_dynamic, 'time', force%time )2635 CALL get_dimension_length( id_dynamic, nest_offl%nt, 'time' ) 2636 2637 IF ( check_existence( nest_offl%var_names, 'time' ) ) THEN 2638 ALLOCATE( nest_offl%time(0:nest_offl%nt-1) ) 2639 CALL get_variable( id_dynamic, 'time', nest_offl%time ) 2578 2640 ENDIF 2579 2641 ! 2580 2642 !-- Read vertical dimension of scalar und w grid 2581 CALL get_dimension_length( id_dynamic, force%nzu, 'z' )2582 CALL get_dimension_length( id_dynamic, force%nzw, 'zw' )2583 2584 IF ( check_existence( force%var_names, 'z' ) ) THEN2585 ALLOCATE( force%zu_atmos(1:force%nzu) )2586 CALL get_variable( id_dynamic, 'z', force%zu_atmos )2587 ENDIF 2588 IF ( check_existence( force%var_names, 'zw' ) ) THEN2589 ALLOCATE( force%zw_atmos(1:force%nzw) )2590 CALL get_variable( id_dynamic, 'zw', force%zw_atmos )2643 CALL get_dimension_length( id_dynamic, nest_offl%nzu, 'z' ) 2644 CALL get_dimension_length( id_dynamic, nest_offl%nzw, 'zw' ) 2645 2646 IF ( check_existence( nest_offl%var_names, 'z' ) ) THEN 2647 ALLOCATE( nest_offl%zu_atmos(1:nest_offl%nzu) ) 2648 CALL get_variable( id_dynamic, 'z', nest_offl%zu_atmos ) 2649 ENDIF 2650 IF ( check_existence( nest_offl%var_names, 'zw' ) ) THEN 2651 ALLOCATE( nest_offl%zw_atmos(1:nest_offl%nzw) ) 2652 CALL get_variable( id_dynamic, 'zw', nest_offl%zw_atmos ) 2591 2653 ENDIF 2592 2654 2593 2655 ! 2594 2656 !-- Read surface pressure 2595 IF ( check_existence( force%var_names,&2596 'surface_forcing_surface_pressure' ) ) THEN2597 ALLOCATE( force%surface_pressure(0:force%nt-1) )2657 IF ( check_existence( nest_offl%var_names, & 2658 'surface_forcing_surface_pressure' ) ) THEN 2659 ALLOCATE( nest_offl%surface_pressure(0:nest_offl%nt-1) ) 2598 2660 CALL get_variable( id_dynamic, & 2599 2661 'surface_forcing_surface_pressure', & 2600 force%surface_pressure )2662 nest_offl%surface_pressure ) 2601 2663 ENDIF 2602 2664 ! 2603 2665 !-- Set control flag to indicate that initialization is already done 2604 force%init = .TRUE.2666 nest_offl%init = .TRUE. 2605 2667 2606 2668 ENDIF … … 2610 2672 !-- @todo: At the moment time, in INIFOR and simulated time correspond 2611 2673 !-- to each other. If required, adjust to daytime. 2612 force%tind = MINLOC( ABS( force%time - simulated_time ), DIM = 1 ) & 2613 - 1 2614 force%tind_p = force%tind + 1 2674 nest_offl%tind = MINLOC( ABS( nest_offl%time - & 2675 time_since_reference_point ), DIM = 1 ) & 2676 - 1 2677 nest_offl%tind_p = nest_offl%tind + 1 2615 2678 ! 2616 2679 !-- Read geostrophic wind components. In case of forcing, this is only 2617 2680 !-- required if cyclic boundary conditions are applied. 2618 2681 IF ( bc_lr_cyc .AND. bc_ns_cyc ) THEN 2619 DO t = force%tind, force%tind_p2682 DO t = nest_offl%tind, nest_offl%tind_p 2620 2683 ! CALL get_variable_pr( id_dynamic, 'tend_ug', t+1, & 2621 ! force%ug(t-force%tind,:) )2684 ! nest_offl%ug(t-nest_offl%tind,:) ) 2622 2685 ! CALL get_variable_pr( id_dynamic, 'tend_vg', t+1, & 2623 ! force%ug(t-force%tind,:) )2686 ! nest_offl%ug(t-nest_offl%tind,:) ) 2624 2687 CALL get_variable_pr( id_dynamic, 'ls_forcing_ug', t+1, & 2625 force%ug(t-force%tind,:) )2688 nest_offl%ug(t-nest_offl%tind,:) ) 2626 2689 CALL get_variable_pr( id_dynamic, 'ls_forcing_vg', t+1, & 2627 force%ug(t-force%tind,:) )2690 nest_offl%ug(t-nest_offl%tind,:) ) 2628 2691 ENDDO 2629 2692 ENDIF … … 2633 2696 !-- For the v-component, the data starts at nysv, while for the other 2634 2697 !-- quantities the data starts at nys. This is equivalent at the north 2635 !-- and south domain boundary for the u-component. 2636 IF ( force_bound_l ) THEN 2698 !-- and south domain boundary for the u-component. 2699 !-- Further, lateral data is not accessed by parallel IO, indicated by the 2700 !-- last passed flag in the subroutine get_variable(). This is because 2701 !-- not every PE participates in this collective blocking read operation. 2702 IF ( bc_dirichlet_l ) THEN 2637 2703 CALL get_variable( id_dynamic, 'ls_forcing_left_u', & 2638 force%u_left(0:1,nzb+1:nzt+1,nys:nyn),&2639 nys+1, nzb+1, force%tind+1,&2640 nyn-nys+1, force%nzu, 2, dynamic_3d)2641 2704 nest_offl%u_left(0:1,nzb+1:nzt,nys:nyn), & 2705 nys+1, nzb+1, nest_offl%tind+1, & 2706 nyn-nys+1, nest_offl%nzu, 2, .FALSE. ) 2707 2642 2708 CALL get_variable( id_dynamic, 'ls_forcing_left_v', & 2643 force%v_left(0:1,nzb+1:nzt+1,nysv:nyn),&2644 nysv, nzb+1, force%tind+1,&2645 nyn-nysv+1, force%nzu, 2, dynamic_3d)2709 nest_offl%v_left(0:1,nzb+1:nzt,nysv:nyn), & 2710 nysv, nzb+1, nest_offl%tind+1, & 2711 nyn-nysv+1, nest_offl%nzu, 2, .FALSE. ) 2646 2712 2647 2713 CALL get_variable( id_dynamic, 'ls_forcing_left_w', & 2648 force%w_left(0:1,nzb+1:nzt,nys:nyn),&2649 nys+1, nzb+1, force%tind+1,&2650 nyn-nys+1, force%nzw, 2, dynamic_3d)2714 nest_offl%w_left(0:1,nzb+1:nzt-1,nys:nyn), & 2715 nys+1, nzb+1, nest_offl%tind+1, & 2716 nyn-nys+1, nest_offl%nzw, 2, .FALSE. ) 2651 2717 2652 2718 IF ( .NOT. neutral ) THEN 2653 2719 CALL get_variable( id_dynamic, 'ls_forcing_left_pt', & 2654 force%pt_left(0:1,nzb+1:nzt+1,nys:nyn), & 2655 nys+1, nzb+1, force%tind+1, & 2656 nyn-nys+1, force%nzu, 2, dynamic_3d ) 2657 ENDIF 2720 nest_offl%pt_left(0:1,nzb+1:nzt,nys:nyn), & 2721 nys+1, nzb+1, nest_offl%tind+1, & 2722 nyn-nys+1, nest_offl%nzu, 2, .FALSE. ) 2723 ENDIF 2724 2658 2725 IF ( humidity ) THEN 2659 2726 CALL get_variable( id_dynamic, 'ls_forcing_left_qv', & 2660 force%q_left(0:1,nzb+1:nzt+1,nys:nyn), & 2661 nys+1, nzb+1, force%tind+1, & 2662 nyn-nys+1, force%nzu, 2, dynamic_3d ) 2663 ENDIF 2664 ENDIF 2665 2666 IF ( force_bound_r ) THEN 2727 nest_offl%q_left(0:1,nzb+1:nzt,nys:nyn), & 2728 nys+1, nzb+1, nest_offl%tind+1, & 2729 nyn-nys+1, nest_offl%nzu, 2, .FALSE. ) 2730 ENDIF 2731 2732 ENDIF 2733 2734 IF ( bc_dirichlet_r ) THEN 2667 2735 CALL get_variable( id_dynamic, 'ls_forcing_right_u', & 2668 force%u_right(0:1,nzb+1:nzt+1,nys:nyn),&2669 nys+1, nzb+1, force%tind+1,&2670 nyn-nys+1, force%nzu, 2, dynamic_3d)2736 nest_offl%u_right(0:1,nzb+1:nzt,nys:nyn), & 2737 nys+1, nzb+1, nest_offl%tind+1, & 2738 nyn-nys+1, nest_offl%nzu, 2, .FALSE. ) 2671 2739 2672 2740 CALL get_variable( id_dynamic, 'ls_forcing_right_v', & 2673 force%v_right(0:1,nzb+1:nzt+1,nysv:nyn),&2674 nysv, nzb+1, force%tind+1,&2675 nyn-nysv+1, force%nzu, 2, dynamic_3d)2741 nest_offl%v_right(0:1,nzb+1:nzt,nysv:nyn), & 2742 nysv, nzb+1, nest_offl%tind+1, & 2743 nyn-nysv+1, nest_offl%nzu, 2, .FALSE. ) 2676 2744 2677 2745 CALL get_variable( id_dynamic, 'ls_forcing_right_w', & 2678 force%w_right(0:1,nzb+1:nzt,nys:nyn),&2679 nys+1, nzb+1, force%tind+1,&2680 nyn-nys+1, force%nzw, 2, dynamic_3d)2746 nest_offl%w_right(0:1,nzb+1:nzt-1,nys:nyn), & 2747 nys+1, nzb+1, nest_offl%tind+1, & 2748 nyn-nys+1, nest_offl%nzw, 2, .FALSE. ) 2681 2749 2682 2750 IF ( .NOT. neutral ) THEN 2683 2751 CALL get_variable( id_dynamic, 'ls_forcing_right_pt', & 2684 force%pt_right(0:1,nzb+1:nzt+1,nys:nyn),&2685 nys+1, nzb+1, force%tind+1,&2686 nyn-nys+1, force%nzu, 2, dynamic_3d)2752 nest_offl%pt_right(0:1,nzb+1:nzt,nys:nyn), & 2753 nys+1, nzb+1, nest_offl%tind+1, & 2754 nyn-nys+1, nest_offl%nzu, 2, .FALSE. ) 2687 2755 ENDIF 2688 2756 IF ( humidity ) THEN 2689 2757 CALL get_variable( id_dynamic, 'ls_forcing_right_qv', & 2690 force%q_right(0:1,nzb+1:nzt+1,nys:nyn),&2691 nys+1, nzb+1, force%tind+1,&2692 nyn-nys+1, force%nzu, 2, dynamic_3d)2693 ENDIF 2694 ENDIF 2695 2696 IF ( force_bound_n ) THEN2758 nest_offl%q_right(0:1,nzb+1:nzt,nys:nyn), & 2759 nys+1, nzb+1, nest_offl%tind+1, & 2760 nyn-nys+1, nest_offl%nzu, 2, .FALSE. ) 2761 ENDIF 2762 ENDIF 2763 2764 IF ( bc_dirichlet_n ) THEN 2697 2765 2698 2766 CALL get_variable( id_dynamic, 'ls_forcing_north_u', & 2699 force%u_north(0:1,nzb+1:nzt+1,nxlu:nxr),&2700 nxlu, nzb+1, force%tind+1,&2701 nxr-nxlu+1, force%nzu, 2, dynamic_3d)2702 2767 nest_offl%u_north(0:1,nzb+1:nzt,nxlu:nxr), & 2768 nxlu, nzb+1, nest_offl%tind+1, & 2769 nxr-nxlu+1, nest_offl%nzu, 2, .FALSE. ) 2770 2703 2771 CALL get_variable( id_dynamic, 'ls_forcing_north_v', & 2704 force%v_north(0:1,nzb+1:nzt+1,nxl:nxr),&2705 nxl+1, nzb+1, force%tind+1,&2706 nxr-nxl+1, force%nzu, 2, dynamic_3d)2772 nest_offl%v_north(0:1,nzb+1:nzt,nxl:nxr), & 2773 nxl+1, nzb+1, nest_offl%tind+1, & 2774 nxr-nxl+1, nest_offl%nzu, 2, .FALSE. ) 2707 2775 2708 2776 CALL get_variable( id_dynamic, 'ls_forcing_north_w', & 2709 force%w_north(0:1,nzb+1:nzt,nxl:nxr),&2710 nxl+1, nzb+1, force%tind+1,&2711 nxr-nxl+1, force%nzw, 2, dynamic_3d)2777 nest_offl%w_north(0:1,nzb+1:nzt-1,nxl:nxr), & 2778 nxl+1, nzb+1, nest_offl%tind+1, & 2779 nxr-nxl+1, nest_offl%nzw, 2, .FALSE. ) 2712 2780 2713 2781 IF ( .NOT. neutral ) THEN 2714 2782 CALL get_variable( id_dynamic, 'ls_forcing_north_pt', & 2715 force%pt_north(0:1,nzb+1:nzt+1,nxl:nxr),&2716 nxl+1, nzb+1, force%tind+1,&2717 nxr-nxl+1, force%nzu, 2, dynamic_3d)2783 nest_offl%pt_north(0:1,nzb+1:nzt,nxl:nxr), & 2784 nxl+1, nzb+1, nest_offl%tind+1, & 2785 nxr-nxl+1, nest_offl%nzu, 2, .FALSE. ) 2718 2786 ENDIF 2719 2787 IF ( humidity ) THEN 2720 2788 CALL get_variable( id_dynamic, 'ls_forcing_north_qv', & 2721 force%q_north(0:1,nzb+1:nzt+1,nxl:nxr),&2722 nxl+1, nzb+1, force%tind+1,&2723 nxr-nxl+1, force%nzu, 2, dynamic_3d)2724 ENDIF 2725 ENDIF 2726 2727 IF ( force_bound_s ) THEN2789 nest_offl%q_north(0:1,nzb+1:nzt,nxl:nxr), & 2790 nxl+1, nzb+1, nest_offl%tind+1, & 2791 nxr-nxl+1, nest_offl%nzu, 2, .FALSE. ) 2792 ENDIF 2793 ENDIF 2794 2795 IF ( bc_dirichlet_s ) THEN 2728 2796 CALL get_variable( id_dynamic, 'ls_forcing_south_u', & 2729 force%u_south(0:1,nzb+1:nzt+1,nxlu:nxr),&2730 nxlu, nzb+1, force%tind+1,&2731 nxr-nxlu+1, force%nzu, 2, dynamic_3d)2797 nest_offl%u_south(0:1,nzb+1:nzt,nxlu:nxr), & 2798 nxlu, nzb+1, nest_offl%tind+1, & 2799 nxr-nxlu+1, nest_offl%nzu, 2, .FALSE. ) 2732 2800 2733 2801 CALL get_variable( id_dynamic, 'ls_forcing_south_v', & 2734 force%v_south(0:1,nzb+1:nzt+1,nxl:nxr),&2735 nxl+1, nzb+1, force%tind+1,&2736 nxr-nxl+1, force%nzu, 2, dynamic_3d)2802 nest_offl%v_south(0:1,nzb+1:nzt,nxl:nxr), & 2803 nxl+1, nzb+1, nest_offl%tind+1, & 2804 nxr-nxl+1, nest_offl%nzu, 2, .FALSE. ) 2737 2805 2738 2806 CALL get_variable( id_dynamic, 'ls_forcing_south_w', & 2739 force%w_south(0:1,nzb+1:nzt,nxl:nxr),&2740 nxl+1, nzb+1, force%tind+1,&2741 nxr-nxl+1, force%nzw, 2, dynamic_3d)2807 nest_offl%w_south(0:1,nzb+1:nzt-1,nxl:nxr), & 2808 nxl+1, nzb+1, nest_offl%tind+1, & 2809 nxr-nxl+1, nest_offl%nzw, 2, .FALSE. ) 2742 2810 2743 2811 IF ( .NOT. neutral ) THEN 2744 2812 CALL get_variable( id_dynamic, 'ls_forcing_south_pt', & 2745 force%pt_south(0:1,nzb+1:nzt+1,nxl:nxr),&2746 nxl+1, nzb+1, force%tind+1,&2747 nxr-nxl+1, force%nzu, 2, dynamic_3d)2813 nest_offl%pt_south(0:1,nzb+1:nzt,nxl:nxr), & 2814 nxl+1, nzb+1, nest_offl%tind+1, & 2815 nxr-nxl+1, nest_offl%nzu, 2, .FALSE. ) 2748 2816 ENDIF 2749 2817 IF ( humidity ) THEN 2750 2818 CALL get_variable( id_dynamic, 'ls_forcing_south_qv', & 2751 force%q_south(0:1,nzb+1:nzt+1,nxl:nxr), & 2752 nxl+1, nzb+1, force%tind+1, & 2753 nxr-nxl+1, force%nzu, 2, dynamic_3d ) 2754 ENDIF 2755 ENDIF 2819 nest_offl%q_south(0:1,nzb+1:nzt,nxl:nxr), & 2820 nxl+1, nzb+1, nest_offl%tind+1, & 2821 nxr-nxl+1, nest_offl%nzu, 2, .FALSE. ) 2822 ENDIF 2823 ENDIF 2824 2756 2825 ! 2757 2826 !-- Top boundary 2758 2827 CALL get_variable( id_dynamic, 'ls_forcing_top_u', & 2759 force%u_top(0:1,nys:nyn,nxlu:nxr),&2760 nxlu, nys+1, force%tind+1,&2761 nxr-nxlu+1, nyn-nys+1, 2, dynamic_3d)2828 nest_offl%u_top(0:1,nys:nyn,nxlu:nxr), & 2829 nxlu, nys+1, nest_offl%tind+1, & 2830 nxr-nxlu+1, nyn-nys+1, 2, .TRUE. ) 2762 2831 2763 2832 CALL get_variable( id_dynamic, 'ls_forcing_top_v', & 2764 force%v_top(0:1,nysv:nyn,nxl:nxr),&2765 nxl+1, nysv, force%tind+1,&2766 nxr-nxl+1, nyn-nysv+1, 2, dynamic_3d)2833 nest_offl%v_top(0:1,nysv:nyn,nxl:nxr), & 2834 nxl+1, nysv, nest_offl%tind+1, & 2835 nxr-nxl+1, nyn-nysv+1, 2, .TRUE. ) 2767 2836 2768 2837 CALL get_variable( id_dynamic, 'ls_forcing_top_w', & 2769 force%w_top(0:1,nys:nyn,nxl:nxr),&2770 nxl+1, nys+1, force%tind+1,&2771 nxr-nxl+1, nyn-nys+1, 2, dynamic_3d)2838 nest_offl%w_top(0:1,nys:nyn,nxl:nxr), & 2839 nxl+1, nys+1, nest_offl%tind+1, & 2840 nxr-nxl+1, nyn-nys+1, 2, .TRUE. ) 2772 2841 2773 2842 IF ( .NOT. neutral ) THEN 2774 2843 CALL get_variable( id_dynamic, 'ls_forcing_top_pt', & 2775 force%pt_top(0:1,nys:nyn,nxl:nxr),&2776 nxl+1, nys+1, force%tind+1,&2777 nxr-nxl+1, nyn-nys+1, 2, dynamic_3d)2844 nest_offl%pt_top(0:1,nys:nyn,nxl:nxr), & 2845 nxl+1, nys+1, nest_offl%tind+1, & 2846 nxr-nxl+1, nyn-nys+1, 2, .TRUE. ) 2778 2847 ENDIF 2779 2848 IF ( humidity ) THEN 2780 2849 CALL get_variable( id_dynamic, 'ls_forcing_top_qv', & 2781 force%q_top(0:1,nys:nyn,nxl:nxr),&2782 nxl+1, nys+1, force%tind+1,&2783 nxr-nxl+1, nyn-nys+1, 2, dynamic_3d)2850 nest_offl%q_top(0:1,nys:nyn,nxl:nxr), & 2851 nxl+1, nys+1, nest_offl%tind+1, & 2852 nxr-nxl+1, nyn-nys+1, 2, .TRUE. ) 2784 2853 ENDIF 2785 2854 … … 2792 2861 CALL cpu_log( log_point_s(86), 'NetCDF input forcing', 'stop' ) 2793 2862 2794 !2795 !-- Finally, after data input set control flag indicating that vertical2796 !-- inter- and/or extrapolation is required.2797 !-- Please note, inter/extrapolation of INIFOR data is only a workaroud,2798 !-- as long as INIFOR delivers vertically equidistant data.2799 force%interpolated = .FALSE.2800 2801 2863 END SUBROUTINE netcdf_data_input_lsf 2802 2864 … … 2810 2872 2811 2873 USE control_parameters, & 2812 ONLY: initializing_actions, forcing, message_string2874 ONLY: initializing_actions, message_string, nesting_offline 2813 2875 2814 2876 IMPLICIT NONE … … 2816 2878 ! 2817 2879 !-- In case of forcing, check whether dynamic input file is present 2818 IF ( .NOT. input_pids_dynamic .AND. forcing ) THEN 2819 message_string = 'forcing = .TRUE. requires dynamic input file ' // & 2880 IF ( .NOT. input_pids_dynamic .AND. nesting_offline ) THEN 2881 message_string = 'nesting_offline = .TRUE. requires dynamic ' // & 2882 'input file ' // & 2820 2883 TRIM( input_file_dynamic ) // TRIM( coupling_char ) 2821 2884 CALL message( 'netcdf_data_input_mod', 'NDI009', 1, 2, 0, 6, 0 ) … … 4514 4577 !------------------------------------------------------------------------------! 4515 4578 SUBROUTINE get_variable_3d_real_dynamic( id, variable_name, var, & 4516 i1s, i2s, i3s, count_1, count_2, count_3, dynamic) 4579 i1s, i2s, i3s, & 4580 count_1, count_2, count_3, & 4581 par_access ) 4517 4582 4518 4583 USE indices … … 4523 4588 CHARACTER(LEN=*) :: variable_name !< variable name 4524 4589 4525 LOGICAL :: dynamic !< additional flag just used to select correct overloaded routine from interface block4590 LOGICAL :: par_access !< additional flag indicating whether parallel read operations should be performed or not 4526 4591 4527 4592 INTEGER(iwp) :: count_1 !< number of elements to be read along 1st dimension (with respect to file) … … 4550 4615 #if defined( __netcdf ) 4551 4616 ! 4552 !-- Inquire variable id 4617 !-- Inquire variable id. 4553 4618 nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var ) 4554 4619 ! 4555 4620 !-- Check for collective read-operation and set respective NetCDF flags if 4556 4621 !-- required. 4557 IF ( collective_read ) THEN 4622 !-- Please note, in contrast to the other input routines where each PEs 4623 !-- reads its subdomain data, dynamic input data not by all PEs, only 4624 !-- by those which encompass lateral model boundaries. Hence, collective 4625 !-- read operations are only enabled for top-boundary data. 4626 IF ( collective_read .AND. par_access ) THEN 4558 4627 nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE) 4559 4628 ENDIF -
palm/trunk/SOURCE/palm.f90
r2977 r3182 238 238 USE control_parameters, & 239 239 ONLY: air_chemistry, & 240 cloud_physics, constant_diffusion, coupling_char, coupling_mode,& 240 cloud_physics, constant_diffusion, child_domain, coupling_char, & 241 coupling_mode, & 241 242 do2d_at_begin, do3d_at_begin, humidity, initializing_actions, & 242 243 io_blocks, io_group, large_scale_forcing, & 243 244 message_string, microphysics_morrison, microphysics_seifert, & 244 ne st_domain, neutral, nudging, passive_scalar, runnr,&245 neutral, nudging, passive_scalar, runnr, & 245 246 simulated_time, simulated_time_chr, spinup, & 246 247 time_since_reference_point, & … … 428 429 ! 429 430 !-- Exchange_horiz is needed after the nest initialization 430 IF ( nest_domain ) THEN431 IF ( child_domain ) THEN 431 432 CALL exchange_horiz( u, nbgp ) 432 433 CALL exchange_horiz( v, nbgp ) -
palm/trunk/SOURCE/parin.f90
r3159 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Rename variables and boundary conditions in mesoscale-offline nesting mode 23 23 ! 24 24 ! Former revisions: … … 529 529 dz_stretch_factor, dz_stretch_level, dz_stretch_level_start, & 530 530 dz_stretch_level_end, end_time_1d, ensemble_member_nr, e_init, & 531 e_min, fft_method, flux_input_mode, flux_output_mode, forcing,&531 e_min, fft_method, flux_input_mode, flux_output_mode, & 532 532 galilei_transformation, humidity, & 533 533 inflow_damping_height, inflow_damping_width, & … … 538 538 loop_optimization, lsf_exception, masking_method, mg_cycles, & 539 539 mg_switch_to_pe0_level, mixing_length_1d, momentum_advec, & 540 most_method, na_init, nc_const, netcdf_precision, neutral, ngsrb, & 540 most_method, na_init, nc_const, nesting_offline, & 541 netcdf_precision, neutral, ngsrb, & 541 542 nsor, nsor_ini, nudging, nx, ny, nz, ocean, omega, omega_sor, & 542 543 outflow_source_plane, passive_scalar, & … … 601 602 dz_stretch_factor, dz_stretch_level, dz_stretch_level_start, & 602 603 dz_stretch_level_end, end_time_1d, ensemble_member_nr, e_init, & 603 e_min, fft_method, flux_input_mode, flux_output_mode, forcing,&604 e_min, fft_method, flux_input_mode, flux_output_mode, & 604 605 galilei_transformation, humidity, & 605 606 inflow_damping_height, inflow_damping_width, & … … 610 611 loop_optimization, lsf_exception, masking_method, mg_cycles, & 611 612 mg_switch_to_pe0_level, mixing_length_1d, momentum_advec, & 612 most_method, na_init, nc_const, netcdf_precision, neutral, ngsrb, & 613 most_method, na_init, nc_const, nesting_offline, & 614 netcdf_precision, neutral, ngsrb, & 613 615 nsor, nsor_ini, nudging, nx, ny, nz, ocean, omega, omega_sor, & 614 616 outflow_source_plane, passive_scalar, & … … 924 926 bc_ns = 'cyclic' 925 927 ENDIF 926 IF ( nest_domain ) THEN928 IF ( child_domain ) THEN 927 929 bc_uv_t = 'nested' 928 930 bc_pt_t = 'nested' … … 936 938 !-- nested domains. 937 939 ELSE 938 IF ( nest_domain ) THEN940 IF ( child_domain ) THEN 939 941 bc_lr = 'nested' 940 942 bc_ns = 'nested' … … 948 950 ENDIF 949 951 ENDIF 950 951 IF ( forcing ) THEN 952 bc_lr = 'forcing' 953 bc_ns = 'forcing' 954 bc_uv_t = 'forcing' 955 bc_pt_t = 'forcing' 956 bc_q_t = 'forcing' 957 bc_s_t = 'forcing' ! scalar boundary condition is not clear 958 bc_cs_t = 'forcing' ! same for chemical species 952 ! 953 !-- Set boundary conditions also in case the model is offline-nested in 954 !-- larger-scale models. 955 IF ( nesting_offline ) THEN 956 bc_lr = 'nesting_offline' 957 bc_ns = 'nesting_offline' 958 bc_uv_t = 'nesting_offline' 959 bc_pt_t = 'nesting_offline' 960 bc_q_t = 'nesting_offline' 961 bc_s_t = 'nesting_offline' ! scalar boundary condition is not clear 962 bc_cs_t = 'nesting_offline' ! same for chemical species 959 963 bc_p_t = 'neumann' 960 964 ENDIF … … 968 972 !-- are set properly. An exception is made in case of restart runs and 969 973 !-- if user decides to do everything by its own. 970 IF ( nest_domain .AND. .NOT. (&974 IF ( child_domain .AND. .NOT. ( & 971 975 TRIM( initializing_actions ) == 'read_restart_data' .OR. & 972 976 TRIM( initializing_actions ) == 'set_constant_profiles' .OR. & … … 979 983 980 984 initializing_actions = 'set_constant_profiles' 981 ENDIF 982 985 ENDIF 983 986 ! 984 987 !-- Check validity of lateral boundary conditions. This has to be done … … 987 990 IF ( bc_lr /= 'cyclic' .AND. bc_lr /= 'dirichlet/radiation' .AND. & 988 991 bc_lr /= 'radiation/dirichlet' .AND. bc_lr /= 'nested' .AND. & 989 bc_lr /= ' forcing' ) THEN992 bc_lr /= 'nesting_offline' ) THEN 990 993 message_string = 'unknown boundary condition: bc_lr = "' // & 991 994 TRIM( bc_lr ) // '"' … … 994 997 IF ( bc_ns /= 'cyclic' .AND. bc_ns /= 'dirichlet/radiation' .AND. & 995 998 bc_ns /= 'radiation/dirichlet' .AND. bc_ns /= 'nested' .AND. & 996 bc_ns /= ' forcing' ) THEN999 bc_ns /= 'nesting_offline' ) THEN 997 1000 message_string = 'unknown boundary condition: bc_ns = "' // & 998 1001 TRIM( bc_ns ) // '"' -
palm/trunk/SOURCE/pmc_interface_mod.f90
r3083 r3182 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Variable names for nest_bound_x replaced by bc_dirichlet_x. 23 ! Remove commented prints into debug files. 23 24 ! 24 25 ! Former revisions: … … 306 307 USE arrays_3d, & 307 308 ONLY: diss, diss_2, dzu, dzw, e, e_p, e_2, nc, nc_2, nc_p, nr, nr_2, & 308 pt, pt_2, q, q_2, qc, qc_2, qr, qr_2, s, s_2, 309 pt, pt_2, q, q_2, qc, qc_2, qr, qr_2, s, s_2, & 309 310 u, u_p, u_2, v, v_p, v_2, w, w_p, w_2, zu, zw 310 311 #endif 311 312 312 313 USE control_parameters, & 313 ONLY: air_chemistry, cloud_physics, & 314 ONLY: air_chemistry, bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 315 bc_dirichlet_s, cloud_physics, child_domain, & 314 316 constant_diffusion, constant_flux_layer, & 315 317 coupling_char, dt_3d, dz, humidity, message_string, & 316 318 microphysics_morrison, microphysics_seifert, & 317 nest_bound_l, nest_bound_r, nest_bound_s, nest_bound_n, & 318 nest_domain, neutral, passive_scalar, rans_mode, rans_tke_e, & 319 neutral, passive_scalar, rans_mode, rans_tke_e, & 319 320 roughness_length, simulated_time, topography, volume_flow 320 321 … … 743 744 !-- course the root domain (cpl_id = 1) is not nested) 744 745 IF ( cpl_id >= 2 ) THEN 745 nest_domain = .TRUE.746 child_domain = .TRUE. 746 747 WRITE( coupling_char, '(A2,I2.2)') '_N', cpl_id 747 748 ENDIF … … 1192 1193 childgrid(m)%uz_coord = zmax_coarse(2) 1193 1194 childgrid(m)%uz_coord_b = zmax_coarse(1) 1194 1195 ! WRITE(9,*) 'edge coordinates for child id ',child_id,m1196 ! WRITE(9,*) 'Number of Boundray cells lpm ',nbgp_lpm1197 ! WRITE(9,'(a,3i7,2f10.2)') ' model size ', nx_cl, ny_cl, nz_cl, dx_cl, dy_cl1198 ! WRITE(9,'(a,5f10.2)') ' model edge ', childgrid(m)%lx_coord, &1199 ! childgrid(m)%rx_coord, childgrid(m)%sy_coord, &1200 ! childgrid(m)%ny_coord,childgrid(m)%uz_coord1201 ! WRITE(9,'(a,4f10.2)') ' model edge with Boundary ', childgrid(m)%lx_coord_b,&1202 ! childgrid(m)%rx_coord_b, childgrid(m)%sy_coord_b, &1203 ! childgrid(m)%ny_coord_b1204 1195 1205 1196 END SUBROUTINE set_child_edge_coords … … 1714 1705 !-- interpolation routines. 1715 1706 nzt_topo_nestbc_l = nzb 1716 IF ( nest_bound_l ) THEN1707 IF ( bc_dirichlet_l ) THEN 1717 1708 DO i = nxl-1, nxl 1718 1709 DO j = nys, nyn … … 1740 1731 1741 1732 nzt_topo_nestbc_r = nzb 1742 IF ( nest_bound_r ) THEN1733 IF ( bc_dirichlet_r ) THEN 1743 1734 i = nxr + 1 1744 1735 DO j = nys, nyn … … 1765 1756 1766 1757 nzt_topo_nestbc_s = nzb 1767 IF ( nest_bound_s ) THEN1758 IF ( bc_dirichlet_s ) THEN 1768 1759 DO j = nys-1, nys 1769 1760 DO i = nxl, nxr … … 1791 1782 1792 1783 nzt_topo_nestbc_n = nzb 1793 IF ( nest_bound_n ) THEN1784 IF ( bc_dirichlet_n ) THEN 1794 1785 j = nyn + 1 1795 1786 DO i = nxl, nxr … … 1862 1853 !-- logc_kbounds_* need to be allocated and initialized here. 1863 1854 !-- Left boundary 1864 IF ( nest_bound_l ) THEN1855 IF ( bc_dirichlet_l ) THEN 1865 1856 1866 1857 ALLOCATE( logc_u_l(1:2,nzb:nzt_topo_nestbc_l,nys:nyn) ) … … 1923 1914 ! 1924 1915 !-- Right boundary 1925 IF ( nest_bound_r ) THEN1916 IF ( bc_dirichlet_r ) THEN 1926 1917 1927 1918 ALLOCATE( logc_u_r(1:2,nzb:nzt_topo_nestbc_r,nys:nyn) ) … … 1985 1976 ! 1986 1977 !-- South boundary 1987 IF ( nest_bound_s ) THEN1978 IF ( bc_dirichlet_s ) THEN 1988 1979 1989 1980 ALLOCATE( logc_u_s(1:2,nzb:nzt_topo_nestbc_s,nxl:nxr) ) … … 2044 2035 ! 2045 2036 !-- North boundary 2046 IF ( nest_bound_n ) THEN2037 IF ( bc_dirichlet_n ) THEN 2047 2038 2048 2039 ALLOCATE( logc_u_n(1:2,nzb:nzt_topo_nestbc_n,nxl:nxr) ) … … 2116 2107 ! 2117 2108 !-- Left boundary 2118 IF ( nest_bound_l ) THEN2109 IF ( bc_dirichlet_l ) THEN 2119 2110 logc_kbounds_u_l(1:2,nys:nyn) = 0 2120 2111 logc_kbounds_v_l(1:2,nys:nyn) = 0 … … 2255 2246 ENDDO 2256 2247 2257 ENDIF ! IF ( nest_bound_l )2248 ENDIF ! IF ( bc_dirichlet_l ) 2258 2249 ! 2259 2250 !-- Right boundary 2260 IF ( nest_bound_r ) THEN2251 IF ( bc_dirichlet_r ) THEN 2261 2252 logc_kbounds_u_r(1:2,nys:nyn) = 0 2262 2253 logc_kbounds_v_r(1:2,nys:nyn) = 0 … … 2395 2386 ENDDO 2396 2387 2397 ENDIF ! IF ( nest_bound_r )2388 ENDIF ! IF ( bc_dirichlet_r ) 2398 2389 ! 2399 2390 !-- South boundary 2400 IF ( nest_bound_s ) THEN2391 IF ( bc_dirichlet_s ) THEN 2401 2392 logc_kbounds_u_s(1:2,nxl:nxr) = 0 2402 2393 logc_kbounds_v_s(1:2,nxl:nxr) = 0 … … 2537 2528 ENDDO 2538 2529 2539 ENDIF ! IF ( nest_bound_s )2530 ENDIF ! IF (bc_dirichlet_s ) 2540 2531 ! 2541 2532 !-- North boundary 2542 IF ( nest_bound_n ) THEN2533 IF ( bc_dirichlet_n ) THEN 2543 2534 logc_kbounds_u_n(1:2,nxl:nxr) = 0 2544 2535 logc_kbounds_v_n(1:2,nxl:nxr) = 0 … … 2678 2669 ENDDO 2679 2670 2680 ENDIF ! IF ( nest_bound_n )2671 ENDIF ! IF ( bc_dirichlet_n ) 2681 2672 2682 2673 ENDIF ! IF ( topography /= 'flat' ) … … 2786 2777 2787 2778 END SELECT 2788 2789 !write(9,"('pmci_define_loglaw_correction_parameters: ', 6(i3,2x))") &2790 ! direction, ij, k, wall_index, inc, lc2791 2779 2792 2780 END SUBROUTINE pmci_define_loglaw_correction_parameters … … 3325 3313 ! 3326 3314 IF ( .NOT. rans_mode .AND. .NOT. rans_mode_parent ) THEN 3327 IF ( nest_bound_l ) THEN3315 IF ( bc_dirichlet_l ) THEN 3328 3316 ALLOCATE( tkefactor_l(nzb:nzt+1,nysg:nyng) ) 3329 3317 tkefactor_l = 0.0_wp … … 3345 3333 ENDIF 3346 3334 3347 IF ( nest_bound_r ) THEN3335 IF ( bc_dirichlet_r ) THEN 3348 3336 ALLOCATE( tkefactor_r(nzb:nzt+1,nysg:nyng) ) 3349 3337 tkefactor_r = 0.0_wp … … 3365 3353 ENDIF 3366 3354 3367 IF ( nest_bound_s ) THEN3355 IF ( bc_dirichlet_s ) THEN 3368 3356 ALLOCATE( tkefactor_s(nzb:nzt+1,nxlg:nxrg) ) 3369 3357 tkefactor_s = 0.0_wp … … 3386 3374 ENDIF 3387 3375 3388 IF ( nest_bound_n ) THEN3376 IF ( bc_dirichlet_n ) THEN 3389 3377 ALLOCATE( tkefactor_n(nzb:nzt+1,nxlg:nxrg) ) 3390 3378 tkefactor_n = 0.0_wp … … 3428 3416 !-- RANS mode 3429 3417 ELSE 3430 IF ( nest_bound_l ) THEN3418 IF ( bc_dirichlet_l ) THEN 3431 3419 ALLOCATE( tkefactor_l(nzb:nzt+1,nysg:nyng) ) 3432 3420 tkefactor_l = 1.0_wp 3433 3421 ENDIF 3434 IF ( nest_bound_r ) THEN3422 IF ( bc_dirichlet_r ) THEN 3435 3423 ALLOCATE( tkefactor_r(nzb:nzt+1,nysg:nyng) ) 3436 3424 tkefactor_r = 1.0_wp 3437 3425 ENDIF 3438 IF ( nest_bound_s ) THEN3426 IF ( bc_dirichlet_s ) THEN 3439 3427 ALLOCATE( tkefactor_s(nzb:nzt+1,nxlg:nxrg) ) 3440 3428 tkefactor_s = 1.0_wp 3441 3429 ENDIF 3442 IF ( nest_bound_n ) THEN3430 IF ( bc_dirichlet_n ) THEN 3443 3431 ALLOCATE( tkefactor_n(nzb:nzt+1,nxlg:nxrg) ) 3444 3432 tkefactor_n = 1.0_wp … … 3980 3968 je = nyn 3981 3969 IF ( nesting_mode /= 'vertical' ) THEN 3982 IF ( nest_bound_l ) THEN3970 IF ( bc_dirichlet_l ) THEN 3983 3971 ib = nxl - 1 3984 3972 ! … … 3988 3976 ENDIF 3989 3977 ENDIF 3990 IF ( nest_bound_s ) THEN3978 IF ( bc_dirichlet_s ) THEN 3991 3979 jb = nys - 1 3992 3980 ! … … 3996 3984 ENDIF 3997 3985 ENDIF 3998 IF ( nest_bound_r ) THEN3986 IF ( bc_dirichlet_r ) THEN 3999 3987 ie = nxr + 1 4000 3988 ENDIF 4001 IF ( nest_bound_n ) THEN3989 IF ( bc_dirichlet_n ) THEN 4002 3990 je = nyn + 1 4003 3991 ENDIF … … 4201 4189 volume_flow_l(1) = 0.0_wp 4202 4190 4203 IF ( nest_bound_l ) THEN4191 IF ( bc_dirichlet_l ) THEN 4204 4192 i = 0 4205 4193 innor = dy … … 4213 4201 ENDIF 4214 4202 4215 IF ( nest_bound_r ) THEN4203 IF ( bc_dirichlet_r ) THEN 4216 4204 i = nx + 1 4217 4205 innor = -dy … … 4238 4226 volume_flow_l(2) = 0.0_wp 4239 4227 4240 IF ( nest_bound_s ) THEN4228 IF ( bc_dirichlet_s ) THEN 4241 4229 j = 0 4242 4230 innor = dx … … 4250 4238 ENDIF 4251 4239 4252 IF ( nest_bound_n ) THEN4240 IF ( bc_dirichlet_n ) THEN 4253 4241 j = ny + 1 4254 4242 innor = -dx … … 4549 4537 ! 4550 4538 !-- Left border pe: 4551 IF ( nest_bound_l ) THEN4539 IF ( bc_dirichlet_l ) THEN 4552 4540 4553 4541 CALL pmci_interp_tril_lr( u, uc, icu, jco, kco, r1xu, r2xu, & … … 4656 4644 ! 4657 4645 !-- Right border pe 4658 IF ( nest_bound_r ) THEN4646 IF ( bc_dirichlet_r ) THEN 4659 4647 4660 4648 CALL pmci_interp_tril_lr( u, uc, icu, jco, kco, r1xu, r2xu, & … … 4769 4757 ! 4770 4758 !-- South border pe 4771 IF ( nest_bound_s ) THEN4759 IF ( bc_dirichlet_s ) THEN 4772 4760 4773 4761 CALL pmci_interp_tril_sn( u, uc, icu, jco, kco, r1xu, r2xu, & … … 4880 4868 ! 4881 4869 !-- North border pe 4882 IF ( nest_bound_n ) THEN4870 IF ( bc_dirichlet_n ) THEN 4883 4871 4884 4872 CALL pmci_interp_tril_sn( u, uc, icu, jco, kco, r1xu, r2xu, & … … 5748 5736 !-- comprehensive explanation for this is still pending. 5749 5737 IF ( nesting_mode == 'vertical' ) THEN 5750 IF ( nest_bound_l ) THEN5738 IF ( bc_dirichlet_l ) THEN 5751 5739 iclp = icl + nhll 5752 5740 ENDIF 5753 IF ( nest_bound_r ) THEN5741 IF ( bc_dirichlet_r ) THEN 5754 5742 icrm = icr - nhlr 5755 5743 ENDIF 5756 IF ( nest_bound_s ) THEN5744 IF ( bc_dirichlet_s ) THEN 5757 5745 jcsp = jcs + nhls 5758 5746 ENDIF 5759 IF ( nest_bound_n ) THEN5747 IF ( bc_dirichlet_n ) THEN 5760 5748 jcnm = jcn - nhln 5761 5749 ENDIF 5762 5750 ELSE 5763 IF ( nest_bound_l ) THEN5751 IF ( bc_dirichlet_l ) THEN 5764 5752 IF ( var == 'u' ) THEN 5765 5753 iclp = icl + nhll + 1 + 1 … … 5768 5756 ENDIF 5769 5757 ENDIF 5770 IF ( nest_bound_r ) THEN5758 IF ( bc_dirichlet_r ) THEN 5771 5759 icrm = icr - nhlr - 1 5772 5760 ENDIF 5773 5761 5774 IF ( nest_bound_s ) THEN5762 IF ( bc_dirichlet_s ) THEN 5775 5763 IF ( var == 'v' ) THEN 5776 5764 jcsp = jcs + nhls + 1 + 1 … … 5779 5767 ENDIF 5780 5768 ENDIF 5781 IF ( nest_bound_n ) THEN5769 IF ( bc_dirichlet_n ) THEN 5782 5770 jcnm = jcn - nhln - 1 5783 5771 ENDIF -
palm/trunk/SOURCE/pmc_parent_mod.f90
r3049 r3182 203 203 INTEGER(iwp) :: istat !< 204 204 205 206 205 DO i = 1, SIZE( pmc_parent_for_child )-1 207 206 … … 219 218 CALL MPI_COMM_REMOTE_SIZE( children(childid)%inter_comm, & 220 219 children(childid)%inter_npes, istat ) 221 222 220 ! 223 221 !-- Intra communicator is used for MPI_GET … … 228 226 229 227 ALLOCATE( children(childid)%pes(children(childid)%inter_npes)) 230 231 228 ! 232 229 !-- Allocate array of TYPE arraydef for all child PEs to store information … … 865 862 DO 866 863 CALL pmc_bcast( myname%couple_index, 0, comm=m_to_child_comm(childid) ) 864 867 865 IF ( myname%couple_index == -1 ) EXIT 866 868 867 CALL pmc_bcast( myname%parentdesc, 0, comm=m_to_child_comm(childid) ) 869 868 CALL pmc_bcast( myname%nameonparent, 0, comm=m_to_child_comm(childid) ) -
palm/trunk/SOURCE/poismg_mod.f90
r2939 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Rename variables in mesoscale-offline nesting mode 23 23 ! 24 24 ! Former revisions: … … 26 26 ! $Id$ 27 27 ! Set lateral boundary conditions for divergence 28 ! 28 ! 29 29 ! 2937 2018-03-27 14:58:33Z suehring 30 30 ! Corrected "Former revisions" section … … 107 107 108 108 USE control_parameters, & 109 ONLY: grid_level, force_bound_l, force_bound_n, force_bound_r, & 110 force_bound_s, forcing, inflow_l, inflow_n, inflow_r, inflow_s, & 111 nest_bound_l, nest_bound_n, nest_bound_r, nest_bound_s, & 112 outflow_l, outflow_n, outflow_r, outflow_s 109 ONLY: bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 110 bc_dirichlet_s, bc_radiation_l, bc_radiation_n, bc_radiation_r, & 111 bc_radiation_s, grid_level, nesting_offline 113 112 114 113 USE cpulog, & … … 206 205 !-- Set lateral boundary conditions in non-cyclic case 207 206 IF ( .NOT. bc_lr_cyc ) THEN 208 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l )&207 IF ( bc_dirichlet_l .OR. bc_radiation_l ) & 209 208 d(:,:,nxl-1) = d(:,:,nxl) 210 IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. force_bound_r )&209 IF ( bc_dirichlet_r .OR. bc_radiation_r ) & 211 210 d(:,:,nxr+1) = d(:,:,nxr) 212 211 ENDIF 213 212 IF ( .NOT. bc_ns_cyc ) THEN 214 IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. force_bound_n )&213 IF ( bc_dirichlet_n .OR. bc_radiation_n ) & 215 214 d(:,nyn+1,:) = d(:,nyn,:) 216 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s )&215 IF ( bc_dirichlet_s .OR. bc_radiation_s ) & 217 216 d(:,nys-1,:) = d(:,nys,:) 218 217 ENDIF … … 375 374 376 375 IF ( .NOT. bc_lr_cyc ) THEN 377 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. & 378 force_bound_l ) THEN 376 IF ( bc_dirichlet_l .OR. bc_radiation_l ) THEN 379 377 r(:,:,nxl_mg(l)-1) = r(:,:,nxl_mg(l)) 380 378 ENDIF 381 IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. & 382 force_bound_r ) THEN 379 IF ( bc_dirichlet_r .OR. bc_radiation_r ) THEN 383 380 r(:,:,nxr_mg(l)+1) = r(:,:,nxr_mg(l)) 384 381 ENDIF … … 386 383 387 384 IF ( .NOT. bc_ns_cyc ) THEN 388 IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. & 389 force_bound_n ) THEN 385 IF ( bc_dirichlet_n .OR. bc_radiation_n ) THEN 390 386 r(:,nyn_mg(l)+1,:) = r(:,nyn_mg(l),:) 391 387 ENDIF 392 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. & 393 force_bound_s ) THEN 388 IF ( bc_dirichlet_s .OR. bc_radiation_s ) THEN 394 389 r(:,nys_mg(l)-1,:) = r(:,nys_mg(l),:) 395 390 ENDIF … … 510 505 !-- Horizontal boundary conditions 511 506 IF ( .NOT. bc_lr_cyc ) THEN 512 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. & 513 force_bound_l ) THEN 507 IF ( bc_dirichlet_l .OR. bc_radiation_l ) THEN 514 508 f_mg(:,:,nxl_mg(l)-1) = f_mg(:,:,nxl_mg(l)) 515 509 ENDIF 516 IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. & 517 force_bound_r ) THEN 510 IF ( bc_dirichlet_r .OR. bc_radiation_r ) THEN 518 511 f_mg(:,:,nxr_mg(l)+1) = f_mg(:,:,nxr_mg(l)) 519 512 ENDIF … … 521 514 522 515 IF ( .NOT. bc_ns_cyc ) THEN 523 IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. & 524 force_bound_n ) THEN 516 IF ( bc_dirichlet_n .OR. bc_radiation_n ) THEN 525 517 f_mg(:,nyn_mg(l)+1,:) = f_mg(:,nyn_mg(l),:) 526 518 ENDIF 527 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. & 528 force_bound_s ) THEN 519 IF ( bc_dirichlet_s .OR. bc_radiation_s ) THEN 529 520 f_mg(:,nys_mg(l)-1,:) = f_mg(:,nys_mg(l),:) 530 521 ENDIF … … 681 672 682 673 IF ( .NOT. bc_lr_cyc ) THEN 683 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. & 684 force_bound_l ) THEN 674 IF ( bc_dirichlet_l .OR. bc_radiation_l ) THEN 685 675 temp(:,:,nxl_mg(l)-1) = temp(:,:,nxl_mg(l)) 686 676 ENDIF 687 IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. & 688 force_bound_r ) THEN 677 IF ( bc_dirichlet_r .OR. bc_radiation_r ) THEN 689 678 temp(:,:,nxr_mg(l)+1) = temp(:,:,nxr_mg(l)) 690 679 ENDIF … … 692 681 693 682 IF ( .NOT. bc_ns_cyc ) THEN 694 IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. & 695 force_bound_n ) THEN 683 IF ( bc_dirichlet_n .OR. bc_radiation_n ) THEN 696 684 temp(:,nyn_mg(l)+1,:) = temp(:,nyn_mg(l),:) 697 685 ENDIF 698 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. & 699 force_bound_s ) THEN 686 IF ( bc_dirichlet_s .OR. bc_radiation_s ) THEN 700 687 temp(:,nys_mg(l)-1,:) = temp(:,nys_mg(l),:) 701 688 ENDIF … … 991 978 992 979 IF ( .NOT. bc_lr_cyc ) THEN 993 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. & 994 force_bound_l ) THEN 980 IF ( bc_dirichlet_l .OR. bc_radiation_l ) THEN 995 981 p_mg(:,:,nxl_mg(l)-1) = p_mg(:,:,nxl_mg(l)) 996 982 ENDIF 997 IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. & 998 force_bound_r ) THEN 983 IF ( bc_dirichlet_r .OR. bc_radiation_r ) THEN 999 984 p_mg(:,:,nxr_mg(l)+1) = p_mg(:,:,nxr_mg(l)) 1000 985 ENDIF … … 1002 987 1003 988 IF ( .NOT. bc_ns_cyc ) THEN 1004 IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. & 1005 force_bound_n ) THEN 989 IF ( bc_dirichlet_n .OR. bc_radiation_n ) THEN 1006 990 p_mg(:,nyn_mg(l)+1,:) = p_mg(:,nyn_mg(l),:) 1007 991 ENDIF 1008 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. & 1009 force_bound_s ) THEN 992 IF ( bc_dirichlet_s .OR. bc_radiation_s ) THEN 1010 993 p_mg(:,nys_mg(l)-1,:) = p_mg(:,nys_mg(l),:) 1011 994 ENDIF … … 1423 1406 USE control_parameters, & 1424 1407 ONLY: bc_lr_dirrad, bc_lr_raddir, bc_ns_dirrad, bc_ns_raddir, & 1425 gamma_mg, grid_level_count, ibc_p_b, ibc_p_t,&1408 child_domain, gamma_mg, grid_level_count, ibc_p_b, ibc_p_t, & 1426 1409 maximum_grid_level, mg_switch_to_pe0_level, & 1427 mg_switch_to_pe0, n est_domain, ngsrb1410 mg_switch_to_pe0, ngsrb 1428 1411 1429 1412 USE indices, & … … 1564 1547 !-- because then they have the total domain. 1565 1548 IF ( bc_lr_dirrad ) THEN 1566 inflow_l = .TRUE.1567 inflow_r = .FALSE.1568 outflow_l = .FALSE.1569 outflow_r = .TRUE.1549 bc_dirichlet_l = .TRUE. 1550 bc_dirichlet_r = .FALSE. 1551 bc_radiation_l = .FALSE. 1552 bc_radiation_r = .TRUE. 1570 1553 ELSEIF ( bc_lr_raddir ) THEN 1571 inflow_l = .FALSE. 1572 inflow_r = .TRUE. 1573 outflow_l = .TRUE. 1574 outflow_r = .FALSE. 1575 ELSEIF ( nest_domain ) THEN 1576 nest_bound_l = .TRUE. 1577 nest_bound_r = .TRUE. 1578 ELSEIF ( forcing ) THEN 1579 force_bound_l = .TRUE. 1580 force_bound_r = .TRUE. 1554 bc_dirichlet_l = .FALSE. 1555 bc_dirichlet_r = .TRUE. 1556 bc_radiation_l = .TRUE. 1557 bc_radiation_r = .FALSE. 1558 ELSEIF ( child_domain .OR. nesting_offline ) THEN 1559 bc_dirichlet_l = .TRUE. 1560 bc_dirichlet_r = .TRUE. 1581 1561 ENDIF 1582 1562 1583 1563 IF ( bc_ns_dirrad ) THEN 1584 inflow_n = .TRUE.1585 inflow_s = .FALSE.1586 outflow_n = .FALSE.1587 outflow_s = .TRUE.1564 bc_dirichlet_n = .TRUE. 1565 bc_dirichlet_s = .FALSE. 1566 bc_radiation_n = .FALSE. 1567 bc_radiation_s = .TRUE. 1588 1568 ELSEIF ( bc_ns_raddir ) THEN 1589 inflow_n = .FALSE. 1590 inflow_s = .TRUE. 1591 outflow_n = .TRUE. 1592 outflow_s = .FALSE. 1593 ELSEIF ( nest_domain ) THEN 1594 nest_bound_s = .TRUE. 1595 nest_bound_n = .TRUE. 1596 ELSEIF ( forcing ) THEN 1597 force_bound_s = .TRUE. 1598 force_bound_n = .TRUE. 1569 bc_dirichlet_n = .FALSE. 1570 bc_dirichlet_s = .TRUE. 1571 bc_radiation_n = .TRUE. 1572 bc_radiation_s = .FALSE. 1573 ELSEIF ( child_domain .OR. nesting_offline) THEN 1574 bc_dirichlet_s = .TRUE. 1575 bc_dirichlet_n = .TRUE. 1599 1576 ENDIF 1600 1577 … … 1659 1636 !-- For non-cyclic lateral boundary conditions and in case of nesting, 1660 1637 !-- restore the in-/outflow conditions. 1661 inflow_l = .FALSE.; inflow_r = .FALSE. 1662 inflow_n = .FALSE.; inflow_s = .FALSE. 1663 outflow_l = .FALSE.; outflow_r = .FALSE. 1664 outflow_n = .FALSE.; outflow_s = .FALSE. 1665 ! 1666 !-- In case of nesting or forcing, restore lateral boundary conditions 1667 IF ( nest_domain ) THEN 1668 nest_bound_l = .FALSE. 1669 nest_bound_r = .FALSE. 1670 nest_bound_s = .FALSE. 1671 nest_bound_n = .FALSE. 1672 ENDIF 1673 IF ( forcing ) THEN 1674 force_bound_l = .FALSE. 1675 force_bound_r = .FALSE. 1676 force_bound_s = .FALSE. 1677 force_bound_n = .FALSE. 1678 ENDIF 1638 bc_dirichlet_l = .FALSE.; bc_dirichlet_r = .FALSE. 1639 bc_dirichlet_n = .FALSE.; bc_dirichlet_s = .FALSE. 1640 bc_radiation_l = .FALSE.; bc_radiation_r = .FALSE. 1641 bc_radiation_n = .FALSE.; bc_radiation_s = .FALSE. 1679 1642 1680 1643 IF ( pleft == MPI_PROC_NULL ) THEN 1681 IF ( bc_lr_dirrad ) THEN 1682 inflow_l = .TRUE. 1644 IF ( bc_lr_dirrad .OR. child_domain .OR. nesting_offline ) & 1645 THEN 1646 bc_dirichlet_l = .TRUE. 1683 1647 ELSEIF ( bc_lr_raddir ) THEN 1684 outflow_l = .TRUE. 1685 ELSEIF ( nest_domain ) THEN 1686 nest_bound_l = .TRUE. 1687 ELSEIF ( forcing ) THEN 1688 force_bound_l = .TRUE. 1648 bc_radiation_l = .TRUE. 1689 1649 ENDIF 1690 1650 ENDIF … … 1692 1652 IF ( pright == MPI_PROC_NULL ) THEN 1693 1653 IF ( bc_lr_dirrad ) THEN 1694 outflow_r = .TRUE. 1695 ELSEIF ( bc_lr_raddir ) THEN 1696 inflow_r = .TRUE. 1697 ELSEIF ( nest_domain ) THEN 1698 nest_bound_r = .TRUE. 1699 ELSEIF ( forcing ) THEN 1700 force_bound_r = .TRUE. 1654 bc_radiation_r = .TRUE. 1655 ELSEIF ( bc_lr_raddir .OR. child_domain .OR. & 1656 nesting_offline ) THEN 1657 bc_dirichlet_r = .TRUE. 1701 1658 ENDIF 1702 1659 ENDIF … … 1704 1661 IF ( psouth == MPI_PROC_NULL ) THEN 1705 1662 IF ( bc_ns_dirrad ) THEN 1706 outflow_s = .TRUE. 1663 bc_radiation_s = .TRUE. 1664 ELSEIF ( bc_ns_raddir .OR. child_domain .OR. & 1665 nesting_offline ) THEN 1666 bc_dirichlet_s = .TRUE. 1667 ENDIF 1668 ENDIF 1669 1670 IF ( pnorth == MPI_PROC_NULL ) THEN 1671 IF ( bc_ns_dirrad .OR. child_domain .OR. nesting_offline ) & 1672 THEN 1673 bc_dirichlet_n = .TRUE. 1707 1674 ELSEIF ( bc_ns_raddir ) THEN 1708 inflow_s = .TRUE. 1709 ELSEIF ( nest_domain ) THEN 1710 nest_bound_s = .TRUE. 1711 ELSEIF ( forcing ) THEN 1712 force_bound_s = .TRUE. 1713 ENDIF 1714 ENDIF 1715 1716 IF ( pnorth == MPI_PROC_NULL ) THEN 1717 IF ( bc_ns_dirrad ) THEN 1718 inflow_n = .TRUE. 1719 ELSEIF ( bc_ns_raddir ) THEN 1720 outflow_n = .TRUE. 1721 ELSEIF ( nest_domain ) THEN 1722 nest_bound_n = .TRUE. 1723 ELSEIF ( forcing ) THEN 1724 force_bound_n = .TRUE. 1675 bc_radiation_n = .TRUE. 1725 1676 ENDIF 1726 1677 ENDIF -
palm/trunk/SOURCE/poismg_noopt_mod.f90
r2939 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Rename variables in mesoscale-offline nesting mode 23 23 ! 24 24 ! Former revisions: … … 165 165 166 166 USE control_parameters, & 167 ONLY: grid_level, force_bound_l, force_bound_n, force_bound_r, & 168 force_bound_s, forcing, inflow_l, inflow_n, inflow_r, inflow_s, & 169 nest_bound_l, nest_bound_n, nest_bound_r, nest_bound_s, & 170 outflow_l, outflow_n, outflow_r, outflow_s 167 ONLY: bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r, & 168 bc_dirichlet_s, bc_radiation_l, bc_radiation_n, bc_radiation_r, & 169 bc_radiation_s, child_domain, grid_level, nesting_offline 171 170 172 171 USE cpulog, & … … 261 260 !-- Set lateral boundary conditions in non-cyclic case 262 261 IF ( .NOT. bc_lr_cyc ) THEN 263 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l )&262 IF ( bc_dirichlet_l .OR. bc_radiation_l ) & 264 263 d(:,:,nxl-1) = d(:,:,nxl) 265 IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. force_bound_r )&264 IF ( bc_dirichlet_r .OR. bc_radiation_r ) & 266 265 d(:,:,nxr+1) = d(:,:,nxr) 267 266 ENDIF 268 267 IF ( .NOT. bc_ns_cyc ) THEN 269 IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. force_bound_n )&268 IF ( bc_dirichlet_n .OR. bc_radiation_n ) & 270 269 d(:,nyn+1,:) = d(:,nyn,:) 271 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s )&270 IF ( bc_dirichlet_s .OR. bc_radiation_s ) & 272 271 d(:,nys-1,:) = d(:,nys,:) 273 272 ENDIF … … 442 441 443 442 IF ( .NOT. bc_lr_cyc ) THEN 444 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l ) THEN443 IF ( bc_dirichlet_l .OR. bc_radiation_l ) THEN 445 444 r(:,:,nxl_mg(l)-1) = r(:,:,nxl_mg(l)) 446 445 ENDIF 447 IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. force_bound_r ) THEN446 IF ( bc_dirichlet_r .OR. bc_radiation_r ) THEN 448 447 r(:,:,nxr_mg(l)+1) = r(:,:,nxr_mg(l)) 449 448 END