forked from pressel/pycles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMicrophysics.pyx
29 lines (24 loc) · 971 Bytes
/
Microphysics.pyx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!python
#cython: boundscheck=False
#cython: wraparound=False
#cython: initializedcheck=False
#cython: cdivision=True
cimport ParallelMPI
from Thermodynamics cimport LatentHeat
cdef class No_Microphysics_Dry:
def __init__(self, ParallelMPI.ParallelMPI Par, LatentHeat LH, namelist):
LH.Lambda_fp = lambda_constant
LH.L_fp = latent_heat_constant
self.thermodynamics_type = 'dry'
return
cdef class No_Microphysics_SA:
def __init__(self, ParallelMPI.ParallelMPI Par, LatentHeat LH, namelist):
LH.Lambda_fp = lambda_constant
LH.L_fp = latent_heat_variable
self.thermodynamics_type = 'SA'
return
def MicrophysicsFactory(namelist, LatentHeat LH, ParallelMPI.ParallelMPI Par):
if(namelist['microphysics']['scheme'] == 'None_Dry'):
return No_Microphysics_Dry(Par, LH, namelist)
elif(namelist['microphysics']['scheme'] == 'None_SA'):
return No_Microphysics_SA(Par, LH, namelist)