Ignore:
Timestamp:
09/18/17 17:03:05 (7 years ago)
Author:
dubos
Message:

trunk : backported commits 535-540 from devel

File:
1 edited

Legend:

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

    r548 r555  
    3535 
    3636    INTEGER :: i,j,ij,l 
    37     REAL(rstd) :: Rd, p_ik, exner_ik, temp_ik, qv, chi, Rmix 
     37    REAL(rstd) :: Rd, p_ik, exner_ik, temp_ik, qv, chi, Rmix, gv 
    3838    INTEGER    :: ij_omp_begin_ext, ij_omp_end_ext 
    3939 
     
    4747 
    4848    Rd = kappa*cpp 
     49 
     50#ifdef CPP_DYSL 
     51!#if 0 
     52#include "../kernels/compute_geopot.k90" 
     53#else 
    4954 
    5055    ! Pressure is computed first top-down (temporarily stored in pk) 
     
    158163    END IF 
    159164 
     165#endif 
     166 
    160167    !ym flush geopot 
    161168    !$OMP BARRIER 
     
    297304    REAL(rstd),INTENT(INOUT) :: dW(iim*jjm,llm+1) 
    298305    ! local arrays 
    299     REAL(rstd) :: eta_dot(iim*jjm) ! eta_dot in full layers 
    300     REAL(rstd) :: wcov(iim*jjm) ! covariant vertical momentum in full layers 
     306    REAL(rstd) :: eta_dot(iim*jjm, llm) ! eta_dot in full layers 
     307    REAL(rstd) :: wcov(iim*jjm,llm) ! covariant vertical momentum in full layers 
    301308    REAL(rstd) :: W_etadot(iim*jjm,llm) ! vertical flux of vertical momentum 
    302309    ! indices and temporary values 
     
    306313    CALL trace_start("compute_caldyn_vert_nh") 
    307314 
     315#ifdef CPP_DYSL 
     316!#if 0 
     317#include "../kernels/caldyn_vert_NH.k90" 
     318#else 
     319#define ETA_DOT(ij) eta_dot(ij,1) 
     320#define WCOV(ij) wcov(ij,1) 
     321 
    308322    DO l=ll_begin,ll_end 
    309323       ! compute the local arrays 
     
    313327          w_ij = .5*(W(ij,l)+W(ij,l+1))/mass(ij,l) 
    314328          W_etadot(ij,l) = wflux_ij*w_ij 
    315           eta_dot(ij) = wflux_ij / mass(ij,l) 
    316           wcov(ij) = w_ij*(geopot(ij,l+1)-geopot(ij,l)) 
     329          ETA_DOT(ij) = wflux_ij / mass(ij,l) 
     330          WCOV(ij) = w_ij*(geopot(ij,l+1)-geopot(ij,l)) 
    317331       ENDDO 
    318332       ! add NH term to du 
     
    320334      DO ij=ij_begin,ij_end 
    321335          du(ij+u_right,l) = du(ij+u_right,l) & 
    322                - .5*(wcov(ij+t_right)+wcov(ij)) & 
    323                *ne_right*(eta_dot(ij+t_right)-eta_dot(ij)) 
     336               - .5*(WCOV(ij+t_right)+WCOV(ij)) & 
     337               *ne_right*(ETA_DOT(ij+t_right)-ETA_DOT(ij)) 
    324338          du(ij+u_lup,l) = du(ij+u_lup,l) & 
    325                - .5*(wcov(ij+t_lup)+wcov(ij)) & 
    326                *ne_lup*(eta_dot(ij+t_lup)-eta_dot(ij)) 
     339               - .5*(WCOV(ij+t_lup)+WCOV(ij)) & 
     340               *ne_lup*(ETA_DOT(ij+t_lup)-ETA_DOT(ij)) 
    327341          du(ij+u_ldown,l) = du(ij+u_ldown,l) & 
    328                - .5*(wcov(ij+t_ldown)+wcov(ij)) & 
    329                *ne_ldown*(eta_dot(ij+t_ldown)-eta_dot(ij)) 
     342               - .5*(WCOV(ij+t_ldown)+WCOV(ij)) & 
     343               *ne_ldown*(ETA_DOT(ij+t_ldown)-ETA_DOT(ij)) 
    330344       END DO 
    331345    ENDDO 
     
    346360       END DO 
    347361    END DO 
     362 
     363#undef ETA_DOT 
     364#undef WCOV 
     365#endif 
     366 
    348367    CALL trace_end("compute_caldyn_vert_nh") 
    349368 
Note: See TracChangeset for help on using the changeset viewer.