-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdefine_types_mod.f90
73 lines (59 loc) · 2.13 KB
/
define_types_mod.f90
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
module define_types
use sizes
implicit none
type a_gas
character(len=10):: name
integer :: num
double precision:: VMR
double precision :: molmass
end type a_gas
type a_cloud
character(len=15):: name
double precision :: dtau1,rg,rsig
end type a_cloud
type a_layer
! set an index to identify the layer in the fixed pressure scale
! layer 1 is top of atmosphere!!
integer:: index
double precision:: temp
double precision :: press,logP,dz,dp,ndens,fH2,fHe,fHmin,fH,fe,mu
double precision, allocatable,dimension(:) ::opd_ext,opd_scat,gg
double precision, allocatable,dimension(:) :: opd_lines,opd_CIA,opd_rayl,opd_hmbff
type(a_gas),allocatable,dimension(:) :: gas
type(a_cloud),allocatable,dimension(:) :: cloud
end type a_layer
type a_patch
integer:: index
integer :: cloudy
real:: cover
type(a_layer),allocatable,dimension(:):: atm
end type a_patch
save
contains
subroutine init_column(col)
type(a_layer),allocatable,dimension(:) :: col
integer:: ipatch,ilayer
if ( .NOT. allocated (col)) &
allocate (col(nlayers))
do ilayer = 1, nlayers
if ( .NOT. allocated (col(ilayer)%gas)) &
allocate (col(ilayer)%gas(ngas))
if ( .NOT. allocated (col(ilayer)%cloud)) &
allocate (col(ilayer)%cloud(nclouds))
if ( .NOT. allocated (col(ilayer)%opd_ext)) &
allocate (col(ilayer)%opd_ext(nwave))
if ( .NOT. allocated (col(ilayer)%opd_scat)) &
allocate (col(ilayer)%opd_scat(nwave))
if ( .NOT. allocated (col(ilayer)%opd_lines)) &
allocate (col(ilayer)%opd_lines(nwave))
if ( .NOT. allocated (col(ilayer)%opd_CIA)) &
allocate (col(ilayer)%opd_CIA(nwave))
if ( .NOT. allocated (col(ilayer)%opd_rayl)) &
allocate (col(ilayer)%opd_rayl(nwave))
if ( .NOT. allocated (col(ilayer)%gg)) &
allocate (col(ilayer)%gg(nwave))
if ( .NOT. allocated (col(ilayer)%opd_hmbff)) &
allocate (col(ilayer)%opd_hmbff(nwave))
end do
end subroutine init_column
end module define_types