Changeset 928 for codes/icosagcm/devel/src
- Timestamp:
- 06/21/19 01:01:34 (5 years ago)
- Location:
- codes/icosagcm/devel/src/dynamics
- Files:
-
- 1 added
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/src/dynamics/caldyn_gcm.F90
r920 r928 3 3 USE transfert_mod 4 4 USE caldyn_vars_mod 5 USE caldyn_kernels_hevi_mod 6 USE caldyn_kernels_base_mod 5 USE compute_caldyn_vert_mod, ONLY : compute_caldyn_vert => compute_caldyn_vert_manual 7 6 USE caldyn_kernels_mod 8 7 USE omp_para … … 171 170 CALL allocate_field(f_wwuu, field_u,type_real,llm+1,name='wwuu') 172 171 CALL allocate_field(f_planetvel, field_u,type_real, name='planetvel') ! planetary velocity at r=a 172 CALL allocate_field(f_Ftheta,field_u,type_real,llm, name='Ftheta') 173 CALL allocate_field(f_berni, field_t,type_real,llm, name='berni') 173 174 IF(.NOT.hydrostatic) THEN 174 175 CALL allocate_field(f_Fel, field_u,type_real,llm+1,name='F_el') -
codes/icosagcm/devel/src/dynamics/caldyn_hevi.f90
r921 r928 3 3 USE transfert_mod 4 4 USE caldyn_vars_mod 5 USE c aldyn_kernels_hevi_mod6 USE c aldyn_kernels_base_mod5 USE compute_caldyn_vert_mod, ONLY : compute_caldyn_vert => compute_caldyn_vert_manual 6 USE compute_caldyn_vert_NH_mod, ONLY : compute_caldyn_vert_NH => compute_caldyn_vert_NH_manual 7 7 USE compute_theta_mod, ONLY : compute_theta => compute_theta_manual 8 8 USE compute_geopot_mod, ONLY : compute_geopot => compute_geopot_manual 9 9 USE compute_caldyn_kv_mod, ONLY : compute_caldyn_kv 10 USE compute_caldyn_Coriolis_mod, ONLY : compute_caldyn_Coriolis 10 USE compute_caldyn_Coriolis_mod, ONLY : compute_caldyn_Coriolis => compute_caldyn_Coriolis_manual 11 11 USE compute_caldyn_slow_hydro_mod, ONLY : compute_caldyn_slow_hydro => compute_caldyn_slow_hydro_manual 12 12 USE compute_caldyn_slow_NH_mod, ONLY : compute_caldyn_slow_NH … … 62 62 REAL(rstd),POINTER :: du(:,:), dW(:,:), dPhi(:,:), hflux(:,:), wflux(:,:) 63 63 REAL(rstd),POINTER :: u(:,:), w(:,:), qu(:,:), qv(:,:), Kv(:,:), hv(:,:) 64 64 REAL(rstd),POINTER :: berni(:,:), Ftheta(:,:) 65 65 ! temporary shared variable 66 66 REAL(rstd),POINTER :: theta(:,:,:) … … 136 136 END IF 137 137 u=f_u(ind) 138 Kv=f_Kv(ind) ! buffer for partial Bernoulli function139 CALL compute_caldyn_fast(tau,theta,geopot, pk, Kv,du,u) ! computes du_fast and updates u138 berni=f_berni(ind) ! buffer for partial Bernoulli function 139 CALL compute_caldyn_fast(tau,theta,geopot, pk,berni,du,u) ! computes du_fast and updates u 140 140 ENDDO 141 141 … … 186 186 hv=f_hv(ind) 187 187 Kv=f_Kv(ind) 188 CALL compute_caldyn_slow_hydro(.TRUE., u,mass,hv,Kv, Kv, hflux,du) 188 berni=f_berni(ind) 189 CALL compute_caldyn_slow_hydro(.TRUE., u,mass,hv,Kv, berni, hflux,du) 189 190 ELSE 190 191 W = f_W(ind) … … 197 198 CALL compute_caldyn_slow_NH(u,mass,geopot,W, F_el,gradPhi2,w_il, hflux,du,dPhi,dW) 198 199 END IF 199 CALL compute_caldyn_Coriolis(hflux,theta,qu, convm,dtheta_rhodz,du) 200 Ftheta=f_Ftheta(ind) 201 CALL compute_caldyn_Coriolis(hflux,theta,qu, Ftheta, convm,dtheta_rhodz,du) 200 202 IF(caldyn_eta==eta_mass) THEN 201 203 wflux=f_wflux(ind) -
codes/icosagcm/devel/src/dynamics/caldyn_vars.f90
r834 r928 22 22 TYPE(t_field),POINTER, PUBLIC :: f_qu(:), f_qv(:), f_Kv(:), f_hv(:), & 23 23 f_pk(:),f_wwuu(:),f_planetvel(:), & 24 f_berni(:), f_Ftheta(:), & 24 25 f_Fel(:), f_gradPhi2(:), f_wil(:), f_Wetadot(:) 25 26 -
codes/icosagcm/devel/src/dynamics/compute_caldyn_Coriolis.F90
r876 r928 1 1 MODULE compute_caldyn_Coriolis_mod 2 USE grid_param, ONLY : llm 2 USE prec, ONLY : rstd 3 USE grid_param 4 USE earth_const 5 USE disvert_mod 6 USE omp_para 7 USE trace 3 8 IMPLICIT NONE 4 9 PRIVATE … … 6 11 #include "../unstructured/unstructured.h90" 7 12 8 PUBLIC :: compute_caldyn_Coriolis 13 PUBLIC :: compute_caldyn_Coriolis_manual, & 14 compute_caldyn_Coriolis_unst, compute_caldyn_Coriolis_hex 9 15 10 16 CONTAINS … … 55 61 #endif END_DYSL 56 62 57 SUBROUTINE compute_c oriolis_unst(hflux,theta,qu,Ftheta, convm,dtheta_rhodz,du)63 SUBROUTINE compute_caldyn_coriolis_unst(hflux,theta,qu, Ftheta, convm,dtheta_rhodz,du) 58 64 USE ISO_C_BINDING, only : C_DOUBLE, C_FLOAT 59 USE grid_param, ONLY : nqdyn60 65 USE data_unstructured_mod, ONLY : id_coriolis, primal_num, dual_num, edge_num, & 61 66 left, right,primal_deg,primal_edge,primal_ne,trisk_deg,wee,trisk,Ai, & 62 67 enter_trace, exit_trace 63 FIELD_U :: hflux, Ftheta, qu, du 64 FIELD_MASS :: convm 65 FIELD_THETA :: theta, dtheta_rhodz 68 FIELD_U :: hflux, Ftheta, qu, du ! IN, BUF, IN, INOUT 69 FIELD_MASS :: convm ! BUF 70 FIELD_THETA :: theta, dtheta_rhodz ! IN, OUT 66 71 DECLARE_INDICES 67 72 DECLARE_EDGES … … 70 75 #include "../kernels_unst/coriolis.k90" 71 76 STOP_TRACE 72 END SUBROUTINE compute_c oriolis_unst73 74 SUBROUTINE compute_caldyn_Coriolis (hflux,theta,qu, convm,dtheta_rhodz,du)77 END SUBROUTINE compute_caldyn_coriolis_unst 78 79 SUBROUTINE compute_caldyn_Coriolis_hex(hflux,theta,qu, Ftheta, convm,dtheta_rhodz,du) 75 80 USE icosa 76 USE trace77 81 USE caldyn_vars_mod 78 USE omp_para, ONLY : ll_begin, ll_end79 REAL(rstd),INTENT(IN) :: hflux(3*iim*jjm,llm) ! hflux in kg/s80 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm,nqdyn) ! active scalars81 REAL(rstd), INTENT(IN) :: qu(3*iim*jjm,llm)82 REAL(rstd),INTENT(OUT) :: convm(iim*jjm,llm) ! mass flux convergence83 REAL(rstd),INTENT(OUT) :: dtheta_rhodz(iim*jjm,llm,nqdyn)82 REAL(rstd),INTENT(IN) :: hflux(3*iim*jjm,llm) ! hflux in kg/s 83 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm,nqdyn) ! active scalars 84 REAL(rstd),INTENT(IN) :: qu(3*iim*jjm,llm) 85 REAL(rstd), INTENT(OUT) :: Ftheta(3*iim*jjm,llm) ! potential temperature flux 86 REAL(rstd),INTENT(OUT) :: convm(iim*jjm,llm) ! mass flux convergence 87 REAL(rstd),INTENT(OUT) :: dtheta_rhodz(iim*jjm,llm,nqdyn) 84 88 REAL(rstd),INTENT(INOUT) :: du(3*iim*jjm,llm) 85 86 REAL(rstd) :: Ftheta(3*iim*jjm,llm) ! potential temperature flux87 89 REAL(rstd) :: uu_right, uu_lup, uu_ldown, du_trisk, divF 88 90 INTEGER :: ij,iq,l,kdown 89 90 91 CALL trace_start("compute_caldyn_Coriolis") 91 92 92 IF(dysl_caldyn_coriolis) THEN93 94 93 #include "../kernels_hex/coriolis.k90" 95 94 96 ELSE 97 #define FTHETA(ij) Ftheta(ij,1) 95 CALL trace_end("compute_caldyn_Coriolis") 96 END SUBROUTINE compute_caldyn_Coriolis_hex 97 98 SUBROUTINE compute_caldyn_Coriolis_manual(hflux,theta,qu, Ftheta, convm,dtheta_rhodz,du) 99 USE icosa 100 USE caldyn_vars_mod 101 REAL(rstd),INTENT(IN) :: hflux(3*iim*jjm,llm) ! hflux in kg/s 102 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm,nqdyn) ! active scalars 103 REAL(rstd),INTENT(IN) :: qu(3*iim*jjm,llm) 104 REAL(rstd),INTENT(IN) :: Ftheta(3*iim*jjm,llm) ! ignored in favor of local buffer 105 REAL(rstd),INTENT(OUT) :: convm(iim*jjm,llm) ! mass flux convergence 106 REAL(rstd),INTENT(OUT) :: dtheta_rhodz(iim*jjm,llm,nqdyn) 107 REAL(rstd),INTENT(INOUT) :: du(3*iim*jjm,llm) 108 REAL(rstd) :: buf_Ftheta(3*iim*jjm) ! local buffer for potential temperature flux 109 REAL(rstd) :: uu_right, uu_lup, uu_ldown, du_trisk, divF 110 INTEGER :: ij,iq,l,kdown 111 112 CALL trace_start("compute_caldyn_Coriolis") 113 114 #define FTHETA(ij) buf_Ftheta(ij) 98 115 99 116 DO l=ll_begin, ll_end … … 275 292 #undef FTHETA 276 293 277 END IF ! dysl278 279 294 CALL trace_end("compute_caldyn_Coriolis") 280 295 281 END SUBROUTINE compute_caldyn_Coriolis 296 END SUBROUTINE compute_caldyn_Coriolis_manual 282 297 283 298 END MODULE compute_caldyn_Coriolis_mod -
codes/icosagcm/devel/src/dynamics/compute_caldyn_solver.F90
r878 r928 121 121 USE omp_para, ONLY : ll_begin, ll_end,ll_beginp1,ll_endp1 122 122 USE disvert_mod, ONLY : ptop 123 USE caldyn_kernels_hevi_mod124 123 USE compute_NH_geopot_mod 125 124 REAL(rstd), PARAMETER :: pbot=1e5, rho_bot=1e6 -
codes/icosagcm/devel/src/dynamics/compute_caldyn_vert_NH.F90
r924 r928 1 MODULE c aldyn_kernels_base_mod2 USE icosa3 USE transfert_mod1 MODULE compute_caldyn_vert_NH_mod 2 USE prec, ONLY : rstd 3 USE grid_param 4 4 USE disvert_mod 5 USE caldyn_vars_mod6 5 USE omp_para 7 6 USE trace … … 10 9 SAVE 11 10 12 PUBLIC :: compute_caldyn_vert, compute_caldyn_vert_nh 11 PUBLIC :: compute_caldyn_vert_nh_manual, & 12 compute_caldyn_vert_nh_hex 13 13 14 14 CONTAINS 15 15 16 17 SUBROUTINE compute_caldyn_vert(u,theta,rhodz,convm, wflux,wwuu, dps,dtheta_rhodz,du) 18 REAL(rstd),INTENT(IN) :: u(iim*3*jjm,llm) 19 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm,nqdyn) 20 REAL(rstd),INTENT(IN) :: rhodz(iim*jjm,llm) 21 REAL(rstd),INTENT(INOUT) :: convm(iim*jjm,llm) ! mass flux convergence 22 REAL(rstd),INTENT(INOUT) :: wflux(iim*jjm,llm+1) ! vertical mass flux (kg/m2/s) 23 REAL(rstd),INTENT(INOUT) :: wwuu(iim*3*jjm,llm+1) 24 REAL(rstd),INTENT(INOUT) :: du(iim*3*jjm,llm) 25 REAL(rstd),INTENT(INOUT) :: dtheta_rhodz(iim*jjm,llm,nqdyn) 26 REAL(rstd),INTENT(OUT) :: dps(iim*jjm) 27 28 ! temporary variable 29 INTEGER :: i,j,ij,l,iq 30 REAL(rstd) :: p_ik, exner_ik, dF_deta, dFu_deta 31 INTEGER :: ij_omp_begin, ij_omp_end 32 33 CALL trace_start("compute_caldyn_vert") 34 35 !$OMP BARRIER 36 37 CALL distrib_level(ij_begin,ij_end, ij_omp_begin,ij_omp_end) 38 39 IF(dysl_caldyn_vert) THEN 40 #define mass_bl(ij,l) bp(l) 41 #define dmass_col(ij) dps(ij) 42 #include "../kernels_hex/caldyn_wflux.k90" 43 #include "../kernels_hex/caldyn_vert.k90" 44 #undef mass_bl 45 #undef dmass_col 46 ELSE 47 48 !!! cumulate mass flux convergence from top to bottom 49 DO l = llm-1, 1, -1 50 !DIR$ SIMD 51 DO ij=ij_omp_begin,ij_omp_end 52 convm(ij,l) = convm(ij,l) + convm(ij,l+1) 53 ENDDO 54 ENDDO 55 ! ENDIF 56 57 !$OMP BARRIER 58 ! FLUSH on convm 59 ! compute dmass_col 60 IF (is_omp_first_level) THEN 61 !DIR$ SIMD 62 DO ij=ij_begin,ij_end 63 ! dps/dt = -int(div flux)dz 64 dps(ij) = convm(ij,1) 65 ENDDO 66 ENDIF 67 68 !!! Compute vertical mass flux (l=1,llm+1 done by caldyn_BC) 69 DO l=ll_beginp1,ll_end 70 ! IF (caldyn_conserv==energy) CALL test_message(req_qu) 71 !DIR$ SIMD 72 DO ij=ij_begin,ij_end 73 ! w = int(z,ztop,div(flux)dz) + B(eta)dps/dt 74 ! => w>0 for upward transport 75 wflux( ij, l ) = bp(l) * convm( ij, 1 ) - convm( ij, l ) 76 ENDDO 77 ENDDO 78 79 !--> flush wflux 80 !$OMP BARRIER 81 82 DO iq=1,nqdyn 83 DO l=ll_begin,ll_endm1 84 !DIR$ SIMD 85 DO ij=ij_begin,ij_end 86 dtheta_rhodz(ij, l, iq) = dtheta_rhodz(ij, l, iq) - 0.5 * & 87 ( wflux(ij,l+1) * (theta(ij,l,iq) + theta(ij,l+1,iq))) 88 END DO 89 END DO 90 DO l=ll_beginp1,ll_end 91 !DIR$ SIMD 92 DO ij=ij_begin,ij_end 93 dtheta_rhodz(ij, l, iq) = dtheta_rhodz(ij, l, iq) + 0.5 * & 94 ( wflux(ij,l) * (theta(ij,l-1,iq) + theta(ij,l,iq) ) ) 95 END DO 96 END DO 97 END DO 98 99 ! Compute vertical transport 100 DO l=ll_beginp1,ll_end 101 !DIR$ SIMD 102 DO ij=ij_begin,ij_end 103 wwuu(ij+u_right,l) = 0.5*( wflux(ij,l) + wflux(ij+t_right,l)) * (u(ij+u_right,l) - u(ij+u_right,l-1)) 104 wwuu(ij+u_lup,l) = 0.5* ( wflux(ij,l) + wflux(ij+t_lup,l)) * (u(ij+u_lup,l) - u(ij+u_lup,l-1)) 105 wwuu(ij+u_ldown,l) = 0.5*( wflux(ij,l) + wflux(ij+t_ldown,l)) * (u(ij+u_ldown,l) - u(ij+u_ldown,l-1)) 106 ENDDO 107 ENDDO 108 109 !--> flush wwuu 110 !$OMP BARRIER 111 112 ! Add vertical transport to du 113 DO l=ll_begin,ll_end 114 !DIR$ SIMD 115 DO ij=ij_begin,ij_end 116 du(ij+u_right, l ) = du(ij+u_right,l) - (wwuu(ij+u_right,l+1)+ wwuu(ij+u_right,l)) / (rhodz(ij,l)+rhodz(ij+t_right,l)) 117 du(ij+u_lup, l ) = du(ij+u_lup,l) - (wwuu(ij+u_lup,l+1) + wwuu(ij+u_lup,l)) / (rhodz(ij,l)+rhodz(ij+t_lup,l)) 118 du(ij+u_ldown, l ) = du(ij+u_ldown,l) - (wwuu(ij+u_ldown,l+1)+ wwuu(ij+u_ldown,l)) / (rhodz(ij,l)+rhodz(ij+t_ldown,l)) 119 ENDDO 120 ENDDO 121 122 END IF ! dysl 123 124 CALL trace_end("compute_caldyn_vert") 125 126 END SUBROUTINE compute_caldyn_vert 127 128 SUBROUTINE compute_caldyn_vert_NH(mass,geopot,W,wflux, W_etadot, du,dPhi,dW) 16 SUBROUTINE compute_caldyn_vert_NH_hex(mass,geopot,W,wflux, W_etadot, du,dPhi,dW) 129 17 REAL(rstd),INTENT(IN) :: mass(iim*jjm,llm) 130 18 REAL(rstd),INTENT(IN) :: geopot(iim*jjm,llm+1) … … 144 32 CALL trace_start("compute_caldyn_vert_nh") 145 33 146 IF(dysl) THEN147 34 !$OMP BARRIER 148 35 #include "../kernels_hex/caldyn_vert_NH.k90" 149 36 !$OMP BARRIER 150 ELSE 37 CALL trace_end("compute_caldyn_vert_nh") 38 END SUBROUTINE compute_caldyn_vert_NH_hex 39 40 SUBROUTINE compute_caldyn_vert_NH_manual(mass,geopot,W,wflux, W_etadot, du,dPhi,dW) 41 REAL(rstd),INTENT(IN) :: mass(iim*jjm,llm) 42 REAL(rstd),INTENT(IN) :: geopot(iim*jjm,llm+1) 43 REAL(rstd),INTENT(IN) :: W(iim*jjm,llm+1) 44 REAL(rstd),INTENT(IN) :: wflux(iim*jjm,llm+1) 45 REAL(rstd),INTENT(INOUT) :: du(iim*3*jjm,llm) 46 REAL(rstd),INTENT(INOUT) :: dPhi(iim*jjm,llm+1) 47 REAL(rstd),INTENT(INOUT) :: dW(iim*jjm,llm+1) 48 REAL(rstd) :: W_etadot(iim*jjm,llm) ! vertical flux of vertical momentum 49 ! local arrays 50 REAL(rstd) :: eta_dot(iim*jjm, llm) ! eta_dot in full layers 51 REAL(rstd) :: wcov(iim*jjm,llm) ! covariant vertical momentum in full layers 52 ! indices and temporary values 53 INTEGER :: ij, l 54 REAL(rstd) :: wflux_ij, w_ij 55 56 CALL trace_start("compute_caldyn_vert_nh") 57 151 58 #define ETA_DOT(ij) eta_dot(ij,1) 152 59 #define WCOV(ij) wcov(ij,1) … … 196 103 #undef WCOV 197 104 198 END IF ! dysl199 105 CALL trace_end("compute_caldyn_vert_nh") 200 106 201 END SUBROUTINE compute_caldyn_vert_NH 107 END SUBROUTINE compute_caldyn_vert_NH_manual 202 108 203 END MODULE c aldyn_kernels_base_mod109 END MODULE compute_caldyn_vert_NH_mod
Note: See TracChangeset
for help on using the changeset viewer.