299 character (len=8) :: start_date, stop_date
300 character (len=10),
dimension(12) :: timing
302 call date_and_time(date=start_date, time=timing(1))
304 WRITE(*,*)
' atrem_app_refl_plus_gas_removal_2013'
305 WRITE(*,*)
' (atrem for apparent reflectance + gas absorption '
306 WRITE(*,*)
' effect removal from imaging spectrometer Data )'
307 WRITE(*,*)
' April 2013'
312 call date_and_time(time=timing(2))
320 call date_and_time(time=timing(3))
328 call date_and_time(time=timing(5))
332 call date_and_time(time=timing(6))
337 call date_and_time(time=timing(7))
342 call date_and_time(date=stop_date, time=timing(8))
344 WRITE(*,*)
'*** ATREM: Finished processing image. ***'
347 write(*,*)
' ***TIMING SUMMARY**'
349 write(*,*)
'Started on : ', start_date
351 write(*,*)
'Started time : ', timing(1)
352 write(*,*)
'Finished GET_INPUT : ', timing(2)
353 write(*,*)
'Finished GEOMETRY : ', timing(3)
355 write(*,*)
'Finished INIT_SPECCAL : ', timing(5)
356 write(*,*)
'Finished SOLAR_IRR_PC : ', timing(6)
357 write(*,*)
'Finished TRAN_TABLE : ', timing(7)
358 write(*,*)
'Finished PROCESS_CUBE at: ', timing(8)
360 write(*,*)
'Stopped on : ', stop_date
424 include
'COMMONS_INC'
426 INTEGER LUN_IN, LUN_OUT, LUN_VAP, I_RET
427 COMMON /inout_units/ lun_in, lun_out, lun_vap
431 dimension h(25), t(25), p(25), vmr(25)
432 dimension wavobs(1024),fwhm(1024)
433 dimension tpvmr(7,81)
434 CHARACTER*1 LATHEM, LNGHEM
436 CHARACTER (LEN = 1000) :: FINAV,FOCUB,FOH2O
441 CHARACTER (LEN = 1000) :: FINPWV,FTPVMR
443 CHARACTER (LEN = 1000) :: FOUT1
447 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
448 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
449 COMMON /getinput4/ wavobs,fwhm
450 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
451 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
452 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
453 COMMON /getinput8/ imn,idy,iyr,ih,im,is
454 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
455 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
456 COMMON /getinput11/hdrec,nsamps,nlines,nbands,sorder
457 COMMON /getinput12/scalef
458 COMMON /tpvmr_init1/ tpvmr
461 COMMON /outcube/ focub
462 COMMON /incube/ finav
463 COMMON /outh2ovap/ foh2o
466 CHARACTER (LEN = 80) :: NAME_INSTRU, NAMES(10)
467 COMMON /getinput13/ name_instru,
names
470 COMMON /getinput14/ xpss, xppp
472 REAL XVIEWD, XVIEWM, XVIEWS
473 REAL XAZMUD, XAZMUM, XAZMUS
474 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
479 READ(5,627) name_instru
490 names(4) =
'TRWIS-III'
492 names(6) =
'Hyperion'
499 print*,
'Instrument Name: ', name_instru
507 READ (5,*) imn,idy,iyr,ih,im,is
508 IF((imn.LT.1).OR.(imn.GT.12).OR.(idy.LT.1).OR.(idy.GT.31).OR.
509 & (iyr.LT.1987).OR.(iyr.GT.2020))
THEN
510 WRITE(*,*)
'Invalid date:',imn,idy,iyr
511 WRITE(*,*)
'Format is MM DD YYYY where 0<MM<12, 0<DD<32,
515 IF((ih.LT.0).OR.(ih.GT.24).OR.(im.LT.0).OR.(im.GT.60).OR.
516 & (is.LT.0).OR.(is.GT.60))
THEN
517 WRITE(*,*)
'Invalid time:',ih,im,is
518 WRITE(*,*)
'Format is HH MM SS where 0<HH<24, 0<MM<60, SS<60.'
523 READ (5,*) xlatd,xlatm,xlats
524 IF((xlatd.GT.90).OR.(xlatm.GT.60).OR.(xlats.GT.60))
THEN
525 WRITE(*,*)
'Invalid latitude:',xlatd,xlatm,xlats
526 WRITE(*,*)
'Format: degrees minutes seconds'
527 WRITE(*,*)
'Valid values are degrees < 90, minutes < 60,
535 IF((lathem.NE.
'N').AND.(lathem.NE.
'S'))
THEN
536 WRITE(*,*)
'Invalid hemisphere value:',lathem
537 WRITE(*,*)
'Valid values are "N" or "S".'
542 READ (5,*) xlongd,xlongm,xlongs
543 IF((xlongd.GT.180).OR.(xlongm.GT.60).OR.(xlongs.GT.60))
THEN
544 WRITE(*,*)
'Invalid longitude:',xlongd,xlongm,xlongs
545 WRITE(*,*)
'Format: degrees minutes seconds'
546 WRITE(*,*)
'Valid values are degrees < 180 minutes < 60,
553 IF((lnghem.NE.
'E').AND.(lnghem.NE.
'W'))
THEN
554 WRITE(*,*)
'Invalid hemisphere:',lnghem
555 WRITE(*,*)
'Valid values are "E" or "W".'
560 READ (5,*) xviewd,xviewm,xviews
561 IF((xviewd.GT.90).OR.(xviewm.GT.60).OR.(xviews.GT.60))
THEN
562 WRITE(*,*)
'Invalid latitude:',xviewd,xviewm,xviews
563 WRITE(*,*)
'Format: degrees minutes seconds'
564 WRITE(*,*)
'Valid values are degrees < 90, minutes < 60,
571 READ (5,*) xazmud,xazmum,xazmus
572 IF((xazmud.GT.360.).OR.(xazmum.GT.60).OR.(xazmus.GT.60))
THEN
573 WRITE(*,*)
'Invalid view azimuth ang.:',xazmud,xazmum,xazmus
574 WRITE(*,*)
'Format: degrees minutes seconds'
575 WRITE(*,*)
'Valid values are degrees < 360, minutes < 60,
585 IF((dlt.LT.0.0005).OR.(dlt.GT.0.1))
THEN
586 WRITE(*,*)
'Invalid spectral resolution value:',dlt
587 WRITE(*,*)
'Valid values are 0.0005-0.1 micron.'
601 OPEN(11,file=finpwv,status=
'OLD',iostat=istat)
603 WRITE(*,*)
'wavelength file did not open
604 &successfully:',finpwv
615 READ(11,*,
END=520) X,WAVOBS(I)
617 READ(11,*,
END=520) X,WAVOBS(I), FWHM(I)
626 IF((ans.NE.0).AND.(ans.NE.1))
THEN
627 WRITE(*,*)
'Invalid value to indicate whether the channel ratio
628 & parameters should be read:',ans
629 WRITE(*,*)
'Valid values: 0=no 1=yes.'
643 114
READ(*,*)wndow1, nb1, wndow2, nb2, wp94c, nbp94
645 IF((wndow1.LT.0.6).OR.(wndow1.GT.2.5))
THEN
646 WRITE(*,*)
'Invalid wavelength position for first atmospheric
647 & window in the .94-um region:',wndow1
648 WRITE(*,*)
'Valid values are 0.6-2.5.'
652 IF((nb1.LT.1).OR.(nb1.GT.50))
THEN
653 WRITE(*,*)
'Invalid number of channels for first wavelength
654 &position in the .94-um region:',nb1
655 WRITE(*,*)
'Valid values are 1-50.'
659 IF((wndow2.LT.0.6).OR.(wndow2.GT.2.5))
THEN
660 WRITE(*,*)
'Invalid wavelength position for second atmospheric
661 & window in the .94-um region:',wndow2
662 WRITE(*,*)
'Valid values are 0.6-2.5.'
666 IF((nb2.LT.1).OR.(nb2.GT.50))
THEN
667 WRITE(*,*)
'Invalid number of channels for second wavelength
668 &position in the .94-um region:',nb2
669 WRITE(*,*)
'Valid values are 1-50.'
673 IF((wp94c.LE.wndow1).OR.(wp94c.GE.wndow2))
THEN
674 WRITE(*,*)
'Invalid water vapor wavelength position for
675 & the .94-um region:',wp94c
676 WRITE(*,*)
'Valid range is:',wndow1,
' < value < ',
681 IF((nbp94.LT.1).OR.(nbp94.GT.90))
THEN
682 WRITE(*,*)
'Invalid number of channels for water vapor
683 &wavelength position in the .94-um region:',nbp94
684 WRITE(*,*)
'Valid values are 1-90.'
699 READ(*,*)wndow3, nb3, wndow4, nb4, w1p14c, nb1p14
701 IF((wndow3.LT.0.6).OR.(wndow3.GT.2.5))
THEN
702 WRITE(*,*)
'Invalid wavelength position for first atmospheric
703 & window in the 1.14-um region:',wndow3
704 WRITE(*,*)
'Valid values are 0.6-2.5'
708 IF((nb3.LT.1).OR.(nb3.GT.50))
THEN
709 WRITE(*,*)
'Invalid number of channels for first wavelength
710 &position in the 1.14-um region:',nb3
711 WRITE(*,*)
'Valid values are 1-50.'
715 IF((wndow4.LT.0.6).OR.(wndow4.GT.2.5))
THEN
716 WRITE(*,*)
'Invalid wavelength position for second atmospheric
717 & window in the 1.14-um region:',wndow4
718 WRITE(*,*)
'Valid values are 0.6-2.5'
722 IF((nb4.LT.1).OR.(nb4.GT.50))
THEN
723 WRITE(*,*)
'Invalid number of channels for second wavelength
724 &position in the 1.14-um region:',nb4
725 WRITE(*,*)
'Valid values are 1-50.'
729 IF((w1p14c.LE.wndow3).OR.(w1p14c.GE.wndow4))
THEN
730 WRITE(*,*)
'Invalid water vapor wavelength position for
732 WRITE(*,*)
'Valid range is:',wndow3,
' < value <',
737 IF((nb1p14.LT.1).OR.(nb1p14.GT.110))
THEN
738 WRITE(*,*)
'Invalid number of channels for water vapor
739 &wavelength position in the 1.14-um region:',nb1p14
740 WRITE(*,*)
'Valid values are 1-110.'
771 IF((model.LT.1).OR.(model.GT.7))
THEN
772 WRITE(*,*)
'Invalid atmospheric model value:',model
773 WRITE(*,*)
'Valid values are 1-7.'
782 OPEN(20,file=ftpvmr,status=
'OLD',iostat=istat)
784 WRITE(*,*)
'Atmospheric model file did not open
785 & successfully:',ftpvmr
791 IF((nb.LE.0).OR.(nb.GT.25))
THEN
792 WRITE(*,*)
'Invalid number of boundaries:',nb
793 WRITE(*,*)
'Valid values are 1-25.'
797 READ(20,*) h(i),p(i),t(i),vmr(i)
799 CLOSE(20,iostat=istat)
806 h(i) = tpvmr(model,2+(4*(i-1)))
807 p(i) = tpvmr(model,3+(4*(i-1)))
808 t(i) = tpvmr(model,4+(4*(i-1)))
809 vmr(i) = tpvmr(model,5+(4*(i-1)))
832 READ(*,*)ih2ovp, ico2, io3, in2o, ico, ich4, io2, ino2
833 IF((ih2ovp.NE.0).AND.(ih2ovp.NE.1))
THEN
834 WRITE(*,*)
'Invalid selection for H2O vapor:',ih2ovp
835 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
839 IF((ico2.NE.0).AND.(ico2.NE.1))
THEN
840 WRITE(*,*)
'Invalid selection for CO2:',ico2
841 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
845 IF((io3.NE.0).AND.(io3.NE.1))
THEN
846 WRITE(*,*)
'Invalid selection for O3:',io3
847 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
851 IF((in2o.NE.0).AND.(in2o.NE.1))
THEN
852 WRITE(*,*)
'Invalid selection for N2O:',in2o
853 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
857 IF((ico.NE.0).AND.(ico.NE.1))
THEN
858 WRITE(*,*)
'Invalid selection for CO:',ico
859 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
863 IF((ich4.NE.0).AND.(ich4.NE.1))
THEN
864 WRITE(*,*)
'Invalid selection for CH4:',ich4
865 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
869 IF((io2.NE.0).AND.(io2.NE.1))
THEN
870 WRITE(*,*)
'Invalid selection for O2:',io2
871 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
875 IF((ino2.NE.0).AND.(ino2.NE.1))
THEN
876 WRITE(*,*)
'Invalid selection for NO2:',ino2
877 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
885 IF((vrto3.LT.0.1).OR.(vrto3.GT.0.6))
THEN
886 WRITE(*,*)
'Invalid vertical column amount of ozone:',vrto3
887 WRITE(*,*)
'Valid values are 0.1-0.6.'
888 WRITE(*,*)
'Reasonable values are 0.28-0.55.'
899 IF((iaer.LT.0).OR.(iaer.GT.6))
THEN
900 WRITE(*,*)
'Invalid aerosol model value:',iaer
901 WRITE(*,*)
'Valid values are 0-3.'
909 IF((v.LT.0).OR.(v.GT.300))
THEN
910 WRITE(*,*)
'Invalid visibility value:',v
911 WRITE(*,*)
'Value must be greater than 0 and less than 300.'
918 IF((taer55.GT.10.).OR.(taer55.LE.0))
THEN
919 WRITE(*,*)
'Invalid aerosol optical depth at 550 nm: ',taer55
920 WRITE(*,*)
'Valid values are between 0 and 10.'
930 IF((hsurf.LT.0).OR.(hsurf.GT.h(nb-1)))
THEN
931 WRITE(*,*)
'Invalid surface elevation value:',hsurf
932 WRITE(*,*)
'Value must be less than the maximum elevation in
933 & the atmospheric model.'
938 IF(xppp .LT. hsurf)
THEN
939 WRITE(*,*)
'Invalid plane altitude:',xppp
940 WRITE(*,*)
'Plane altitude must be greater than the bottom
941 & surface elevation.'
952 CALL openinfile(lun_in, i_ret)
955 WRITE(*,*)
'Input image file did not open
956 & successfully:',finav
963 IF((ans.NE.0).AND.(ans.NE.1))
THEN
964 WRITE(*,*)
'Invalid value to indicate whether the cube
965 & dimensions should be read:',ans
966 WRITE(*,*)
'Valid values: 0=no 1=yes.'
972 READ(*,*) hdrec, nsamps, nlines, nbands, sorder
973 IF ((hdrec.LT.0).OR.(nsamps.LE.0).OR.
974 & (nlines.LE.0).OR.(nbands.LE.0).OR.
975 & (sorder.LE.0).OR.(sorder.GT.2))
THEN
976 WRITE(*,*)
'Invalid cube parameters:',hdrec,nsamps,nlines,
978 WRITE(*,*)
'Values must be greater than or equal to 1 and
979 &the storage order must be less than 3.'
980 WRITE(*,*)
'Storage Order (0=BSQ, 1=BIP, 2=BIL)'
981 WRITE(*,*)
' 0 = BSQ is not supported in this version of ATREM'
998 CALL openoutfile(lun_out, i_ret)
1001 WRITE(*,*)
'Output image file did not open
1002 & successfully:',focub
1008 IF((dlt2.LT.0.).OR.(dlt2.GT.100.))
THEN
1009 WRITE(*,*)
'Invalid output resolution value:',dlt2
1010 WRITE(*,*)
'Valid values are 0-100 nm.'
1016 IF((scalef.LT.1.).OR.(scalef.GT.32000.))
THEN
1017 WRITE(*,*)
'Invalid output resolution value:',scalef
1018 WRITE(*,*)
'Valid values are 1-32000 nm.'
1027 CALL openvapfile(lun_vap, i_ret)
1030 WRITE(*,*)
'Output water vapor file did not open
1031 & successfully:',foh2o
1040 OPEN(35,file=fout1,status=
'UNKNOWN',iostat=istat)
1042 WRITE(*,*)
'Output file did not open successfully:',fout1
1046 IF(good_data .NEQV. .true.)
THEN
1047 WRITE(*,*)
'**** ERROR: Invalid input detected. ****'
1102 include
'COMMONS_INC'
1105 dimension h(25), t(25), p(25), vmr(25)
1107 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1108 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
1109 COMMON /model_adj1/ clmvap,q
1111 dimension hp(25), tp(25), pp(25), vmrp(25)
1112 COMMON /model_adj2/ hp, tp, pp, vmrp
1113 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer,
1114 & dp_plane, dp_layer, clmvapp
1115 COMMON /model_adj4/ k_surf
1118 COMMON /getinput14/ xpss, xppp
1139 310 vmr(i)=vmr(i)*1.0e-06
1146 7455
IF(hsurf.EQ.h(i)) hsurf=h(i)+0.0001
1149 CALL locate(h,nb,hsurf,k)
1157 5237
FORMAT(2x,
'***WARNING: Surface elevation smaller then lowest'/
1158 & 2x,
'boundary of the model atmosphere.')
1169 tsurf=t(k)+(dhs/dhk)*(t(k+1)-t(k))
1170 vmrs =vmr(k)+(dhs/dhk)*(vmr(k+1)-vmr(k))
1173 psurf=p(k)*exp(-alog(p(k)/p(k+1))*dhs/dhk)
1204 damtvt=q*(p(i)-p(i+1))*(vmr(i)+vmr(i+1))/2.0
1205 amtvrt=amtvrt+damtvt
1208 clmvap=amtvrt/3.34e+22
1210 WRITE(*,*)
'Column vapor amount in model atmosphere from ground'
1211 WRITE(*,*)
' to space = ', clmvap,
' cm'
1237 IF(hplane.GE.100.0) hplane = 100. - 0.0001
1240 IF(hplane.GT.hp(1))
THEN
1245 7456
IF(hplane.EQ.hp(i)) hplane=hp(i)-0.0001
1248 CALL locate(hp,nb,hplane,kk)
1252 5239
FORMAT(2x,
'***WARNING: Plane altitude less then lowest'/
1253 & 2x,
'boundary of the model atmosphere.')
1258 dhkk = hp(kk+1) - hp(kk)
1259 dhss = hplane - hp(kk)
1262 tplane = tp(kk) + (dhss/dhkk)*(tp(kk+1)-tp(kk))
1263 vmrsp = vmrp(kk) + (dhss/dhkk)*(vmrp(kk+1)-vmrp(kk))
1266 pplane = pp(kk)*exp(-alog(pp(kk)/pp(kk+1))*dhss/dhkk)
1290 damtvtp=q*(pp(i)-pp(i+1))*(vmrp(i)+vmrp(i+1))/2.0
1291 amtvrtp=amtvrtp+damtvtp
1294 clmvapp=amtvrtp/3.34e+22
1296 WRITE(*,*)
'Column vapor below plane (CLMVAPP) = ',
1308 dvap_plane = q*(pp(k_plane) - pp(k_plane+1))*
1309 & (vmrp(k_plane) + vmrp(k_plane+1))/2.0 / 3.34e+22
1311 dvap_layer = q*(p(k_plane) - p(k_plane+1))*
1312 & (vmr(k_plane) + vmr(k_plane+1))/2.0 / 3.34e+22
1314 dp_plane = pp(k_plane) - pp(k_plane+1)
1315 dp_layer = p(k_plane) - p(k_plane+1)
1357 include
'COMMONS_INC'
1359 dimension vapvrt(60), vap_slant(60)
1362 dimension h(25), t(25), p(25), vmr(25)
1363 CHARACTER*1 LATHEM,LNGHEM
1370 DATA vapvrt/.00, .02, .06, .11, .16, .21, .26, .31, .36, .40,
1371 & .43, .46, .50, .54, .58, .62, .66, .70, .75, .80,
1372 & .86, .92, .98, 1.06,1.14, 1.22, 1.3, 1.4, 1.5, 1.6,
1373 & 1.7, 1.8, 1.9, 2.05, 2.2, 2.35, 2.55, 2.75, 2.95, 3.2,
1374 & 3.5, 3.8, 4.1, 4.4, 4.7, 5.0, 5.3, 5.6, 6.0, 6.4,
1375 & 7.0, 7.7, 8.5, 9.4,10.4, 11.6, 13.0, 15.0, 25.0, 50./
1377 DATA md/0,31,59,90,120,151,181,212,243,273,304,334/
1379 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1381 COMMON /getinput8/ imn,idy,iyr,ih,im,is
1382 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
1383 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
1384 COMMON /model_adj1/ clmvap,q
1385 COMMON /geometry1/ solzni,solaz,obszni,obsphi,iday
1386 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1388 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer,
1389 & dp_plane, dp_layer, clmvapp
1391 dimension g_vap(25), g_other(25)
1392 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
1395 COMMON /getinput14/ xpss, xppp
1397 REAL XVIEWD, XVIEWM, XVIEWS
1398 REAL XAZMUD, XAZMUM, XAZMUS
1399 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
1409 vap_slant(i) = vapvrt(i) * 2.0
1415 tt=6.28318*((xh)/24+xm/1440+xs/86400)
1417 xlat = xlatd + xlatm/60.0 + xlats/3600.0
1418 xlong = xlongd + xlongm/60.0 + xlongs/3600.0
1422 IF(lathem.NE.
'N') xlat = -xlat
1423 IF(lnghem.NE.
'W') xlong = -xlong
1425 325 xlatr = xlat/57.2958
1426 xlongr = xlong/57.2958
1428 CALL suncor(idy,imn,iyr,
tt,dec,haz)
1429 CALL hazel(haz+
tt-xlongr,dec,solaz,el,xlatr)
1432 IF (el .LE. 0.)
THEN
1433 WRITE(*,*)
'ERROR: Sun is below the horizon!!!'
1434 WRITE(*,*)
'Check input date, time, latitude and longitude.'
1439 obszni = xviewd + xviewm/60.0 + xviews/3600.0
1440 obsphi = xazmud + xazmum/60.0 + xazmus/3600.0
1442 print*,
'OBSZNI = ',obszni,
' OBSPHI = ',obsphi,
' degrees'
1444 obszni = obszni / 57.2958
1445 obsphi = obsphi / 57.2958
1447 solzni = 90.0/57.2958 - el
1449 ggeom = 1./cos(solzni) + 1./cos(obszni)
1454 IF(hplane.LT.27.) go3 = ggeom - 1./cos(obszni)
1464 totlo3 = go3 * vrto3
1474 DO i = 1, k_plane - 1
1480 DO i = k_plane + 1, 25
1481 g_vap(i) = ggeom - 1./cos(obszni)
1482 g_other(i) = ggeom - 1./cos(obszni)
1487 g_vap(k_plane) = ggeom - 1./cos(obszni)
1488 & + dvap_plane/dvap_layer/cos(obszni)
1489 g_other(k_plane) = ggeom - 1./cos(obszni)
1490 & + dp_plane/dp_layer/cos(obszni)
1501 vap_slant_mdl = clmvap/cos(solzni) + clmvapp/cos(obszni)
1502 print*,
'VAP_SLANT_MDL =', vap_slant_mdl,
' cm'
1507 g_vap_equiv = vap_slant_mdl / clmvap
1511 ssh2o(i) = vap_slant(i) / vap_slant_mdl
1517 iday = md(imn) + idy
1518 lpyr = iyr - (4 * (iyr/4))
1519 IF((lpyr.EQ.0).AND.(iday.GT.59).AND.(imn.NE.2)) iday = iday + 1
1617 include
'COMMONS_INC'
1620 dimension h(25), t(25), p(25), vmr(25)
1622 dimension wavobs(1024),fwhm(1024)
1623 dimension dp(25), pm(25), tm(25), vmrm(25)
1624 dimension finst2(100)
1628 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
1629 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1630 COMMON /getinput4/ wavobs,fwhm
1631 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
1632 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
1633 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
1634 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1635 COMMON /model_adj1/ clmvap,q
1637 COMMON /init_speccal3/ nh2o
1638 COMMON /init_speccal5/ dp,pm,tm,vmrm
1639 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
1640 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
1641 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
1643 COMMON /init_speccal10/ ncv2,ncvhf2,ncvtt2,istrt2,iend2,finst2
1644 COMMON /init_speccal11/ natot,nbtot,nctot,ndtot
1646 dimension g_vap(25), g_other(25)
1647 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
1649 dimension o3cf(5001)
1650 COMMON /o3cf_init1/ o3cf
1652 dimension tran_o3_std(5001)
1653 COMMON /init_speccal16/ tran_o3_std
1655 dimension rno2cf(5001)
1656 COMMON /no2cf_init1/ rno2cf
1658 dimension tran_no2_std(5001)
1659 COMMON /init_speccal17/ tran_no2_std
1661 COMMON /model_adj4/ k_surf
1676 wavno_hi(i) = 3000. + float(i-1)*dwavno
1685 wavln_med(i) = vstart + float(i-1)*dwavln
1696 wavln_std(i) = 0.3 + float(i-1)*dwavln
1710 index_med(i) = ( (10000./wavln_med(i) - 3000.)/dwavno + 1.)
1721 wavln_med_index(i) = 10000. /(float(index_med(i)-1)*dwavno
1731 fwhm_wavno(i) = 10000.*dlt_med
1732 & /(wavln_med_index(i)*wavln_med_index(i))
1741 ncvhf_wavno(i) = ( facdlt * fwhm_wavno(i) / dwavno + 1.)
1753 ncvhf(i) = ( facdlt * fwhm(i) / dwavln + 1.)
1767 IF(dwvavr.LT.fwhm(i)) dwvavr = fwhm(i)
1775 cons2=dlt2*sqrt(3.1415926/const1)
1777 IF (dlt2 .NE. 0.0)
THEN
1779 DO 585 i=ncvhf2,ncvtt2
1780 finst2(i)=exp(-const1*(float(i-ncvhf2)*dwvavr/dlt2)**2.0)
1781 sumins=sumins+finst2(i)
1785 finst2(i)=finst2(ncvtt2-i+1)
1786 sumins=sumins+finst2(i)
1789 sumins=sumins*dwvavr
1792 finst2(i)=finst2(i)*dwvavr/sumins
1809 nctot=nchnla+nchnlb+nchnlc
1810 ndtot=nchnla+nchnlb+nchnlc+nchnld
1817 wndow1=wavobs(iwndw1)
1818 wndow2=wavobs(iwndw2)
1821 IF(jj.EQ.0) nb1=nb1+1
1823 IF(kk.EQ.0) nb2=nb2+1
1833 wp94c=wavobs(iwp94c)
1836 IF(ll.EQ.0) nbp94=nbp94+1
1838 istp94=iwp94c-nb3haf
1839 iedp94=iwp94c+nb3haf
1841 wt1=(wndow2-wp94c)/(wndow2-wndow1)
1842 wt2=(wp94c-wndow1)/(wndow2-wndow1)
1847 wndow3=wavobs(iwndw4)
1848 wndow4=wavobs(iwndw5)
1851 IF(jj.EQ.0) nb3=nb3+1
1853 IF(kk.EQ.0) nb4=nb4+1
1864 w1p14c=wavobs(iw1p14c)
1866 IF(ll.EQ.0) nb1p14=nb1p14+1
1868 ist1p14=iw1p14c-nb6haf
1869 ied1p14=iw1p14c+nb6haf
1871 wt3=(wndow4-w1p14c)/(wndow4-wndow3)
1872 wt4=(w1p14c-wndow3)/(wndow4-wndow3)
1883 tran_o3_std(i) = exp(-totlo3*o3cf(i))
1893 tran_o3_std(i) = 1.0
1902 vrtno2 = sno2 * vrtno2
1905 totno2 = gno2 * vrtno2
1909 tran_no2_std(i) = exp(-totno2*rno2cf(i))
1930 tran_no2_std(i) = 1.0
1940 pm(i)=(p(i)+p(i+1))/2.0
1941 tm(i)=(t(i)+t(i+1))/2.0
1962 tran_hi_others(i) = 1.0
1976 vmrm(i)=sclco2*355.0*1.0e-06
1980 vmrm(i)= vmrm(i)*g_other(i)
1983 OPEN(31,file=
'abscf_co2_PC',status=
'old',
1984 & form=
'unformatted',access=
'direct',recl=4*300000)
1986 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
1989 READ(31,rec=j+1) (a(i), i = 1, 300000)
1992 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
1993 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
1994 & 6.0225e+23 / 1.0e-06)
2007 vmrm(i)= vmrm(i)*g_other(i)
2010 OPEN(31,file=
'abscf_n2o_PC',status=
'old',
2011 & form=
'unformatted',access=
'direct',recl=4*300000)
2013 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2016 READ(31,rec=j+1) (a(i), i = 1, 300000)
2019 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2020 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2021 & 6.0225e+23 / 1.0e-06)
2033 vmrm(i)= vmrm(i)*g_other(i)
2036 OPEN(31,file=
'abscf_co_PC',status=
'old',
2037 & form=
'unformatted',access=
'direct',recl=4*300000)
2039 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2042 READ(31,rec=j+1) (a(i), i = 1, 300000)
2045 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2046 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2047 & 6.0225e+23 / 1.0e-06)
2072 vmrm(i)=sclch4*1.6*1.0e-06
2073 vmrm(i)= vmrm(i)*g_other(i)
2076 OPEN(31,file=
'abscf_ch4_PC',status=
'old',
2077 & form=
'unformatted',access=
'direct',recl=4*300000)
2079 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2082 READ(31,rec=j+1) (a(i), i = 1, 300000)
2085 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2086 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2087 & 6.0225e+23 / 1.0e-06)
2107 vmrm(i)= vmrm(i)*g_other(i)
2110 OPEN(31,file=
'abscf_o2_PC',status=
'old',
2111 & form=
'unformatted',access=
'direct',recl=4*300000)
2113 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2116 READ(31,rec=j+1) (a(i), i = 1, 300000)
2124 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2125 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2126 & 6.0225e+23 / 1.0e-06)
2130 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2131 & dp(j-k_surf+1)*vmrm(j-k_surf+1)*scl_o2 *28.966/
2132 & 6.0225e+23 / 1.0e-06)
2135 DO i = 106601, np_hi
2136 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2137 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2138 & 6.0225e+23 / 1.0e-06)
2152 vmrm(i) = (vmr(i)+vmr(i+1))/2.0
2156 vmrm(i) = vmrm(i)*g_vap(i)
2213 include
'COMMONS_INC'
2216 dimension trncal(1024)
2217 dimension wavobs(1024),fwhm(1024)
2218 dimension dp(25), pm(25), tm(25), vmrm(25)
2220 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2222 dimension o3cf(5001)
2223 COMMON /o3cf_init1/ o3cf
2225 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
2226 COMMON /getinput4/ wavobs,fwhm
2227 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2228 COMMON /init_speccal3/ nh2o
2229 COMMON /init_speccal5/ dp,pm,tm,vmrm
2231 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2232 COMMON /trancal1/ trncal,vaptt
2233 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
2234 COMMON /chnlratio1/ r094,r114
2249 trntbl(j,i)=trncal(j)
2259 WRITE(35,77) (vaptot(i+(kk-1)*10),i=1,10)
2260 77
FORMAT(7x,10(1x,e11.4))
2261 WRITE(35,77) ( r0p94(i+(kk-1)*10),i=1,10)
2262 WRITE(35,77) ( r1p14(i+(kk-1)*10),i=1,10)
2264 385
WRITE(35,78) wavobs(ii),(trntbl(ii,i+(kk-1)*10),i=1,10)
2265 78
FORMAT(1x,f6.4,10(1x,e11.4))
2268 WRITE(35,77) (vaptot(i+nk*10),i=1,njdiff)
2269 WRITE(35,77) ( r0p94(i+nk*10),i=1,njdiff)
2270 WRITE(35,77) ( r1p14(i+nk*10),i=1,njdiff)
2272 IF(njdiff.GE.1)
THEN
2274 386
WRITE(35,78) wavobs(ii),(trntbl(ii,i+nk*10),i=1,njdiff)
2276 CLOSE(35,iostat=istat)
2312 include
'COMMONS_INC'
2315 dimension trncal(1024)
2316 dimension wavobs(1024),fwhm(1024)
2317 dimension dp(25), pm(25), tm(25), vmrm(25)
2318 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2321 dimension trans(1024)
2322 dimension trncv(1024)
2323 dimension trnstd_sm(1050)
2326 COMMON /getinput4/ wavobs,fwhm
2327 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2328 COMMON /model_adj1/ clmvap,q
2329 COMMON /init_speccal5/ dp,pm,tm,vmrm
2330 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2331 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2332 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2333 COMMON /trancal1/ trncal,vaptt
2335 dimension g_vap(25), g_other(25)
2336 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
2338 COMMON /model_adj4/ k_surf
2347 OPEN(31,file=
'abscf_h2o_PC',status=
'old',
2348 & form=
'unformatted',access=
'direct',recl=4*300000)
2350 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2353 READ(31,rec=j+1) (a(i), i = 1, 300000)
2356 tran_hi(i) = tran_hi(i) * exp( - a(i) * q *
2357 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * sh2o * 28.966 /
2358 & 6.0225e+23 / 1.0e-06)
2369 tran_hi(i) = tran_hi(i) * tran_hi_others(i)
2385 vaptt = vap_slant_mdl * sh2o
2414 include
'COMMONS_INC'
2416 dimension tran_o3_std(5001)
2417 COMMON /init_speccal16/ tran_o3_std
2419 dimension tran_no2_std(5001)
2420 COMMON /init_speccal17/ tran_no2_std
2422 dimension wavobs(1024),fwhm(1024)
2423 COMMON /getinput4/ wavobs,fwhm
2425 dimension trncal(1024)
2426 COMMON /trancal1/ trncal,vaptt
2428 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2450 tran_med_index(j) = 0.0
2451 ncvtot_wavno = 2 * ncvhf_wavno(j) - 1
2455 DO 560 i = ncvhf_wavno(j), ncvtot_wavno
2457 & exp( -const1*(float(i-ncvhf_wavno(j))*dwavno
2458 & /fwhm_wavno(j))**2.0)
2459 sumins = sumins + finstr_wavno(i)
2462 DO 565 i = 1, ncvhf_wavno(j)-1
2463 finstr_wavno(i) = finstr_wavno(ncvtot_wavno-i+1)
2464 sumins = sumins + finstr_wavno(i)
2467 sumins = sumins * dwavno
2469 DO 570 i = 1, ncvtot_wavno
2470 finstr_wavno(i) = finstr_wavno(i)*dwavno/sumins
2480 DO 491 k = index_med(j)-(ncvhf_wavno(j)-1),
2481 & index_med(j)+ncvhf_wavno(j)-1
2482 tran_med_index(j) = tran_med_index(j) + tran_hi(k)*
2483 & finstr_wavno(k-index_med(j)+ncvhf_wavno(j))
2492 tran_med(1) = tran_med_index(1)
2493 tran_med(np_med) = tran_med_index(np_med)
2496 IF(wavln_med_index(j).LE.wavln_med(j))
THEN
2497 tran_med(j) = tran_med_index(j)
2499 dlt = wavln_med_index(j) - wavln_med_index(j-1)
2500 fjm1 = (wavln_med_index(j) - wavln_med(j)) /dlt
2501 fj = (wavln_med(j) - wavln_med_index(j-1))/dlt
2502 tran_med(j) = fjm1*tran_med_index(j-1) + fj*tran_med_index(j)
2516 tran_std(i) = tran_o3_std(i) * tran_no2_std(i)
2519 DO i = npshif+1, np_std
2520 tran_std(i) = tran_std(i)*tran_med(i-npshif)
2537 ncvtot = 2 * ncvhf(j) - 1
2544 DO 1560 i = ncvhf(j), ncvtot
2546 & exp( -const1*(float(i-ncvhf(j))*dwavln
2548 sumins = sumins + finstr(i)
2551 DO 1565 i = 1, ncvhf(j)-1
2552 finstr(i) = finstr(ncvtot-i+1)
2553 sumins = sumins + finstr(i)
2556 sumins = sumins * dwavln
2558 DO 1570 i = 1, ncvtot
2559 finstr(i) = finstr(i)*dwavln/sumins
2571 CALL hunt(wavln_std, np_std, wavobs(j), ia)
2577 DO 1491 k = ia-(ncvhf(j)-1), ia+ncvhf(j)-1
2578 tran_ia = tran_ia + tran_std(k)*
2579 & finstr(k-ia+ncvhf(j))
2590 DO 1492 k = ia_p1-(ncvhf(j)-1), ia_p1+ncvhf(j)-1
2591 tran_iap1 = tran_iap1 + tran_std(k)*
2592 & finstr(k-ia_p1+ncvhf(j))
2597 dlt_ia = wavln_std(ia_p1) - wavln_std(ia)
2598 fia = (wavln_std(ia_p1) - wavobs(j)) /dlt_ia
2601 trncal(j) = fia*tran_ia + fia_p1*tran_iap1
2642 dimension trncal(1024)
2644 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
2645 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2646 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2647 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2648 COMMON /trancal1/ trncal,vaptt
2649 COMMON /chnlratio1/ r094,r114
2654 const1=const1+trncal(i)
2656 const1=const1/float(nb1)
2660 const2=const2+trncal(i)
2662 const2=const2/float(nb2)
2665 DO 575 i=istp94,iedp94
2666 const3=const3+trncal(i)
2668 const3=const3/float(nbp94)
2670 r094=const3/((wt1*const1) + (wt2*const2))
2674 const4=const4+trncal(i)
2676 const4=const4/float(nb3)
2680 const5=const5+trncal(i)
2682 const5=const5/float(nb4)
2685 DO 595 i=ist1p14,ied1p14
2686 const6=const6+trncal(i)
2688 const6=const6/float(nb1p14)
2690 r114=const6/((wt3*const4) + (wt4*const5))
2742 INTEGER LUN_IN, LUN_OUT, LUN_VAP, I_RET
2743 COMMON /inout_units/ lun_in, lun_out, lun_vap
2749 CHARACTER (LEN = 1000) :: FINAV,FOCUB,FOH2O
2750 INTEGER*2 BUFFER(8388608)
2751 INTEGER*2 H2OBUF(8388608)
2752 INTEGER SORDER,HDREC
2754 INTEGER I_Sample, J_Line
2760 INTEGER J, ISAMP, IBAND
2761 real*4 scalef,clmwvp
2768 COMMON /proccube1/ yy
2769 COMMON /getinput11/hdrec,nsamps,nlines,nbands,sorder
2770 COMMON /getinput12/scalef
2773 COMMON /outcube/ focub
2774 COMMON /incube/ finav
2775 COMMON /outh2ovap/ foh2o
2790 CALL rd_slice(lun_in,nsamps,nbands,sorder,buffer)
2794 DO 46 isamp= 1,nsamps
2795 offset = (isamp-1) * nbands
2796 DO 45 iband=1,nbands
2797 yy(iband) = buffer(offset + iband)
2812 DO 55 iband=1,nbands
2813 tbuf(iband)=scalef*yy(iband)
2814 buffer(offset + iband) = nint(tbuf(iband))
2820 h2obuf(isamp) = nint(1000.*clmwvp)
2838 CALL wt_slice(lun_out,nsamps,nbands,sorder,buffer)
2840 CALL wt_line(lun_vap,nsamps,h2obuf)
2887 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2888 dimension yirr(1024)
2891 dimension rotot(1050), ttot(1050), stot(1050)
2892 dimension finst2(100)
2894 dimension trncal(1024)
2897 dimension trncv(1024)
2899 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2900 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
2901 COMMON /getinput8/ imn,idy,iyr,ih,im,is
2902 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
2903 COMMON /init_speccal3/ nh2o
2904 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2905 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2906 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2907 COMMON /init_speccal10/ ncv2,ncvhf2,ncvtt2,istrt2,iend2,finst2
2908 COMMON /init_speccal11/ natot,nbtot,nctot,ndtot
2909 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2910 COMMON /trancal1/ trncal,vaptt
2911 COMMON /solar_irr1/yirr
2912 COMMON /proccube1/ yy
2913 COMMON /sixs1/ rotot, ttot, stot
2915 dimension g_vap(25), g_other(25)
2916 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
2919 CHARACTER (LEN = 80) :: NAME_INSTRU, NAMES(10)
2920 COMMON /getinput13/ name_instru,
names
2927 dimension speca(1024),specb(1024),specav(1024)
2935 DATA pi,dtorad /3.1415926,0.0174533/
2939 IF((name_instru.EQ.
names(1)).AND.(iyr.LE.2009))
THEN
2951 IF(iyr.LE.1989)
THEN
2958 IF((iyr.GE.1990).AND.(iyr.LE.1991))
THEN
2965 IF((iyr.GE.1992).AND.(iyr.LE.1994))
THEN
2972 IF((iyr.GE.1995).AND.(iyr.LE.2009))
THEN
2988 yy(i)=pi*yy(i)/(xfa*yirr(i))
2995 ELSE if ((nobs.GE.33).and.(nobs.LT.96))
THEN
3002 yy(i)=pi*yy(i)/(xfb*yirr(i))
3007 IF(nobs.GE.160)
THEN
3009 ELSE if ((nobs.GE.97).and.(nobs.LT.160))
THEN
3016 yy(i)=pi*yy(i)/(xfc*yirr(i))
3021 IF(nobs.GE.161)
THEN
3028 yy(i)=pi*yy(i)/(xfd*yirr(i))
3038 IF((name_instru.EQ.
names(1)).AND.(iyr.GE.2010))
THEN
3045 yy(i) = pi*yy(i) / (f_av_1 * yirr(i))
3049 yy(i) = pi*yy(i) / (f_av_2 * yirr(i))
3053 yy(i) = pi*yy(i) / (f_av_3 * yirr(i))
3060 IF(name_instru.EQ.
names(2))
THEN
3065 yy(i) = pi*yy(i) / (f_hydice * yirr(i))
3073 IF(name_instru.EQ.
names(3))
THEN
3078 yy(i) = pi*yy(i) / (f_hsi * yirr(i))
3086 IF(name_instru.EQ.
names(4))
THEN
3091 yy(i) = pi*yy(i) / (f_trwis * yirr(i))
3098 IF(name_instru.EQ.
names(6))
THEN
3104 yy(i) = pi*yy(i) / (f_hyperion_a * yirr(i))
3108 yy(i) = pi*yy(i) / (f_hyperion_b * yirr(i))
3115 IF(name_instru.EQ.
names(7))
THEN
3121 yy(i) = pi*yy(i) / (f_hico * yirr(i))
3128 IF(name_instru.EQ.
names(8))
THEN
3133 yy(i) = pi*yy(i) / (f_nis * yirr(i))
3140 IF(name_instru.EQ.
names(9))
THEN
3145 yy(i) = pi*yy(i) / (f_prism * yirr(i))
3158 const1=const1/float(nb1)
3164 const2=const2/float(nb2)
3167 DO 575 i=istp94,iedp94
3170 const3=const3/float(nbp94)
3172 r094co=const3/((wt1*const1) + (wt2*const2))
3175 IF(r094co.GT.1.0)
THEN
3178 const1=const1+1.0/yy(i)
3180 const1=const1/float(nb1)
3184 const2=const2+1.0/yy(i)
3186 const2=const2/float(nb2)
3189 DO 576 i=istp94,iedp94
3190 const3=const3+1.0/yy(i)
3192 const3=const3/float(nbp94)
3194 r094c=const3/((wt1*const1) + (wt2*const2))
3201 const4=const4/float(nb3)
3207 const5=const5/float(nb4)
3210 DO 595 i=ist1p14,ied1p14
3213 const6=const6/float(nb1p14)
3215 r114co=const6/((wt3*const4) + (wt4*const5))
3218 IF(r114co.GT.1.0)
THEN
3221 const4=const4+1.0/yy(i)
3223 const4=const4/float(nb3)
3227 const5=const5+1.0/yy(i)
3229 const5=const5/float(nb4)
3232 DO 596 i=ist1p14,ied1p14
3233 const6=const6+1.0/yy(i)
3235 const6=const6/float(nb1p14)
3237 r114c=const6/((wt3*const4) + (wt4*const5))
3240 CALL hunt(r0p94,nh2o,r094c,ja)
3241 IF (ja.GT.0.AND.ja.LT.60)
THEN
3242 dlta =r0p94(ja+1)-r0p94(ja)
3243 fja =(r0p94(ja+1)-r094c)/dlta
3244 fjap1 =(r094c-r0p94(ja))/dlta
3246 vaptta=fja*vaptot(ja)+fjap1*vaptot(ja+1)
3247 IF(r094co.GT.1.) vaptta=-vaptta
3249 IF(ja.LE.0) vaptta = vaptot(ja+1)
3250 IF(ja.GE.60) vaptta = vaptot(ja)
3253 IF(r094co.LE.1.)
THEN
3255 IF (ja.GT.0.AND.ja.LT.60)
THEN
3256 speca(i)=fja*trntbl(i,ja)+fjap1*trntbl(i,ja+1)
3258 IF(ja.LE.0) speca(i)=trntbl(i,ja+1)
3259 IF(ja.GE.60) speca(i)=trntbl(i,ja)
3264 IF(r094co.GT.1.)
THEN
3266 IF (ja.GT.0.AND.ja.LT.60)
THEN
3267 speca(i)=1.0/(fja*trntbl(i,ja)+fjap1*trntbl(i,ja+1))
3269 IF(ja.LE.0) speca(i)=1.0/trntbl(i,ja+1)
3270 IF(ja.GE.60) speca(i)=1.0/trntbl(i,ja)
3276 CALL hunt(r1p14,nh2o,r114c,jb)
3277 IF (jb.GT.0.AND.jb.LT.60)
THEN
3278 dltb =r1p14(jb+1)-r1p14(jb)
3279 fjb =(r1p14(jb+1)-r114c)/dltb
3280 fjbp1 =(r114c-r1p14(jb))/dltb
3282 vapttb=fjb*vaptot(jb)+fjbp1*vaptot(jb+1)
3283 IF(r114co.GT.1.) vapttb=-vapttb
3285 IF(jb.LE.0) vapttb = vaptot(jb+1)
3286 IF(jb.GE.60) vapttb = vaptot(jb)
3289 IF(r114co.LE.1.)
THEN
3291 IF (jb.GT.0.AND.jb.LT.60)
THEN
3292 specb(i)=fjb*trntbl(i,jb)+fjbp1*trntbl(i,jb+1)
3294 IF(jb.LE.0) specb(i)=trntbl(i,jb+1)
3295 IF(jb.GE.60) specb(i)=trntbl(i,jb)
3300 IF(r114co.GT.1.)
THEN
3302 IF (jb.GT.0.AND.jb.LT.60)
THEN
3303 specb(i)=1.0/(fjb*trntbl(i,jb)+fjbp1*trntbl(i,jb+1))
3305 IF(jb.LE.0) specb(i)=1.0/trntbl(i,jb+1)
3306 IF(jb.GE.60) specb(i)=1.0/trntbl(i,jb)
3312 clmwvp=0.5*(vaptta+vapttb)/g_vap_equiv
3316 specav(i)=0.5*(speca(i)+specb(i))
3319 yy(i) = yy(i) / specav(i)
3330 IF(dlt2.GT.dlt)
THEN
3334 DO 920 i=natot-2,natot+2
3335 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3338 DO 921 i=nbtot-2,nbtot+2
3339 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3342 DO 922 i=nctot-4,nctot+4
3343 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3346 DO 923 i=ndtot-7,nobs
3347 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3350 DO 3480 i=istrt2,iend2
3353 DO 3490 j=i-ncv2,i+ncv2
3354 trncv(i)=trncv(i)+yy(j)*finst2(j-ii+1)
3357 DO 3495 i=istrt2,iend2
3381 SUBROUTINE locate(xx,n,x,j)
3387 10
if(ju-jl.gt.1)
then
3389 if((xx(n).ge.xx(1)).eqv.(x.ge.xx(jm)))
then
3398 else if(x.eq.xx(n))
then
3423 SUBROUTINE cubspln(N,XORGN,YORGN,XINT,YINT)
3425 dimension xorgn(1050),yorgn(1050),y2(1050)
3426 dimension xint(1024),yint(1024)
3429 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
3438 CALL spline(xorgn,yorgn,n,yp1,ypn,y2)
3442 CALL splint(xorgn,yorgn,y2,n,x,y)
3478 subroutine spline(x,y,n,yp1,ypn,y2)
3481 real x(n),y(n),y2(n),u(nmax)
3482 real yp1,ypn,sig,p,qn,un
3483 if (yp1.gt..99e30)
then
3488 u(1)=(3./(x(2)-x(1)))*((y(2)-y(1))/(x(2)-x(1))-yp1)
3491 sig=(x(i)-x(i-1))/(x(i+1)-x(i-1))
3494 u(i)=(6.*((y(i+1)-y(i))/(x(i+1)-x(i))-(y(i)-y(i-1))
3495 * /(x(i)-x(i-1)))/(x(i+1)-x(i-1))-sig*u(i-1))/p
3497 if (ypn.gt..99e30)
then
3502 un=(3./(x(n)-x(n-1)))*(ypn-(y(n)-y(n-1))/(x(n)-x(n-1)))
3504 y2(n)=(un-qn*u(n-1))/(qn*y2(n-1)+1.)
3506 y2(k)=y2(k)*y2(k+1)+u(k)
3537 subroutine splint(xa,ya,y2a,n,x,y)
3539 real xa(n),ya(n),y2a(n)
3543 1
if (khi-klo.gt.1)
then
3553 if (h.eq.0.) pause
'bad xa input.'
3556 y=a*ya(klo)+b*ya(khi)+
3557 * ((a**3-a)*y2a(klo)+(b**3-b)*y2a(khi))*(h**2)/6.
3578 SUBROUTINE hunt(xx,n,x,jlo)
3583 ascnd=xx(n).ge.xx(1)
3584 if(jlo.le.0.or.jlo.gt.n)
then
3590 if(x.ge.xx(jlo).eqv.ascnd)
then
3594 else if(x.ge.xx(jhi).eqv.ascnd)
then
3604 else if(x.lt.xx(jlo).eqv.ascnd)
then
3610 3
if(jhi-jlo.eq.1)
then
3611 if(x.eq.xx(n))jlo=n-1
3616 if(x.ge.xx(jm).eqv.ascnd)
then
3642 SUBROUTINE suncor(IDAY,MONTH,IYR,TZ,DEC,HAZ)
3645 fjd=0.5+tz/6.283185307
3664 SUBROUTINE solcor(JD,FJD,RAS,DECS,GSDT,BZRO,P,SOLONG)
3669 g=-.026601523+.01720196977*d-1.95e-15*d*d -2.*pi*iyr
3670 xlms=4.881627938+.017202791266*d+3.95e-15*d*d-2.*pi*iyr
3671 obl=.409319747-6.2179e-9*d
3672 ecc=.01675104-1.1444e-9*d
3674 gsdt=1.739935476+2.*pi*
f/365.25+1.342027e-4*d/365.25
3675 gsdt=gsdt+6.2831853*(fjd-0.5)
3676 xlts=xlms+2.*ecc*sin(g)+1.25*ecc*ecc*sin(2.*g)
3677 sndc=sin(xlts)*sin(obl)
3679 csra=cos(xlts)/cos(decs)
3681 IF(sin(xlts).LT.0.) ras=2.*pi-ras
3682 omega=1.297906+6.66992e-7*d
3684 bzro=asin(.126199*sin(thetac))
3685 p=-atan(cos(xlts)*tan(obl))-atan(.127216*cos(thetac))
3686 xlmm=atan2(.992005*sin(thetac),cos(thetac))
3688 irot=(jdr+fjd)/25.38
3689 frot=(jdr+fjd)/25.38-irot
3690 solong=xlmm-2.*pi*frot+pi-3.e-4
3691 IF(solong.LT.0.) solong=solong+2.*pi
3692 IF(solong.GT.(2.*pi)) solong=solong-2.*pi
3712 FUNCTION julian(IDAY,MONTH,IYR)
3717 DATA md/0,31,59,90,120,151,181,212,243,273,304,334/
3719 IF(iyr.LT.100) iyr=iyr+1900
3723 i3=(jyr-400*i1-100*i2)/4
3724 julian=2305447+365*jyr+97*i1+24*i2+i3
3726 IF(mod(jyr,4).EQ.0)
leap=1
3727 IF(mod(jyr,100).EQ.0)
leap=0
3728 IF(mod(jyr,400).EQ.0)
leap=1
3749 SUBROUTINE hazel (H,D,A,E,XLAT)
3759 sne = sin(d)*sin(xlat)+cos(d)*cos(xlat)*cos(h)
3762 csa=(sin(xlat)*cos(h)*cos(d)-sin(d)*cos(xlat))
3785 dimension
list(1500)
3790 IF(
list(i).GT.elem)
GOTO 470
3795 IF (diff1.LT.diff2)
THEN