10 integer,
parameter :: Fnr = 17, fnd = 10
12 real :: coefd(Fncd,Fnm,0:Fnd,Fnr),&
13 coefo(Fnco,Fnm,0:Fnd,Fnr), &
14 coefl(Fncl,Fnm,0:Fnd,Fnr),&
15 coefs(Fncs,Fnm,0:Fnd,Fnr), &
16 coefc(Fncc,Fnm,0:Fnd,Fnr)
21 subroutine modis_fascode(coeff_dir_path, year, jday, temp, wvmr, ozmr, theta, ang_2way, platform, &
22 kban, jdet, taut, taut_2way, newang, newatm, new_2way, do_2way, iok, xxx, yyy )
51 character(*),
intent(in) :: coeff_dir_path
52 integer,
intent(in) :: year,
jday
53 real,
intent(inout) :: temp(*),wvmr(*),ozmr(*),taut(*), taut_2way(*)
54 integer,
intent(in) :: platform
55 real,
intent(in) :: theta, ang_2way
56 integer,
intent(in) :: kban, jdet, xxx, yyy
57 integer,
intent(inout) :: iok
58 logical,
intent(in) :: newang, newatm, new_2way, do_2way
60 integer,
parameter :: nd=10,nk=5,nl=101,nm=nl-1,koff=19,nr=17
61 integer,
parameter :: nxc= 4,ncc=nxc+1,lencc=ncc*nm,lenccb=lencc*4
62 integer,
parameter :: nxd= 8,ncd=nxd+1,lencd=ncd*nm,lencdb=lencd*4
63 integer,
parameter :: nxo= 9,nco=nxo+1,lenco=nco*nm,lencob=lenco*4
64 integer,
parameter :: nxl= 2,ncl=nxl+1,lencl=ncl*nm,lenclb=lencl*4
65 integer,
parameter :: nxs=11,ncs=nxs+1,lencs=ncs*nm,lencsb=lencs*4
66 integer,
parameter :: ndt=nd+1,nrps=nr*ndt,nxw=nxl+nxs
67 real,
parameter :: slp=1.5/365.0
68 real,
parameter :: smag=3.0
69 real,
parameter ::
pi=3.14159
70 real,
parameter :: soff=0.41
71 real,
parameter :: coff=337.5
75 real :: taud(nl), tauw(nl), tauo(nl)
76 real :: taud_2way(nl), tauw_2way(nl), tauo_2way(nl)
81 real :: tauc(nl),tauc_2way(nl), tlas(nl),wlas(nl),olas(nl)
83 real*4 x,rco2,ratio,tau_test
86 character*256 cfile(nk),dfile
98 real :: zlas, zlas2way
103 integer :: ksat, iux, m, j, kk, ikrec, krec, krecx, k, lencx, l, i
106 real :: dt, dw, fdo, datm, zsec, zsec_2way
108 integer :: firsttime = 0
121 xfile =
'/modisdet.com.101.xxx_end.v3'
130 comp = (/
'dry',
'ozo',
'wts',
'wtl',
'wco'/)
131 lengcf = (/lencdb,lencob,lencsb,lenclb,lenccb/)
132 lengcx = (/lencd,lenco,lencs,lencl,lencc/)
136 if (platform == 0)
then
139 path = coeff_dir_path
140 else if (platform == 1)
then
142 path = coeff_dir_path
144 write(*,
'(''tran_modisd101- unknown spacecraft '',i2)') platform
149 if (craft /=
cinit)
then
151 if (craft ==
"TERRA")
then
153 else if (craft ==
"AQUA")
then
156 write(*,
'(''tran_modisd101- unknown spacecraft '',a6)') craft
169 if( firsttime == 0 )
then
209 call get_cld_tbl( 0, trans_id(m), dfile, stat )
211 print *, __file__,__line__, &
212 'Unable to get the FAST_TRANS_COEFF file', m
216 open( iux, file=dfile, recl=lencf, access=
'direct', status=
'old', &
217 convert=
'big_endian')
229 read(iuc(k),rec=krecx) (bufs(j),j=1,lencx)
231 if(nsat /= ksat)
then
233 write(*,
'(''In tran_modisd101 ... requested data for '', &
234 & ''satellite '',i1/'' but read data for '', ''satellite '',i1,'' from file '',a80)') ksat,nsat,dfile
245 read(iuc(1),rec=krec) ((coefd(i,j,l,k),i=1,ncd),j=1,nm)
246 read(iuc(2),rec=krec) ((coefo(i,j,l,k),i=1,nco),j=1,nm)
247 read(iuc(3),rec=krec) ((coefs(i,j,l,k),i=1,ncs),j=1,nm)
248 read(iuc(4),rec=krec) ((coefl(i,j,l,k),i=1,ncl),j=1,nm)
249 read(iuc(5),rec=krec) ((coefc(i,j,l,k),i=1,ncc),j=1,nm)
278 if (do_2way .and. new_2way)
then
279 zsec_2way =
secant(ang_2way)
284 if(newang .or. newatm )
then
289 if (do_2way .and. (new_2way .or. newatm))
then
308 call taudoc(ncd,nxd,nm,coefd(:,:,j,k),
xdry,taud)
317 x = (year - 1980) * 365.25 +
jday
318 rco2 = (slp*x - smag*sin(2*
pi*(x/365.25 + soff))) + coff
322 if(taud(jj) > 0.0 .and. taud(jj) < 1.0)
then
323 taud(jj)=taud(jj)**ratio
328 call taudoc(nco,nxo,nm,coefo(:,:,j,k),
xozo,tauo)
335 call tauwtr(ncs,ncl,nxs,nxl,nxw,nm,coefs(:,:,j,k),coefl(:,:,j,k),
xwet,tauw)
337 call taudoc(ncc,nxc,nm,coefc(:,:,j,k),
xcon,tauc)
340 tauw(jj)=tauw(jj)*tauc(jj)
344 taut(jj)=taud(jj)*tauo(jj)*tauw(jj)
353 tau_test = taud_2way(jj)
354 if(taud_2way(jj) > 0.0 .and. taud_2way(jj) < 1.0)
then
355 taud_2way(jj)=taud_2way(jj)**ratio
364 call tauwtr(ncs,ncl,nxs,nxl,nxw,nm,coefs(:,:,j,k),coefl(:,:,j,k),
xwet_2way,tauw_2way)
369 tauw_2way(jj)=tauw_2way(jj)*tauc_2way(jj)
373 taut_2way(jj)=taud_2way(jj)*tauo_2way(jj)*tauw_2way(jj)