-
Notifications
You must be signed in to change notification settings - Fork 11
/
rout.f90
60 lines (46 loc) · 2.3 KB
/
rout.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
! Subroutine ROUT writes model atmosphere and excitation rates to an output file
! in order to transfer them to Randy Gladstone's REDISTER radiative transfer program.
! This software is part of the GLOW model. Use is governed by the Open Source
! Academic Research License Agreement contained in the file glowlicense.txt.
! For more information see the file glow.txt.
! Scott Baily and Stan Solomon, 9/1994
! Replaced 834 with LBH, SCS, 2/2003
! Reduced cascade contribution to 1356, SCS, 9/2003
! Included radiative recombination in 1356, SCS, 9/2003
! Refactored to f90, SCS, 12/2016
! Changed 1356, 1304, and LBH to use volume emission rate arrays, SCS, 12/2016
SUBROUTINE ROUT(ROFILE,LUN,EF,EZ,ITAIL,FRACO,FRACO2,FRACN2)
use cglow,only: jmax,idate
use cglow,only: ut,glat,glong,f107,f107p,f107a
use cglow,only: zz,aglw,sza,dip,xuvfac,ztn,zti,zte,zo,zo2,zns,zn2,ecalc,zxden,zeta
implicit none
integer,intent(in) :: lun,itail
real,intent(in) :: ef,ez,fraco,fraco2,fracn2
character(len=40),intent(in) :: rofile
real :: z(jmax), zhe(jmax), e1356(jmax), e1304(jmax), e1027(jmax), e989(jmax), elbh(jmax)
integer :: j
do j=1,jmax
z(j)=zz(j)/1.e5
zhe(j)=0.
e1356(j)=zeta(13,j)
e1304(j)=zeta(14,j)
e1027(j)=aglw(7,1,j)
e989(j)=aglw(8,1,j)
elbh(j)=zeta(12,j)
enddo
open(unit=lun,file=rofile,status='unknown')
write(lun,"(' JMAX ',' SZA ',' UT ',' IDATE',' LAT ',' LONG ',' DIP ')")
write(lun,"(i8,f8.2,f8.1,i8,3f8.2)") jmax,sza*180./3.14159,ut,idate,glat,glong,dip
write(lun,"(' F107 ',' F107p ',' F107a ',' XUVfac ')")
write(lun,"(4f8.2)") f107,f107p,f107a,xuvfac
write(lun,"(' Eflux ',' Ezero ',' Itail ',' FracO ',' FracO2 ',' FracN2 ')")
write(lun,"(f8.2,f8.1,i8,3f8.2)") ef, ez, itail, fraco, fraco2, fracn2
write(lun,"(' Alt Tn Ti Te O O2 N2 He N Ne O+ 1356 1304 1027 989 LBH')")
do j=1,jmax
write(lun,"(0p,f6.1,3f6.0,1p,12e9.2)") &
z(j),ztn(j),zti(j),zte(j),zo(j),zo2(j),zn2(j),zhe(j), &
zns(j),ecalc(j),zxden(3,j),e1356(j),e1304(j),e1027(j),e989(j),elbh(j)
enddo
close(lun)
return
end subroutine rout