Changeset 573
- Timestamp:
- 10/12/17 19:10:20 (7 years ago)
- Location:
- codes/icosagcm/devel/src/dynamics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/src/dynamics/caldyn_kernels_base.F90
r562 r573 50 50 51 51 IF(dysl_geopot) THEN 52 #ifdef CPP_DYSL53 52 #include "../kernels/compute_geopot.k90" 54 #else55 STOP 'dysl_geopot=.TRUE. but DYNAMICO has been compiled without the -dysl option'56 #endif57 53 ELSE 58 54 ! Pressure is computed first top-down (temporarily stored in pk) … … 316 312 CALL trace_start("compute_caldyn_vert_nh") 317 313 318 #ifdef CPP_DYSL 314 IF(dysl) THEN 319 315 !$OMP BARRIER 320 316 #include "../kernels/caldyn_vert_NH.k90" 321 317 !$OMP BARRIER 322 #else 318 ELSE 323 319 #define ETA_DOT(ij) eta_dot(ij,1) 324 320 #define WCOV(ij) wcov(ij,1) … … 367 363 #undef ETA_DOT 368 364 #undef WCOV 369 #endif 370 365 366 END IF ! dysl 371 367 CALL trace_end("compute_caldyn_vert_nh") 372 368 -
codes/icosagcm/devel/src/dynamics/caldyn_kernels_hevi.F90
r565 r573 62 62 !!! Compute shallow-water potential vorticity 63 63 IF(dysl_pvort_only) THEN 64 #ifdef CPP_DYSL65 64 #include "../kernels/pvort_only.k90" 66 #else67 STOP 'dysl_pvort_only=.TRUE. but DYNAMICO is compiled without the -dysl option'68 #endif69 65 ELSE 70 66 … … 130 126 ij_omp_end_ext=ij_omp_end_ext+ij_begin_ext-1 131 127 132 #ifdef CPP_DYSL 128 IF(dysl) THEN 133 129 #define PHI_BOT(ij) phis(ij) 134 130 #include "../kernels/compute_NH_geopot.k90" 135 #else 131 #undef PHI_BOT 132 ELSE 136 133 ! FIXME : vertical OpenMP parallelism will not work 137 134 … … 267 264 END DO ! Newton-Raphson 268 265 269 #endif 266 END IF ! dysl 270 267 271 268 END SUBROUTINE compute_NH_geopot … … 286 283 287 284 REAL(rstd) :: berni(iim*jjm,llm) ! (W/m_il)^2 285 REAL(rstd) :: berni1(iim*jjm) ! (W/m_il)^2 288 286 REAL(rstd) :: gamma, rho_ij, T_ij, X_ij, Y_ij, vreff, Rd, Cvd 289 287 INTEGER :: ij, l … … 293 291 Rd=cpp*kappa 294 292 295 #ifdef CPP_DYSL 293 IF(dysl) THEN 294 296 295 !$OMP BARRIER 297 296 #define PHI_BOT(ij) phis(ij) 298 297 #define PHI_BOT_VAR phis 299 298 #include "../kernels/caldyn_solver.k90" 299 #undef PHI_BOT_VAR 300 #undef PHI_BOT 300 301 !$OMP BARRIER 301 #else 302 #define BERNI(ij) berni(ij,1) 302 303 ELSE 304 305 #define BERNI(ij) berni1(ij) 303 306 ! FIXME : vertical OpenMP parallelism will not work 304 307 … … 382 385 ENDDO 383 386 #undef BERNI 384 #endif 387 388 END IF ! dysl 385 389 386 390 CALL trace_end("compute_caldyn_solver") … … 407 411 408 412 IF(dysl_caldyn_fast) THEN 409 #ifdef CPP_DYSL410 413 #include "../kernels/caldyn_fast.k90" 411 #else412 STOP 'dysl_caldyn_fast=.TRUE. but DYNAMICO is compiled without the -dysl option'413 #endif414 414 ELSE 415 415 … … 532 532 533 533 IF(dysl_caldyn_coriolis) THEN 534 #ifdef CPP_DYSL 534 535 535 #include "../kernels/coriolis.k90" 536 #else537 STOP 'dysl_caldyn_coriolis is .TRUE. but DYNAMICO is compiled without the -dysl option'538 #endif539 536 540 537 ELSE … … 689 686 690 687 REAL(rstd) :: berni(iim*jjm,llm) ! Bernoulli function 688 REAL(rstd) :: berni1(iim*jjm) ! Bernoulli function 691 689 REAL(rstd) :: uu_right, uu_lup, uu_ldown, ke, uu 692 690 INTEGER :: ij,l … … 695 693 696 694 IF(dysl_slow_hydro) THEN 697 #ifdef CPP_DYSL 695 698 696 #define BERNI(ij,l) berni(ij,l) 699 697 #include "../kernels/caldyn_slow_hydro.k90" 700 698 #undef BERNI 701 #else702 STOP 'dysl_slow_hydro=.TRUE. but DYNAMICO is compiled without the -dysl option'703 #endif704 699 705 700 ELSE 706 701 707 #define BERNI(ij) berni (ij,1)702 #define BERNI(ij) berni1(ij) 708 703 709 704 DO l = ll_begin, ll_end … … 753 748 END IF 754 749 END DO 750 755 751 #undef BERNI 752 756 753 END IF ! dysl 757 754 CALL trace_end("compute_caldyn_slow_hydro") … … 777 774 REAL(rstd) :: W_el, W2_el, uu_right, uu_lup, uu_ldown, gPhi2, dP, divG, u2, uu 778 775 779 #ifdef CPP_DYSL780 776 REAL(rstd) :: berni(iim*jjm,llm) ! Bernoulli function 781 777 REAL(rstd) :: G_el(3*iim*jjm,llm+1) ! horizontal flux of W 782 778 REAL(rstd) :: v_el(3*iim*jjm,llm+1) 783 #else 784 REAL(rstd) :: berni(iim*jjm) ! Bernoulli function 785 REAL(rstd) :: G_el(3*iim*jjm) ! horizontal flux of W 786 REAL(rstd) :: v_el(3*iim*jjm) 787 #endif 779 780 REAL(rstd) :: berni1(iim*jjm) ! Bernoulli function 781 REAL(rstd) :: G_el1(3*iim*jjm) ! horizontal flux of W 782 REAL(rstd) :: v_el1(3*iim*jjm) 788 783 789 784 CALL trace_start("compute_caldyn_slow_NH") 790 785 791 #ifdef CPP_DYSL 786 IF(dysl) THEN 787 792 788 !$OMP BARRIER 793 789 #include "../kernels/caldyn_slow_NH.k90" 794 790 !$OMP BARRIER 795 #else 791 792 ELSE 793 794 #define BERNI(ij) berni1(ij) 795 #define G_EL(ij) G_el1(ij) 796 #define V_EL(ij) v_el1(ij) 797 796 798 DO l=ll_begin, ll_endp1 ! compute on l levels (interfaces) 797 799 IF(l==1) THEN … … 820 822 W2_el = .5*le_de(ij+u_right) * & 821 823 ( W(ij,l)*w_il(ij,l) + W(ij+t_right,l)*w_il(ij+t_right,l) ) 822 v_el(ij+u_right) = .5*le_de(ij+u_right)*(u(ij+u_right,kup)+u(ij+u_right,kdown)) ! checked823 G_ el(ij+u_right) = v_el(ij+u_right)*W_el - DePhil(ij+u_right,l)*W2_el824 V_EL(ij+u_right) = .5*le_de(ij+u_right)*(u(ij+u_right,kup)+u(ij+u_right,kdown)) ! checked 825 G_EL(ij+u_right) = V_EL(ij+u_right)*W_el - DePhil(ij+u_right,l)*W2_el 824 826 ! Compute on edge 'lup' 825 827 W_el = .5*( W(ij,l)+W(ij+t_lup,l) ) … … 828 830 W2_el = .5*le_de(ij+u_lup) * & 829 831 ( W(ij,l)*w_il(ij,l) + W(ij+t_lup,l)*w_il(ij+t_lup,l) ) 830 v_el(ij+u_lup) = .5*le_de(ij+u_lup)*( u(ij+u_lup,kup) + u(ij+u_lup,kdown)) ! checked831 G_ el(ij+u_lup) = v_el(ij+u_lup)*W_el - DePhil(ij+u_lup,l)*W2_el832 V_EL(ij+u_lup) = .5*le_de(ij+u_lup)*( u(ij+u_lup,kup) + u(ij+u_lup,kdown)) ! checked 833 G_EL(ij+u_lup) = V_EL(ij+u_lup)*W_el - DePhil(ij+u_lup,l)*W2_el 832 834 ! Compute on edge 'ldown' 833 835 W_el = .5*( W(ij,l)+W(ij+t_ldown,l) ) … … 836 838 W2_el = .5*le_de(ij+u_ldown) * & 837 839 ( W(ij,l)*w_il(ij,l) + W(ij+t_ldown,l)*w_il(ij+t_ldown,l) ) 838 v_el(ij+u_ldown) = .5*le_de(ij+u_ldown)*( u(ij+u_ldown,kup) + u(ij+u_ldown,kdown)) ! checked839 G_ el(ij+u_ldown) = v_el(ij+u_ldown)*W_el - DePhil(ij+u_ldown,l)*W2_el840 V_EL(ij+u_ldown) = .5*le_de(ij+u_ldown)*( u(ij+u_ldown,kup) + u(ij+u_ldown,kdown)) ! checked 841 G_EL(ij+u_ldown) = V_EL(ij+u_ldown)*W_el - DePhil(ij+u_ldown,l)*W2_el 840 842 END DO 841 843 ! compute GradPhi2, dPhi, dW … … 848 850 le_de(ij+u_ldown)*DePhil(ij+u_ldown,l)**2 + & 849 851 le_de(ij+u_rdown)*DePhil(ij+u_rdown,l)**2 ) 850 ! gradPhi2(ij,l) = 0. ! FIXME !!851 852 852 853 dPhi(ij,l) = gradPhi2(ij,l)*w_il(ij,l) -1/(2*Ai(ij))* & 853 ( DePhil(ij+u_right,l)* v_el(ij+u_right) + & ! -v.gradPhi,854 DePhil(ij+u_rup,l)* v_el(ij+u_rup) + & ! v_el already has le_de855 DePhil(ij+u_lup,l)* v_el(ij+u_lup) + &856 DePhil(ij+u_left,l)* v_el(ij+u_left) + &857 DePhil(ij+u_ldown,l)* v_el(ij+u_ldown) + &858 DePhil(ij+u_rdown,l)* v_el(ij+u_rdown) )854 ( DePhil(ij+u_right,l)*V_EL(ij+u_right) + & ! -v.gradPhi, 855 DePhil(ij+u_rup,l)*V_EL(ij+u_rup) + & ! v_el already has le_de 856 DePhil(ij+u_lup,l)*V_EL(ij+u_lup) + & 857 DePhil(ij+u_left,l)*V_EL(ij+u_left) + & 858 DePhil(ij+u_ldown,l)*V_EL(ij+u_ldown) + & 859 DePhil(ij+u_rdown,l)*V_EL(ij+u_rdown) ) 859 860 860 861 dW(ij,l) = -1./Ai(ij)*( & ! -div(G_el), 861 ne_right*G_ el(ij+u_right) + & ! G_el already has le_de862 ne_rup*G_ el(ij+u_rup) + &863 ne_lup*G_ el(ij+u_lup) + &864 ne_left*G_ el(ij+u_left) + &865 ne_ldown*G_ el(ij+u_ldown) + &866 ne_rdown*G_ el(ij+u_rdown))862 ne_right*G_EL(ij+u_right) + & ! G_el already has le_de 863 ne_rup*G_EL(ij+u_rup) + & 864 ne_lup*G_EL(ij+u_lup) + & 865 ne_left*G_EL(ij+u_left) + & 866 ne_ldown*G_EL(ij+u_ldown) + & 867 ne_rdown*G_EL(ij+u_rdown)) 867 868 END DO 868 869 END DO … … 871 872 ! Compute berni at scalar points 872 873 DO ij=ij_begin_ext, ij_end_ext 873 berni(ij) = &874 BERNI(ij) = & 874 875 1/(4*Ai(ij))*( & 875 876 le_de(ij+u_right)*u(ij+u_right,l)**2 + & … … 888 889 -0.5*(F_el(ij+u_right,l)+F_el(ij+u_right,l+1)) 889 890 hflux(ij+u_right,l) = uu_right*le_de(ij+u_right) 890 du(ij+u_right,l) = ne_right*( berni(ij)-berni(ij+t_right))891 du(ij+u_right,l) = ne_right*(BERNI(ij)-BERNI(ij+t_right)) 891 892 ! Compute on edge 'lup' 892 893 uu_lup = 0.5*(rhodz(ij,l)+rhodz(ij+t_lup,l))*u(ij+u_lup,l) & 893 894 -0.5*(F_el(ij+u_lup,l)+F_el(ij+u_lup,l+1)) 894 895 hflux(ij+u_lup,l) = uu_lup*le_de(ij+u_lup) 895 du(ij+u_lup,l) = ne_lup*( berni(ij)-berni(ij+t_lup))896 du(ij+u_lup,l) = ne_lup*(BERNI(ij)-BERNI(ij+t_lup)) 896 897 ! Compute on edge 'ldown' 897 898 uu_ldown = 0.5*(rhodz(ij,l)+rhodz(ij+t_ldown,l))*u(ij+u_ldown,l) & 898 899 -0.5*(F_el(ij+u_ldown,l)+F_el(ij+u_ldown,l+1)) 899 900 hflux(ij+u_ldown,l) = uu_ldown*le_de(ij+u_ldown) 900 du(ij+u_ldown,l) = ne_ldown*( berni(ij)-berni(ij+t_ldown))901 du(ij+u_ldown,l) = ne_ldown*(BERNI(ij)-BERNI(ij+t_ldown)) 901 902 END DO 902 903 END DO 903 #endif 904 905 #undef V_EL 906 #undef G_EL 907 #undef BERNI 908 909 END IF ! dysl 904 910 905 911 CALL trace_end("compute_caldyn_slow_NH")
Note: See TracChangeset
for help on using the changeset viewer.