1 | c*********************************************************************** |
---|
2 | c tcrco2_subrut.f |
---|
3 | c |
---|
4 | c jan 98 malv version for mz1d. copied from solar10/mz4sub.f |
---|
5 | c jul 2011 malv+fgg adapted to LMD-MGCM |
---|
6 | c*********************************************************************** |
---|
7 | |
---|
8 | ************************************************************************ |
---|
9 | |
---|
10 | subroutine dinterconnection ( v, vt ) |
---|
11 | |
---|
12 | * input: vib. temp. from che*.for programs, vt(nl) |
---|
13 | * output: test vibrational temp. for other che*.for, v(nl) |
---|
14 | ! iconex_smooth=1 ==> with smoothing |
---|
15 | ! iconex_smooth=0 ==> without smoothing |
---|
16 | ! iconex_tk=40 ==> with forced lte up to 40 km |
---|
17 | ! iconex_tk=20 ==> with forced lte up to 20 km |
---|
18 | ************************************************************************ |
---|
19 | |
---|
20 | implicit none |
---|
21 | include 'nltedefs.h' |
---|
22 | |
---|
23 | c argumentos |
---|
24 | real*8 vt(nl), v(nl) |
---|
25 | |
---|
26 | c local variables |
---|
27 | integer i |
---|
28 | |
---|
29 | c ************* |
---|
30 | |
---|
31 | do i=1,nl |
---|
32 | v(i) = vt(i) |
---|
33 | end do |
---|
34 | |
---|
35 | ! lo siguiente se utilizaba en solar10, pero es mejor introducirlo en |
---|
36 | ! la driver. por ahora no lo uso todavia. |
---|
37 | ! call fluctua(v,iconex_fluctua) |
---|
38 | ! call smooth_nl(v,iconex_smooth,nl) |
---|
39 | ! call forzar_tk(v,iconex_tk) |
---|
40 | |
---|
41 | return |
---|
42 | end |
---|
43 | |
---|
44 | c*********************************************************************** |
---|
45 | subroutine smooth_nl(y,nlx,nl) |
---|
46 | |
---|
47 | c returns smoothed y |
---|
48 | c*********************************************************************** |
---|
49 | |
---|
50 | implicit none |
---|
51 | |
---|
52 | c arguments |
---|
53 | integer nl ! Dimension of vectors |
---|
54 | integer nlx ! i. =0 ==> no smoothing |
---|
55 | ! =m ==> smoothing from point m up to nl |
---|
56 | real*8 y(nl) ! o. is returned after smoothed |
---|
57 | |
---|
58 | c local variables and constants |
---|
59 | integer i , nlmax |
---|
60 | parameter ( nlmax=250 ) ! Llevarse esto al mz1d.par ! |
---|
61 | real*8 x(nlmax) |
---|
62 | |
---|
63 | c *************** |
---|
64 | |
---|
65 | if (nlx.eq.0) return |
---|
66 | |
---|
67 | do i=nlx,nl |
---|
68 | x(i)=y(i) |
---|
69 | y(i)=0. |
---|
70 | end do |
---|
71 | |
---|
72 | do i=nlx,nl |
---|
73 | if(i.eq.nlx)then |
---|
74 | y(i)=x(i) |
---|
75 | elseif(i.eq.nl)then |
---|
76 | y(i)=2.*y(i-1)-y(i-2) |
---|
77 | else |
---|
78 | y(i)=(x(i+1)/2.+x(i)+x(i-1)/2.)/2. |
---|
79 | end if |
---|
80 | end do |
---|
81 | |
---|
82 | return |
---|
83 | end |
---|
84 | |
---|
85 | c*********************************************************************** |
---|
86 | function planckdp(tp,xnu) |
---|
87 | c returns the black body function at wavenumber xnu and temperature t. |
---|
88 | c*********************************************************************** |
---|
89 | |
---|
90 | implicit none |
---|
91 | |
---|
92 | include 'nltedefs.h' |
---|
93 | include 'nlte_data.h' |
---|
94 | ! common/datis/ pi, vlight, ee, hplanck, gamma, ab, |
---|
95 | ! @ n_avog, GG, R0, cte_sb, kboltzman, raddeg |
---|
96 | ! real*8 pi, vlight, ee, hplanck, gamma, ab, |
---|
97 | ! @ n_avog, GG, R0, cte_sb, kboltzman, raddeg |
---|
98 | |
---|
99 | real*8 planckdp |
---|
100 | real*8 xnu |
---|
101 | real tp |
---|
102 | |
---|
103 | planckdp = gamma*xnu**3.0 / exp( ee*xnu/dble(tp) ) |
---|
104 | !erg cm-2.sr-1/cm-1. |
---|
105 | |
---|
106 | return |
---|
107 | end |
---|
108 | c*********************************************************************** |
---|
109 | function planckdpdp(tp,xnu) |
---|
110 | c returns the black body function at wavenumber xnu and temperature t. |
---|
111 | c*********************************************************************** |
---|
112 | |
---|
113 | implicit none |
---|
114 | |
---|
115 | include 'nltedefs.h' |
---|
116 | include 'nlte_data.h' |
---|
117 | ! common/datis/ pi, vlight, ee, hplanck, gamma, ab, |
---|
118 | ! @ n_avog, GG, R0, cte_sb, kboltzman, raddeg |
---|
119 | ! real*8 pi, vlight, ee, hplanck, gamma, ab, |
---|
120 | ! @ n_avog, GG, R0, cte_sb, kboltzman, raddeg |
---|
121 | |
---|
122 | real*8 planckdpdp |
---|
123 | real*8 xnu |
---|
124 | real*8 tp |
---|
125 | |
---|
126 | planckdpdp = gamma*xnu**3.0 / exp( ee*xnu/dble(tp) ) |
---|
127 | !erg cm-2.sr-1/cm-1. |
---|
128 | |
---|
129 | return |
---|
130 | end |
---|
131 | c **************************************************************** |
---|
132 | function bandid (ib) |
---|
133 | c returns the 2 character code of the band |
---|
134 | c **************************************************************** |
---|
135 | implicit none |
---|
136 | |
---|
137 | integer ib |
---|
138 | character*2 bandid |
---|
139 | |
---|
140 | 132 format(i2) |
---|
141 | ! encode (2,132,bandid) ib |
---|
142 | write ( bandid, 132) ib |
---|
143 | |
---|
144 | if ( ib .eq. 1 ) bandid = '01' |
---|
145 | if ( ib .eq. 2 ) bandid = '02' |
---|
146 | if ( ib .eq. 3 ) bandid = '03' |
---|
147 | if ( ib .eq. 4 ) bandid = '04' |
---|
148 | if ( ib .eq. 5 ) bandid = '05' |
---|
149 | if ( ib .eq. 6 ) bandid = '06' |
---|
150 | if ( ib .eq. 7 ) bandid = '07' |
---|
151 | if ( ib .eq. 8 ) bandid = '08' |
---|
152 | if ( ib .eq. 9 ) bandid = '09' |
---|
153 | if ( ib .eq. 0 ) bandid = '00' |
---|
154 | |
---|
155 | c end |
---|
156 | return |
---|
157 | end |
---|