Changeset 573


Ignore:
Timestamp:
10/12/17 19:10:20 (7 years ago)
Author:
dubos
Message:

devel : get rid of CPP_DYSL

Location:
codes/icosagcm/devel/src/dynamics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/src/dynamics/caldyn_kernels_base.F90

    r562 r573  
    5050 
    5151    IF(dysl_geopot) THEN 
    52 #ifdef CPP_DYSL 
    5352#include "../kernels/compute_geopot.k90" 
    54 #else 
    55     STOP 'dysl_geopot=.TRUE. but DYNAMICO has been compiled without the -dysl option' 
    56 #endif 
    5753    ELSE 
    5854    ! Pressure is computed first top-down (temporarily stored in pk) 
     
    316312    CALL trace_start("compute_caldyn_vert_nh") 
    317313 
    318 #ifdef CPP_DYSL 
     314    IF(dysl) THEN 
    319315!$OMP BARRIER 
    320316#include "../kernels/caldyn_vert_NH.k90" 
    321317!$OMP BARRIER 
    322 #else 
     318    ELSE 
    323319#define ETA_DOT(ij) eta_dot(ij,1) 
    324320#define WCOV(ij) wcov(ij,1) 
     
    367363#undef ETA_DOT 
    368364#undef WCOV 
    369 #endif 
    370  
     365 
     366    END IF ! dysl 
    371367    CALL trace_end("compute_caldyn_vert_nh") 
    372368 
  • codes/icosagcm/devel/src/dynamics/caldyn_kernels_hevi.F90

    r565 r573  
    6262!!! Compute shallow-water potential vorticity 
    6363    IF(dysl_pvort_only) THEN 
    64 #ifdef CPP_DYSL 
    6564#include "../kernels/pvort_only.k90" 
    66 #else 
    67         STOP 'dysl_pvort_only=.TRUE. but DYNAMICO is compiled without the -dysl option' 
    68 #endif 
    6965    ELSE 
    7066 
     
    130126    ij_omp_end_ext=ij_omp_end_ext+ij_begin_ext-1 
    131127 
    132 #ifdef CPP_DYSL 
     128    IF(dysl) THEN 
    133129#define PHI_BOT(ij) phis(ij) 
    134130#include "../kernels/compute_NH_geopot.k90" 
    135 #else 
     131#undef PHI_BOT 
     132    ELSE 
    136133!    FIXME : vertical OpenMP parallelism will not work 
    137134    
     
    267264    END DO ! Newton-Raphson 
    268265 
    269 #endif 
     266    END IF ! dysl 
    270267     
    271268  END SUBROUTINE compute_NH_geopot 
     
    286283 
    287284    REAL(rstd) :: berni(iim*jjm,llm)         ! (W/m_il)^2 
     285    REAL(rstd) :: berni1(iim*jjm)         ! (W/m_il)^2 
    288286    REAL(rstd) :: gamma, rho_ij, T_ij, X_ij, Y_ij, vreff, Rd, Cvd 
    289287    INTEGER    :: ij, l 
     
    293291    Rd=cpp*kappa 
    294292 
    295 #ifdef CPP_DYSL 
     293    IF(dysl) THEN 
     294 
    296295!$OMP BARRIER 
    297296#define PHI_BOT(ij) phis(ij) 
    298297#define PHI_BOT_VAR phis 
    299298#include "../kernels/caldyn_solver.k90" 
     299#undef PHI_BOT_VAR 
     300#undef PHI_BOT 
    300301!$OMP BARRIER 
    301 #else 
    302 #define BERNI(ij) berni(ij,1) 
     302 
     303    ELSE 
     304 
     305#define BERNI(ij) berni1(ij) 
    303306    ! FIXME : vertical OpenMP parallelism will not work 
    304307 
     
    382385    ENDDO 
    383386#undef BERNI 
    384 #endif 
     387 
     388    END IF ! dysl 
    385389 
    386390    CALL trace_end("compute_caldyn_solver") 
     
    407411 
    408412    IF(dysl_caldyn_fast) THEN 
    409 #ifdef CPP_DYSL 
    410413#include "../kernels/caldyn_fast.k90" 
    411 #else 
    412     STOP 'dysl_caldyn_fast=.TRUE. but DYNAMICO is compiled without the -dysl option' 
    413 #endif 
    414414    ELSE 
    415415 
     
    532532 
    533533    IF(dysl_caldyn_coriolis) THEN 
    534 #ifdef CPP_DYSL 
     534 
    535535#include "../kernels/coriolis.k90" 
    536 #else 
    537     STOP 'dysl_caldyn_coriolis is .TRUE. but DYNAMICO is compiled without the -dysl option' 
    538 #endif 
    539536 
    540537    ELSE 
     
    689686     
    690687    REAL(rstd) :: berni(iim*jjm,llm)  ! Bernoulli function 
     688    REAL(rstd) :: berni1(iim*jjm)  ! Bernoulli function 
    691689    REAL(rstd) :: uu_right, uu_lup, uu_ldown, ke, uu 
    692690    INTEGER :: ij,l 
     
    695693 
    696694    IF(dysl_slow_hydro) THEN 
    697 #ifdef CPP_DYSL 
     695 
    698696#define BERNI(ij,l) berni(ij,l) 
    699697#include "../kernels/caldyn_slow_hydro.k90" 
    700698#undef BERNI 
    701 #else 
    702         STOP 'dysl_slow_hydro=.TRUE. but DYNAMICO is compiled without the -dysl option' 
    703 #endif 
    704699 
    705700     ELSE 
    706701 
    707 #define BERNI(ij) berni(ij,1) 
     702#define BERNI(ij) berni1(ij) 
    708703 
    709704    DO l = ll_begin, ll_end 
     
    753748       END IF 
    754749    END DO 
     750 
    755751#undef BERNI 
     752 
    756753    END IF ! dysl 
    757754    CALL trace_end("compute_caldyn_slow_hydro")     
     
    777774    REAL(rstd) :: W_el, W2_el, uu_right, uu_lup, uu_ldown, gPhi2, dP, divG, u2, uu 
    778775 
    779 #ifdef CPP_DYSL 
    780776    REAL(rstd) :: berni(iim*jjm,llm)  ! Bernoulli function 
    781777    REAL(rstd) :: G_el(3*iim*jjm,llm+1) ! horizontal flux of W 
    782778    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) 
    788783 
    789784    CALL trace_start("compute_caldyn_slow_NH") 
    790785 
    791 #ifdef CPP_DYSL 
     786    IF(dysl) THEN 
     787 
    792788!$OMP BARRIER 
    793789#include "../kernels/caldyn_slow_NH.k90" 
    794790!$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 
    796798    DO l=ll_begin, ll_endp1 ! compute on l levels (interfaces) 
    797799       IF(l==1) THEN 
     
    820822          W2_el = .5*le_de(ij+u_right) * & 
    821823               ( 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)) ! checked 
    823           G_el(ij+u_right) = v_el(ij+u_right)*W_el - DePhil(ij+u_right,l)*W2_el 
     824          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 
    824826          ! Compute on edge 'lup' 
    825827          W_el  = .5*( W(ij,l)+W(ij+t_lup,l) ) 
     
    828830          W2_el = .5*le_de(ij+u_lup) * & 
    829831               ( 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)) ! checked 
    831           G_el(ij+u_lup) = v_el(ij+u_lup)*W_el - DePhil(ij+u_lup,l)*W2_el 
     832          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 
    832834          ! Compute on edge 'ldown' 
    833835          W_el  = .5*( W(ij,l)+W(ij+t_ldown,l) ) 
     
    836838          W2_el = .5*le_de(ij+u_ldown) * & 
    837839               ( 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)) ! checked 
    839           G_el(ij+u_ldown) = v_el(ij+u_ldown)*W_el - DePhil(ij+u_ldown,l)*W2_el 
     840          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 
    840842       END DO 
    841843       ! compute GradPhi2, dPhi, dW 
     
    848850               le_de(ij+u_ldown)*DePhil(ij+u_ldown,l)**2 +  & 
    849851               le_de(ij+u_rdown)*DePhil(ij+u_rdown,l)**2 ) 
    850 !          gradPhi2(ij,l) = 0. ! FIXME !! 
    851852 
    852853          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_de 
    855                  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) ) 
    859860 
    860861          dW(ij,l) = -1./Ai(ij)*(           & ! -div(G_el),  
    861                ne_right*G_el(ij+u_right) +  & ! G_el already has le_de 
    862                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)) 
    867868       END DO 
    868869    END DO 
     
    871872       ! Compute berni at scalar points 
    872873       DO ij=ij_begin_ext, ij_end_ext 
    873           berni(ij) = & 
     874          BERNI(ij) = & 
    874875               1/(4*Ai(ij))*( & 
    875876                    le_de(ij+u_right)*u(ij+u_right,l)**2 +    & 
     
    888889                    -0.5*(F_el(ij+u_right,l)+F_el(ij+u_right,l+1)) 
    889890          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)) 
    891892          ! Compute on edge 'lup' 
    892893          uu_lup = 0.5*(rhodz(ij,l)+rhodz(ij+t_lup,l))*u(ij+u_lup,l) & 
    893894                  -0.5*(F_el(ij+u_lup,l)+F_el(ij+u_lup,l+1)) 
    894895          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)) 
    896897          ! Compute on edge 'ldown' 
    897898          uu_ldown = 0.5*(rhodz(ij,l)+rhodz(ij+t_ldown,l))*u(ij+u_ldown,l) & 
    898899                    -0.5*(F_el(ij+u_ldown,l)+F_el(ij+u_ldown,l+1)) 
    899900          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)) 
    901902       END DO 
    902903    END DO 
    903 #endif 
     904 
     905#undef V_EL 
     906#undef G_EL 
     907#undef BERNI 
     908 
     909    END IF ! dysl 
    904910 
    905911    CALL trace_end("compute_caldyn_slow_NH") 
Note: See TracChangeset for help on using the changeset viewer.