274 character (len=8) :: start_date, stop_date
275 character (len=10),
dimension(12) :: timing
277 call date_and_time(date=start_date, time=timing(1))
280 WRITE(*,*)
' (ATmosphere REMoval Program)'
281 WRITE(*,*)
' Version 4.1, August 1999'
286 call date_and_time(time=timing(2))
294 call date_and_time(time=timing(3))
298 call date_and_time(time=timing(4))
302 call date_and_time(time=timing(5))
306 call date_and_time(time=timing(6))
311 call date_and_time(time=timing(7))
316 call date_and_time(date=stop_date, time=timing(8))
318 WRITE(*,*)
'*** ATREM: Finished processing image. ***'
321 write(*,*)
' ***TIMING SUMMARY**'
323 write(*,*)
'Started on : ', start_date
325 write(*,*)
'Started time : ', timing(1)
326 write(*,*)
'Finished GET_INPUT : ', timing(2)
327 write(*,*)
'Finished GEOMETRY : ', timing(3)
328 write(*,*)
'Finished 6S : ', timing(4)
329 write(*,*)
'Finished INIT_SPECCAL : ', timing(5)
330 write(*,*)
'Finished SOLAR_IRR_PC : ', timing(6)
331 write(*,*)
'Finished TRAN_TABLE : ', timing(7)
332 write(*,*)
'Finished PROCESS_CUBE at: ', timing(8)
334 write(*,*)
'Stopped on : ', stop_date
398 include
'COMMONS_INC'
400 INTEGER LUN_IN, LUN_OUT, LUN_VAP, I_RET
401 COMMON /inout_units/ lun_in, lun_out, lun_vap
404 dimension h(25), t(25), p(25), vmr(25)
405 dimension wavobs(1024),fwhm(1024)
406 dimension tpvmr(7,81)
407 CHARACTER*1 LATHEM, LNGHEM
409 CHARACTER (LEN = 1000) :: FINAV,FOCUB,FOH2O
414 CHARACTER (LEN = 1000) :: FINPWV,FTPVMR
416 CHARACTER (LEN = 1000) :: FOUT1
420 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
421 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
422 COMMON /getinput4/ wavobs,fwhm
423 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
424 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
425 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
426 COMMON /getinput8/ imn,idy,iyr,ih,im,is
427 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
428 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
429 COMMON /getinput11/hdrec,nsamps,nlines,nbands,sorder
430 COMMON /getinput12/scalef
431 COMMON /tpvmr_init1/ tpvmr
434 COMMON /outcube/ focub
435 COMMON /incube/ finav
436 COMMON /outh2ovap/ foh2o
439 CHARACTER (LEN = 80) :: NAME_INSTRU, NAMES(10)
440 COMMON /getinput13/ name_instru,
names
443 COMMON /getinput14/ xpss, xppp
445 REAL XVIEWD, XVIEWM, XVIEWS
446 REAL XAZMUD, XAZMUM, XAZMUS
447 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
452 READ(5,627) name_instru
463 names(4) =
'TRWIS-III'
465 names(6) =
'Hyperion'
472 print*,
'Instrument Name: ', name_instru
480 READ (5,*) imn,idy,iyr,ih,im,is
481 IF((imn.LT.1).OR.(imn.GT.12).OR.(idy.LT.1).OR.(idy.GT.31).OR.
482 & (iyr.LT.1987).OR.(iyr.GT.2020))
THEN
483 WRITE(*,*)
'Invalid date:',imn,idy,iyr
484 WRITE(*,*)
'Format is MM DD YYYY where 0<MM<12, 0<DD<32,
488 IF((ih.LT.0).OR.(ih.GT.24).OR.(im.LT.0).OR.(im.GT.60).OR.
489 & (is.LT.0).OR.(is.GT.60))
THEN
490 WRITE(*,*)
'Invalid time:',ih,im,is
491 WRITE(*,*)
'Format is HH MM SS where 0<HH<24, 0<MM<60, SS<60.'
496 READ (5,*) xlatd,xlatm,xlats
497 IF((xlatd.GT.90).OR.(xlatm.GT.60).OR.(xlats.GT.60))
THEN
498 WRITE(*,*)
'Invalid latitude:',xlatd,xlatm,xlats
499 WRITE(*,*)
'Format: degrees minutes seconds'
500 WRITE(*,*)
'Valid values are degrees < 90, minutes < 60,
508 IF((lathem.NE.
'N').AND.(lathem.NE.
'S'))
THEN
509 WRITE(*,*)
'Invalid hemisphere value:',lathem
510 WRITE(*,*)
'Valid values are "N" or "S".'
515 READ (5,*) xlongd,xlongm,xlongs
516 IF((xlongd.GT.180).OR.(xlongm.GT.60).OR.(xlongs.GT.60))
THEN
517 WRITE(*,*)
'Invalid longitude:',xlongd,xlongm,xlongs
518 WRITE(*,*)
'Format: degrees minutes seconds'
519 WRITE(*,*)
'Valid values are degrees < 180 minutes < 60,
526 IF((lnghem.NE.
'E').AND.(lnghem.NE.
'W'))
THEN
527 WRITE(*,*)
'Invalid hemisphere:',lnghem
528 WRITE(*,*)
'Valid values are "E" or "W".'
533 READ (5,*) xviewd,xviewm,xviews
534 IF((xviewd.GT.90).OR.(xviewm.GT.60).OR.(xviews.GT.60))
THEN
535 WRITE(*,*)
'Invalid latitude:',xviewd,xviewm,xviews
536 WRITE(*,*)
'Format: degrees minutes seconds'
537 WRITE(*,*)
'Valid values are degrees < 90, minutes < 60,
544 READ (5,*) xazmud,xazmum,xazmus
545 IF((xazmud.GT.360.).OR.(xazmum.GT.60).OR.(xazmus.GT.60))
THEN
546 WRITE(*,*)
'Invalid view azimuth ang.:',xazmud,xazmum,xazmus
547 WRITE(*,*)
'Format: degrees minutes seconds'
548 WRITE(*,*)
'Valid values are degrees < 360, minutes < 60,
558 IF((dlt.LT.0.0005).OR.(dlt.GT.0.1))
THEN
559 WRITE(*,*)
'Invalid spectral resolution value:',dlt
560 WRITE(*,*)
'Valid values are 0.0005-0.1 micron.'
574 OPEN(11,file=finpwv,status=
'OLD',iostat=istat)
576 WRITE(*,*)
'wavelength file did not open
577 &successfully:',finpwv
588 READ(11,*,
END=520) X,WAVOBS(I)
590 READ(11,*,
END=520) X,WAVOBS(I), FWHM(I)
599 IF((ans.NE.0).AND.(ans.NE.1))
THEN
600 WRITE(*,*)
'Invalid value to indicate whether the channel ratio
601 & parameters should be read:',ans
602 WRITE(*,*)
'Valid values: 0=no 1=yes.'
616 114
READ(*,*)wndow1, nb1, wndow2, nb2, wp94c, nbp94
618 IF((wndow1.LT.0.6).OR.(wndow1.GT.2.5))
THEN
619 WRITE(*,*)
'Invalid wavelength position for first atmospheric
620 & window in the .94-um region:',wndow1
621 WRITE(*,*)
'Valid values are 0.6-2.5.'
625 IF((nb1.LT.1).OR.(nb1.GT.50))
THEN
626 WRITE(*,*)
'Invalid number of channels for first wavelength
627 &position in the .94-um region:',nb1
628 WRITE(*,*)
'Valid values are 1-50.'
632 IF((wndow2.LT.0.6).OR.(wndow2.GT.2.5))
THEN
633 WRITE(*,*)
'Invalid wavelength position for second atmospheric
634 & window in the .94-um region:',wndow2
635 WRITE(*,*)
'Valid values are 0.6-2.5.'
639 IF((nb2.LT.1).OR.(nb2.GT.50))
THEN
640 WRITE(*,*)
'Invalid number of channels for second wavelength
641 &position in the .94-um region:',nb2
642 WRITE(*,*)
'Valid values are 1-50.'
646 IF((wp94c.LE.wndow1).OR.(wp94c.GE.wndow2))
THEN
647 WRITE(*,*)
'Invalid water vapor wavelength position for
648 & the .94-um region:',wp94c
649 WRITE(*,*)
'Valid range is:',wndow1,
' < value < ',
654 IF((nbp94.LT.1).OR.(nbp94.GT.90))
THEN
655 WRITE(*,*)
'Invalid number of channels for water vapor
656 &wavelength position in the .94-um region:',nbp94
657 WRITE(*,*)
'Valid values are 1-90.'
672 READ(*,*)wndow3, nb3, wndow4, nb4, w1p14c, nb1p14
674 IF((wndow3.LT.0.6).OR.(wndow3.GT.2.5))
THEN
675 WRITE(*,*)
'Invalid wavelength position for first atmospheric
676 & window in the 1.14-um region:',wndow3
677 WRITE(*,*)
'Valid values are 0.6-2.5'
681 IF((nb3.LT.1).OR.(nb3.GT.50))
THEN
682 WRITE(*,*)
'Invalid number of channels for first wavelength
683 &position in the 1.14-um region:',nb3
684 WRITE(*,*)
'Valid values are 1-50.'
688 IF((wndow4.LT.0.6).OR.(wndow4.GT.2.5))
THEN
689 WRITE(*,*)
'Invalid wavelength position for second atmospheric
690 & window in the 1.14-um region:',wndow4
691 WRITE(*,*)
'Valid values are 0.6-2.5'
695 IF((nb4.LT.1).OR.(nb4.GT.50))
THEN
696 WRITE(*,*)
'Invalid number of channels for second wavelength
697 &position in the 1.14-um region:',nb4
698 WRITE(*,*)
'Valid values are 1-50.'
702 IF((w1p14c.LE.wndow3).OR.(w1p14c.GE.wndow4))
THEN
703 WRITE(*,*)
'Invalid water vapor wavelength position for
705 WRITE(*,*)
'Valid range is:',wndow3,
' < value <',
710 IF((nb1p14.LT.1).OR.(nb1p14.GT.110))
THEN
711 WRITE(*,*)
'Invalid number of channels for water vapor
712 &wavelength position in the 1.14-um region:',nb1p14
713 WRITE(*,*)
'Valid values are 1-110.'
744 IF((model.LT.1).OR.(model.GT.7))
THEN
745 WRITE(*,*)
'Invalid atmospheric model value:',model
746 WRITE(*,*)
'Valid values are 1-7.'
755 OPEN(20,file=ftpvmr,status=
'OLD',iostat=istat)
757 WRITE(*,*)
'Atmospheric model file did not open
758 & successfully:',ftpvmr
764 IF((nb.LE.0).OR.(nb.GT.25))
THEN
765 WRITE(*,*)
'Invalid number of boundaries:',nb
766 WRITE(*,*)
'Valid values are 1-25.'
770 READ(20,*) h(i),p(i),t(i),vmr(i)
772 CLOSE(20,iostat=istat)
779 h(i) = tpvmr(model,2+(4*(i-1)))
780 p(i) = tpvmr(model,3+(4*(i-1)))
781 t(i) = tpvmr(model,4+(4*(i-1)))
782 vmr(i) = tpvmr(model,5+(4*(i-1)))
805 READ(*,*)ih2ovp, ico2, io3, in2o, ico, ich4, io2, ino2
806 IF((ih2ovp.NE.0).AND.(ih2ovp.NE.1))
THEN
807 WRITE(*,*)
'Invalid selection for H2O vapor:',ih2ovp
808 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
812 IF((ico2.NE.0).AND.(ico2.NE.1))
THEN
813 WRITE(*,*)
'Invalid selection for CO2:',ico2
814 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
818 IF((io3.NE.0).AND.(io3.NE.1))
THEN
819 WRITE(*,*)
'Invalid selection for O3:',io3
820 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
824 IF((in2o.NE.0).AND.(in2o.NE.1))
THEN
825 WRITE(*,*)
'Invalid selection for N2O:',in2o
826 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
830 IF((ico.NE.0).AND.(ico.NE.1))
THEN
831 WRITE(*,*)
'Invalid selection for CO:',ico
832 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
836 IF((ich4.NE.0).AND.(ich4.NE.1))
THEN
837 WRITE(*,*)
'Invalid selection for CH4:',ich4
838 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
842 IF((io2.NE.0).AND.(io2.NE.1))
THEN
843 WRITE(*,*)
'Invalid selection for O2:',io2
844 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
848 IF((ino2.NE.0).AND.(ino2.NE.1))
THEN
849 WRITE(*,*)
'Invalid selection for NO2:',ino2
850 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
858 IF((vrto3.LT.0.1).OR.(vrto3.GT.0.6))
THEN
859 WRITE(*,*)
'Invalid vertical column amount of ozone:',vrto3
860 WRITE(*,*)
'Valid values are 0.1-0.6.'
861 WRITE(*,*)
'Reasonable values are 0.28-0.55.'
872 IF((iaer.LT.0).OR.(iaer.GT.6))
THEN
873 WRITE(*,*)
'Invalid aerosol model value:',iaer
874 WRITE(*,*)
'Valid values are 0-3.'
882 IF((v.LT.0).OR.(v.GT.300))
THEN
883 WRITE(*,*)
'Invalid visibility value:',v
884 WRITE(*,*)
'Value must be greater than 0 and less than 300.'
891 IF((taer55.GT.10.).OR.(taer55.LE.0))
THEN
892 WRITE(*,*)
'Invalid aerosol optical depth at 550 nm: ',taer55
893 WRITE(*,*)
'Valid values are between 0 and 10.'
903 IF((hsurf.LT.0).OR.(hsurf.GT.h(nb-1)))
THEN
904 WRITE(*,*)
'Invalid surface elevation value:',hsurf
905 WRITE(*,*)
'Value must be less than the maximum elevation in
906 & the atmospheric model.'
911 IF(xppp .LT. hsurf)
THEN
912 WRITE(*,*)
'Invalid plane altitude:',xppp
913 WRITE(*,*)
'Plane altitude must be greater than the bottom
914 & surface elevation.'
925 CALL openinfile(lun_in, i_ret)
928 WRITE(*,*)
'Input image file did not open
929 & successfully:',finav
936 IF((ans.NE.0).AND.(ans.NE.1))
THEN
937 WRITE(*,*)
'Invalid value to indicate whether the cube
938 & dimensions should be read:',ans
939 WRITE(*,*)
'Valid values: 0=no 1=yes.'
945 READ(*,*) hdrec, nsamps, nlines, nbands, sorder
946 IF ((hdrec.LT.0).OR.(nsamps.LE.0).OR.
947 & (nlines.LE.0).OR.(nbands.LE.0).OR.
948 & (sorder.LE.0).OR.(sorder.GT.2))
THEN
949 WRITE(*,*)
'Invalid cube parameters:',hdrec,nsamps,nlines,
951 WRITE(*,*)
'Values must be greater than or equal to 1 and
952 &the storage order must be less than 3.'
953 WRITE(*,*)
'Storage Order (0=BSQ, 1=BIP, 2=BIL)'
954 WRITE(*,*)
' 0 = BSQ is not supported in this version of ATREM'
971 CALL openoutfile(lun_out, i_ret)
974 WRITE(*,*)
'Output image file did not open
975 & successfully:',focub
981 IF((dlt2.LT.0.).OR.(dlt2.GT.100.))
THEN
982 WRITE(*,*)
'Invalid output resolution value:',dlt2
983 WRITE(*,*)
'Valid values are 0-100 nm.'
989 IF((scalef.LT.1.).OR.(scalef.GT.32000.))
THEN
990 WRITE(*,*)
'Invalid output resolution value:',scalef
991 WRITE(*,*)
'Valid values are 1-32000 nm.'
1000 CALL openvapfile(lun_vap, i_ret)
1003 WRITE(*,*)
'Output water vapor file did not open
1004 & successfully:',foh2o
1013 OPEN(35,file=fout1,status=
'UNKNOWN',iostat=istat)
1015 WRITE(*,*)
'Output file did not open successfully:',fout1
1019 IF(good_data .NEQV. .true.)
THEN
1020 WRITE(*,*)
'**** ERROR: Invalid input detected. ****'
1075 include
'COMMONS_INC'
1078 dimension h(25), t(25), p(25), vmr(25)
1080 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1081 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
1082 COMMON /model_adj1/ clmvap,q
1084 dimension hp(25), tp(25), pp(25), vmrp(25)
1085 COMMON /model_adj2/ hp, tp, pp, vmrp
1086 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer,
1087 & dp_plane, dp_layer, clmvapp
1088 COMMON /model_adj4/ k_surf
1091 COMMON /getinput14/ xpss, xppp
1112 310 vmr(i)=vmr(i)*1.0e-06
1119 7455
IF(hsurf.EQ.h(i)) hsurf=h(i)+0.0001
1122 CALL locate(h,nb,hsurf,k)
1130 5237
FORMAT(2x,
'***WARNING: Surface elevation smaller then lowest'/
1131 & 2x,
'boundary of the model atmosphere.')
1142 tsurf=t(k)+(dhs/dhk)*(t(k+1)-t(k))
1143 vmrs =vmr(k)+(dhs/dhk)*(vmr(k+1)-vmr(k))
1146 psurf=p(k)*exp(-alog(p(k)/p(k+1))*dhs/dhk)
1177 damtvt=q*(p(i)-p(i+1))*(vmr(i)+vmr(i+1))/2.0
1178 amtvrt=amtvrt+damtvt
1181 clmvap=amtvrt/3.34e+22
1183 WRITE(*,*)
'Column vapor amount in model atmosphere from ground'
1184 WRITE(*,*)
' to space = ', clmvap,
' cm'
1210 IF(hplane.GE.100.0) hplane = 100. - 0.0001
1213 IF(hplane.GT.hp(1))
THEN
1218 7456
IF(hplane.EQ.hp(i)) hplane=hp(i)-0.0001
1221 CALL locate(hp,nb,hplane,kk)
1225 5239
FORMAT(2x,
'***WARNING: Plane altitude less then lowest'/
1226 & 2x,
'boundary of the model atmosphere.')
1231 dhkk = hp(kk+1) - hp(kk)
1232 dhss = hplane - hp(kk)
1235 tplane = tp(kk) + (dhss/dhkk)*(tp(kk+1)-tp(kk))
1236 vmrsp = vmrp(kk) + (dhss/dhkk)*(vmrp(kk+1)-vmrp(kk))
1239 pplane = pp(kk)*exp(-alog(pp(kk)/pp(kk+1))*dhss/dhkk)
1263 damtvtp=q*(pp(i)-pp(i+1))*(vmrp(i)+vmrp(i+1))/2.0
1264 amtvrtp=amtvrtp+damtvtp
1267 clmvapp=amtvrtp/3.34e+22
1269 WRITE(*,*)
'Column vapor below plane (CLMVAPP) = ',
1281 dvap_plane = q*(pp(k_plane) - pp(k_plane+1))*
1282 & (vmrp(k_plane) + vmrp(k_plane+1))/2.0 / 3.34e+22
1284 dvap_layer = q*(p(k_plane) - p(k_plane+1))*
1285 & (vmr(k_plane) + vmr(k_plane+1))/2.0 / 3.34e+22
1287 dp_plane = pp(k_plane) - pp(k_plane+1)
1288 dp_layer = p(k_plane) - p(k_plane+1)
1330 include
'COMMONS_INC'
1332 dimension vapvrt(60), vap_slant(60)
1335 dimension h(25), t(25), p(25), vmr(25)
1336 CHARACTER*1 lathem,lnghem
1343 DATA vapvrt/.00, .02, .06, .11, .16, .21, .26, .31, .36, .40,
1344 & .43, .46, .50, .54, .58, .62, .66, .70, .75, .80,
1345 & .86, .92, .98, 1.06,1.14, 1.22, 1.3, 1.4, 1.5, 1.6,
1346 & 1.7, 1.8, 1.9, 2.05, 2.2, 2.35, 2.55, 2.75, 2.95, 3.2,
1347 & 3.5, 3.8, 4.1, 4.4, 4.7, 5.0, 5.3, 5.6, 6.0, 6.4,
1348 & 7.0, 7.7, 8.5, 9.4,10.4, 11.6, 13.0, 15.0, 25.0, 50./
1350 DATA md/0,31,59,90,120,151,181,212,243,273,304,334/
1352 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1354 COMMON /getinput8/ imn,idy,iyr,ih,im,is
1355 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
1356 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
1357 COMMON /model_adj1/ clmvap,q
1358 COMMON /geometry1/ solzni,solaz,obszni,obsphi,iday
1359 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1361 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer,
1362 & dp_plane, dp_layer, clmvapp
1364 dimension g_vap(25), g_other(25)
1365 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
1368 COMMON /getinput14/ xpss, xppp
1370 REAL xviewd, xviewm, xviews
1371 REAL xazmud, xazmum, xazmus
1372 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
1382 vap_slant(i) = vapvrt(i) * 2.0
1388 tt=6.28318*((xh)/24+xm/1440+xs/86400)
1390 xlat = xlatd + xlatm/60.0 + xlats/3600.0
1391 xlong = xlongd + xlongm/60.0 + xlongs/3600.0
1395 IF(lathem.NE.
'N') xlat = -xlat
1396 IF(lnghem.NE.
'W') xlong = -xlong
1398 325 xlatr = xlat/57.2958
1399 xlongr = xlong/57.2958
1401 CALL suncor(idy,imn,iyr,
tt,dec,haz)
1402 CALL hazel(haz+
tt-xlongr,dec,solaz,el,xlatr)
1405 IF (el .LE. 0.)
THEN
1406 WRITE(*,*)
'ERROR: Sun is below the horizon!!!'
1407 WRITE(*,*)
'Check input date, time, latitude and longitude.'
1412 obszni = xviewd + xviewm/60.0 + xviews/3600.0
1413 obsphi = xazmud + xazmum/60.0 + xazmus/3600.0
1415 print*,
'OBSZNI = ',obszni,
' OBSPHI = ',obsphi,
' degrees'
1417 obszni = obszni / 57.2958
1418 obsphi = obsphi / 57.2958
1420 solzni = 90.0/57.2958 - el
1422 ggeom = 1./cos(solzni) + 1./cos(obszni)
1427 IF(hplane.LT.27.) go3 = ggeom - 1./cos(obszni)
1437 totlo3 = go3 * vrto3
1447 DO i = 1, k_plane - 1
1453 DO i = k_plane + 1, 25
1454 g_vap(i) = ggeom - 1./cos(obszni)
1455 g_other(i) = ggeom - 1./cos(obszni)
1460 g_vap(k_plane) = ggeom - 1./cos(obszni)
1461 & + dvap_plane/dvap_layer/cos(obszni)
1462 g_other(k_plane) = ggeom - 1./cos(obszni)
1463 & + dp_plane/dp_layer/cos(obszni)
1474 vap_slant_mdl = clmvap/cos(solzni) + clmvapp/cos(obszni)
1475 print*,
'VAP_SLANT_MDL =', vap_slant_mdl,
' cm'
1480 g_vap_equiv = vap_slant_mdl / clmvap
1484 ssh2o(i) = vap_slant(i) / vap_slant_mdl
1490 iday = md(imn) + idy
1491 lpyr = iyr - (4 * (iyr/4))
1492 IF((lpyr.EQ.0).AND.(iday.GT.59).AND.(imn.NE.2)) iday = iday + 1
1590 include
'COMMONS_INC'
1593 dimension h(25), t(25), p(25), vmr(25)
1595 dimension wavobs(1024),fwhm(1024)
1596 dimension dp(25), pm(25), tm(25), vmrm(25)
1597 dimension finst2(100)
1601 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
1602 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1603 COMMON /getinput4/ wavobs,fwhm
1604 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
1605 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
1606 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
1607 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1608 COMMON /model_adj1/ clmvap,q
1610 COMMON /init_speccal3/ nh2o
1611 COMMON /init_speccal5/ dp,pm,tm,vmrm
1612 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
1613 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
1614 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
1616 COMMON /init_speccal10/ ncv2,ncvhf2,ncvtt2,istrt2,iend2,finst2
1617 COMMON /init_speccal11/ natot,nbtot,nctot,ndtot
1619 dimension g_vap(25), g_other(25)
1620 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
1622 dimension o3cf(5001)
1623 COMMON /o3cf_init1/ o3cf
1625 dimension tran_o3_std(5001)
1626 COMMON /init_speccal16/ tran_o3_std
1628 dimension rno2cf(5001)
1629 COMMON /no2cf_init1/ rno2cf
1631 dimension tran_no2_std(5001)
1632 COMMON /init_speccal17/ tran_no2_std
1634 COMMON /model_adj4/ k_surf
1649 wavno_hi(i) = 3000. + float(i-1)*dwavno
1658 wavln_med(i) = vstart + float(i-1)*dwavln
1669 wavln_std(i) = 0.3 + float(i-1)*dwavln
1683 index_med(i) = ( (10000./wavln_med(i) - 3000.)/dwavno + 1.)
1694 wavln_med_index(i) = 10000. /(float(index_med(i)-1)*dwavno
1704 fwhm_wavno(i) = 10000.*dlt_med
1705 & /(wavln_med_index(i)*wavln_med_index(i))
1714 ncvhf_wavno(i) = ( facdlt * fwhm_wavno(i) / dwavno + 1.)
1726 ncvhf(i) = ( facdlt * fwhm(i) / dwavln + 1.)
1740 IF(dwvavr.LT.fwhm(i)) dwvavr = fwhm(i)
1748 cons2=dlt2*sqrt(3.1415926/const1)
1750 IF (dlt2 .NE. 0.0)
THEN
1752 DO 585 i=ncvhf2,ncvtt2
1753 finst2(i)=exp(-const1*(float(i-ncvhf2)*dwvavr/dlt2)**2.0)
1754 sumins=sumins+finst2(i)
1758 finst2(i)=finst2(ncvtt2-i+1)
1759 sumins=sumins+finst2(i)
1762 sumins=sumins*dwvavr
1765 finst2(i)=finst2(i)*dwvavr/sumins
1782 nctot=nchnla+nchnlb+nchnlc
1783 ndtot=nchnla+nchnlb+nchnlc+nchnld
1790 wndow1=wavobs(iwndw1)
1791 wndow2=wavobs(iwndw2)
1794 IF(jj.EQ.0) nb1=nb1+1
1796 IF(kk.EQ.0) nb2=nb2+1
1806 wp94c=wavobs(iwp94c)
1809 IF(ll.EQ.0) nbp94=nbp94+1
1811 istp94=iwp94c-nb3haf
1812 iedp94=iwp94c+nb3haf
1814 wt1=(wndow2-wp94c)/(wndow2-wndow1)
1815 wt2=(wp94c-wndow1)/(wndow2-wndow1)
1820 wndow3=wavobs(iwndw4)
1821 wndow4=wavobs(iwndw5)
1824 IF(jj.EQ.0) nb3=nb3+1
1826 IF(kk.EQ.0) nb4=nb4+1
1837 w1p14c=wavobs(iw1p14c)
1839 IF(ll.EQ.0) nb1p14=nb1p14+1
1841 ist1p14=iw1p14c-nb6haf
1842 ied1p14=iw1p14c+nb6haf
1844 wt3=(wndow4-w1p14c)/(wndow4-wndow3)
1845 wt4=(w1p14c-wndow3)/(wndow4-wndow3)
1856 tran_o3_std(i) = exp(-totlo3*o3cf(i))
1866 tran_o3_std(i) = 1.0
1875 vrtno2 = sno2 * vrtno2
1878 totno2 = gno2 * vrtno2
1882 tran_no2_std(i) = exp(-totno2*rno2cf(i))
1903 tran_no2_std(i) = 1.0
1913 pm(i)=(p(i)+p(i+1))/2.0
1914 tm(i)=(t(i)+t(i+1))/2.0
1935 tran_hi_others(i) = 1.0
1944 vmrm(i)=sclco2*355.0*1.0e-06
1948 vmrm(i)= vmrm(i)*g_other(i)
1951 OPEN(31,file=
'/u2/atrem_f90_cubeio/abscf_co2_PC',status=
'old',
1952 & form=
'unformatted',access=
'direct',recl=4*300000)
1954 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
1957 READ(31,rec=j+1) (a(i), i = 1, 300000)
1960 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
1961 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
1962 & 6.0225e+23 / 1.0e-06)
1975 vmrm(i)= vmrm(i)*g_other(i)
1978 OPEN(31,file=
'/u2/atrem_f90_cubeio/abscf_n2o_PC',status=
'old',
1979 & form=
'unformatted',access=
'direct',recl=4*300000)
1981 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
1984 READ(31,rec=j+1) (a(i), i = 1, 300000)
1987 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
1988 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
1989 & 6.0225e+23 / 1.0e-06)
2001 vmrm(i)= vmrm(i)*g_other(i)
2004 OPEN(31,file=
'/u2/atrem_f90_cubeio/abscf_co_PC',status=
'old',
2005 & form=
'unformatted',access=
'direct',recl=4*300000)
2007 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2010 READ(31,rec=j+1) (a(i), i = 1, 300000)
2013 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2014 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2015 & 6.0225e+23 / 1.0e-06)
2040 vmrm(i)=sclch4*1.6*1.0e-06
2041 vmrm(i)= vmrm(i)*g_other(i)
2044 OPEN(31,file=
'/u2/atrem_f90_cubeio/abscf_ch4_PC',status=
'old',
2045 & form=
'unformatted',access=
'direct',recl=4*300000)
2047 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2050 READ(31,rec=j+1) (a(i), i = 1, 300000)
2053 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2054 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2055 & 6.0225e+23 / 1.0e-06)
2067 vmrm(i)= vmrm(i)*g_other(i)
2070 OPEN(31,file=
'/u2/atrem_f90_cubeio/abscf_o2_PC',status=
'old',
2071 & form=
'unformatted',access=
'direct',recl=4*300000)
2073 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2076 READ(31,rec=j+1) (a(i), i = 1, 300000)
2079 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2080 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2081 & 6.0225e+23 / 1.0e-06)
2095 vmrm(i) = (vmr(i)+vmr(i+1))/2.0
2099 vmrm(i) = vmrm(i)*g_vap(i)
2156 include
'COMMONS_INC'
2159 dimension trncal(1024)
2160 dimension wavobs(1024),fwhm(1024)
2161 dimension dp(25), pm(25), tm(25), vmrm(25)
2163 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2165 dimension o3cf(5001)
2166 COMMON /o3cf_init1/ o3cf
2168 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
2169 COMMON /getinput4/ wavobs,fwhm
2170 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2171 COMMON /init_speccal3/ nh2o
2172 COMMON /init_speccal5/ dp,pm,tm,vmrm
2174 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2175 COMMON /trancal1/ trncal,vaptt
2176 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
2177 COMMON /chnlratio1/ r094,r114
2192 trntbl(j,i)=trncal(j)
2202 WRITE(35,77) (vaptot(i+(kk-1)*10),i=1,10)
2203 77
FORMAT(7x,10(1x,e11.4))
2204 WRITE(35,77) ( r0p94(i+(kk-1)*10),i=1,10)
2205 WRITE(35,77) ( r1p14(i+(kk-1)*10),i=1,10)
2207 385
WRITE(35,78) wavobs(ii),(trntbl(ii,i+(kk-1)*10),i=1,10)
2208 78
FORMAT(1x,f6.4,10(1x,e11.4))
2211 WRITE(35,77) (vaptot(i+nk*10),i=1,njdiff)
2212 WRITE(35,77) ( r0p94(i+nk*10),i=1,njdiff)
2213 WRITE(35,77) ( r1p14(i+nk*10),i=1,njdiff)
2215 IF(njdiff.GE.1)
THEN
2217 386
WRITE(35,78) wavobs(ii),(trntbl(ii,i+nk*10),i=1,njdiff)
2219 CLOSE(35,iostat=istat)
2255 include
'COMMONS_INC'
2258 dimension trncal(1024)
2259 dimension wavobs(1024),fwhm(1024)
2260 dimension dp(25), pm(25), tm(25), vmrm(25)
2261 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2264 dimension trans(1024)
2265 dimension trncv(1024)
2266 dimension trnstd_sm(1050)
2269 COMMON /getinput4/ wavobs,fwhm
2270 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2271 COMMON /model_adj1/ clmvap,q
2272 COMMON /init_speccal5/ dp,pm,tm,vmrm
2273 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2274 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2275 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2276 COMMON /trancal1/ trncal,vaptt
2278 dimension g_vap(25), g_other(25)
2279 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
2281 COMMON /model_adj4/ k_surf
2290 OPEN(31,file=
'/u2/atrem_f90_cubeio/abscf_h2o_PC',status=
'old',
2291 & form=
'unformatted',access=
'direct',recl=4*300000)
2293 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2296 READ(31,rec=j+1) (a(i), i = 1, 300000)
2299 tran_hi(i) = tran_hi(i) * exp( - a(i) * q *
2300 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * sh2o * 28.966 /
2301 & 6.0225e+23 / 1.0e-06)
2312 tran_hi(i) = tran_hi(i) * tran_hi_others(i)
2328 vaptt = vap_slant_mdl * sh2o
2357 include
'COMMONS_INC'
2359 dimension tran_o3_std(5001)
2360 COMMON /init_speccal16/ tran_o3_std
2362 dimension tran_no2_std(5001)
2363 COMMON /init_speccal17/ tran_no2_std
2365 dimension wavobs(1024),fwhm(1024)
2366 COMMON /getinput4/ wavobs,fwhm
2368 dimension trncal(1024)
2369 COMMON /trancal1/ trncal,vaptt
2371 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2393 tran_med_index(j) = 0.0
2394 ncvtot_wavno = 2 * ncvhf_wavno(j) - 1
2398 DO 560 i = ncvhf_wavno(j), ncvtot_wavno
2400 & exp( -const1*(float(i-ncvhf_wavno(j))*dwavno
2401 & /fwhm_wavno(j))**2.0)
2402 sumins = sumins + finstr_wavno(i)
2405 DO 565 i = 1, ncvhf_wavno(j)-1
2406 finstr_wavno(i) = finstr_wavno(ncvtot_wavno-i+1)
2407 sumins = sumins + finstr_wavno(i)
2410 sumins = sumins * dwavno
2412 DO 570 i = 1, ncvtot_wavno
2413 finstr_wavno(i) = finstr_wavno(i)*dwavno/sumins
2423 DO 491 k = index_med(j)-(ncvhf_wavno(j)-1),
2424 & index_med(j)+ncvhf_wavno(j)-1
2425 tran_med_index(j) = tran_med_index(j) + tran_hi(k)*
2426 & finstr_wavno(k-index_med(j)+ncvhf_wavno(j))
2435 tran_med(1) = tran_med_index(1)
2436 tran_med(np_med) = tran_med_index(np_med)
2439 IF(wavln_med_index(j).LE.wavln_med(j))
THEN
2440 tran_med(j) = tran_med_index(j)
2442 dlt = wavln_med_index(j) - wavln_med_index(j-1)
2443 fjm1 = (wavln_med_index(j) - wavln_med(j)) /dlt
2444 fj = (wavln_med(j) - wavln_med_index(j-1))/dlt
2445 tran_med(j) = fjm1*tran_med_index(j-1) + fj*tran_med_index(j)
2459 tran_std(i) = tran_o3_std(i) * tran_no2_std(i)
2462 DO i = npshif+1, np_std
2463 tran_std(i) = tran_std(i)*tran_med(i-npshif)
2480 ncvtot = 2 * ncvhf(j) - 1
2487 DO 1560 i = ncvhf(j), ncvtot
2489 & exp( -const1*(float(i-ncvhf(j))*dwavln
2491 sumins = sumins + finstr(i)
2494 DO 1565 i = 1, ncvhf(j)-1
2495 finstr(i) = finstr(ncvtot-i+1)
2496 sumins = sumins + finstr(i)
2499 sumins = sumins * dwavln
2501 DO 1570 i = 1, ncvtot
2502 finstr(i) = finstr(i)*dwavln/sumins
2514 CALL hunt(wavln_std, np_std, wavobs(j), ia)
2520 DO 1491 k = ia-(ncvhf(j)-1), ia+ncvhf(j)-1
2521 tran_ia = tran_ia + tran_std(k)*
2522 & finstr(k-ia+ncvhf(j))
2533 DO 1492 k = ia_p1-(ncvhf(j)-1), ia_p1+ncvhf(j)-1
2534 tran_iap1 = tran_iap1 + tran_std(k)*
2535 & finstr(k-ia_p1+ncvhf(j))
2540 dlt_ia = wavln_std(ia_p1) - wavln_std(ia)
2541 fia = (wavln_std(ia_p1) - wavobs(j)) /dlt_ia
2544 trncal(j) = fia*tran_ia + fia_p1*tran_iap1
2585 dimension trncal(1024)
2587 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
2588 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2589 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2590 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2591 COMMON /trancal1/ trncal,vaptt
2592 COMMON /chnlratio1/ r094,r114
2597 const1=const1+trncal(i)
2599 const1=const1/float(nb1)
2603 const2=const2+trncal(i)
2605 const2=const2/float(nb2)
2608 DO 575 i=istp94,iedp94
2609 const3=const3+trncal(i)
2611 const3=const3/float(nbp94)
2613 r094=const3/((wt1*const1) + (wt2*const2))
2617 const4=const4+trncal(i)
2619 const4=const4/float(nb3)
2623 const5=const5+trncal(i)
2625 const5=const5/float(nb4)
2628 DO 595 i=ist1p14,ied1p14
2629 const6=const6+trncal(i)
2631 const6=const6/float(nb1p14)
2633 r114=const6/((wt3*const4) + (wt4*const5))
2685 INTEGER LUN_IN, LUN_OUT, LUN_VAP, I_RET
2686 COMMON /inout_units/ lun_in, lun_out, lun_vap
2692 CHARACTER (LEN = 1000) :: FINAV,FOCUB,FOH2O
2693 INTEGER*2 BUFFER(8388608)
2694 INTEGER*2 H2OBUF(8388608)
2695 INTEGER SORDER,HDREC
2701 INTEGER J, ISAMP, IBAND
2702 real*4 scalef,clmwvp
2708 COMMON /dummyglob/ buffer,h2obuf
2710 COMMON /proccube1/ yy
2711 COMMON /getinput11/hdrec,nsamps,nlines,nbands,sorder
2712 COMMON /getinput12/scalef
2715 COMMON /outcube/ focub
2716 COMMON /incube/ finav
2717 COMMON /outh2ovap/ foh2o
2732 CALL rd_slice(lun_in,nsamps,nbands,sorder,buffer)
2737 DO 46 isamp= 1,nsamps
2738 offset = (isamp-1) * nbands
2739 DO 45 iband=1,nbands
2740 yy(iband) = buffer(offset + iband)
2754 DO 55 iband=1,nbands
2755 tbuf(iband)=scalef*yy(iband)
2756 buffer(offset + iband) = nint(tbuf(iband))
2762 h2obuf(isamp) = nint(1000.*clmwvp)
2780 CALL wt_slice(lun_out,nsamps,nbands,sorder,buffer)
2782 CALL wt_line(lun_vap,nsamps,h2obuf)
2828 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2829 dimension yirr(1024)
2832 dimension rotot(1050), ttot(1050), stot(1050)
2833 dimension finst2(100)
2835 dimension trncal(1024)
2838 dimension trncv(1024)
2840 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2841 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
2842 COMMON /getinput8/ imn,idy,iyr,ih,im,is
2843 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
2844 COMMON /init_speccal3/ nh2o
2845 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2846 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2847 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2848 COMMON /init_speccal10/ ncv2,ncvhf2,ncvtt2,istrt2,iend2,finst2
2849 COMMON /init_speccal11/ natot,nbtot,nctot,ndtot
2850 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2851 COMMON /trancal1/ trncal,vaptt
2852 COMMON /solar_irr1/yirr
2853 COMMON /proccube1/ yy
2854 COMMON /sixs1/ rotot, ttot, stot
2856 dimension g_vap(25), g_other(25)
2857 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
2860 CHARACTER (LEN = 80) :: NAME_INSTRU, NAMES(10)
2861 COMMON /getinput13/ name_instru,
names
2868 dimension speca(1024),specb(1024),specav(1024)
2876 DATA pi,dtorad /3.1415926,0.0174533/
2881 IF((name_instru.EQ.
names(1)).AND.(iyr.LE.2009))
THEN
2893 IF(iyr.LE.1989)
THEN
2900 IF((iyr.GE.1990).AND.(iyr.LE.1991))
THEN
2907 IF((iyr.GE.1992).AND.(iyr.LE.1994))
THEN
2915 IF((iyr.GE.1995).AND.(iyr.LE.2009))
THEN
2931 yy(i)=pi*yy(i)/(xfa*yirr(i))
2938 ELSE if ((nobs.GE.33).and.(nobs.LT.96))
THEN
2945 yy(i)=pi*yy(i)/(xfb*yirr(i))
2950 IF(nobs.GE.160)
THEN
2952 ELSE if ((nobs.GE.97).and.(nobs.LT.160))
THEN
2959 yy(i)=pi*yy(i)/(xfc*yirr(i))
2964 IF(nobs.GE.161)
THEN
2971 yy(i)=pi*yy(i)/(xfd*yirr(i))
2981 IF((name_instru.EQ.
names(1)).AND.(iyr.GE.2010))
THEN
2988 yy(i) = pi*yy(i) / (f_av_1 * yirr(i))
2992 yy(i) = pi*yy(i) / (f_av_2 * yirr(i))
2996 yy(i) = pi*yy(i) / (f_av_3 * yirr(i))
3003 IF(name_instru.EQ.
names(2))
THEN
3008 yy(i) = pi*yy(i) / (f_hydice * yirr(i))
3016 IF(name_instru.EQ.
names(3))
THEN
3021 yy(i) = pi*yy(i) / (f_hsi * yirr(i))
3029 IF(name_instru.EQ.
names(4))
THEN
3034 yy(i) = pi*yy(i) / (f_trwis * yirr(i))
3041 IF(name_instru.EQ.
names(6))
THEN
3047 yy(i) = pi*yy(i) / (f_hyperion_a * yirr(i))
3051 yy(i) = pi*yy(i) / (f_hyperion_b * yirr(i))
3058 IF(name_instru.EQ.
names(7))
THEN
3064 yy(i) = pi*yy(i) / (f_hico * yirr(i))
3071 IF(name_instru.EQ.
names(8))
THEN
3076 yy(i) = pi*yy(i) / (f_nis * yirr(i))
3083 IF(name_instru.EQ.
names(9))
THEN
3088 yy(i) = pi*yy(i) / (f_prism * yirr(i))
3113 SUBROUTINE locate(xx,n,x,j)
3119 10
if(ju-jl.gt.1)
then
3121 if((xx(n).ge.xx(1)).eqv.(x.ge.xx(jm)))
then
3130 else if(x.eq.xx(n))
then
3155 SUBROUTINE cubspln(N,XORGN,YORGN,XINT,YINT)
3157 dimension xorgn(1050),yorgn(1050),y2(1050)
3158 dimension xint(1024),yint(1024)
3161 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
3170 CALL spline(xorgn,yorgn,n,yp1,ypn,y2)
3174 CALL splint(xorgn,yorgn,y2,n,x,y)
3210 subroutine spline(x,y,n,yp1,ypn,y2)
3213 real x(n),y(n),y2(n),u(nmax)
3214 real yp1,ypn,sig,p,qn,un
3215 if (yp1.gt..99e30)
then
3220 u(1)=(3./(x(2)-x(1)))*((y(2)-y(1))/(x(2)-x(1))-yp1)
3223 sig=(x(i)-x(i-1))/(x(i+1)-x(i-1))
3226 u(i)=(6.*((y(i+1)-y(i))/(x(i+1)-x(i))-(y(i)-y(i-1))
3227 * /(x(i)-x(i-1)))/(x(i+1)-x(i-1))-sig*u(i-1))/p
3229 if (ypn.gt..99e30)
then
3234 un=(3./(x(n)-x(n-1)))*(ypn-(y(n)-y(n-1))/(x(n)-x(n-1)))
3236 y2(n)=(un-qn*u(n-1))/(qn*y2(n-1)+1.)
3238 y2(k)=y2(k)*y2(k+1)+u(k)
3269 subroutine splint(xa,ya,y2a,n,x,y)
3271 real xa(n),ya(n),y2a(n)
3275 1
if (khi-klo.gt.1)
then
3285 if (h.eq.0.) pause
'bad xa input.'
3288 y=a*ya(klo)+b*ya(khi)+
3289 * ((a**3-a)*y2a(klo)+(b**3-b)*y2a(khi))*(h**2)/6.
3310 SUBROUTINE hunt(xx,n,x,jlo)
3315 ascnd=xx(n).ge.xx(1)
3316 if(jlo.le.0.or.jlo.gt.n)
then
3322 if(x.ge.xx(jlo).eqv.ascnd)
then
3326 else if(x.ge.xx(jhi).eqv.ascnd)
then
3336 else if(x.lt.xx(jlo).eqv.ascnd)
then
3342 3
if(jhi-jlo.eq.1)
then
3343 if(x.eq.xx(n))jlo=n-1
3348 if(x.ge.xx(jm).eqv.ascnd)
then
3374 SUBROUTINE suncor(IDAY,MONTH,IYR,TZ,DEC,HAZ)
3377 fjd=0.5+tz/6.283185307
3396 SUBROUTINE solcor(JD,FJD,RAS,DECS,GSDT,BZRO,P,SOLONG)
3401 g=-.026601523+.01720196977*d-1.95e-15*d*d -2.*pi*iyr
3402 xlms=4.881627938+.017202791266*d+3.95e-15*d*d-2.*pi*iyr
3403 obl=.409319747-6.2179e-9*d
3404 ecc=.01675104-1.1444e-9*d
3406 gsdt=1.739935476+2.*pi*
f/365.25+1.342027e-4*d/365.25
3407 gsdt=gsdt+6.2831853*(fjd-0.5)
3408 xlts=xlms+2.*ecc*sin(g)+1.25*ecc*ecc*sin(2.*g)
3409 sndc=sin(xlts)*sin(obl)
3411 csra=cos(xlts)/cos(decs)
3413 IF(sin(xlts).LT.0.) ras=2.*pi-ras
3414 omega=1.297906+6.66992e-7*d
3416 bzro=asin(.126199*sin(thetac))
3417 p=-atan(cos(xlts)*tan(obl))-atan(.127216*cos(thetac))
3418 xlmm=atan2(.992005*sin(thetac),cos(thetac))
3420 irot=(jdr+fjd)/25.38
3421 frot=(jdr+fjd)/25.38-irot
3422 solong=xlmm-2.*pi*frot+pi-3.e-4
3423 IF(solong.LT.0.) solong=solong+2.*pi
3424 IF(solong.GT.(2.*pi)) solong=solong-2.*pi
3444 FUNCTION julian(IDAY,MONTH,IYR)
3449 DATA md/0,31,59,90,120,151,181,212,243,273,304,334/
3451 IF(iyr.LT.100) iyr=iyr+1900
3455 i3=(jyr-400*i1-100*i2)/4
3456 julian=2305447+365*jyr+97*i1+24*i2+i3
3458 IF(mod(jyr,4).EQ.0)
leap=1
3459 IF(mod(jyr,100).EQ.0)
leap=0
3460 IF(mod(jyr,400).EQ.0)
leap=1
3481 SUBROUTINE hazel (H,D,A,E,XLAT)
3491 sne = sin(d)*sin(xlat)+cos(d)*cos(xlat)*cos(h)
3494 csa=(sin(xlat)*cos(h)*cos(d)-sin(d)*cos(xlat))
3517 dimension
list(1500)
3522 IF(
list(i).GT.elem)
GOTO 470
3527 IF (diff1.LT.diff2)
THEN