Changeset 657
- Timestamp:
- 12/30/17 01:56:49 (6 years ago)
- Location:
- codes/icosagcm/devel/src
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/src/dynamics/caldyn_kernels_hevi.F90
r612 r657 118 118 REAL(rstd) :: D_il(iim*jjm,llm+1) ! Thomas algorithm 119 119 REAL(rstd) :: gamma, rho_ij, X_ij, Y_ij 120 REAL(rstd) :: wil, tau2_g, g2, gm2, ml_g2, c2_mik 120 REAL(rstd) :: wil, tau2_g, g2, gm2, ml_g2, c2_mik, vreff 121 121 122 122 INTEGER :: iter, ij, l, ij_omp_begin_ext, ij_omp_end_ext … … 282 282 REAL(rstd) :: berni(iim*jjm,llm) ! (W/m_il)^2 283 283 REAL(rstd) :: berni1(iim*jjm) ! (W/m_il)^2 284 REAL(rstd) :: gamma, rho_ij, T_ij, X_ij, Y_ij, vreff, Rd, Cvd 284 REAL(rstd) :: gamma, rho_ij, T_ij, X_ij, Y_ij, vreff, Rd, Cvd, Rd_preff 285 285 INTEGER :: ij, l 286 286 … … 292 292 293 293 !$OMP BARRIER 294 295 #include "../kernels_hex/caldyn_mil.k90" 296 IF(tau>0) THEN ! solve implicit problem for geopotential 297 CALL compute_NH_geopot(tau,phis, rhodz, m_il, theta, W, geopot) 298 END IF 294 299 #define PHI_BOT(ij) phis(ij) 295 #define PHI_BOT_VAR phis296 300 #include "../kernels_hex/caldyn_solver.k90" 297 #undef PHI_BOT_VAR298 301 #undef PHI_BOT 299 302 !$OMP BARRIER -
codes/icosagcm/devel/src/kernels_hex/caldyn_solver.k90
r578 r657 1 1 !-------------------------------------------------------------------------- 2 2 !---------------------------- caldyn_solver ---------------------------------- 3 IF (ll_begin==1) THEN4 !DIR$ SIMD5 DO ij=ij_begin_ext, ij_end_ext6 m_il(ij,1) = .5*rhodz(ij,1)7 END DO8 END IF9 DO l = ll_beginp1, ll_end10 !DIR$ SIMD11 DO ij=ij_begin_ext, ij_end_ext12 m_il(ij,l) = .5*(rhodz(ij,l)+rhodz(ij,l-1))13 END DO14 END DO15 IF(ll_endp1==llm+1) THEN16 !DIR$ SIMD17 DO ij=ij_begin_ext, ij_end_ext18 m_il(ij,llm+1) = .5*rhodz(ij,llm+1 -1)19 END DO20 END IF21 !22 IF(tau>0) THEN ! solve implicit problem for geopotential23 CALL compute_NH_geopot(tau,PHI_BOT_VAR, rhodz, m_il, theta, W, geopot)24 END IF25 3 ! 26 4 ! Compute pressure (pres) and Exner function (pk) … … 30 8 gamma = 1./(1.-kappa) 31 9 vreff = Rd*Treff/preff ! reference specific volume 32 Cvd = cpp-Rd 10 Cvd = 1./(cpp-Rd) 11 Rd_preff = kappa*cpp/preff 33 12 DO l = ll_begin, ll_end 34 13 !DIR$ SIMD … … 36 15 SELECT CASE(caldyn_thermo) 37 16 CASE(thermo_theta) 38 rho_ij = g*rhodz(ij,l)/(geopot(ij,l+1)-geopot(ij,l)) 39 X_ij = (cpp/preff)*kappa*theta(ij,l,1)*rho_ij 17 rho_ij = 1./(geopot(ij,l+1)-geopot(ij,l)) 18 rho_ij = rho_ij*g*rhodz(ij,l) 19 X_ij = Rd_preff*theta(ij,l,1)*rho_ij 40 20 ! kappa.theta.rho = p/exner 41 21 ! => X = (p/p0)/(exner/Cp) … … 46 26 pk(ij,l) = cpp*((pres(ij,l)/preff)**kappa) ! Exner 47 27 CASE(thermo_entropy) 48 rho_ij = g*rhodz(ij,l)/(geopot(ij,l+1)-geopot(ij,l)) 49 T_ij = Treff*exp( (theta(ij,l,1)+Rd*log(vreff*rho_ij))/Cvd ) 28 rho_ij = 1./(geopot(ij,l+1)-geopot(ij,l)) 29 rho_ij = rho_ij*g*rhodz(ij,l) 30 T_ij = Treff*exp( (theta(ij,l,1)+Rd*log(vreff*rho_ij))*Cvd ) 50 31 pres(ij,l) = rho_ij*Rd*T_ij 51 32 pk(ij,l) = T_ij -
codes/icosagcm/devel/src/kernels_hex/compute_NH_geopot.k90
r563 r657 4 4 g2=g*g 5 5 gm2 = 1./g2 6 vreff = Treff*cpp/preff*kappa 6 7 gamma = 1./(1.-kappa) 7 8 !$OMP BARRIER … … 30 31 DO ij=ij_omp_begin_ext,ij_omp_end_ext 31 32 rho_ij = (g*m_ik(ij,l))/(Phi_il(ij,l+1)-Phi_il(ij,l)) 32 X_ij = Treff*exp(theta(ij,l)/cpp) ! theta = Tref.exp(s/Cp) 33 X_ij = (cpp/preff)*kappa*X_ij*rho_ij 34 p_ik(ij,l) = preff*(X_ij**gamma) 33 X_ij = log(vreff*rho_ij) + theta(ij,l)/cpp 34 p_ik(ij,l) = preff*exp(X_ij*gamma) 35 35 c2_mik = gamma*p_ik(ij,l)/(rho_ij*m_ik(ij,l)) ! c^2 = gamma*R*T = gamma*p/rho 36 36 A_ik(ij,l) = c2_mik*(tau/g*rho_ij)**2
Note: See TracChangeset
for help on using the changeset viewer.