Changeset 837 for codes


Ignore:
Timestamp:
05/03/19 13:40:15 (5 years ago)
Author:
dubos
Message:

devel : Cp(T) thermodynamics (TBC)

Location:
codes/icosagcm/devel
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/Python/src/kernels_caldyn_hevi.jin

    r685 r837  
    151151      END_BLOCK 
    152152    END_BLOCK 
     153  CASE(thermo_variable_Cp) 
     154    ! thermodynamics with variable Cp 
     155    !           Cp(T) = Cp0 * (T/T0)^nu 
     156    ! =>            h = Cp(T).T/(nu+1) 
     157 
     158    FORALL_CELLS() 
     159      ON_PRIMAL 
     160        berni(CELL) = .5*(geopot(CELL)+geopot(UP(CELL))) 
     161        cp_ik = cpp*(pk(CELL)/Treff)**nu 
     162        berni(CELL) = berni(CELL) + pk(CELL)*(cp_ik/(nu+1.)-theta(CELL,1)) ! Gibbs = h-Ts = T(Cp/(nu+1)-s) 
     163      END_BLOCK 
     164    END_BLOCK 
    153165  CASE DEFAULT 
    154166    PRINT *, 'Unsupported value of caldyn_thermo : ',caldyn_thermo  ! FIXME 
  • codes/icosagcm/devel/src/dynamics/caldyn_kernels_hevi.F90

    r831 r837  
    368368 
    369369    INTEGER :: i,j,ij,l 
    370     REAL(rstd) :: Rd, qv, temp, chi, nu, due, due_right, due_lup, due_ldown 
     370    REAL(rstd) :: cp_ik, qv, temp, chi, nu, due, due_right, due_lup, due_ldown 
    371371 
    372372    CALL trace_start("compute_caldyn_fast") 
    373  
    374     Rd=cpp*kappa 
    375373 
    376374    IF(dysl_caldyn_fast) THEN 
  • codes/icosagcm/devel/src/kernels_hex/caldyn_fast.k90

    r563 r837  
    2727         END DO 
    2828      END DO 
     29   CASE(thermo_variable_Cp) 
     30      ! thermodynamics with variable Cp 
     31      ! Cp(T) = Cp0 * (T/T0)^nu 
     32      ! => h = Cp(T).T/(nu+1) 
     33      DO l = ll_begin, ll_end 
     34         !DIR$ SIMD 
     35         DO ij=ij_begin, ij_end 
     36            berni(ij,l) = .5*(geopot(ij,l)+geopot(ij,l+1)) 
     37            cp_ik = cpp*(pk(ij,l)/Treff)**nu 
     38            berni(ij,l) = berni(ij,l) + pk(ij,l)*(cp_ik/(nu+1.)-theta(ij,l,1)) ! Gibbs = h-Ts = T(Cp/(nu+1)-s) 
     39         END DO 
     40      END DO 
    2941   CASE DEFAULT 
    3042      PRINT *, 'Unsupported value of caldyn_thermo : ',caldyn_thermo ! FIXME 
  • codes/icosagcm/devel/src/kernels_unst/caldyn_fast.k90

    r658 r837  
    3333      END DO 
    3434      !$OMP END DO 
     35   CASE(thermo_variable_Cp) 
     36      ! thermodynamics with variable Cp 
     37      ! Cp(T) = Cp0 * (T/T0)^nu 
     38      ! => h = Cp(T).T/(nu+1) 
     39      !$OMP DO SCHEDULE(STATIC) 
     40      DO ij = 1, primal_num 
     41         !DIR$ SIMD 
     42         DO l = 1, llm 
     43            berni(l,ij) = .5*(geopot(l,ij)+geopot(l+1,ij)) 
     44            cp_ik = cpp*(pk(l,ij)/Treff)**nu 
     45            berni(l,ij) = berni(l,ij) + pk(l,ij)*(cp_ik/(nu+1.)-theta(l,ij,1)) ! Gibbs = h-Ts = T(Cp/(nu+1)-s) 
     46         END DO 
     47      END DO 
     48      !$OMP END DO 
    3549   CASE DEFAULT 
    3650      PRINT *, 'Unsupported value of caldyn_thermo : ',caldyn_thermo ! FIXME 
  • codes/icosagcm/devel/src/unstructured/caldyn_unstructured.F90

    r836 r837  
    203203  DECLARE_INDICES 
    204204  DECLARE_EDGES 
    205   NUM          :: due 
     205  NUM          :: due, cp_ik 
    206206  START_TRACE(id_fast, 4,0,2) ! primal, dual, edge 
    207207#include "../kernels_unst/caldyn_fast.k90" 
  • codes/icosagcm/devel/src/unstructured/data_unstructured.F90

    r836 r837  
    1414 
    1515  INTEGER, PARAMETER :: eta_mass=1, eta_lag=2, & 
    16 !       thermo_theta=1, thermo_entropy=2, thermo_moist=3, thermo_boussinesq=4, & 
    1716       caldyn_vert_cons=1, max_nb_stage=5 
    1817  INDEX,  BIND(C) :: caldyn_eta=eta_lag, & 
    1918       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 
    2219  LOGICAL(C_BOOL), BIND(C) :: hydrostatic=.TRUE., debug_on=.FALSE. 
    2320  LOGICAL(C_BOOL), BIND(C, NAME='debug_hevi_solver') :: debug_hevi_solver_=.TRUE. 
     
    4441  TIME, BIND(C) :: elapsed 
    4542  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 
    4843  NUM1(max_nb_stage), BIND(C)              :: tauj       ! diagonal of fast Butcher tableau 
    4944  NUM2(max_nb_stage,max_nb_stage), BIND(C) :: cslj, cflj ! slow and fast modified Butcher tableaus 
Note: See TracChangeset for help on using the changeset viewer.