Changeset 836 for codes/icosagcm/devel/src
- Timestamp:
- 05/03/19 13:25:21 (5 years ago)
- Location:
- codes/icosagcm/devel/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/src/base/earth_const.f90
r834 r836 7 7 ! hence the variables set here are not THREADPRIVATE 8 8 9 REAL(rstd) :: g=9.80616 10 REAL(rstd) :: radius=6.37122E6 9 ! Some variable are BIND(C) to be accessible from Python 10 11 REAL(rstd), BIND(C) :: g=9.80616 ! acceleration of gravity assumed constant 12 REAL(rstd):: radius=6.37122E6 11 13 REAL(rstd) :: omega=7.292E-5 12 14 REAL(rstd) :: scale_factor=1. 13 15 REAL(rstd),PARAMETER :: daysec=86400 14 16 15 REAL(rstd) :: kappa=0.2857143 16 REAL(rstd) :: cpp=1004.70885 17 REAL(rstd) :: nu=0.35 ! exponent in variable-Cp law Cp=cpp*(T/Treff)^nu 18 REAL(rstd) :: cppv=1860. 19 REAL(rstd) :: Rv=461.5 20 REAL(rstd) :: Treff=273. 21 REAL(rstd) :: preff=101325. 22 REAL(rstd) :: pa=50000. ! default value set to preff/2 by disvert_std 17 REAL(rstd), BIND(C) :: Treff=273., & ! reference temperature, used in definition of entropy 18 preff=101325., & ! reference pressure, used in definition of entropy and theta 19 cpp=1004.70885, & ! specific heat at constant pressure at t=Treff for dry air 20 cppv=1860., & ! specific heat at constant pressure at t=Treff for water vapor 21 Rd, & ! specific perfect gas constant for dry air 22 Rv=461.5 ! specific perfect gas constant for water vapor 23 24 REAL(rstd) :: nu=0.35 ! exponent in variable-Cp law Cp=cpp*(T/Treff)^nu 25 REAL(rstd) :: pa=50000. ! default value set to preff/2 by disvert_std 23 26 REAL(rstd) :: scale_height=8000. ! atmospheric scale height (m) 24 27 REAL(rstd) :: gas_constant = 8.3144621 25 REAL(rstd) :: Rd, mu ! specific perfect gas constant andmolar mass (?)28 REAL(rstd) :: mu ! molar mass (?) 26 29 27 INTEGER, PUBLIC, PARAMETER :: thermo_none=-99, thermo_theta=1, thermo_entropy=2, thermo_variable_Cp=3, & 30 REAL(rstd) :: kappa=0.2857143 31 32 INTEGER, PARAMETER :: thermo_none=-99, thermo_theta=1, thermo_entropy=2, thermo_variable_Cp=3, & 28 33 thermo_moist=4, thermo_boussinesq=5, thermo_dry=10, thermo_fake_moist=11, thermo_moist_debug=100 29 LOGICAL , PUBLIC:: boussinesq30 INTEGER, PUBLIC:: caldyn_thermo, physics_thermo34 LOGICAL :: boussinesq 35 INTEGER, BIND(C) :: caldyn_thermo, physics_thermo 31 36 32 37 CONTAINS -
codes/icosagcm/devel/src/dynamics/caldyn_kernels_base.F90
r731 r836 24 24 25 25 INTEGER :: i,j,ij,l 26 REAL(rstd) :: Rd, p_ik, exner_ik, temp_ik, qv, chi, Rmix, gv26 REAL(rstd) :: p_ik, exner_ik, Cp_ik, temp_ik, qv, chi, Rmix, gv 27 27 INTEGER :: ij_omp_begin_ext, ij_omp_end_ext 28 28 … … 32 32 33 33 CALL distrib_level(ij_begin_ext,ij_end_ext, ij_omp_begin_ext,ij_omp_end_ext) 34 35 Rd = kappa*cpp36 34 37 35 IF(dysl_geopot) THEN -
codes/icosagcm/devel/src/kernels_hex/compute_geopot.k90
r724 r836 82 82 END DO 83 83 END DO 84 CASE(thermo_variable_Cp) 85 ! thermodynamics with variable Cp 86 ! Cp.dT = dh = Tds + vdp 87 ! pv = RT 88 ! => ds = (dh+v.dp)/T = Cp.dT/T - R dp/p 89 ! Cp(T) = Cp0 * (T/T0)^nu 90 ! => s(p,T) = Cp(T)/nu - R log(p/preff) 91 ! h = Cp(T).T/(nu+1) 92 !DIR$ SIMD 93 DO ij=ij_omp_begin_ext,ij_omp_end_ext 94 pk(ij,llm) = ptop + .5*g* rhodz(ij,llm) 95 END DO 96 DO l = llm-1,1,-1 97 !DIR$ SIMD 98 DO ij=ij_omp_begin_ext,ij_omp_end_ext 99 pk(ij,l) = pk(ij,l+1) + (.5*g)*( rhodz(ij,l) + rhodz(ij,l+1) ) 100 END DO 101 END DO 102 IF(caldyn_eta == eta_lag) THEN 103 !DIR$ SIMD 104 DO ij=ij_omp_begin_ext,ij_omp_end_ext 105 ps(ij) = pk(ij,1) + .5*g* rhodz(ij,1) 106 END DO 107 END IF 108 DO l = 1,llm 109 !DIR$ SIMD 110 DO ij=ij_omp_begin_ext,ij_omp_end_ext 111 p_ik = pk(ij,l) 112 Cp_ik = nu*( theta(ij,l,1) + Rd*log(p_ik/preff) ) 113 temp_ik = Treff* (Cp_ik/cpp)**(1./nu) 114 gv = (g*Rd)*temp_ik/p_ik ! specific volume v = Rd*T/p 115 pk(ij,l) = temp_ik 116 geopot(ij,l+1) = geopot(ij,l) + gv*rhodz(ij,l) 117 END DO 118 END DO 84 119 CASE(thermo_moist) 85 120 !DIR$ SIMD -
codes/icosagcm/devel/src/kernels_unst/compute_geopot.k90
r686 r836 70 70 END DO 71 71 !$OMP END DO 72 CASE(thermo_variable_Cp) 73 ! thermodynamics with variable Cp 74 ! Cp.dT = dh = Tds + vdp 75 ! pv = RT 76 ! => ds = (dh+v.dp)/T = Cp.dT/T - R dp/p 77 ! Cp(T) = Cp0 * (T/T0)^nu 78 ! => s(p,T) = Cp(T)/nu - R log(p/preff) 79 ! h = Cp(T).T/(nu+1) 80 !$OMP DO SCHEDULE(STATIC) 81 DO ij=1,primal_num 82 pk(llm,ij) = ptop + .5*g* rhodz(llm,ij) 83 DO l = llm-1,1,-1 84 pk(l,ij) = pk(l+1,ij) + (.5*g)*( rhodz(l,ij) + rhodz(l+1,ij) ) 85 END DO 86 IF(caldyn_eta == eta_lag) THEN 87 ps(ij) = pk(1,ij) + .5*g* rhodz(1,ij) 88 END IF 89 END DO 90 !$OMP END DO 91 !$OMP DO SCHEDULE(STATIC) 92 DO ij=1,primal_num 93 DO l = 1,llm 94 p_ik = pk(l,ij) 95 Cp_ik = nu*( theta(l,ij,1) + Rd*log(p_ik/preff) ) 96 temp_ik = Treff* (Cp_ik/cpp)**(1./nu) 97 gv = (g*Rd)*temp_ik/p_ik ! specific volume v = Rd*T/p 98 pk(l,ij) = temp_ik 99 geopot(l+1,ij) = geopot(l,ij) + gv*rhodz(l,ij) 100 END DO 101 END DO 102 !$OMP END DO 72 103 CASE(thermo_moist) 73 104 !$OMP DO SCHEDULE(STATIC) -
codes/icosagcm/devel/src/unstructured/caldyn_unstructured.F90
r833 r836 2 2 USE ISO_C_BINDING 3 3 USE OMP_LIB 4 USE earth_const 4 5 USE data_unstructured_mod 5 6 IMPLICIT NONE … … 119 120 FIELD_PS :: ps ! OUT 120 121 DECLARE_INDICES 121 NUM :: gdz, ke, uu, chi, gv, exner_ik, temp_ik, p_ik, qv, Rmix 122 NUM :: gdz, ke, uu, chi, gv, exner_ik, temp_ik, p_ik, qv, Rmix, Cp_ik 122 123 START_TRACE(id_geopot, 3,0,3) 123 124 #include "../kernels_unst/compute_geopot.k90" -
codes/icosagcm/devel/src/unstructured/data_unstructured.F90
r832 r836 1 1 MODULE data_unstructured_mod 2 2 USE ISO_C_BINDING 3 USE earth_const, ONLY : thermo_theta 3 4 USE mpipara, ONLY : is_mpi_master 4 5 USE grid_param, ONLY : llm, nqdyn … … 13 14 14 15 INTEGER, PARAMETER :: eta_mass=1, eta_lag=2, & 15 thermo_theta=1, thermo_entropy=2, thermo_moist=3, thermo_boussinesq=4, &16 ! thermo_theta=1, thermo_entropy=2, thermo_moist=3, thermo_boussinesq=4, & 16 17 caldyn_vert_cons=1, max_nb_stage=5 17 INDEX, BIND(C) :: caldyn_ thermo=thermo_theta, caldyn_eta=eta_lag, &18 INDEX, BIND(C) :: caldyn_eta=eta_lag, & 18 19 caldyn_vert_variant=caldyn_vert_cons, nb_threads=0, nb_stage=0 20 ! INDEX, BIND(C) :: caldyn_thermo=thermo_theta, caldyn_eta=eta_lag, & 21 ! caldyn_vert_variant=caldyn_vert_cons, nb_threads=0, nb_stage=0 19 22 LOGICAL(C_BOOL), BIND(C) :: hydrostatic=.TRUE., debug_on=.FALSE. 20 23 LOGICAL(C_BOOL), BIND(C, NAME='debug_hevi_solver') :: debug_hevi_solver_=.TRUE. … … 40 43 TIME, PARAMETER :: print_trace_interval = 1. 41 44 TIME, BIND(C) :: elapsed 42 NUM, BIND(C) :: g, ptop, cpp, cppv, Rd, Rv, preff, Treff, pbot, Phi_bot, rho_bot 43 NUM :: kappa 45 NUM, BIND(C) :: ptop, pbot, Phi_bot, rho_bot 46 ! NUM, BIND(C) :: g, ptop, cpp, cppv, Rd, Rv, preff, Treff, pbot, Phi_bot, rho_bot 47 ! NUM :: kappa 44 48 NUM1(max_nb_stage), BIND(C) :: tauj ! diagonal of fast Butcher tableau 45 49 NUM2(max_nb_stage,max_nb_stage), BIND(C) :: cslj, cflj ! slow and fast modified Butcher tableaus … … 252 256 ! 253 257 SUBROUTINE init_params() BINDC(init_params) 258 USE earth_const 254 259 kappa = Rd/cpp 255 260 IF(is_mpi_master) THEN
Note: See TracChangeset
for help on using the changeset viewer.