-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit_msis.LV-426.f90
127 lines (82 loc) · 2.74 KB
/
init_msis.LV-426.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
subroutine get_msis_temperature(lon, lat, alt, t, h)
use ModIndicesInterfaces
use ModTime
use ModInputs
use GITM_planet
use ModGITM
use EUA_ModMsis90, only: meter6, gtd6
implicit none
real, intent(in) :: lon, lat, alt
real, intent(out) :: t, h
real :: m, r, g
!-------------------------------------------------------
t = 100.0
m = Mass(iH2_)
r = RBody + alt
g = Gravitational_Constant * (RBody/r) ** 2
h = Boltzmanns_Constant * t / (m*g)
end subroutine get_msis_temperature
!--------------------------------------------------------------
!
!--------------------------------------------------------------
subroutine init_msis
use ModGITM
use ModInputs
use ModConstants
use GITM_planet
use ModTime
implicit none
integer :: iBlock, iAlt, iLat, iLon, iSpecies, iyd
real :: geo_lat, geo_lon, geo_alt
if (DoRestart) return
! Initialize data
do iBlock = 1, nBlocks
do iAlt = -1, nAlts+2
do iLon=-1,nLons+2
do iLat=-1,nLats+2
NDensityS(iLon,iLat,iAlt,iH2_,iBlock) = 0.0
MeanMajorMass(iLon,iLat,iAlt) = Mass(iH2_)
TempUnit(iLon,iLat,iAlt) = &
MeanMajorMass(iLon,iLat,iAlt)/ Boltzmanns_Constant
Temperature(iLon,iLat,iAlt,iBlock) = 100.0
Rho(iLon,iLat,iAlt,iBlock) = &
MeanMajorMass(iLon,iLat,iAlt) * &
NDensityS(iLon,iLat,iAlt,iH2_,iBlock)
LogNS(iLon,iLat,iAlt,:,iBlock) = &
log(NDensityS(iLon,iLat,iAlt,:,iBlock))
NDensity(iLon,iLat,iAlt,iBlock) = &
sum(NDensityS(iLon,iLat,iAlt,1:nSpecies,iBlock))
Velocity(iLon,iLat,iAlt,:,iBlock) = 0.0
enddo
enddo
enddo
Rho(:,:,:,iBlock) = 0.0
NDensity(:,:,:,iBlock) = 0.0
do iSpecies=1,nSpecies
NDensity(:,:,:,iBlock) = NDensity(:,:,:,iBlock) + &
NDensityS(:,:,:,iSpecies,iBlock)
Rho(:,:,:,iBlock) = Rho(:,:,:,iBlock) + &
Mass(iSpecies)*NDensityS(:,:,:,iSpecies,iBlock)
enddo
enddo
end subroutine init_msis
!--------------------------------------------------------------
!
!--------------------------------------------------------------
subroutine msis_bcs(iJulianDay,UTime,Alt,Lat,Lon,Lst, &
F107A,F107,AP,LogNS, Temp, LogRho, v)
use ModTime, only : iTimeArray
use GITM_planet
implicit none
integer, intent(in) :: iJulianDay
real, intent(in) :: uTime, Alt, Lat, Lon, LST, f107a, f107
real, intent(in):: ap
real, intent(out) :: LogNS(nSpecies), Temp, LogRho, v(2)
real :: h2
h2 = 1.0e10
LogNS(iH2_) = alog(h2)
Temp = 100.0
LogRho = alog(h2*mass(iH2_))
V(1) = 0.0
V(2) = 0.0
end subroutine msis_bcs