Changeset 558 for codes/icosagcm/devel/src
- Timestamp:
- 09/21/17 18:18:47 (7 years ago)
- Location:
- codes/icosagcm/devel/src/dynamics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/src/dynamics/caldyn_gcm.F90
r557 r558 22 22 REAL(rstd),POINTER :: planetvel(:) 23 23 24 24 #ifdef CPP_DYSL 25 25 IF(is_master) PRINT *,'CPP_DYSL : Using macro-generated compute kernels' 26 26 #endif 27 27 28 28 hydrostatic=.TRUE. … … 122 122 CALL allocate_field(f_qv,field_z,type_real,llm) 123 123 CALL allocate_field(f_pk, field_t,type_real,llm, name='pk') 124 CALL allocate_field(f_wwuu, field_u,type_real,llm+1,name='wwuu') 124 CALL allocate_field(f_wwuu, field_u,type_real,llm+1,name='wwuu') 125 125 CALL allocate_field(f_planetvel, field_u,type_real, name='planetvel') ! planetary velocity at r=a 126 126 IF(.NOT.hydrostatic) THEN 127 CALL allocate_field(f_Fel, field_u,type_real,llm+1,name='F_el') 128 CALL allocate_field(f_gradPhi2, field_t,type_real,llm+1,name='gradPhi2') 129 CALL allocate_field(f_wil, field_t,type_real,llm+1,name='w_il') 130 CALL allocate_field(f_Wetadot, field_t,type_real,llm,name='W_etadot') 131 END IF 127 132 END SUBROUTINE allocate_caldyn 128 133 -
codes/icosagcm/devel/src/dynamics/caldyn_hevi.f90
r531 r558 59 59 REAL(rstd),POINTER :: convm(:,:) 60 60 REAL(rstd),POINTER :: wwuu(:,:) 61 61 REAL(rstd),POINTER :: F_el(:,:), gradPhi2(:,:), w_il(:,:) , W_etadot(:,:), pres(:,:), m_il(:,:) 62 62 INTEGER :: ind 63 63 LOGICAL,SAVE :: first=.TRUE. … … 118 118 dW = f_dW_fast(ind) 119 119 dPhi = f_dPhi_fast(ind) 120 CALL compute_caldyn_solver(tau,mass,theta,pk,geopot,W,dPhi,dW,du) ! computes d(Phi,W,du)_fast and updates Phi,W 120 ! reuse buffers 121 m_il = f_wil(ind) 122 pres = f_gradPhi2(ind) 123 CALL compute_caldyn_solver(tau,mass,theta,pk,geopot,W, m_il,pres, dPhi,dW,du) ! computes d(Phi,W,du)_fast and updates Phi,W 121 124 END IF 122 125 u=f_u(ind) … … 161 164 geopot = f_geopot(ind) 162 165 dPhi = f_dPhi_slow(ind) 163 CALL compute_caldyn_slow_NH(u,mass,geopot,W, hflux,du,dPhi,dW) 166 F_el = f_Fel(ind) 167 gradPhi2 = f_gradPhi2(ind) 168 w_il = f_wil(ind) 169 CALL compute_caldyn_slow_NH(u,mass,geopot,W, F_el,gradPhi2,w_il, hflux,du,dPhi,dW) 164 170 END IF 165 171 CALL compute_caldyn_Coriolis(hflux,theta,qu, convm,dtheta_rhodz,du) … … 168 174 wwuu=f_wwuu(ind) 169 175 dps=f_dps(ind) 176 W_etadot=f_Wetadot(ind) 170 177 CALL compute_caldyn_vert(u,theta,mass,convm, wflux,wwuu, dps, dtheta_rhodz, du) 171 178 IF(.NOT.hydrostatic) THEN 172 CALL compute_caldyn_vert_NH(mass,geopot,W,wflux, du,dPhi,dW)179 CALL compute_caldyn_vert_NH(mass,geopot,W,wflux, W_etadot, du,dPhi,dW) 173 180 END IF 174 181 END IF -
codes/icosagcm/devel/src/dynamics/caldyn_kernels_base.F90
r538 r558 14 14 15 15 ! temporary shared variables for caldyn 16 TYPE(t_field),POINTER,PUBLIC :: f_pk(:),f_wwuu(:),f_planetvel(:) 16 TYPE(t_field),POINTER,PUBLIC :: f_pk(:),f_wwuu(:),f_planetvel(:), & 17 f_Fel(:), f_gradPhi2(:), f_wil(:), f_Wetadot(:) 17 18 18 19 INTEGER, PUBLIC :: caldyn_conserv … … 295 296 END SUBROUTINE compute_caldyn_vert 296 297 297 SUBROUTINE compute_caldyn_vert_NH(mass,geopot,W,wflux, du,dPhi,dW)298 SUBROUTINE compute_caldyn_vert_NH(mass,geopot,W,wflux, W_etadot, du,dPhi,dW) 298 299 REAL(rstd),INTENT(IN) :: mass(iim*jjm,llm) 299 300 REAL(rstd),INTENT(IN) :: geopot(iim*jjm,llm+1) … … 303 304 REAL(rstd),INTENT(INOUT) :: dPhi(iim*jjm,llm+1) 304 305 REAL(rstd),INTENT(INOUT) :: dW(iim*jjm,llm+1) 306 REAL(rstd) :: W_etadot(iim*jjm,llm) ! vertical flux of vertical momentum 305 307 ! local arrays 306 308 REAL(rstd) :: eta_dot(iim*jjm, llm) ! eta_dot in full layers 307 309 REAL(rstd) :: wcov(iim*jjm,llm) ! covariant vertical momentum in full layers 308 REAL(rstd) :: W_etadot(iim*jjm,llm) ! vertical flux of vertical momentum309 310 ! indices and temporary values 310 311 INTEGER :: ij, l … … 314 315 315 316 #ifdef CPP_DYSL 316 ! #if 0317 !$OMP BARRIER 317 318 #include "../kernels/caldyn_vert_NH.k90" 319 !$OMP BARRIER 318 320 #else 319 321 #define ETA_DOT(ij) eta_dot(ij,1) -
codes/icosagcm/devel/src/dynamics/caldyn_kernels_hevi.F90
r539 r558 125 125 126 126 #ifdef CPP_DYSL 127 !#if 0128 127 #include "../kernels/compute_NH_geopot.k90" 129 128 #else 130 131 129 ! FIXME : vertical OpenMP parallelism will not work 132 130 … … 266 264 END SUBROUTINE compute_NH_geopot 267 265 268 SUBROUTINE compute_caldyn_solver(tau,rhodz,theta,pk, geopot,W, dPhi,dW,du)266 SUBROUTINE compute_caldyn_solver(tau,rhodz,theta,pk, geopot,W, m_il,pres, dPhi,dW,du) 269 267 REAL(rstd),INTENT(IN) :: tau ! "solve" Phi-tau*dPhi/dt = Phi_rhs 270 268 REAL(rstd),INTENT(IN) :: rhodz(iim*jjm,llm) … … 273 271 REAL(rstd),INTENT(INOUT) :: geopot(iim*jjm,llm+1) 274 272 REAL(rstd),INTENT(INOUT) :: W(iim*jjm,llm+1) ! OUT if tau>0 273 REAL(rstd),INTENT(OUT) :: m_il(iim*jjm,llm+1) ! rhodz averaged to interfaces 274 REAL(rstd),INTENT(OUT) :: pres(iim*jjm,llm) ! pressure 275 275 REAL(rstd),INTENT(OUT) :: dW(iim*jjm,llm+1) 276 276 REAL(rstd),INTENT(OUT) :: dPhi(iim*jjm,llm+1) 277 277 REAL(rstd),INTENT(OUT) :: du(3*iim*jjm,llm) 278 278 279 REAL(rstd) :: m_il(iim*jjm,llm+1) ! rhodz averaged to interfaces 280 REAL(rstd) :: pres(iim*jjm,llm) ! pressure 281 REAL(rstd) :: berni(iim*jjm,llm) ! (W/m_il)^2 279 REAL(rstd) :: berni(iim*jjm,llm) ! (W/m_il)^2 282 280 REAL(rstd) :: gamma, rho_ij, T_ij, X_ij, Y_ij, vreff, Rd, Cvd 283 281 INTEGER :: ij, l … … 288 286 289 287 #ifdef CPP_DYSL 290 ! #if 0288 !$OMP BARRIER 291 289 #include "../kernels/caldyn_solver.k90" 290 !$OMP BARRIER 292 291 #else 293 292 #define BERNI(ij) berni(ij,1) … … 517 516 518 517 #ifdef CPP_DYSL 519 !#if 0520 518 #include "../kernels/coriolis.k90" 521 519 #else … … 675 673 676 674 #ifdef CPP_DYSL 677 !#if 0678 675 #define BERNI(ij,l) berni(ij,l) 679 676 #include "../kernels/caldyn_slow_hydro.k90" … … 733 730 END SUBROUTINE compute_caldyn_slow_hydro 734 731 735 SUBROUTINE compute_caldyn_slow_NH(u,rhodz,Phi,W, hflux,du,dPhi,dW)732 SUBROUTINE compute_caldyn_slow_NH(u,rhodz,Phi,W, F_el,gradPhi2,w_il, hflux,du,dPhi,dW) 736 733 REAL(rstd),INTENT(IN) :: u(3*iim*jjm,llm) ! prognostic "velocity" 737 734 REAL(rstd),INTENT(IN) :: rhodz(iim*jjm,llm) ! rho*dz … … 744 741 REAL(rstd),INTENT(OUT) :: dPhi(iim*jjm,llm+1) 745 742 746 REAL(rstd) :: w_il( 3*iim*jjm,llm+1) ! Wil/mil743 REAL(rstd) :: w_il(iim*jjm,llm+1) ! Wil/mil 747 744 REAL(rstd) :: F_el(3*iim*jjm,llm+1) ! NH mass flux 748 REAL(rstd) :: GradPhi2(3*iim*jjm,llm+1) ! grad_Phi**2745 REAL(rstd) :: gradPhi2(iim*jjm,llm+1) ! grad_Phi**2 749 746 REAL(rstd) :: DePhil(3*iim*jjm,llm+1) ! grad(Phi) 750 747 … … 765 762 766 763 #ifdef CPP_DYSL 764 !$OMP BARRIER 767 765 #include "../kernels/caldyn_slow_NH.k90" 766 !$OMP BARRIER 768 767 #else 769 768 DO l=ll_begin, ll_endp1 ! compute on l levels (interfaces)
Note: See TracChangeset
for help on using the changeset viewer.