370 include
'COMMONS_INC.f'
372 INTEGER LUN_IN, LUN_OUT, LUN_VAP, I_RET
373 COMMON /inout_units/ lun_in, lun_out, lun_vap
377 dimension h(25), t(25), p(25), vmr(25)
378 dimension wavobs(nobs_max),fwhm(nobs_max)
379 dimension tpvmr(7,81)
380 CHARACTER*1 LATHEM, LNGHEM
382 CHARACTER (LEN = 1000) :: FINAV,FOCUB,FOH2O
387 CHARACTER (LEN = 1000) :: FINPWV,FTPVMR
389 CHARACTER (LEN = 1000) :: FOUT1
393 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
394 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
395 COMMON /getinput4/ wavobs,fwhm
396 COMMON /getinput5/ nobs,ifullcalc,hsurf,dlt,dlt2
397 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
398 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
399 COMMON /getinput8/ imn,idy,iyr,ih,im,is
400 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
401 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
402 COMMON /getinput11/hdrec,nsamps,nlines,nbands,sorder
403 COMMON /getinput12/scalef
404 COMMON /tpvmr_init1/ tpvmr
407 COMMON /outcube/ focub
408 COMMON /incube/ finav
409 COMMON /outh2ovap/ foh2o
412 CHARACTER (LEN = 80) :: NAME_INSTRU, NAMES(10)
413 COMMON /getinput13/ name_instru,
names
416 COMMON /getinput14/ xpss, xppp
418 REAL XVIEWD, XVIEWM, XVIEWS
419 REAL XAZMUD, XAZMUM, XAZMUS
420 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
434 names(4) =
'TRWIS-III'
436 names(6) =
'Hyperion'
476 h(i) = tpvmr(model,2+(4*(i-1)))
478 p(i) = tpvmr(model,3+(4*(i-1))) / 1013.
479 t(i) = tpvmr(model,4+(4*(i-1)))
481 vmr(i) = tpvmr(model,5+(4*(i-1)))*1.0e-06
539 include
'COMMONS_INC.f'
542 dimension h(25), t(25), p(25), vmr(25)
544 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
545 COMMON /getinput5/ nobs,ifullcalc,hsurf,dlt,dlt2
546 COMMON /model_adj1/ clmvap,q
548 dimension hp(25), tp(25), pp(25), vmrp(25)
549 COMMON /model_adj2/ hp, tp, pp, vmrp
550 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer, &
551 dp_plane, dp_layer, clmvapp
552 COMMON /model_adj4/ k_surf
555 COMMON /getinput14/ xpss, xppp
585 7455
IF(hsurf.EQ.h(i)) hsurf=h(i)+0.0001
596 5237
FORMAT(2x,
'***WARNING: Surface elevation smaller then lowest boundary of the model atmosphere.'
607 tsurf=t(k)+(dhs/dhk)*(t(k+1)-t(k))
608 vmrs =vmr(k)+(dhs/dhk)*(vmr(k+1)-vmr(k))
611 psurf=p(k)*exp(-alog(p(k)/p(k+1))*dhs/dhk)
642 damtvt=q*(p(i)-p(i+1))*(vmr(i)+vmr(i+1))/2.0
646 clmvap=amtvrt/3.34e+22
648 WRITE(91,*)
'Column vapor amount in model atmosphere from ground'
649 WRITE(91,*)
' to space = ', clmvap,
' cm'
675 IF(hplane.GE.100.0) hplane = 100. - 0.0001
678 IF(hplane.GT.hp(1))
THEN
683 7456
IF(hplane.EQ.hp(i)) hplane=hp(i)-0.0001
686 CALL locate(hp,nb,hplane,kk)
690 5239
FORMAT(2x,
'***WARNING: Plane altitude less then lowest boundary of the model atmosphere.'
695 dhkk = hp(kk+1) - hp(kk)
696 dhss = hplane - hp(kk)
699 tplane = tp(kk) + (dhss/dhkk)*(tp(kk+1)-tp(kk))
700 vmrsp = vmrp(kk) + (dhss/dhkk)*(vmrp(kk+1)-vmrp(kk))
703 pplane = pp(kk)*exp(-alog(pp(kk)/pp(kk+1))*dhss/dhkk)
727 damtvtp=q*(pp(i)-pp(i+1))*(vmrp(i)+vmrp(i+1))/2.0
728 amtvrtp=amtvrtp+damtvtp
731 clmvapp=amtvrtp/3.34e+22
733 WRITE(91,*)
'Column vapor below plane (CLMVAPP) = ', &
745 dvap_plane = q*(pp(k_plane) - pp(k_plane+1))* &
746 (vmrp(k_plane) + vmrp(k_plane+1))/2.0 / 3.34e+22
748 dvap_layer = q*(p(k_plane) - p(k_plane+1))* &
749 (vmr(k_plane) + vmr(k_plane+1))/2.0 / 3.34e+22
751 dp_plane = pp(k_plane) - pp(k_plane+1)
752 dp_layer = p(k_plane) - p(k_plane+1)
794 include
'COMMONS_INC.f'
796 dimension vapvrt(nh2o_max), vap_slant(nh2o_max)
798 dimension ssh2o(nh2o_max)
799 dimension h(25), t(25), p(25), vmr(25)
800 CHARACTER*1 LATHEM,LNGHEM
807 DATA vapvrt/.00, .02, .06, .11, .16, .21, .26, .31, .36, .40,
808 .43, .46, .50, .54, .58, .62, .66, .70, .75, .80,
809 .86, .92, .98, 1.06,1.14, 1.22, 1.3, 1.4, 1.5, 1.6,
810 1.7, 1.8, 1.9, 2.05, 2.2, 2.35, 2.55, 2.75, 2.95, 3.2,
811 3.5, 3.8, 4.1, 4.4, 4.7, 5.0, 5.3, 5.6, 6.0, 6.4,
812 7.0, 7.7, 8.5, 9.4,10.4, 11.6, 13.0, 15.0, 25.0, 50./
814 DATA md/0,31,59,90,120,151,181,212,243,273,304,334/
816 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
818 COMMON /getinput8/ imn,idy,iyr,ih,im,is
819 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
820 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
821 COMMON /model_adj1/ clmvap,q
822 COMMON /geometry1/ solzni,solaz,obszni,obsphi,iday
823 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
824 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer, &
825 dp_plane, dp_layer, clmvapp
827 dimension g_vap(25), g_other(25)
828 COMMON /geometry3/ g_vap, g_other, g_vap_equiv
829 COMMON /geometry4/vap_slant_mdl
830 REAL MU,MU0, SSH2O_S(NH2O_MAX,2)
831 COMMON /geometry5/mu,mu0,ssh2o_s
833 COMMON /getinput14/ xpss, xppp
835 REAL XVIEWD, XVIEWM, XVIEWS
836 REAL XAZMUD, XAZMUM, XAZMUS
837 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
848 vap_slant(i) = vapvrt(i) * 2.0
855 obszni = obszni / radeg
856 obsphi = obsphi / radeg
858 solzni = solzni/radeg
865 write(91,*)
'GGEOM =',ggeom,
' OBSZNI = ',obszni,
' OBSPHI = ',obsphi
866 'solzni=',solzni,
' degrees :: MU0, MU = ',mu0, mu
867 write(91,*)
'f1a,f2a,f1b,f2b=',f1a,f2a,f1b,f2b
871 IF(hplane.LT.27.) go3 = ggeom - 1./cos(obszni)
883 WRITE(91,*)
'TOTLO3 = ', totlo3, vrto3
891 DO i = 1, k_plane - 1
897 DO i = k_plane + 1, 25
898 g_vap(i) = ggeom - 1./cos(obszni)
899 g_other(i) = ggeom - 1./cos(obszni)
904 g_vap(k_plane) = ggeom - 1./cos(obszni) &
905 + dvap_plane/dvap_layer/cos(obszni)
906 g_other(k_plane) = ggeom - 1./cos(obszni) &
907 + dp_plane/dp_layer/cos(obszni)
918 vap_slant_mdl = clmvap/cos(solzni) + clmvapp/cos(obszni)
919 vap_sol = clmvapp*mu0
926 g_vap_equiv = vap_slant_mdl / clmvap
927 write(91,*)
'G_VAP_EQUIV = ', g_vap_equiv, vap_slant_mdl, clmvap
928 write(91,*)
'VAP_SOL,VAP_SEN = ', vap_sol, vap_sen, wtrvpr
931 ssh2o(i) = vap_slant(i) / vap_slant_mdl
932 write(91,*)
'SSH2O(I), I = ', ssh2o(i), i, vap_slant_mdl, wtrvpr
933 if (wtrvpr.gt.0)
THEN
934 ssh2o_s(i,1) = vapvrt(i) / vap_sol
935 ssh2o_s(i,2) = vapvrt(i) / vap_sen
936 write(91,*)
'SSH2O_S(I,1), I = ', ssh2o_s(i,1), i, solzni*radeg
937 write(91,*)
'SSH2O_S(I,2), I = ', ssh2o_s(i,2), i, obszni*radeg
939 if (isplitp.ne.0)
then
940 write(6,*)
'ATREM: Split paths is not working because WaterVapor is 0'
949 lpyr = iyr - (4 * (iyr/4))
950 IF((lpyr.EQ.0).AND.(iday.GT.59).AND.(imn.NE.2)) iday = iday + 1
1048 include
'COMMONS_INC.f'
1051 dimension h(25), t(25), p(25), vmr(25)
1052 dimension ssh2o(nh2o_max)
1053 dimension wavobs(nobs_max),fwhm(nobs_max)
1054 dimension dp(25), pm(25), tm(25), vmrm(25)
1055 dimension finst2(100)
1056 dimension sumcf(np_hi)
1060 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
1061 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1062 COMMON /getinput4/ wavobs,fwhm
1063 COMMON /getinput5/ nobs,ifullcalc,hsurf,dlt,dlt2
1064 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
1065 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
1066 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1068 COMMON /model_adj1/ clmvap,q
1070 COMMON /init_speccal3/ nh2o
1071 COMMON /init_speccal5/ dp,pm,tm,vmrm
1072 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
1073 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
1074 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
1076 COMMON /init_speccal10/ ncv2,ncvhf2,ncvtt2,istrt2,iend2,finst2
1077 COMMON /init_speccal11/ natot,nbtot,nctot,ndtot
1079 REAL,
ALLOCATABLE :: ABSCF_CO2(:,:),ABSCF_O2(:,:),ABSCF_N2O(:,:),ABSCF_CH4(
1081 COMMON /geometry3/ g_vap, g_other, g_vap_equiv
1082 COMMON /geometry4/vap_slant_mdl
1084 dimension o3cf(no3pt)
1085 COMMON /o3cf_init1/ o3cf
1087 dimension tran_o3_std(no3pt)
1088 COMMON /init_speccal16/ tran_o3_std
1090 dimension rno2cf(no3pt)
1091 COMMON /no2cf_init1/ rno2cf
1093 dimension tran_no2_std(no3pt)
1094 COMMON /init_speccal17/ tran_no2_std
1096 COMMON /model_adj4/ k_surf
1097 INTEGER start(2)/1,1/
1098 INTEGER cnt(2)/NP_HI,19/
1099 CHARACTER(len=4096) :: filename
1103 SAVE first,abscf_co2,abscf_o2,abscf_n2o,abscf_ch4,abscf_co
1105 IF (first.eq.1)
THEN
1134 wavln_med(i) = vstart + float(i-1)*dwavln
1145 wavln_std(i) = 0.3 + float(i-1)*dwavln
1159 index_med(i) = ( (10000./wavln_med(i) - 3000.)/dwavno + 1.)
1170 wavln_med_index(i) = 10000. /(float(index_med(i)-1)*dwavno &
1180 fwhm_wavno(i) = 10000.*dlt_med &
1181 /(wavln_med_index(i)*wavln_med_index(i))
1190 ncvhf_wavno(i) = ( facdlt * fwhm_wavno(i) / dwavno + 1.)
1202 ncvhf(i) = ( facdlt * fwhm(i) / dwavln + 1.)
1216 IF(dwvavr.LT.fwhm(i)) dwvavr = fwhm(i)
1224 cons2=dlt2*sqrt(3.1415926/const1)
1226 IF (dlt2 .NE. 0.0)
THEN
1228 DO 585 i=ncvhf2,ncvtt2
1229 finst2(i)=exp(-const1*(float(i-ncvhf2)*dwvavr/dlt2)**2)
1230 sumins=sumins+finst2(i)
1234 finst2(i)=finst2(ncvtt2-i+1)
1235 sumins=sumins+finst2(i)
1238 sumins=sumins*dwvavr
1241 finst2(i)=finst2(i)*dwvavr/sumins
1258 nctot=nchnla+nchnlb+nchnlc
1259 ndtot=nchnla+nchnlb+nchnlc+nchnld
1265 write(91,*)
'IWNDW1=',iwndw1,iwndw1c,
' list[0]=',wavobs(1)
1268 wndow1=wavobs(iwndw1)
1269 wndow2=wavobs(iwndw2)
1272 IF(jj.EQ.0) nb1=nb1+1
1274 IF(kk.EQ.0) nb2=nb2+1
1284 wp94c=wavobs(iwp94c)
1287 IF(ll.EQ.0) nbp94=nbp94+1
1289 istp94=iwp94c-nb3haf
1290 iedp94=iwp94c+nb3haf
1292 wt1=(wndow2-wp94c)/(wndow2-wndow1)
1293 wt2=(wp94c-wndow1)/(wndow2-wndow1)
1298 wndow3=wavobs(iwndw4)
1299 wndow4=wavobs(iwndw5)
1302 IF(jj.EQ.0) nb3=nb3+1
1304 IF(kk.EQ.0) nb4=nb4+1
1315 w1p14c=wavobs(iw1p14c)
1317 IF(ll.EQ.0) nb1p14=nb1p14+1
1319 ist1p14=iw1p14c-nb6haf
1320 ied1p14=iw1p14c+nb6haf
1322 wt3=(wndow4-w1p14c)/(wndow4-wndow3)
1323 wt4=(w1p14c-wndow3)/(wndow4-wndow3)
1325 ALLOCATE ( abscf_co2(np_hi,19) )
1326 ALLOCATE ( abscf_n2o(np_hi,19) )
1327 ALLOCATE ( abscf_co(np_hi,19) )
1328 ALLOCATE ( abscf_ch4(np_hi,19) )
1329 ALLOCATE ( abscf_o2(np_hi,19) )
1331 write(filename(1:dln),
'(a)') datpath(1:dln)
1332 write(filename(dln+1:),
'(a)')
'abscf_gas.nc'
1333 ncid = ncopn(filename,ncnowrit,ircode)
1335 nrhid = ncvid(ncid,
'abscf_co2', ircode)
1336 CALL ncvgt (ncid, nrhid, start, cnt, abscf_co2, ircode)
1337 if (ircode .ne.0)
then
1338 write(*,*)
'Error reading abscf_gas.nc: abscf_co2: rcode=',ircode
1342 nrhid = ncvid(ncid,
'abscf_n2o', ircode)
1343 CALL ncvgt (ncid, nrhid, start, cnt, abscf_n2o, ircode)
1344 if (ircode .ne.0)
then
1345 write(*,*)
'Error reading abscf_gas.nc: abscf_n2o: rcode=',ircode
1349 nrhid = ncvid(ncid,
'abscf_co', ircode)
1350 CALL ncvgt (ncid, nrhid, start, cnt, abscf_co, ircode)
1351 if (ircode .ne.0)
then
1352 write(*,*)
'Error reading abscf_gas.nc: abscf_co: rcode=',ircode
1356 nrhid = ncvid(ncid,
'abscf_ch4', ircode)
1357 CALL ncvgt (ncid, nrhid, start, cnt, abscf_ch4, ircode)
1358 if (ircode .ne.0)
then
1359 write(*,*)
'Error reading abscf_gas.nc: abscf_ch4: rcode=',ircode
1363 nrhid = ncvid(ncid,
'abscf_o2', ircode)
1364 CALL ncvgt (ncid, nrhid, start, cnt, abscf_o2, ircode)
1365 if (ircode .ne.0)
then
1366 write(*,*)
'Error reading abscf_gas.nc: abscf_o2: rcode=',ircode
1370 CALL ncclos(ncid, rcode)
1382 tran_o3_std(i) = exp(-totlo3*o3cf(i))
1392 tran_o3_std(i) = 1.0
1401 vrtno2 = sno2 * vrtno2
1404 totno2 = gno2 * vrtno2
1408 tran_no2_std(i) = exp(-totno2*rno2cf(i))
1429 tran_no2_std(i) = 1.0
1439 pm(i)=(p(i)+p(i+1))/2.0
1440 tm(i)=(t(i)+t(i+1))/2.0
1461 tran_hi_others(:) = 1.0
1475 vmrm(i)=sclco2*355.0*1.0e-06
1479 vmrm(i)= vmrm(i)*g_other(i)
1484 sumcf(:) = sumcf(:) - abscf_co2(:,j)*dp(j-k_surf+1)*vmrm(j-k_surf
1487 tran_hi_others(:) = tran_hi_others(:)*exp(sumcf(:)*q* 28.966 /
1488 6.0225e+23 / 1.0e-06)
1498 vmrm(i)= vmrm(i)*g_other(i)
1504 sumcf(:) = sumcf(:) - abscf_n2o(:,j)*dp(j-k_surf+1)*vmrm(j-k_surf
1507 tran_hi_others(:) = tran_hi_others(:)*exp(sumcf(:)*q* 28.966 /
1508 6.0225e+23 / 1.0e-06)
1522 vmrm(i)= vmrm(i)*g_other(i)
1527 sumcf(:) = sumcf(:) - abscf_co(:,j)*dp(j-k_surf+1)*vmrm(j-k_surf
1529 tran_hi_others(:) = tran_hi_others(:)*exp(sumcf(:)*q* 28.966 /
1530 6.0225e+23 / 1.0e-06)
1556 vmrm(i)=sclch4*1.6*1.0e-06
1557 vmrm(i)= vmrm(i)*g_other(i)
1563 sumcf(:) = sumcf(:) - abscf_ch4(:,j)*dp(j-k_surf+1)*vmrm(j-k_surf
1566 tran_hi_others(:) = tran_hi_others(:)*exp(sumcf(:)*q* 28.966 /
1567 6.0225e+23 / 1.0e-06)
1584 vmrm(i)= vmrm(i)*g_other(i)
1593 sumcf(:) = sumcf(:) - abscf_o2(:,j)*dp(j-k_surf+1)*vmrm(j-k_surf
1596 tran_hi_others(1:9000) = tran_hi_others(1:9000) * exp(sumcf(1:900
1597 6.0225e+23 / 1.0e-06)
1598 tran_hi_others(9001:106600) = tran_hi_others(9001:106600) * exp(sumcf
1599 6.0225e+23 / 1.0e-06)
1600 tran_hi_others(106601:np_hi) = tran_hi_others(106601:np_hi) * exp
1601 6.0225e+23 / 1.0e-06)
1696 include
'COMMONS_INC.f'
1699 dimension dp(25), pm(25), tm(25), vmrm(25), g_vap(25),g_other(25)
1700 dimension h(25), t(25), p(25), vmr(25)
1701 dimension wavobs(nobs_max),fwhm(nobs_max)
1702 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
1703 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1704 COMMON /getinput4/ wavobs,fwhm
1705 COMMON /getinput5/ nobs,ifullcalc,hsurf,dlt,dlt2
1706 COMMON /init_speccal3/ nh2o
1707 COMMON /init_speccal5/ dp,pm,tm,vmrm
1708 COMMON /model_adj1/ clmvap,q
1709 COMMON /model_adj4/ k_surf
1710 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer, &
1711 dp_plane, dp_layer, clmvapp
1713 dimension ssh2o(nh2o_max)
1714 dimension vaptot(nh2o_max), r0p94(nh2o_max), r1p14(nh2o_max), trntbl
1715 tran_kd(nobs_max,nh2o_max), diff_tran(nobs_max,nh2o_max
1717 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl,tran_kd, diff_tran
1721 REAL TRAN_HI_SA(NP_HI,2),TRAN_HI_SAP1(NP_HI,2),TRAN_HI_SB(NP_HI,
1723 COMMON /tran_tables/tran_hi_sa,tran_hi_sap1,tran_hi_sb,tran_hi_sbp1
1724 COMMON /tran_table_l2gen/trntbl_s,trntbl_so
1727 REAL MU,MU0,SSH2O_S(NH2O_MAX,2),VMRM_S(25,2)
1728 COMMON /geometry5/mu,mu0,ssh2o_s
1730 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1731 COMMON /geometry3/ g_vap, g_other, g_vap_equiv
1732 COMMON /geometry4/vap_slant_mdl
1736 CHARACTER(len=4096) :: filename
1737 dimension sumcf(np_hi), sumcf_s(np_hi,2)
1738 REAL ABSCF_H2O(NP_HI,19)
1740 REAL,
ALLOCATABLE :: TG(:), TKCDF(:,:,:),DIFFT(:,:),SUM_KD(:),F1(:)
1741 REAL,
ALLOCATABLE :: WAVNO_HI(:)
1742 CHARACTER*31 GNAM, BNAM,LNAM
1744 REAL,
ALLOCATABLE :: TDP(:),TVMRM(:), TRAN_HI(:,:)
1747 INTEGER FIRST/1/,IDOSMOOTH/0/
1749 LOGICAL DOINLINEKD/.TRUE./
1750 SAVE first, abscf_h2o, tg, tkcdf, difft,n_g, wv, idosmooth, doinlinekd
1753 ALLOCATE( tran_hi(np_hi,nh2o_max) )
1754 ALLOCATE( wavno_hi(np_hi) )
1756 if (first.eq.1)
then
1758 if (ifullcalc.eq.1)
then
1759 print*,
'ATREM: **WARNING** Full_calc is on. Processing will be extremely slow...'
1761 print*,
'ATREM: Full_calc is off. Processing using k-distribution method...'
1764 idosmooth = ico2 + in2o + ico + ich4 + io2 + io3 + ino2
1766 write(filename(1:dln),
'(a)') datpath(1:dln)
1767 write(filename(dln+1:),
'(a)')
'abscf_gas.nc'
1775 ncid = ncopn(filename,ncnowrit,ircode)
1776 nrhid = ncvid(ncid,
'abscf_h2o', ircode)
1777 CALL ncvgt (ncid, nrhid, start, cnt, abscf_h2o, ircode)
1778 if (ircode .ne.0)
then
1779 write(*,*)
'Error reading abscf_gas.nc: abscf_h2o: rcode='
1783 nrhid = ncvid(ncid,
'waveno', ircode)
1784 CALL ncvgt (ncid, nrhid, start, cnt, wavno_hi, ircode)
1785 if (ircode .ne.0)
then
1786 write(*,*)
'Error reading abscf_gas.nc: waveno: rcode=',ircode
1790 CALL ncclos(ncid, rcode)
1792 if (.not.doinlinekd)
then
1793 write(filename(1:dln),
'(a)') datpath(1:dln)
1794 write(filename(dln+1:),
'(a)')
'hico_atrem_h2o_coef7.nc'
1796 ncid = ncopn(filename,ncnowrit,ircode)
1798 CALL ncinq(ncid,ndims,nvars,natts,irecdim,ircode)
1800 if (ndims.NE.3)
then
1801 write(*,*)
'Error Wrong number of dims in file'//
trim(filename
1802 'Expected 4, but got ',ndims
1806 CALL ncdinq(ncid, 1, gnam, n_g, ircode)
1808 CALL ncdinq(ncid, 2, bnam, n_b, ircode)
1810 CALL ncdinq(ncid, 3, lnam, n_l, ircode)
1814 if (n_b.NE.nobs)
then
1815 write(*,*)
' Bands expected (',nobs,
') do not match number of bands in file'
1816 '(',n_b,
') for file='//filename
1832 ALLOCATE( tkcdf(n_l,n_b,n_g) )
1836 ALLOCATE( sum_kd(n_b))
1838 ALLOCATE( tvmrm(n_l) )
1839 ALLOCATE( tdp(n_l) )
1841 if (doinlinekd)
then
1842 tg(1:7) = (/ 0.0, 0.379, 0.5106, 0.81, 0.9548, 0.9933, 1.
1852 nrhid = ncvid(ncid,
'g', ircode)
1853 CALL ncvgt (ncid, nrhid, start, cnt, tg, ircode)
1854 if (ircode .ne.0)
then
1855 write(*,*)
'Error reading '//filename//
': rcode=',ircode
1866 nrhid = ncvid(ncid,
'k_h2o', ircode)
1867 CALL ncvgt (ncid, nrhid, start, cnt, tkcdf, ircode)
1868 if (ircode .ne.0)
then
1869 write(*,*)
'Error reading '//filename//
': rcode=',ircode
1896 vmrm(i) = (vmr(i)+vmr(i+1))/2.0
1900 if (isplitp.ne.0)
then
1901 vmrm_s(i,1) = vmrm(i)*mu0
1902 if (i.lt.k_plane)
THEN
1903 vmrm_s(i,2) = vmrm(i)*mu
1905 if (i.eq.k_plane)
THEN
1906 vmrm_s(i,2) = vmrm(i)*mu*dvap_plane/dvap_layer
1911 WRITE(91,*) i,
' VMRM SOL, OBS=',vmrm_s(i,1),vmrm_s(i,2)
1913 vmrm(i) = vmrm(i)*g_vap(i)
1914 WRITE(91,*)
'VMRM=',vmrm(i)
1917 if (ifullcalc.ne.0.or.first.eq.1)
then
1922 IF (isplitp.NE.0)
THEN
1927 sumcf(:) = sumcf(:) - abscf_h2o(:,j)*dp(j-k_surf+1)*vmrm
1928 IF (isplitp.NE.0)
THEN
1929 sumcf_s(:,1) = sumcf_s(:,1) - abscf_h2o(:,j)*dp(j-k_surf
1930 sumcf_s(:,2) = sumcf_s(:,2) - abscf_h2o(:,j)*dp(j-k_surf
1941 tran_hi(:,i) = exp(sumcf(:)*ssh2o(i) * q * 28.966 / &
1942 6.0225e+23 / 1.0e-06)
1944 vaptot(i)= vap_slant_mdl * ssh2o(i)
1949 if (isplitp.ne.0)
then
1951 tran_hi_sa(:,j) = exp(sumcf_s(:,j) *ssh2o_s(ja_l2,j
1952 6.0225e+23 / 1.0e-06)
1953 tran_hi_sap1(:,j) = exp(sumcf_s(:,j)*ssh2o_s(ja_l2+1
1954 6.0225e+23 / 1.0e-06)
1956 tran_hi_sb(:,j) = exp(sumcf_s(:,j) *ssh2o_s(jb_l2,j
1957 6.0225e+23 / 1.0e-06)
1958 tran_hi_sbp1(:,j) = exp(sumcf_s(:,j)*ssh2o_s(jb_l2+1
1959 6.0225e+23 / 1.0e-06)
1974 if (ifullcalc.eq.0)
then
1978 if (first.eq.1.AND.doinlinekd)
then
1979 ALLOCATE( tkcdfc(n_l,n_b,n_g) )
1980 call kdist_gas_abs(tkcdfc,abscf_h2o,np_hi,wavno_hi,wavobs,n_b
1991 f1(:) = exp(-tkcdf(j,:,1) *dp(j-k_surf+1)*vmrm(j-k_surf
1994 f2(:) = exp(-tkcdf(j,:,k+1)*dp(j-k_surf+1)*vmrm(j-k_surf
1995 sum_kd(:) = sum_kd(:)+(f1(:) + f2(:))*(tg(k+1) - tg(k
1999 tran_kd(:,i) = tran_kd(:,i)*sum_kd(:)
2004 vaptot(i)= vap_slant_mdl * ssh2o(i)
2009 if (ifullcalc.ne.0.or.first.eq.1)
then
2017 if (first.eq.1)
then
2019 trh2(:,i) = trntbl(:,i)
2029 trntbl_so(:,:) = 1.0
2031 IF (idosmooth.GT.0)
THEN
2035 if (ifullcalc.eq.0)
then
2037 if (first.eq.1)
then
2043 trntbl(:,i) = tran_kd(:,i)*diff_tran(:,i)*trntblo(:)
2053 if (first.eq.1)
then
2055 print*,k,
" SLOW)TRNTBL=",trntbl(k,60),trntblo(k)
2060 trntbl(:,i) = trntbl(:,i)*trntblo(:)
2063 trntbl_s(:,:) = trntbl_s(:,:)*trntbl_so(:,:)
2071 DEALLOCATE(tran_hi,wavno_hi)
2075 subroutine linterp(x,y,n,xi,yi)
2076 real*4 x(n),y(n),xi,yi
2082 do while (khi-klo.gt.1)
2091 if (khi.eq.klo)
then
2098 yi = y(khi) + (xi-x(khi))/(x(khi)-x(klo))*(y(khi)-y(klo))
2100 yi = y(klo) + (xi-x(klo))/(x(khi)-x(klo))*(y(khi)-y(klo))
2105 SUBROUTINE kdist_gas_abs(kcdf,abscf,np_hi,waveno,wavobs,nwave)
2110 real*4 :: abscf(np_hi,19),waveno(np_hi),wavobs(nwave),kcdf(19,nwave
2111 real*4 alayers(np_hi,19)
2112 REAL,
ALLOCATABLE :: diflam(:),UV_lam(:),IR_lam(:),uv_dlam(:),ir_dlam(
2115 INTEGER,
ALLOCATABLE :: wavel_window(:,:)
2117 real*4 g7(7)/ 0, 0.379, 0.6, 0.81, 0.9548, 0.9933,
2122 data q/2.15199993e+25/
2126 alayers(:,i) = abscf(:,i)*q*28.966/ &
2127 6.0225e+23 / 1.0e-06
2132 ALLOCATE( diflam(nwave) )
2138 diflam(i) = wavobs(i+1) - wavobs(i)
2139 if (dlam.gt.diflam(i)) dlam = diflam(i)
2140 if (wmin.gt.wavobs(i)) wmin = wavobs(i)
2141 if (wmax.lt.wavobs(i)) wmax = wavobs(i)
2144 diflam(nwave) = diflam(nwave-1)
2146 if (wmin.gt.wavobs(nwave)) wmin = wavobs(nwave)
2147 if (wmax.lt.wavobs(nwave)) wmax = wavobs(nwave)
2149 ndxwuv = (wmin-0.0001 - 0.3)/dlam + 1
2150 ndxwir = (3.1- (wmax+0.0001))/diflam(nwave) + 1
2151 ndxtot = nwave+ndxwuv+ndxwir
2153 ALLOCATE( uv_lam(ndxwuv) )
2154 ALLOCATE( ir_lam(ndxwir) )
2155 ALLOCATE( uv_dlam(ndxwuv) )
2156 ALLOCATE( ir_dlam(ndxwir) )
2157 ALLOCATE( lam(ndxtot) )
2158 ALLOCATE( dwave(ndxtot) )
2159 ALLOCATE( dwn(ndxtot) )
2160 ALLOCATE( wn(ndxtot) )
2161 ALLOCATE( wavel_window(ndxtot,2) )
2168 uv_dlam(i) = diflam(1)
2171 dwn(k) = 10000.*dlam/(lam(k)**2)
2172 wn(k) = 10000./lam(k)
2179 dwn(k) = 10000.*diflam(i)/(lam(k)**2)
2180 wn(k) = 10000./lam(k)
2181 swav = swav + diflam(i)
2189 ir_dlam(i) = diflam(nwave)
2190 swav = swav + diflam(nwave)
2192 dwn(k) = 10000.*diflam(nwave)/(lam(k)**2)
2193 wn(k) = 10000./lam(k)
2197 ALLOCATE( kint(ndxtot,7) )
2198 ALLOCATE( k7(19,ndxtot,7) )
2202 do i=ndxwir+1,ndxtot-ndxwuv
2208 if (kwavdn.lt.0.and.waveno(k).gt.(wn(i)-dwn(i)/2.0)) kwavdn =
2209 if (kwavup.lt.0.and.waveno(k).gt.(wn(i)+dwn(i)/2.0)) kwavup =
2212 wavel_window(i,1) = kwavdn
2213 wavel_window(i,2) = kwavup
2215 if (kwavup.lt.1.or.kwavdn.lt.1)
then
2218 nsamp = kwavup - kwavdn + 1
2222 ALLOCATE( g_i(nbins+1) )
2223 ALLOCATE( k_i(nbins+1) )
2224 ALLOCATE( kk(nsamp+1) )
2227 if (kwavdn.lt.1.or.kwavup.lt.1)
then
2230 kk(1:nsamp) = alayers(kwavdn:kwavup,k)
2234 call ecdf(k_i,g_i,binnum(k),kk,nsamp)
2236 ALLOCATE( logk(nbins+1) )
2237 logk(:) = log10(k_i(:))
2242 call linterp(g_i,logk,binnum(k),g7(l),kint(i,l))
2243 k7(k,i,l) = 10**kint(i,l)
2245 if (i.gt.ndxwir.and.i.le.ndxtot-ndxwuv)
then
2246 if (isnan(k7(k,i,l)))
then
2249 kcdf(k,iw,l) = k7(k,i,l)
2256 DEALLOCATE (g_i, stat=ialloerr)
2260 if (i.gt.ndxwir.and.i.le.ndxtot-ndxwuv) iw = iw - 1
2265 DEALLOCATE( uv_lam )
2266 DEALLOCATE( ir_lam )
2267 DEALLOCATE( uv_dlam )
2268 DEALLOCATE( ir_dlam )
2273 DEALLOCATE( wavel_window )
2300 include
'COMMONS_INC.f'
2302 REAL :: TRAN_HI(NP_HI,NH2O_MAX)
2303 dimension wavobs(nobs_max),fwhm(nobs_max)
2304 COMMON /getinput4/ wavobs,fwhm
2306 dimension vaptot(nh2o_max), r0p94(nh2o_max), r1p14(nh2o_max), trntbl
2307 tran_kd(nobs_max,nh2o_max), diff_tran(nobs_max,nh2o_max
2308 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl,tran_kd, diff_tran
2310 dimension tran_ia(nh2o_max),tran_iap1(nh2o_max)
2312 COMMON /getinput5/ nobs,ifullcalc,hsurf,dlt,dlt2
2313 REAL,
ALLOCATABLE :: TRAN_STD(:,:),TRAN_MED(:,:)
2315 REAL TRAN_HI_SA(NP_HI,2),TRAN_HI_SAP1(NP_HI,2),TRAN_HI_SB(NP_HI,
2317 COMMON /tran_tables/tran_hi_sa,tran_hi_sap1,tran_hi_sb,tran_hi_sbp1
2318 COMMON /tran_table_l2gen/trntbl_s,trntbl_so
2319 REAL TRAN_MED_INDEX_SA(NP_MED,2),TRAN_MED_INDEX_SB(NP_MED,2), &
2320 tran_med_index_sap1(np_med,2),tran_med_index_sbp1(np_med,2
2321 tran_med_sa(np_med,2),tran_med_sap1(np_med,2),tran_med_sb(np_med
2322 tran_std_sa(np_std,2),tran_std_sap1(np_std,2),tran_std_sb(np_std
2323 tran_ia_sa(2),tran_ia_sap1(2),tran_ia_sb(2),tran_ia_sbp1(2
2324 tran_iap1_sa(2),tran_iap1_sap1(2),tran_iap1_sb(2),tran_iap1_sbp1
2325 trntblsa(2),trntblsap1(2),trntblsb(2),trntblsbp1(2)
2326 COMMON /tran_tables1/tran_med_index_sa,tran_med_index_sap1,tran_med_index_sb
2327 tran_med_sa,tran_med_sap1,tran_med_sb,tran_med_sbp1, &
2328 tran_std_sa,tran_std_sap1,tran_std_sb,tran_std_sbp1
2330 INTEGER FIRST/1/,IA(NOBS_MAX)
2351 IF (first.eq.1)
THEN
2354 ncvtot_wavno = 2 * ncvhf_wavno(j) - 1
2358 DO 560 i = ncvhf_wavno(j), ncvtot_wavno
2359 finstr_wavno(i,j) = &
2360 exp( -const1*(float(i-ncvhf_wavno(j))*dwavno &
2362 sumins = sumins + finstr_wavno(i,j)
2365 DO 565 i = 1, ncvhf_wavno(j)-1
2366 finstr_wavno(i,j) = finstr_wavno(ncvtot_wavno-i+1,j)
2367 sumins = sumins + finstr_wavno(i,j)
2370 sumins = sumins * dwavno
2372 DO 570 i = 1, ncvtot_wavno
2373 finstr_wavno(i,j) = finstr_wavno(i,j)*dwavno/sumins
2387 ncvtot = 2 * ncvhf(j) - 1
2389 DO 1560 i = ncvhf(j), ncvtot
2391 exp( -const1*(float(i-ncvhf(j))*dwavln &
2393 sumins = sumins + finstr(i,j)
2396 DO 1565 i = 1, ncvhf(j)-1
2397 finstr(i,j) = finstr(ncvtot-i+1,j)
2398 sumins = sumins + finstr(i,j)
2401 sumins = sumins * dwavln
2403 DO 1570 i = 1, ncvtot
2404 finstr(i,j) = finstr(i,j)*dwavln/sumins
2408 CALL hunt(wavln_std, np_std, wavobs(j), ia(j))
2414 ALLOCATE(tran_std(np_std,nh2o_max))
2415 ALLOCATE(tran_med(np_med,nh2o_max))
2423 tran_med_index(:,:) = 0.0
2424 IF(isplitp.NE.0)
THEN
2425 tran_med_index_sa(:,:) = 0.0
2426 tran_med_index_sap1(:,:) = 0.0
2427 tran_med_index_sb(:,:) = 0.0
2428 tran_med_index_sbp1(:,:) = 0.0
2434 ndx1 = index_med(j)-(ncvhf_wavno(j)-1)
2435 ndx2 = index_med(j)+ ncvhf_wavno(j)-1
2436 DO 491 k = ndx1,ndx2
2437 tran_med_index(j,:) = tran_med_index(j,:) + tran_hi(k,:)*
2438 finstr_wavno(k-index_med(j)+ncvhf_wavno(j),j)
2439 IF(isplitp.NE.0)
THEN
2440 tran_med_index_sa(j,:) = tran_med_index_sa(j,:) + tran_hi_sa
2441 finstr_wavno(k-index_med(j)+ncvhf_wavno(j),j)
2442 tran_med_index_sap1(j,:) = tran_med_index_sap1(j,:) + tran_hi_sap1
2443 finstr_wavno(k-index_med(j)+ncvhf_wavno(j),j)
2444 tran_med_index_sb(j,:) = tran_med_index_sb(j,:) + tran_hi_sb
2445 finstr_wavno(k-index_med(j)+ncvhf_wavno(j),j)
2446 tran_med_index_sbp1(j,:) = tran_med_index_sbp1(j,:) + tran_hi_sbp1
2447 finstr_wavno(k-index_med(j)+ncvhf_wavno(j),j)
2456 tran_med(1,:) = tran_med_index(1,:)
2457 tran_med(np_med,:) = tran_med_index(np_med,:)
2458 IF(isplitp.NE.0)
THEN
2459 tran_med_sa(1,:) = tran_med_index_sa(1,:)
2460 tran_med_sa(np_med,:) = tran_med_index_sa(np_med,:)
2461 tran_med_sap1(1,:) = tran_med_index_sap1(1,:)
2462 tran_med_sap1(np_med,:) = tran_med_index_sap1(np_med,:)
2463 tran_med_sb(1,:) = tran_med_index_sb(1,:)
2464 tran_med_sb(np_med,:) = tran_med_index_sb(np_med,:)
2465 tran_med_sbp1(1,:) = tran_med_index_sbp1(1,:)
2466 tran_med_sbp1(np_med,:) = tran_med_index_sbp1(np_med,:)
2470 IF(wavln_med_index(j).LE.wavln_med(j))
THEN
2471 tran_med(j,:) = tran_med_index(j,:)
2472 IF(isplitp.NE.0)
THEN
2473 tran_med_sa(j,:) = tran_med_index_sa(j,:)
2474 tran_med_sap1(j,:) = tran_med_index_sap1(j,:)
2475 tran_med_sb(j,:) = tran_med_index_sb(j,:)
2476 tran_med_sbp1(j,:) = tran_med_index_sbp1(j,:)
2479 dlt = wavln_med_index(j) - wavln_med_index(j-1)
2480 fjm1 = (wavln_med_index(j) - wavln_med(j)) /dlt
2481 fj = (wavln_med(j) - wavln_med_index(j-1))/dlt
2482 tran_med(j,:) = fjm1*tran_med_index(j-1,:) + fj*tran_med_index
2483 IF(isplitp.NE.0)
THEN
2484 tran_med_sa(j,:) = fjm1*tran_med_index_sa(j-1,:) + fj
2485 tran_med_sap1(j,:) = fjm1*tran_med_index_sap1(j-1,:) + fj
2486 tran_med_sb(j,:) = fjm1*tran_med_index_sb(j-1,:) + fj
2487 tran_med_sbp1(j,:) = fjm1*tran_med_index_sbp1(j-1,:) + fj
2506 DO i = npshif+1, np_std
2507 tran_std(i,:) = tran_std(i,:)*tran_med(i-npshif,:)
2510 IF(isplitp.NE.0)
THEN
2512 tran_std_sa(i,:) = 1.
2513 tran_std_sap1(i,:) = 1.
2514 tran_std_sb(i,:) = 1.
2515 tran_std_sbp1(i,:) = 1.
2517 DO i = npshif+1, np_std
2518 tran_std_sa(i,:) = tran_std_sa(i,:) *tran_med_sa(i-npshif
2519 tran_std_sap1(i,:) = tran_std_sap1(i,:)*tran_med_sap1(i-npshif
2520 tran_std_sb(i,:) = tran_std_sb(i,:) *tran_med_sb(i-npshif
2521 tran_std_sbp1(i,:) = tran_std_sbp1(i,:)*tran_med_sbp1(i-npshif
2543 IF(isplitp.NE.0)
THEN
2546 tran_iap1_sa(:) = 0.0
2547 tran_ia_sap1(:) = 0.0
2548 tran_iap1_sap1(:) = 0.0
2550 tran_iap1_sb(:) = 0.0
2551 tran_ia_sbp1(:) = 0.0
2552 tran_iap1_sbp1(:) = 0.0
2570 DO 1491 k = ia(j)-(ncvhf(j)-1), ia(j)+ncvhf(j)-1
2571 tran_ia(:) = tran_ia(:) + tran_std(k,:)* &
2572 finstr(k-ia(j)+ncvhf(j),j)
2573 IF(isplitp.NE.0)
THEN
2574 tran_ia_sa(:) = tran_ia_sa(:) + tran_std_sa(k,:)*
2575 finstr(k-ia(j)+ncvhf(j),j)
2576 tran_ia_sap1(:) = tran_ia_sap1(:) + tran_std_sap1(k,:)*
2577 finstr(k-ia(j)+ncvhf(j),j)
2578 tran_ia_sb(:) = tran_ia_sb(:) + tran_std_sb(k,:)*
2579 finstr(k-ia(j)+ncvhf(j),j)
2580 tran_ia_sbp1(:) = tran_ia_sbp1(:) + tran_std_sbp1(k,:)*
2581 finstr(k-ia(j)+ncvhf(j),j)
2596 DO 1492 k = ia_p1-(ncvhf(j)-1), ia_p1+ncvhf(j)-1
2597 tran_iap1(:) = tran_iap1(:) + tran_std(k,:)* &
2598 finstr(k-ia_p1+ncvhf(j),j)
2599 IF(isplitp.NE.0)
THEN
2600 tran_iap1_sa(:) = tran_iap1_sa(:) + tran_std_sa(k,:)
2601 finstr(k-ia_p1+ncvhf(j),j)
2602 tran_iap1_sap1(:) = tran_iap1_sap1(:) + tran_std_sap1(k,
2603 finstr(k-ia_p1+ncvhf(j),j)
2604 tran_iap1_sb(:) = tran_iap1_sb(:) + tran_std_sb(k,:)
2605 finstr(k-ia_p1+ncvhf(j),j)
2606 tran_iap1_sbp1(:) = tran_iap1_sbp1(:) + tran_std_sbp1(k,
2607 finstr(k-ia_p1+ncvhf(j),j)
2613 dlt_ia = wavln_std(ia_p1) - wavln_std(ia(j))
2614 fia = (wavln_std(ia_p1) - wavobs(j)) /dlt_ia
2617 trntbl(j,:) = fia*tran_ia(:) + fia_p1*tran_iap1(:)
2618 IF(isplitp.NE.0)
THEN
2619 trntblsa(:) = fia*tran_ia_sa(:) + fia_p1*tran_iap1_sa(:)
2620 trntblsap1(:) = fia*tran_ia_sap1(:) + fia_p1*tran_iap1_sap1(
2621 trntblsb(:) = fia*tran_ia_sb(:) + fia_p1*tran_iap1_sb(:)
2622 trntblsbp1(:) = fia*tran_ia_sbp1(:) + fia_p1*tran_iap1_sbp1(
2623 trntbl_s(j,:) = 0.5*(f1a*trntblsa(:) + f2a*trntblsap1(:) + &
2624 f1b*trntblsb(:) + f2b*trntblsbp1(:) )
2633 IF (ifullcalc.eq.0)
THEN
2636 diff_tran(j,k) = (trntbl(j,k)-tran_kd(j,k))/tran_kd(j,k) +
2649 DEALLOCATE(tran_std,tran_med)
2679 include
'COMMONS_INC.f'
2681 dimension tran_o3_std(no3pt)
2682 COMMON /init_speccal16/ tran_o3_std
2684 dimension tran_no2_std(no3pt)
2685 COMMON /init_speccal17/ tran_no2_std
2687 dimension wavobs(nobs_max),fwhm(nobs_max)
2688 COMMON /getinput4/ wavobs,fwhm
2690 dimension vaptot(nh2o_max), r0p94(nh2o_max), r1p14(nh2o_max), trntbl
2691 tran_kd(nobs_max,nh2o_max), diff_tran(nobs_max,nh2o_max
2692 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl,tran_kd, diff_tran
2693 REAL TRAN_HI_SA(NP_HI,2),TRAN_HI_SAP1(NP_HI,2),TRAN_HI_SB(NP_HI,
2695 COMMON /tran_tables/tran_hi_sa,tran_hi_sap1,tran_hi_sb,tran_hi_sbp1
2696 COMMON /tran_table_l2gen/trntbl_s,trntbl_so
2697 REAL MU,MU0, SSH2O_S(NH2O_MAX,2)
2698 COMMON /geometry5/mu,mu0,ssh2o_s
2700 real*4 tran_ia,tran_iap1, tran_std_o(np_std),tran_std_os(np_std,2)
2702 COMMON /getinput5/ nobs,ifullcalc,hsurf,dlt,dlt2
2703 REAL TRAN_MED_O(NP_MED),TRAN_MED_INDEX_O(NP_MED)
2704 REAL TRAN_MED_OS(NP_MED,2),TRAN_MED_INDEX_OS(NP_MED,2)
2705 INTEGER FIRST/1/,IA(NOBS_MAX)
2726 IF (first.eq.1)
THEN
2729 ncvtot_wavno = 2 * ncvhf_wavno(j) - 1
2733 DO 560 i = ncvhf_wavno(j), ncvtot_wavno
2734 finstr_wavno(i,j) = &
2735 exp( -const1*(float(i-ncvhf_wavno(j))*dwavno &
2737 sumins = sumins + finstr_wavno(i,j)
2740 DO 565 i = 1, ncvhf_wavno(j)-1
2741 finstr_wavno(i,j) = finstr_wavno(ncvtot_wavno-i+1,j)
2742 sumins = sumins + finstr_wavno(i,j)
2745 sumins = sumins * dwavno
2747 DO 570 i = 1, ncvtot_wavno
2748 finstr_wavno(i,j) = finstr_wavno(i,j)*dwavno/sumins
2765 ncvtot = 2 * ncvhf(j) - 1
2767 DO 1560 i = ncvhf(j), ncvtot
2769 exp( -const1*(float(i-ncvhf(j))*dwavln &
2771 sumins = sumins + finstr(i,j)
2774 DO 1565 i = 1, ncvhf(j)-1
2775 finstr(i,j) = finstr(ncvtot-i+1,j)
2776 sumins = sumins + finstr(i,j)
2779 sumins = sumins * dwavln
2781 DO 1570 i = 1, ncvtot
2782 finstr(i,j) = finstr(i,j)*dwavln/sumins
2786 CALL hunt(wavln_std, np_std, wavobs(j), ia(j))
2791 airmass = 1.0/mu0 + 1.0/mu;
2796 tran_med_index_o(:) = 0.0
2797 IF(isplitp.NE.0) tran_med_index_os(:,:) = 0.0
2801 ndx1 = index_med(j)-(ncvhf_wavno(j)-1)
2802 ndx2 = index_med(j)+ ncvhf_wavno(j)-1
2803 DO 491 k = ndx1,ndx2
2804 tran_med_index_o(j) = tran_med_index_o(j) + tran_hi_others(k
2805 finstr_wavno(k-index_med(j)+ncvhf_wavno(j),j)
2807 IF(isplitp.NE.0)
THEN
2808 airm = -log(tran_hi_others(k))/airmass
2809 tran_hi_others_sol = exp(-airm/mu0)
2810 tran_hi_others_sen = exp(-airm/mu)
2812 tran_med_index_os(j,1) = tran_med_index_os(j,1) + tran_hi_others_sol
2813 finstr_wavno(k-index_med(j)+ncvhf_wavno(j),j)
2814 tran_med_index_os(j,2) = tran_med_index_os(j,2) + tran_hi_others_sen
2815 finstr_wavno(k-index_med(j)+ncvhf_wavno(j),j)
2826 tran_med_o(1) = tran_med_index_o(1)
2827 tran_med_o(np_med) = tran_med_index_o(np_med)
2828 IF(isplitp.NE.0)
THEN
2829 tran_med_os(1,:) = tran_med_index_os(1,:)
2830 tran_med_os(np_med,:) = tran_med_index_os(np_med,:)
2834 IF(wavln_med_index(j).LE.wavln_med(j))
THEN
2835 tran_med_o(j) = tran_med_index_o(j)
2836 IF(isplitp.NE.0) tran_med_os(j,:) = tran_med_index_os(j,:)
2838 dlt = wavln_med_index(j) - wavln_med_index(j-1)
2839 fjm1 = (wavln_med_index(j) - wavln_med(j)) /dlt
2840 fj = (wavln_med(j) - wavln_med_index(j-1))/dlt
2841 tran_med_o(j) = fjm1*tran_med_index_o(j-1) + fj*tran_med_index_o
2843 tran_med_os(j,:) = fjm1*tran_med_index_os(j-1,:) + fj*tran_med_index_os
2852 IF(isplitp.NE.0) tran_std_os(:,:) = 1.
2854 tran_std_o(1:no3pt) = tran_o3_std(1:no3pt) * tran_no2_std(1:no3pt
2855 IF(isplitp.NE.0)
THEN
2856 am(1:no3pt) = -log(tran_std_o(1:no3pt))/airmass
2857 tran_std_os(1:no3pt,1) = exp(-am(1:no3pt)/mu0)
2858 tran_std_os(1:no3pt,2) = exp(-am(1:no3pt)/mu)
2861 tran_std_o(npshif+1:np_std) = tran_std_o(npshif+1:np_std)*tran_med_o
2862 IF(isplitp.NE.0)
THEN
2863 tran_std_os(npshif+1:np_std,:) = tran_std_os(npshif+1:np_std,
2885 DO 1491 k = ia(j)-(ncvhf(j)-1), ia(j)+ncvhf(j)-1
2886 tran_ia = tran_ia + tran_std_o(k)* &
2887 finstr(k-ia(j)+ncvhf(j),j)
2889 tran_ias(:) = tran_ias(:) + tran_std_os(k,:)* &
2890 finstr(k-ia(j)+ncvhf(j),j)
2896 DO 1492 k = ia_p1-(ncvhf(j)-1), ia_p1+ncvhf(j)-1
2897 tran_iap1 = tran_iap1 + tran_std_o(k)* &
2898 finstr(k-ia_p1+ncvhf(j),j)
2900 tran_iap1s(:) = tran_iap1s(:) + tran_std_os(k,:)* &
2901 finstr(k-ia_p1+ncvhf(j),j)
2906 dlt_ia = wavln_std(ia_p1) - wavln_std(ia(j))
2907 fia = (wavln_std(ia_p1) - wavobs(j)) /dlt_ia
2910 trntblo(j) = fia*tran_ia + fia_p1*tran_iap1
2911 IF(isplitp.NE.0)
THEN
2912 trntbl_so(j,:) = fia*tran_ias(:) + fia_p1*tran_iap1s(:)
2961 dimension const1(nh2o_max),const2(nh2o_max),const3(nh2o_max)
2962 dimension const4(nh2o_max),const5(nh2o_max),const6(nh2o_max)
2964 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
2965 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2966 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2967 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2968 dimension vaptot(nh2o_max), r0p94(nh2o_max), r1p14(nh2o_max),trntbl
2969 tran_kd(nobs_max,nh2o_max), diff_tran(nobs_max,nh2o_max
2970 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl, tran_kd, diff_tran
2975 const1(:)=const1(:)+trntbl(i,:)
2977 const1(:)=const1(:)/float(nb1)
2981 const2(:)=const2(:)+trntbl(i,:)
2983 const2(:)=const2(:)/float(nb2)
2986 DO 575 i=istp94,iedp94
2987 const3(:)=const3(:)+trntbl(i,:)
2989 const3(:)=const3(:)/float(nbp94)
2991 r0p94(:)=const3(:)/((wt1*const1(:)) + (wt2*const2(:)))
2995 const4(:)=const4(:)+trntbl(i,:)
2997 const4(:)=const4(:)/float(nb3)
3001 const5(:)=const5(:)+trntbl(i,:)
3003 const5(:)=const5(:)/float(nb4)
3006 DO 595 i=ist1p14,ied1p14
3007 const6(:)=const6(:)+trntbl(i,:)
3009 const6(:)=const6(:)/float(nb1p14)
3011 r1p14(:)=const6(:)/((wt3*const4(:)) + (wt4*const5(:)))
3033 SUBROUTINE locate(xx,n,x,j)
3039 10
if(ju-jl.gt.1)
then
3041 if((xx(n).ge.xx(1)).eqv.(x.ge.xx(jm)))
then
3050 else if(x.eq.xx(n))
then
3075 SUBROUTINE cubspln(N,XORGN,YORGN,XINT,YINT)
3078 dimension xorgn(1050),yorgn(1050),y2(1050)
3079 dimension xint(nobs_max),yint(nobs_max)
3082 COMMON /getinput5/ nobs,ifullcalc,hsurf,dlt,dlt2
3091 CALL spline(xorgn,yorgn,n,yp1,ypn,y2)
3095 CALL splint(xorgn,yorgn,y2,n,x,y)
3131 subroutine spline(x,y,n,yp1,ypn,y2)
3134 real x(n),y(n),y2(n),u(nmax)
3135 real yp1,ypn,sig,p,qn,un
3136 if (yp1.gt..99e30)
then
3141 u(1)=(3./(x(2)-x(1)))*((y(2)-y(1))/(x(2)-x(1))-yp1)
3144 sig=(x(i)-x(i-1))/(x(i+1)-x(i-1))
3147 u(i)=(6.*((y(i+1)-y(i))/(x(i+1)-x(i))-(y(i)-y(i-1)) &
3148 /(x(i)-x(i-1)))/(x(i+1)-x(i-1))-sig*u(i-1))/p
3150 if (ypn.gt..99e30)
then
3155 un=(3./(x(n)-x(n-1)))*(ypn-(y(n)-y(n-1))/(x(n)-x(n-1)))
3157 y2(n)=(un-qn*u(n-1))/(qn*y2(n-1)+1.)
3159 y2(k)=y2(k)*y2(k+1)+u(k)
3190 subroutine splint(xa,ya,y2a,n,x,y)
3192 real xa(n),ya(n),y2a(n)
3196 1
if (khi-klo.gt.1)
then
3206 if (h.eq.0.) stop
'bad xa input.'
3209 y=a*ya(klo)+b*ya(khi)+ &
3210 ((a**3-a)*y2a(klo)+(b**3-b)*y2a(khi))*(h**2)/6.
3231 SUBROUTINE hunt(xx,n,x,jlo)
3236 ascnd=xx(n).ge.xx(1)
3237 if(jlo.le.0.or.jlo.gt.n)
then
3243 if(x.ge.xx(jlo).eqv.ascnd)
then
3247 else if(x.ge.xx(jhi).eqv.ascnd)
then
3257 else if(x.lt.xx(jlo).eqv.ascnd)
then
3263 3
if(jhi-jlo.eq.1)
then
3264 if(x.eq.xx(n))jlo=n-1
3269 if(x.ge.xx(jm).eqv.ascnd)
then
3295 INTEGER FUNCTION findmatch(LIST,NOBS,ELEM)
3297 dimension
list(nobs_max)
3302 IF(list(i).GT.elem)
GOTO 470
3305 diff1=
abs(list(i-1)-elem)
3306 diff2=
abs(list(i)-elem)
3307 IF (diff1.LT.diff2)
THEN