Changeset 2984 for palm/trunk/SOURCE/pmc_interface_mod.f90
- Timestamp:
- Apr 18, 2018 11:51:30 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/pmc_interface_mod.f90
r2967 r2984 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Bugfix in the log-law correction initialization. Pivot node cannot any more be 28 ! selected from outside the subdomain in order to prevent array under/overflows. 29 ! 30 ! 2967 2018-04-13 11:22:08Z raasch 27 31 ! bugfix: missing parallel cpp-directives added 28 32 ! … … 2116 2120 k, j, inc, wall_index, z0_topo, kb, direction, & 2117 2121 ncorr ) 2118 ! 2119 !-- The direction of the wall-normal index is stored as the 2120 !-- sign of the logc-element. 2121 logc_u_l(2,k,j) = inc * lc 2122 logc_ratio_u_l(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2122 IF ( lc == -99 ) THEN 2123 ! 2124 !-- The pivot point is out of subdomain, skip the correction. 2125 logc_u_l(2,k,j) = 0 2126 logc_ratio_u_l(2,0:ncorr-1,k,j) = 1.0_wp 2127 ELSE 2128 ! 2129 !-- The direction of the wall-normal index is stored as the 2130 !-- sign of the logc-element. 2131 logc_u_l(2,k,j) = inc * lc 2132 logc_ratio_u_l(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2133 ENDIF 2123 2134 lcr(0:ncorr-1) = 1.0_wp 2124 2135 ENDDO … … 2138 2149 k, j, inc, wall_index, z0_topo, kb, direction, & 2139 2150 ncorr ) 2140 ! 2141 !-- The direction of the wall-normal index is stored as the 2142 !-- sign of the logc-element. 2143 logc_u_l(2,k,j) = inc * lc 2144 logc_ratio_u_l(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2151 IF ( lc == -99 ) THEN 2152 ! 2153 !-- The pivot point is out of subdomain, skip the correction. 2154 logc_u_l(2,k,j) = 0 2155 logc_ratio_u_l(2,0:ncorr-1,k,j) = 1.0_wp 2156 ELSE 2157 ! 2158 !-- The direction of the wall-normal index is stored as the 2159 !-- sign of the logc-element. 2160 logc_u_l(2,k,j) = inc * lc 2161 logc_ratio_u_l(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2162 ENDIF 2145 2163 lcr(0:ncorr-1) = 1.0_wp 2146 2164 ENDDO … … 2166 2184 k, j, inc, wall_index, z0_topo, kb, direction, & 2167 2185 ncorr ) 2168 ! 2169 !-- The direction of the wall-normal index is stored as the 2170 !-- sign of the logc-element. 2171 logc_w_l(2,k,j) = inc * lc 2172 logc_ratio_w_l(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2186 IF ( lc == -99 ) THEN 2187 ! 2188 !-- The pivot point is out of subdomain, skip the correction. 2189 logc_w_l(2,k,j) = 0 2190 logc_ratio_w_l(2,0:ncorr-1,k,j) = 1.0_wp 2191 ELSE 2192 ! 2193 !-- The direction of the wall-normal index is stored as the 2194 !-- sign of the logc-element. 2195 logc_w_l(2,k,j) = inc * lc 2196 logc_ratio_w_l(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2197 ENDIF 2173 2198 lcr(0:ncorr-1) = 1.0_wp 2174 2199 ENDDO … … 2188 2213 k, j, inc, wall_index, z0_topo, kb, direction, & 2189 2214 ncorr ) 2190 ! 2191 !-- The direction of the wall-normal index is stored as the 2192 !-- sign of the logc-element. 2193 logc_w_l(2,k,j) = inc * lc 2194 logc_ratio_w_l(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2215 IF ( lc == -99 ) THEN 2216 ! 2217 !-- The pivot point is out of subdomain, skip the correction. 2218 logc_w_l(2,k,j) = 0 2219 logc_ratio_w_l(2,0:ncorr-1,k,j) = 1.0_wp 2220 ELSE 2221 ! 2222 !-- The direction of the wall-normal index is stored as the 2223 !-- sign of the logc-element. 2224 logc_w_l(2,k,j) = inc * lc 2225 logc_ratio_w_l(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2226 ENDIF 2195 2227 lcr(0:ncorr-1) = 1.0_wp 2196 2228 ENDDO … … 2229 2261 CALL pmci_define_loglaw_correction_parameters( lc, lcr, & 2230 2262 k, j, inc, wall_index, z0_topo, kb, direction, ncorr ) 2231 ! 2232 !-- The direction of the wall-normal index is stored as the 2233 !-- sign of the logc-element. 2234 logc_u_r(2,k,j) = inc * lc 2235 logc_ratio_u_r(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2263 IF ( lc == -99 ) THEN 2264 ! 2265 !-- The pivot point is out of subdomain, skip the correction. 2266 logc_u_r(2,k,j) = 0 2267 logc_ratio_u_r(2,0:ncorr-1,k,j) = 1.0_wp 2268 ELSE 2269 ! 2270 !-- The direction of the wall-normal index is stored as the 2271 !-- sign of the logc-element. 2272 logc_u_r(2,k,j) = inc * lc 2273 logc_ratio_u_r(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2274 ENDIF 2236 2275 lcr(0:ncorr-1) = 1.0_wp 2237 2276 ENDDO … … 2251 2290 k, j, inc, wall_index, z0_topo, kb, direction, & 2252 2291 ncorr ) 2253 ! 2254 !-- The direction of the wall-normal index is stored as the 2255 !-- sign of the logc-element. 2256 logc_u_r(2,k,j) = inc * lc 2257 logc_ratio_u_r(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2292 IF ( lc == -99 ) THEN 2293 ! 2294 !-- The pivot point is out of subdomain, skip the correction. 2295 logc_u_r(2,k,j) = 0 2296 logc_ratio_u_r(2,0:ncorr-1,k,j) = 1.0_wp 2297 ELSE 2298 ! 2299 !-- The direction of the wall-normal index is stored as the 2300 !-- sign of the logc-element. 2301 logc_u_r(2,k,j) = inc * lc 2302 logc_ratio_u_r(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2303 ENDIF 2258 2304 lcr(0:ncorr-1) = 1.0_wp 2259 2305 ENDDO … … 2278 2324 k, j, inc, wall_index, z0_topo, kb, direction, & 2279 2325 ncorr ) 2280 ! 2281 !-- The direction of the wall-normal index is stored as the 2282 !-- sign of the logc-element. 2283 logc_w_r(2,k,j) = inc * lc 2284 logc_ratio_w_r(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2326 IF ( lc == -99 ) THEN 2327 ! 2328 !-- The pivot point is out of subdomain, skip the correction. 2329 logc_w_r(2,k,j) = 0 2330 logc_ratio_w_r(2,0:ncorr-1,k,j) = 1.0_wp 2331 ELSE 2332 ! 2333 !-- The direction of the wall-normal index is stored as the 2334 !-- sign of the logc-element. 2335 logc_w_r(2,k,j) = inc * lc 2336 logc_ratio_w_r(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2337 ENDIF 2285 2338 lcr(0:ncorr-1) = 1.0_wp 2286 2339 ENDDO … … 2300 2353 k, j, inc, wall_index, z0_topo, kb, direction, & 2301 2354 ncorr ) 2302 ! 2303 !-- The direction of the wall-normal index is stored as the 2304 !-- sign of the logc-element. 2305 logc_w_r(2,k,j) = inc * lc 2306 logc_ratio_w_r(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2355 IF ( lc == -99 ) THEN 2356 ! 2357 !-- The pivot point is out of subdomain, skip the correction. 2358 logc_w_r(2,k,j) = 0 2359 logc_ratio_w_r(2,0:ncorr-1,k,j) = 1.0_wp 2360 ELSE 2361 ! 2362 !-- The direction of the wall-normal index is stored as the 2363 !-- sign of the logc-element. 2364 logc_w_r(2,k,j) = inc * lc 2365 logc_ratio_w_r(2,0:ncorr-1,k,j) = lcr(0:ncorr-1) 2366 ENDIF 2307 2367 lcr(0:ncorr-1) = 1.0_wp 2308 2368 ENDDO … … 2342 2402 k, i, inc, wall_index, z0_topo, kb, direction, & 2343 2403 ncorr ) 2344 ! 2345 !-- The direction of the wall-normal index is stored as the 2346 !-- sign of the logc-element. 2347 logc_v_s(2,k,i) = inc * lc 2348 logc_ratio_v_s(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2404 IF ( lc == -99 ) THEN 2405 ! 2406 !-- The pivot point is out of subdomain, skip the correction. 2407 logc_v_s(2,k,i) = 0 2408 logc_ratio_v_s(2,0:ncorr-1,k,i) = 1.0_wp 2409 ELSE 2410 ! 2411 !-- The direction of the wall-normal index is stored as the 2412 !-- sign of the logc-element. 2413 logc_v_s(2,k,i) = inc * lc 2414 logc_ratio_v_s(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2415 ENDIF 2349 2416 lcr(0:ncorr-1) = 1.0_wp 2350 2417 ENDDO … … 2364 2431 k, i, inc, wall_index, z0_topo, kb, direction, & 2365 2432 ncorr ) 2366 ! 2367 !-- The direction of the wall-normal index is stored as the 2368 !-- sign of the logc-element. 2369 logc_v_s(2,k,i) = inc * lc 2370 logc_ratio_v_s(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2433 IF ( lc == -99 ) THEN 2434 ! 2435 !-- The pivot point is out of subdomain, skip the correction. 2436 logc_v_s(2,k,i) = 0 2437 logc_ratio_v_s(2,0:ncorr-1,k,i) = 1.0_wp 2438 ELSE 2439 ! 2440 !-- The direction of the wall-normal index is stored as the 2441 !-- sign of the logc-element. 2442 logc_v_s(2,k,i) = inc * lc 2443 logc_ratio_v_s(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2444 ENDIF 2371 2445 lcr(0:ncorr-1) = 1.0_wp 2372 2446 ENDDO … … 2392 2466 k, i, inc, wall_index, z0_topo, kb, direction, & 2393 2467 ncorr ) 2394 ! 2395 !-- The direction of the wall-normal index is stored as the 2396 !-- sign of the logc-element. 2397 logc_w_s(2,k,i) = inc * lc 2398 logc_ratio_w_s(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2468 IF ( lc == -99 ) THEN 2469 ! 2470 !-- The pivot point is out of subdomain, skip the correction. 2471 logc_w_s(2,k,i) = 0 2472 logc_ratio_w_s(2,0:ncorr-1,k,i) = 1.0_wp 2473 ELSE 2474 ! 2475 !-- The direction of the wall-normal index is stored as the 2476 !-- sign of the logc-element. 2477 logc_w_s(2,k,i) = inc * lc 2478 logc_ratio_w_s(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2479 ENDIF 2399 2480 lcr(0:ncorr-1) = 1.0_wp 2400 2481 ENDDO … … 2414 2495 k, i, inc, wall_index, z0_topo, kb, direction, & 2415 2496 ncorr ) 2416 ! 2417 !-- The direction of the wall-normal index is stored as the 2418 !-- sign of the logc-element. 2419 logc_w_s(2,k,i) = inc * lc 2420 logc_ratio_w_s(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2497 IF ( lc == -99 ) THEN 2498 ! 2499 !-- The pivot point is out of subdomain, skip the correction. 2500 logc_w_s(2,k,i) = 0 2501 logc_ratio_w_s(2,0:ncorr-1,k,i) = 1.0_wp 2502 ELSE 2503 ! 2504 !-- The direction of the wall-normal index is stored as the 2505 !-- sign of the logc-element. 2506 logc_w_s(2,k,i) = inc * lc 2507 logc_ratio_w_s(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2508 ENDIF 2421 2509 lcr(0:ncorr-1) = 1.0_wp 2422 2510 ENDDO … … 2456 2544 k, i, inc, wall_index, z0_topo, kb, direction, & 2457 2545 ncorr ) 2458 ! 2459 !-- The direction of the wall-normal index is stored as the 2460 !-- sign of the logc-element. 2461 logc_v_n(2,k,i) = inc * lc 2462 logc_ratio_v_n(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2546 IF ( lc == -99 ) THEN 2547 ! 2548 !-- The pivot point is out of subdomain, skip the correction. 2549 logc_v_n(2,k,i) = 0 2550 logc_ratio_v_n(2,0:ncorr-1,k,i) = 1.0_wp 2551 ELSE 2552 ! 2553 !-- The direction of the wall-normal index is stored as the 2554 !-- sign of the logc-element. 2555 logc_v_n(2,k,i) = inc * lc 2556 logc_ratio_v_n(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2557 ENDIF 2463 2558 lcr(0:ncorr-1) = 1.0_wp 2464 2559 ENDDO … … 2478 2573 k, i, inc, wall_index, z0_topo, kb, direction, & 2479 2574 ncorr ) 2480 ! 2481 !-- The direction of the wall-normal index is stored as the 2482 !-- sign of the logc-element. 2483 logc_v_n(2,k,i) = inc * lc 2484 logc_ratio_v_n(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2575 IF ( lc == -99 ) THEN 2576 ! 2577 !-- The pivot point is out of subdomain, skip the correction. 2578 logc_v_n(2,k,i) = 0 2579 logc_ratio_v_n(2,0:ncorr-1,k,i) = 1.0_wp 2580 ELSE 2581 ! 2582 !-- The direction of the wall-normal index is stored as the 2583 !-- sign of the logc-element. 2584 logc_v_n(2,k,i) = inc * lc 2585 logc_ratio_v_n(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2586 ENDIF 2485 2587 lcr(0:ncorr-1) = 1.0_wp 2486 2588 ENDDO … … 2505 2607 k, i, inc, wall_index, z0_topo, kb, direction, & 2506 2608 ncorr ) 2507 ! 2508 !-- The direction of the wall-normal index is stored as the 2509 !-- sign of the logc-element. 2510 logc_w_n(2,k,i) = inc * lc 2511 logc_ratio_w_n(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2609 IF ( lc == -99 ) THEN 2610 ! 2611 !-- The pivot point is out of subdomain, skip the correction. 2612 logc_w_n(2,k,i) = 0 2613 logc_ratio_w_n(2,0:ncorr-1,k,i) = 1.0_wp 2614 ELSE 2615 ! 2616 !-- The direction of the wall-normal index is stored as the 2617 !-- sign of the logc-element. 2618 logc_w_n(2,k,i) = inc * lc 2619 logc_ratio_w_n(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2620 ENDIF 2512 2621 lcr(0:ncorr-1) = 1.0_wp 2513 2622 ENDDO … … 2527 2636 k, i, inc, wall_index, z0_topo, kb, direction, & 2528 2637 ncorr ) 2529 ! 2530 !-- The direction of the wall-normal index is stored as the 2531 !-- sign of the logc-element. 2532 logc_w_n(2,k,i) = inc * lc 2533 logc_ratio_w_n(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2638 IF ( lc == -99 ) THEN 2639 ! 2640 !-- The pivot point is out of subdomain, skip the correction. 2641 logc_w_n(2,k,i) = 0 2642 logc_ratio_w_n(2,0:ncorr-1,k,i) = 1.0_wp 2643 ELSE 2644 ! 2645 !-- The direction of the wall-normal index is stored as the 2646 !-- sign of the logc-element. 2647 logc_w_n(2,k,i) = inc * lc 2648 logc_ratio_w_n(2,0:ncorr-1,k,i) = lcr(0:ncorr-1) 2649 ENDIF 2534 2650 lcr(0:ncorr-1) = 1.0_wp 2535 2651 ENDDO … … 2646 2762 2647 2763 END SELECT 2764 2765 !write(9,"('pmci_define_loglaw_correction_parameters: ', 6(i3,2x))") & 2766 ! direction, ij, k, wall_index, inc, lc 2648 2767 2649 2768 END SUBROUTINE pmci_define_loglaw_correction_parameters … … 2670 2789 REAL(wp) :: zuc1 !< 2671 2790 2672 2791 ! 2792 !-- kbc is the first coarse-grid point above the surface 2673 2793 kbc = nzb + 1 2674 !2675 !-- kbc is the first coarse-grid point above the surface2676 2794 DO WHILE ( cg%zu(kbc) < zu(kb) ) 2677 2795 kbc = kbc + 1 … … 2691 2809 SUBROUTINE pmci_find_logc_pivot_j( lc, logyc1, j, jw, z0_l, inc ) 2692 2810 ! 2693 !-- Finds the pivot node and t e log-law factor for near-wall nodes for2811 !-- Finds the pivot node and the log-law factor for near-wall nodes for 2694 2812 !-- which the wall-parallel velocity components will be log-law corrected 2695 2813 !-- after interpolation. This subroutine is only for vertical walls on 2696 !-- south/north sides of the node. 2697 2814 !-- south/north sides of the node. If the pivot node is found to be outside 2815 !-- the subdomain, a marker value of -99 is set to lc and this tells 2816 !-- pmci_init_loglaw_correction to not do the correction in this case. 2817 2698 2818 IMPLICIT NONE 2699 2819 … … 2703 2823 INTEGER(iwp), INTENT(OUT) :: lc !< 2704 2824 2825 INTEGER(iwp) :: jwc !< 2705 2826 INTEGER(iwp) :: j1 !< 2706 2827 … … 2708 2829 2709 2830 REAL(wp) :: logyc1 !< 2831 REAL(wp) :: ycb !< 2710 2832 REAL(wp) :: yc1 !< 2711 2833 2712 2834 ! 2713 2835 !-- yc1 is the y-coordinate of the first coarse-grid u- and w-nodes out from 2714 !-- the wall 2715 yc1 = coord_y(jw) + 0.5_wp * inc * cg%dy 2716 ! 2717 !-- j1 is the first fine-grid index further away from the wall than yc1 2718 j1 = j 2719 ! 2720 !-- Important: must be <, not <= 2721 DO WHILE ( inc * ( coord_y(j1) + 0.5_wp * dy ) < inc * yc1 ) 2722 j1 = j1 + inc 2723 ENDDO 2724 2725 logyc1 = LOG( ABS( coord_y(j1) + 0.5_wp * dy - coord_y(jw) ) / z0_l ) 2726 lc = j1 2727 2836 !-- the wall. Here we assume that the wall index in the coarse grid is the 2837 !-- closest one if they don't match. 2838 jwc = pmci_find_nearest_coarse_grid_index_j( jw ) 2839 yc1 = cg%coord_y(jwc) - lower_left_coord_y + 0.5_wp * inc * cg%dy 2840 ! 2841 !-- Check if yc1 is out of the subdomain y-range. In such case set the marker 2842 !-- value -99 for lc in order to skip the loglaw-correction locally. 2843 IF ( yc1 < ( REAL( nysg, KIND=wp ) + 0.5_wp ) * dy ) THEN 2844 lc = -99 2845 ELSE IF ( yc1 > ( REAL( nyng, KIND=wp ) + 0.5_wp ) * dy ) THEN 2846 lc = -99 2847 ELSE 2848 ! 2849 !-- j1 is the first fine-grid index further away from the wall than yc1 2850 j1 = j 2851 ! 2852 !-- Important: the binary relation must be <, not <= 2853 ycb = 0.5_wp * dy - lower_left_coord_y 2854 DO WHILE ( inc * ( coord_y(j1) + ycb ) < inc * yc1 ) 2855 j1 = j1 + inc 2856 ENDDO 2857 2858 logyc1 = LOG( ABS( coord_y(j1) + 0.5_wp * dy - coord_y(jw) ) / z0_l ) 2859 lc = j1 2860 ENDIF 2861 2728 2862 END SUBROUTINE pmci_find_logc_pivot_j 2729 2863 … … 2735 2869 !-- which the wall-parallel velocity components will be log-law corrected 2736 2870 !-- after interpolation. This subroutine is only for vertical walls on 2737 !-- south/north sides of the node. 2871 !-- left/right sides of the node. If the pivot node is found to be outside 2872 !-- the subdomain, a marker value of -99 is set to lc and this tells 2873 !-- pmci_init_loglaw_correction to not do the correction in this case. 2738 2874 2739 2875 IMPLICIT NONE … … 2744 2880 INTEGER(iwp), INTENT(OUT) :: lc !< 2745 2881 2882 INTEGER(iwp) :: iwc !< 2746 2883 INTEGER(iwp) :: i1 !< 2747 2884 … … 2749 2886 2750 2887 REAL(wp) :: logxc1 !< 2888 REAL(wp) :: xcb !< 2751 2889 REAL(wp) :: xc1 !< 2752 2890 2753 2891 ! 2754 2892 !-- xc1 is the x-coordinate of the first coarse-grid v- and w-nodes out from 2755 !-- the wall 2756 xc1 = coord_x(iw) + 0.5_wp * inc * cg%dx 2757 ! 2758 !-- i1 is the first fine-grid index futher away from the wall than xc1. 2759 i1 = i 2760 ! 2761 !-- Important: must be <, not <= 2762 DO WHILE ( inc * ( coord_x(i1) + 0.5_wp *dx ) < inc * xc1 ) 2763 i1 = i1 + inc 2764 ENDDO 2893 !-- the wall. Here we assume that the wall index in the coarse grid is the 2894 !-- closest one if they don't match. 2895 iwc = pmci_find_nearest_coarse_grid_index_i( iw ) 2896 xc1 = cg%coord_x(iwc) - lower_left_coord_x + 0.5_wp * inc * cg%dx 2897 ! 2898 !-- Check if xc1 is out of the subdomain x-range. In such case set the marker 2899 !-- value -99 for lc in order to skip the loglaw-correction locally. 2900 IF ( xc1 < ( REAL( nxlg, KIND=wp ) + 0.5_wp ) * dx ) THEN 2901 lc = -99 2902 ELSE IF ( xc1 > ( REAL( nxrg, KIND=wp ) + 0.5_wp ) * dx ) THEN 2903 lc = -99 2904 ELSE 2905 ! 2906 !-- i1 is the first fine-grid index futher away from the wall than xc1. 2907 i1 = i 2908 ! 2909 !-- Important: the binary relation must be <, not <= 2910 xcb = 0.5_wp * dx - lower_left_coord_x 2911 DO WHILE ( inc * ( coord_x(i1) + xcb ) < inc * xc1 ) 2912 i1 = i1 + inc 2913 ENDDO 2765 2914 2766 logxc1 = LOG( ABS( coord_x(i1) + 0.5_wp*dx - coord_x(iw) ) / z0_l ) 2767 lc = i1 2768 2915 logxc1 = LOG( ABS( coord_x(i1) + 0.5_wp*dx - coord_x(iw) ) / z0_l ) 2916 lc = i1 2917 ENDIF 2918 2769 2919 END SUBROUTINE pmci_find_logc_pivot_i 2770 2920 2771 2921 2772 2773 2922 2923 FUNCTION pmci_find_nearest_coarse_grid_index_j( jw ) 2924 2925 IMPLICIT NONE 2926 INTEGER(iwp) :: jw !< Fine-grid wall index 2927 2928 INTEGER(iwp) :: jc 2929 INTEGER(iwp) :: pmci_find_nearest_coarse_grid_index_j 2930 REAL(wp) :: dist 2931 REAL(wp) :: newdist 2932 2933 2934 dist = coord_y(nyn) - coord_y(nys) 2935 DO jc = jcs, jcn 2936 newdist = ABS( cg%coord_y(jc) - coord_y(jw) ) 2937 IF ( newdist < dist ) THEN 2938 pmci_find_nearest_coarse_grid_index_j = jc 2939 dist = newdist 2940 ENDIF 2941 ENDDO 2942 2943 END FUNCTION pmci_find_nearest_coarse_grid_index_j 2944 2945 2946 2947 FUNCTION pmci_find_nearest_coarse_grid_index_i( iw ) 2948 2949 IMPLICIT NONE 2950 INTEGER(iwp) :: iw !< Fine-grid wall index 2951 2952 INTEGER(iwp) :: ic 2953 INTEGER(iwp) :: pmci_find_nearest_coarse_grid_index_i 2954 REAL(wp) :: dist 2955 REAL(wp) :: newdist 2956 2957 2958 dist = coord_x(nxr) - coord_x(nxl) 2959 DO ic = icl, icr 2960 newdist = ABS( cg%coord_x(ic) - coord_x(iw) ) 2961 IF ( newdist < dist ) THEN 2962 pmci_find_nearest_coarse_grid_index_i = ic 2963 dist = newdist 2964 ENDIF 2965 ENDDO 2966 2967 END FUNCTION pmci_find_nearest_coarse_grid_index_i 2968 2969 2970 2774 2971 SUBROUTINE pmci_init_anterp_tophat 2775 2972 !
Note: See TracChangeset
for help on using the changeset viewer.