1 | subroutine disr_haze(dz,press,wno,taeros,ssa,cbar) |
---|
2 | |
---|
3 | use datafile_mod, only: datadir |
---|
4 | |
---|
5 | IMPLICIT NONE |
---|
6 | |
---|
7 | ! ========================================================================== |
---|
8 | ! |
---|
9 | ! Purpose : |
---|
10 | ! Interpolate values of extinction coefficient, single scattering albedo |
---|
11 | ! and asymetry factor from hazetable ( Lavvas et al. 2010, mean profile, no |
---|
12 | ! detached layer) |
---|
13 | ! |
---|
14 | ! + JVO 2017 : Vertical extension out of table implemented |
---|
15 | ! |
---|
16 | ! Author : |
---|
17 | ! Jan Vatant d'Ollone (2016) |
---|
18 | ! |
---|
19 | ! ========================================================================== |
---|
20 | |
---|
21 | real*8,intent(in) :: dz, press, wno |
---|
22 | real*8,intent(inout):: taeros, ssa, cbar |
---|
23 | |
---|
24 | !--------------------------- |
---|
25 | ! NB !! |
---|
26 | ! taeros is the integrated extinction over the layer |
---|
27 | ! (extinction * thickness of layer) |
---|
28 | !--------------------------- |
---|
29 | |
---|
30 | integer :: i, j, iw, ip, ierr |
---|
31 | real*8 :: wln, factw, factp |
---|
32 | real*8 :: tmp_p, fact_t, fact_s, fact_c |
---|
33 | integer,parameter :: nbwl_PL=328, nblev_PL=162 |
---|
34 | real*8,save :: ext_PL(nblev_PL,nbwl_PL), ssa_PL(nblev_PL,nbwl_PL) |
---|
35 | real*8,save :: asf_PL(nblev_PL,nbwl_PL) |
---|
36 | real*8,save :: wl_PL(nbwl_PL), press_PL(nblev_PL) |
---|
37 | logical,save :: firstcall=.true. |
---|
38 | character(len=15) :: dummy |
---|
39 | |
---|
40 | if (firstcall) then |
---|
41 | print*,"We use DISR haze mean profile from P.Lavvas" |
---|
42 | |
---|
43 | ! read PL table |
---|
44 | ! wl_PL in nm |
---|
45 | ! press_PL in Pa |
---|
46 | open(11,file=TRIM(datadir)//'/hazetable_PL_original.dat',status="old",iostat=ierr) |
---|
47 | read(11,*) dummy,wl_PL |
---|
48 | do i=1,nblev_PL |
---|
49 | read(11,*) press_PL(i),ext_PL(i,:) ! in cm-1 |
---|
50 | enddo |
---|
51 | do i=1,nblev_PL |
---|
52 | read(11,*) press_PL(i),ssa_PL(i,:) |
---|
53 | enddo |
---|
54 | do i=1,nblev_PL |
---|
55 | read(11,*) press_PL(i),asf_PL(i,:) |
---|
56 | enddo |
---|
57 | close(11) |
---|
58 | ! convert press_PL into millibar for comparison to press in the generic |
---|
59 | press_PL(:)=press_PL(:)*1E-2 |
---|
60 | |
---|
61 | ! Correction of the table according to Lavvas et al. 2010 (ext coeff = constant < 80 km / 20 mbar ) because of condensation |
---|
62 | ! do i=1,49 |
---|
63 | ! ext_PL(i,:) = ext_PL(50,:) |
---|
64 | ! enddo |
---|
65 | |
---|
66 | firstcall=.false. |
---|
67 | endif |
---|
68 | |
---|
69 | ! convert wno (in cm-1) into wln (nm) |
---|
70 | wln=1E7/wno |
---|
71 | |
---|
72 | ! interpolate the needed values from the table |
---|
73 | |
---|
74 | iw=1 |
---|
75 | do i=2,nbwl_PL |
---|
76 | if(wln.gt.wl_PL(i)) then |
---|
77 | iw=i |
---|
78 | endif |
---|
79 | enddo |
---|
80 | |
---|
81 | ip=1 |
---|
82 | do j=2,nblev_PL |
---|
83 | if(press.lt.press_PL(j)) then |
---|
84 | ip=j |
---|
85 | endif |
---|
86 | enddo |
---|
87 | |
---|
88 | !----------------- Interpolate values from the hazetable -------------------- |
---|
89 | |
---|
90 | if(iw.ne.nbwl_PL) then |
---|
91 | factw = (wln-wl_PL(iw)) / (wl_PL(iw+1)-wl_PL(iw)) |
---|
92 | else |
---|
93 | factw = 0. ! If we reach the end of the table we keep the last value |
---|
94 | endif |
---|
95 | if(ip.ne.nblev_PL) then |
---|
96 | factp = (press-press_PL(ip)) / (press_PL(ip+1)-press_PL(ip)) |
---|
97 | else |
---|
98 | factp=0. |
---|
99 | endif |
---|
100 | |
---|
101 | ! Lin-Log interpolation : linear on wln, logarithmic on press |
---|
102 | |
---|
103 | taeros = ( ext_PL(ip,iw)*(1.-factw) + ext_PL(ip,iw+1) *factw ) ** (1.-factp) & |
---|
104 | *( ext_PL(ip+1,iw)*(1.-factw) + ext_PL(ip+1,iw+1)*factw ) ** factp |
---|
105 | |
---|
106 | ssa = ( ssa_PL(ip,iw)*(1.-factw) + ssa_PL(ip,iw+1) *factw ) ** (1.-factp) & |
---|
107 | *( ssa_PL(ip+1,iw)*(1.-factw) + ssa_PL(ip+1,iw+1)*factw ) ** factp |
---|
108 | |
---|
109 | cbar = ( asf_PL(ip,iw)*(1.-factw) + asf_PL(ip,iw+1) *factw ) ** (1.-factp) & |
---|
110 | *( asf_PL(ip+1,iw)*(1.-factw) + asf_PL(ip+1,iw+1)*factw ) ** factp |
---|
111 | |
---|
112 | ! In case of vertical extension over the max of the table |
---|
113 | ! We take the scale height on the last 5 levels (more it's not quite log) |
---|
114 | ! Arbitray threshold pressure value, just to deal with the last level press=0 |
---|
115 | |
---|
116 | if(ip.eq.nblev_PL) then |
---|
117 | |
---|
118 | tmp_p = press |
---|
119 | |
---|
120 | if ( tmp_p .lt. 1.E-15 ) then |
---|
121 | tmp_p = 1.E-15 |
---|
122 | endif |
---|
123 | |
---|
124 | fact_t = log10( ( ext_PL(ip,iw)*(1.-factw) + ext_PL(ip,iw+1) *factw ) & |
---|
125 | / ( ext_PL(ip-5,iw)*(1.-factw) + ext_PL(ip-5,iw+1) *factw ) ) |
---|
126 | fact_s = log10( ( ssa_PL(ip,iw)*(1.-factw) + ssa_PL(ip,iw+1) *factw ) & |
---|
127 | / ( ssa_PL(ip-5,iw)*(1.-factw) + ssa_PL(ip-5,iw+1) *factw ) ) |
---|
128 | fact_c = log10( ( asf_PL(ip,iw)*(1.-factw) + asf_PL(ip,iw+1) *factw ) & |
---|
129 | / ( asf_PL(ip-5,iw)*(1.-factw) + asf_PL(ip-5,iw+1) *factw ) ) |
---|
130 | |
---|
131 | fact_t = fact_t / log10( press_PL(ip) / press_PL(ip-5) ) |
---|
132 | fact_s = fact_s / log10( press_PL(ip) / press_PL(ip-5) ) |
---|
133 | fact_c = fact_c / log10( press_PL(ip) / press_PL(ip-5) ) |
---|
134 | |
---|
135 | taeros = taeros * ( tmp_p / press_PL(ip) ) ** fact_t |
---|
136 | ssa = ssa * ( tmp_p / press_PL(ip) ) ** fact_s |
---|
137 | cbar = cbar * ( tmp_p / press_PL(ip) ) ** fact_c |
---|
138 | |
---|
139 | endif |
---|
140 | |
---|
141 | taeros=taeros*dz*1.E2 ! ext in cm-1 * thickness in m * 1E2 |
---|
142 | |
---|
143 | end subroutine disr_haze |
---|