23 subroutine gettemp(iday,xlat,pr,np,pf,temp,n_o,n_o2,n_n2)
24 use msis_init
, only: msisinit
25 use msis_constants
, only: rp
26 use esmf
, only: esmf_kind_r8
30 integer,
intent(in) :: iday
31 real(kind=esmf_kind_r8),
intent(in) :: xlat
32 real(kind=esmf_kind_r8),
intent(in) :: pr(np)
33 integer,
intent(in) :: np
34 character(*),
intent(in) :: pf
35 real(kind=esmf_kind_r8),
intent(out) :: temp(np)
36 real(kind=esmf_kind_r8),
intent(out) :: n_o(np)
37 real(kind=esmf_kind_r8),
intent(out) :: n_o2(np)
38 real(kind=esmf_kind_r8),
intent(out) :: n_n2(np)
40 real(kind=rp),
parameter :: alt=100, ut=0, f107=150, f107a=150, ap(7)=9, xlong=0
41 real(kind=rp) :: t, d(10), zkm
43 real(4) :: switch_legacy(1:25)
51 switch_legacy(10) = 0.
52 switch_legacy(14) = 0.
54 call msisinit(parmfile=pf, switch_legacy=switch_legacy)
57 call
ghp8(
real(iday, rp), ut, alt,
real(xlat, rp), &
58 xlong , f107a, f107, ap,
real(pr(ip), rp), &
60 temp(ip)=
real(t, esmf_kind_r8)
61 n_n2(ip)=
real(d(2), esmf_kind_r8)
62 n_o2(ip)=
real(d(3), esmf_kind_r8)
63 n_o( ip)=
real(d(4), esmf_kind_r8)
85 subroutine ghp8(day,utsec,z0,glat,glon,f107a,f107,ap,pres,alt,dn,tn)
87 use msis_constants
, only: kb, na, g0, rp
88 use msis_calc
, only: msiscalc
89 use msis_utils
, only: alt2gph
93 real(kind=rp),
intent(in) :: day
94 real(kind=rp),
intent(in) :: utsec
95 real(kind=rp),
intent(in) :: z0
96 real(kind=rp),
intent(in) :: glat,glon
97 real(kind=rp),
intent(in) :: f107a,f107
98 real(kind=rp),
intent(in) :: ap(7)
99 real(kind=rp),
intent(in) :: pres
100 real(kind=rp),
intent(out) :: alt
101 real(kind=rp),
intent(out) :: dn(10)
102 real(kind=rp),
intent(out) :: tn
104 real,
parameter :: tol = 0.000043
105 integer,
parameter :: maxit = 30
107 real(kind=rp) :: tex,zkm,pzkm
108 real :: xn,gz,xmbar,scl
110 real(8) :: xlat,alt0,alt1
112 plog = log10(pres*100.0_rp)
118 do while ( abs(delta) .ge. tol .and. n .le. maxit )
121 call msiscalc(day,utsec,zkm,glat,glon,f107a,f107,ap,tn,dn,tex)
125 delta = plog - log10(pzkm)
126 xmbar = dn(1) / xn / 1.66e-24_rp
130 gz =
real((alt2gph(xlat,alt1) - alt2gph(xlat,alt0)) * g0)
131 scl = na * kb * tn / (xmbar * gz)
134 zkm = zkm - scl * delta / 1000.0_rp
subroutine ghp8(day, utsec, z0, glat, glon, f107a, f107, ap, pres, alt, dn, tn)
Wrapper routine for calls to MSIS 2.1 for computing temperature and neutral density at a given pressu...
subroutine gettemp(iday, xlat, pr, np, pf, temp, n_o, n_o2, n_n2)
Routine that computes temperature and neutral density values utilizing MSIS 2.1.