359 include
'COMMONS_INC.f'
361 INTEGER LUN_IN, LUN_OUT, LUN_VAP, I_RET
362 COMMON /inout_units/ lun_in, lun_out, lun_vap
366 dimension h(25), t(25), p(25), vmr(25)
367 dimension wavobs(1024),fwhm(1024)
368 dimension tpvmr(7,81)
369 CHARACTER*1 LATHEM, LNGHEM
371 CHARACTER (LEN = 1000) :: FINAV,FOCUB,FOH2O
376 CHARACTER (LEN = 1000) :: FINPWV,FTPVMR
378 CHARACTER (LEN = 1000) :: FOUT1
382 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
383 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
384 COMMON /getinput4/ wavobs,fwhm
385 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
386 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
387 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
388 COMMON /getinput8/ imn,idy,iyr,ih,im,is
389 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
390 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
391 COMMON /getinput11/hdrec,nsamps,nlines,nbands,sorder
392 COMMON /getinput12/scalef
393 COMMON /tpvmr_init1/ tpvmr
396 COMMON /outcube/ focub
397 COMMON /incube/ finav
398 COMMON /outh2ovap/ foh2o
401 CHARACTER (LEN = 80) :: NAME_INSTRU, NAMES(10)
402 COMMON /getinput13/ name_instru,
names
405 COMMON /getinput14/ xpss, xppp
407 REAL XVIEWD, XVIEWM, XVIEWS
408 REAL XAZMUD, XAZMUM, XAZMUS
409 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
414 READ(5,627) name_instru
425 names(4) =
'TRWIS-III'
427 names(6) =
'Hyperion'
434 print*,
'Instrument Name: ', name_instru
442 READ (5,*) imn,idy,iyr,ih,im,is
443 IF((imn.LT.1).OR.(imn.GT.12).OR.(idy.LT.1).OR.(idy.GT.31).OR. &
444 (iyr.LT.1987).OR.(iyr.GT.2020))
THEN
445 WRITE(*,*)
'Invalid date:',imn,idy,iyr
446 WRITE(*,*)
'Format is MM DD YYYY where 0<MM<12, 0<DD<32, &
450 IF((ih.LT.0).OR.(ih.GT.24).OR.(im.LT.0).OR.(im.GT.60).OR. &
451 (is.LT.0).OR.(is.GT.60))
THEN
452 WRITE(*,*)
'Invalid time:',ih,im,is
453 WRITE(*,*)
'Format is HH MM SS where 0<HH<24, 0<MM<60, SS<60.'
458 READ (5,*) xlatd,xlatm,xlats
459 IF((xlatd.GT.90).OR.(xlatm.GT.60).OR.(xlats.GT.60))
THEN
460 WRITE(*,*)
'Invalid latitude:',xlatd,xlatm,xlats
461 WRITE(*,*)
'Format: degrees minutes seconds'
462 WRITE(*,*)
'Valid values are degrees < 90, minutes < 60, &
470 IF((lathem.NE.
'N').AND.(lathem.NE.
'S'))
THEN
471 WRITE(*,*)
'Invalid hemisphere value:',lathem
472 WRITE(*,*)
'Valid values are "N" or "S".'
477 READ (5,*) xlongd,xlongm,xlongs
478 IF((xlongd.GT.180).OR.(xlongm.GT.60).OR.(xlongs.GT.60))
THEN
479 WRITE(*,*)
'Invalid longitude:',xlongd,xlongm,xlongs
480 WRITE(*,*)
'Format: degrees minutes seconds'
481 WRITE(*,*)
'Valid values are degrees < 180 minutes < 60, &
488 IF((lnghem.NE.
'E').AND.(lnghem.NE.
'W'))
THEN
489 WRITE(*,*)
'Invalid hemisphere:',lnghem
490 WRITE(*,*)
'Valid values are "E" or "W".'
495 READ (5,*) xviewd,xviewm,xviews
496 IF((xviewd.GT.90).OR.(xviewm.GT.60).OR.(xviews.GT.60))
THEN
497 WRITE(*,*)
'Invalid latitude:',xviewd,xviewm,xviews
498 WRITE(*,*)
'Format: degrees minutes seconds'
499 WRITE(*,*)
'Valid values are degrees < 90, minutes < 60 & seconds<60.'
505 READ (5,*) xazmud,xazmum,xazmus
506 IF((xazmud.GT.360.).OR.(xazmum.GT.60).OR.(xazmus.GT.60))
THEN
507 WRITE(*,*)
'Invalid view azimuth ang.:',xazmud,xazmum,xazmus
508 WRITE(*,*)
'Format: degrees minutes seconds'
509 WRITE(*,*)
'Valid values are degrees < 360, minutes < 60, & seconds<60.'
518 IF((dlt.LT.0.0005).OR.(dlt.GT.0.1))
THEN
519 WRITE(*,*)
'Invalid spectral resolution value:',dlt
520 WRITE(*,*)
'Valid values are 0.0005-0.1 micron.'
534 OPEN(11,file=finpwv,status=
'OLD',iostat=istat)
536 WRITE(*,*)
'wavelength file did not open successfully:',finpwv
547 READ(11,*,
END=520) X,WAVOBS(I)
549 READ(11,*,
END=520) X,WAVOBS(I), FWHM(I)
558 IF((ans.NE.0).AND.(ans.NE.1))
THEN
559 WRITE(*,*)
'Invalid value to indicate whether the channel ratio parameters should be read:'
560 WRITE(*,*)
'Valid values: 0=no 1=yes.'
574 114
READ(*,*)wndow1, nb1, wndow2, nb2, wp94c, nbp94
576 IF((wndow1.LT.0.6).OR.(wndow1.GT.2.5))
THEN
577 WRITE(*,*)
'Invalid wavelength position for first atmospheric window in the .94-um region:'
578 WRITE(*,*)
'Valid values are 0.6-2.5.'
582 IF((nb1.LT.1).OR.(nb1.GT.50))
THEN
583 WRITE(*,*)
'Invalid number of channels for first wavelength position in the .94-um region:'
584 WRITE(*,*)
'Valid values are 1-50.'
588 IF((wndow2.LT.0.6).OR.(wndow2.GT.2.5))
THEN
589 WRITE(*,*)
'Invalid wavelength position for second atmospheric window in the .94-um region:'
590 WRITE(*,*)
'Valid values are 0.6-2.5.'
594 IF((nb2.LT.1).OR.(nb2.GT.50))
THEN
595 WRITE(*,*)
'Invalid number of channels for second wavelength position in the .94-um region:'
596 WRITE(*,*)
'Valid values are 1-50.'
600 IF((wp94c.LE.wndow1).OR.(wp94c.GE.wndow2))
THEN
601 WRITE(*,*)
'Invalid water vapor wavelength position for the .94-um region:'
602 WRITE(*,*)
'Valid range is:',wndow1,
' < value < ',wndow2,
'.'
606 IF((nbp94.LT.1).OR.(nbp94.GT.90))
THEN
607 WRITE(*,*)
'Invalid number of channels for water vapor wavelength position in the .94-um region:'
608 WRITE(*,*)
'Valid values are 1-90.'
623 READ(*,*)wndow3, nb3, wndow4, nb4, w1p14c, nb1p14
625 IF((wndow3.LT.0.6).OR.(wndow3.GT.2.5))
THEN
626 WRITE(*,*)
'Invalid wavelength position for first atmospheric window in the 1.14-um region:'
627 WRITE(*,*)
'Valid values are 0.6-2.5'
631 IF((nb3.LT.1).OR.(nb3.GT.50))
THEN
632 WRITE(*,*)
'Invalid number of channels for first wavelength position in the 1.14-um region:'
633 WRITE(*,*)
'Valid values are 1-50.'
637 IF((wndow4.LT.0.6).OR.(wndow4.GT.2.5))
THEN
638 WRITE(*,*)
'Invalid wavelength position for second atmospheric window in the 1.14-um region:'
639 WRITE(*,*)
'Valid values are 0.6-2.5'
643 IF((nb4.LT.1).OR.(nb4.GT.50))
THEN
644 WRITE(*,*)
'Invalid number of channels for second wavelength position in the 1.14-um region:'
645 WRITE(*,*)
'Valid values are 1-50.'
649 IF((w1p14c.LE.wndow3).OR.(w1p14c.GE.wndow4))
THEN
650 WRITE(*,*)
'Invalid water vapor wavelength position for 1.14-um:',w1p14c
651 WRITE(*,*)
'Valid range is:',wndow3,
' < value <', wndow4,
'.'
655 IF((nb1p14.LT.1).OR.(nb1p14.GT.110))
THEN
656 WRITE(*,*)
'Invalid number of channels for water vapor wavelength position in the 1.14-um region:'
657 WRITE(*,*)
'Valid values are 1-110.'
688 IF((model.LT.1).OR.(model.GT.7))
THEN
689 WRITE(*,*)
'Invalid atmospheric model value:',model
690 WRITE(*,*)
'Valid values are 1-7.'
699 OPEN(20,file=ftpvmr,status=
'OLD',iostat=istat)
701 WRITE(*,*)
'Atmospheric model file did not open successfully:'
707 IF((nb.LE.0).OR.(nb.GT.25))
THEN
708 WRITE(*,*)
'Invalid number of boundaries:',nb
709 WRITE(*,*)
'Valid values are 1-25.'
713 READ(20,*) h(i),p(i),t(i),vmr(i)
715 CLOSE(20,iostat=istat)
722 h(i) = tpvmr(model,2+(4*(i-1)))
723 p(i) = tpvmr(model,3+(4*(i-1)))
724 t(i) = tpvmr(model,4+(4*(i-1)))
725 vmr(i) = tpvmr(model,5+(4*(i-1)))
748 READ(*,*)ih2ovp, ico2, io3, in2o, ico, ich4, io2, ino2
749 IF((ih2ovp.NE.0).AND.(ih2ovp.NE.1))
THEN
750 WRITE(*,*)
'Invalid selection for H2O vapor:',ih2ovp
751 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
755 IF((ico2.NE.0).AND.(ico2.NE.1))
THEN
756 WRITE(*,*)
'Invalid selection for CO2:',ico2
757 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
761 IF((io3.NE.0).AND.(io3.NE.1))
THEN
762 WRITE(*,*)
'Invalid selection for O3:',io3
763 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
767 IF((in2o.NE.0).AND.(in2o.NE.1))
THEN
768 WRITE(*,*)
'Invalid selection for N2O:',in2o
769 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
773 IF((ico.NE.0).AND.(ico.NE.1))
THEN
774 WRITE(*,*)
'Invalid selection for CO:',ico
775 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
779 IF((ich4.NE.0).AND.(ich4.NE.1))
THEN
780 WRITE(*,*)
'Invalid selection for CH4:',ich4
781 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
785 IF((io2.NE.0).AND.(io2.NE.1))
THEN
786 WRITE(*,*)
'Invalid selection for O2:',io2
787 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
791 IF((ino2.NE.0).AND.(ino2.NE.1))
THEN
792 WRITE(*,*)
'Invalid selection for NO2:',ino2
793 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
801 IF((vrto3.LT.0.1).OR.(vrto3.GT.0.6))
THEN
802 WRITE(*,*)
'Invalid vertical column amount of ozone:',vrto3
803 WRITE(*,*)
'Valid values are 0.1-0.6.'
804 WRITE(*,*)
'Reasonable values are 0.28-0.55.'
815 IF((iaer.LT.0).OR.(iaer.GT.6))
THEN
816 WRITE(*,*)
'Invalid aerosol model value:',iaer
817 WRITE(*,*)
'Valid values are 0-3.'
825 IF((v.LT.0).OR.(v.GT.300))
THEN
826 WRITE(*,*)
'Invalid visibility value:',v
827 WRITE(*,*)
'Value must be greater than 0 and less than 300.'
834 IF((taer55.GT.10.).OR.(taer55.LE.0))
THEN
835 WRITE(*,*)
'Invalid aerosol optical depth at 550 nm: ',taer55
836 WRITE(*,*)
'Valid values are between 0 and 10.'
846 IF((hsurf.LT.0).OR.(hsurf.GT.h(nb-1)))
THEN
847 WRITE(*,*)
'Invalid surface elevation value:',hsurf
848 WRITE(*,*)
'Value must be less than the maximum elevation in the atmospheric model.'
853 IF(xppp .LT. hsurf)
THEN
854 WRITE(*,*)
'Invalid plane altitude:',xppp
855 WRITE(*,*)
'Plane altitude must be greater than the bottom surface elevation.'
877 IF((ans.NE.0).AND.(ans.NE.1))
THEN
878 WRITE(*,*)
'Invalid value to indicate whether the cube dimensions should be read:'
879 WRITE(*,*)
'Valid values: 0=no 1=yes.'
885 READ(*,*) hdrec, nsamps, nlines, nbands, sorder
886 IF ((hdrec.LT.0).OR.(nsamps.LE.0).OR. (nlines.LE.0).OR.(nbands.LE.
887 (sorder.LE.0).OR.(sorder.GT.2))
THEN
888 WRITE(*,*)
'Invalid cube parameters:',hdrec,nsamps,nlines, &
890 WRITE(*,*)
'Values must be greater than or equal to 1 and the storage order must be less than 3.'
891 WRITE(*,*)
'Storage Order (0=BSQ, 1=BIP, 2=BIL)'
892 WRITE(*,*)
' 0 = BSQ is not supported in this version of ATREM'
919 IF((dlt2.LT.0.).OR.(dlt2.GT.100.))
THEN
920 WRITE(*,*)
'Invalid output resolution value:',dlt2
921 WRITE(*,*)
'Valid values are 0-100 nm.'
927 IF((scalef.LT.1.).OR.(scalef.GT.32000.))
THEN
928 WRITE(*,*)
'Invalid output resolution value:',scalef
929 WRITE(*,*)
'Valid values are 1-32000 nm.'
1014 include
'COMMONS_INC.f'
1017 dimension h(25), t(25), p(25), vmr(25)
1019 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1020 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
1021 COMMON /model_adj1/ clmvap,q
1023 dimension hp(25), tp(25), pp(25), vmrp(25)
1024 COMMON /model_adj2/ hp, tp, pp, vmrp
1025 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer, &
1026 dp_plane, dp_layer, clmvapp
1027 COMMON /model_adj4/ k_surf
1030 COMMON /getinput14/ xpss, xppp
1051 310 vmr(i)=vmr(i)*1.0e-06
1058 7455
IF(hsurf.EQ.h(i)) hsurf=h(i)+0.0001
1061 CALL locate(h,nb,hsurf,k)
1069 5237
FORMAT(2x,
'***WARNING: Surface elevation smaller then lowest boundary of the model atmosphere.'
1080 tsurf=t(k)+(dhs/dhk)*(t(k+1)-t(k))
1081 vmrs =vmr(k)+(dhs/dhk)*(vmr(k+1)-vmr(k))
1084 psurf=p(k)*exp(-alog(p(k)/p(k+1))*dhs/dhk)
1115 damtvt=q*(p(i)-p(i+1))*(vmr(i)+vmr(i+1))/2.0
1116 amtvrt=amtvrt+damtvt
1119 clmvap=amtvrt/3.34e+22
1121 WRITE(*,*)
'Column vapor amount in model atmosphere from ground'
1122 WRITE(*,*)
' to space = ', clmvap,
' cm'
1148 IF(hplane.GE.100.0) hplane = 100. - 0.0001
1151 IF(hplane.GT.hp(1))
THEN
1156 7456
IF(hplane.EQ.hp(i)) hplane=hp(i)-0.0001
1159 CALL locate(hp,nb,hplane,kk)
1163 5239
FORMAT(2x,
'***WARNING: Plane altitude less then lowest boundary of the model atmosphere.'
1168 dhkk = hp(kk+1) - hp(kk)
1169 dhss = hplane - hp(kk)
1172 tplane = tp(kk) + (dhss/dhkk)*(tp(kk+1)-tp(kk))
1173 vmrsp = vmrp(kk) + (dhss/dhkk)*(vmrp(kk+1)-vmrp(kk))
1176 pplane = pp(kk)*exp(-alog(pp(kk)/pp(kk+1))*dhss/dhkk)
1200 damtvtp=q*(pp(i)-pp(i+1))*(vmrp(i)+vmrp(i+1))/2.0
1201 amtvrtp=amtvrtp+damtvtp
1204 clmvapp=amtvrtp/3.34e+22
1206 WRITE(*,*)
'Column vapor below plane (CLMVAPP) = ', &
1218 dvap_plane = q*(pp(k_plane) - pp(k_plane+1))* &
1219 (vmrp(k_plane) + vmrp(k_plane+1))/2.0 / 3.34e+22
1221 dvap_layer = q*(p(k_plane) - p(k_plane+1))* &
1222 (vmr(k_plane) + vmr(k_plane+1))/2.0 / 3.34e+22
1224 dp_plane = pp(k_plane) - pp(k_plane+1)
1225 dp_layer = p(k_plane) - p(k_plane+1)
1267 include
'COMMONS_INC.f'
1269 dimension vapvrt(60), vap_slant(60)
1272 dimension h(25), t(25), p(25), vmr(25)
1273 CHARACTER*1 LATHEM,LNGHEM
1280 DATA vapvrt/.00, .02, .06, .11, .16, .21, .26, .31, .36, .40,
1281 .43, .46, .50, .54, .58, .62, .66, .70, .75, .80,
1282 .86, .92, .98, 1.06,1.14, 1.22, 1.3, 1.4, 1.5, 1.6,
1283 1.7, 1.8, 1.9, 2.05, 2.2, 2.35, 2.55, 2.75, 2.95, 3.2,
1284 3.5, 3.8, 4.1, 4.4, 4.7, 5.0, 5.3, 5.6, 6.0, 6.4,
1285 7.0, 7.7, 8.5, 9.4,10.4, 11.6, 13.0, 15.0, 25.0, 50./
1287 DATA md/0,31,59,90,120,151,181,212,243,273,304,334/
1289 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1291 COMMON /getinput8/ imn,idy,iyr,ih,im,is
1292 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
1293 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
1294 COMMON /model_adj1/ clmvap,q
1295 COMMON /geometry1/ solzni,solaz,obszni,obsphi,iday
1296 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1298 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer, &
1299 dp_plane, dp_layer, clmvapp
1301 dimension g_vap(25), g_other(25)
1302 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
1305 COMMON /getinput14/ xpss, xppp
1307 REAL XVIEWD, XVIEWM, XVIEWS
1308 REAL XAZMUD, XAZMUM, XAZMUS
1309 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
1320 vap_slant(i) = vapvrt(i) * 2.0
1326 tt=6.28318*((xh)/24+xm/1440+xs/86400)
1328 xlat = xlatd + xlatm/60.0 + xlats/3600.0
1329 xlong = xlongd + xlongm/60.0 + xlongs/3600.0
1333 IF(lathem.NE.
'N') xlat = -xlat
1334 IF(lnghem.NE.
'W') xlong = -xlong
1336 325 xlatr = xlat/57.2958
1337 xlongr = xlong/57.2958
1339 CALL suncor(idy,imn,iyr,
tt,dec,haz)
1340 CALL hazel(haz+
tt-xlongr,dec,solaz,el,xlatr)
1343 IF (el .LE. 0.)
THEN
1344 WRITE(*,*)
'ERROR: Sun is below the horizon!!!'
1345 WRITE(*,*)
'Check input date, time, latitude and longitude.'
1350 obszni = xviewd + xviewm/60.0 + xviews/3600.0
1351 obsphi = xazmud + xazmum/60.0 + xazmus/3600.0
1353 write(91,*)
'OBSZNI = ',obszni,
' OBSPHI = ',obsphi,
' degrees'
1355 obszni = obszni / 57.2958
1356 obsphi = obsphi / 57.2958
1358 solzni = 90.0/57.2958 - el
1360 write(91,*)
'solzni=',solzni
1361 write(91,*)
'KPLANE=',k_plane
1363 ggeom = 1./cos(solzni) + 1./cos(obszni)
1368 IF(hplane.LT.27.) go3 = ggeom - 1./cos(obszni)
1375 write(91,*)
'GGEOM, GCO2, GO3, GN2O, GCO, GCH4, GO2 = '
1376 write(91,*) ggeom, gco2, go3, gn2o, gco, gch4, go2
1378 totlo3 = go3 * vrto3
1380 WRITE(91,*)
'TOTLO3 = ', totlo3
1388 DO i = 1, k_plane - 1
1394 DO i = k_plane + 1, 25
1395 g_vap(i) = ggeom - 1./cos(obszni)
1396 g_other(i) = ggeom - 1./cos(obszni)
1401 g_vap(k_plane) = ggeom - 1./cos(obszni) &
1402 + dvap_plane/dvap_layer/cos(obszni)
1403 g_other(k_plane) = ggeom - 1./cos(obszni) &
1404 + dp_plane/dp_layer/cos(obszni)
1406 write(91,*)
' G_VAP, G_OTHER, I ='
1408 write(91,*) g_vap(i), g_other(i), i
1415 vap_slant_mdl = clmvap/cos(solzni) + clmvapp/cos(obszni)
1416 write(91,*)
'VAP_SLANT_MDL =', vap_slant_mdl,
' cm'
1421 g_vap_equiv = vap_slant_mdl / clmvap
1422 write(91,*)
'G_VAP_EQUIV = ', g_vap_equiv
1425 ssh2o(i) = vap_slant(i) / vap_slant_mdl
1426 write(91,*)
'SSH2O(I), I = ', ssh2o(i), i
1431 iday = md(imn) + idy
1432 lpyr = iyr - (4 * (iyr/4))
1433 IF((lpyr.EQ.0).AND.(iday.GT.59).AND.(imn.NE.2)) iday = iday + 1
1531 include
'COMMONS_INC.f'
1534 dimension h(25), t(25), p(25), vmr(25)
1536 dimension wavobs(1024),fwhm(1024)
1537 dimension dp(25), pm(25), tm(25), vmrm(25)
1538 dimension finst2(100)
1542 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
1543 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1544 COMMON /getinput4/ wavobs,fwhm
1545 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
1546 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
1547 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
1548 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1549 COMMON /model_adj1/ clmvap,q
1551 COMMON /init_speccal3/ nh2o
1552 COMMON /init_speccal5/ dp,pm,tm,vmrm
1553 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
1554 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
1555 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
1557 COMMON /init_speccal10/ ncv2,ncvhf2,ncvtt2,istrt2,iend2,finst2
1558 COMMON /init_speccal11/ natot,nbtot,nctot,ndtot
1560 dimension g_vap(25), g_other(25)
1561 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
1563 dimension o3cf(5001)
1564 COMMON /o3cf_init1/ o3cf
1566 dimension tran_o3_std(5001)
1567 COMMON /init_speccal16/ tran_o3_std
1569 dimension rno2cf(5001)
1570 COMMON /no2cf_init1/ rno2cf
1572 dimension tran_no2_std(5001)
1573 COMMON /init_speccal17/ tran_no2_std
1575 COMMON /model_adj4/ k_surf
1576 INTEGER start(2)/1,1/
1577 INTEGER cnt(2)/NP_HI,19/
1592 wavno_hi(i) = 3000. + float(i-1)*dwavno
1601 wavln_med(i) = vstart + float(i-1)*dwavln
1612 wavln_std(i) = 0.3 + float(i-1)*dwavln
1626 index_med(i) = ( (10000./wavln_med(i) - 3000.)/dwavno + 1.)
1637 wavln_med_index(i) = 10000. /(float(index_med(i)-1)*dwavno &
1647 fwhm_wavno(i) = 10000.*dlt_med &
1648 /(wavln_med_index(i)*wavln_med_index(i))
1657 ncvhf_wavno(i) = ( facdlt * fwhm_wavno(i) / dwavno + 1.)
1669 ncvhf(i) = ( facdlt * fwhm(i) / dwavln + 1.)
1683 IF(dwvavr.LT.fwhm(i)) dwvavr = fwhm(i)
1691 cons2=dlt2*sqrt(3.1415926/const1)
1693 IF (dlt2 .NE. 0.0)
THEN
1695 DO 585 i=ncvhf2,ncvtt2
1696 finst2(i)=exp(-const1*(float(i-ncvhf2)*dwvavr/dlt2)**2.0)
1697 sumins=sumins+finst2(i)
1701 finst2(i)=finst2(ncvtt2-i+1)
1702 sumins=sumins+finst2(i)
1705 sumins=sumins*dwvavr
1708 finst2(i)=finst2(i)*dwvavr/sumins
1725 nctot=nchnla+nchnlb+nchnlc
1726 ndtot=nchnla+nchnlb+nchnlc+nchnld
1733 wndow1=wavobs(iwndw1)
1734 wndow2=wavobs(iwndw2)
1737 IF(jj.EQ.0) nb1=nb1+1
1739 IF(kk.EQ.0) nb2=nb2+1
1749 wp94c=wavobs(iwp94c)
1752 IF(ll.EQ.0) nbp94=nbp94+1
1754 istp94=iwp94c-nb3haf
1755 iedp94=iwp94c+nb3haf
1757 wt1=(wndow2-wp94c)/(wndow2-wndow1)
1758 wt2=(wp94c-wndow1)/(wndow2-wndow1)
1763 wndow3=wavobs(iwndw4)
1764 wndow4=wavobs(iwndw5)
1767 IF(jj.EQ.0) nb3=nb3+1
1769 IF(kk.EQ.0) nb4=nb4+1
1780 w1p14c=wavobs(iw1p14c)
1782 IF(ll.EQ.0) nb1p14=nb1p14+1
1784 ist1p14=iw1p14c-nb6haf
1785 ied1p14=iw1p14c+nb6haf
1787 wt3=(wndow4-w1p14c)/(wndow4-wndow3)
1788 wt4=(w1p14c-wndow3)/(wndow4-wndow3)
1799 tran_o3_std(i) = exp(-totlo3*o3cf(i))
1809 tran_o3_std(i) = 1.0
1818 vrtno2 = sno2 * vrtno2
1821 totno2 = gno2 * vrtno2
1825 tran_no2_std(i) = exp(-totno2*rno2cf(i))
1846 tran_no2_std(i) = 1.0
1856 pm(i)=(p(i)+p(i+1))/2.0
1857 tm(i)=(t(i)+t(i+1))/2.0
1878 tran_hi_others(i) = 1.0
1881 ncid = ncopn(
'abscf_gas.nc',ncnowrit,ircode)
1894 vmrm(i)=sclco2*355.0*1.0e-06
1898 vmrm(i)= vmrm(i)*g_other(i)
1909 nrhid = ncvid(ncid,
'abscf_co2', ircode)
1910 CALL ncvgt (ncid, nrhid, start, cnt, abscf, ircode)
1911 if (ircode .ne.0)
then
1912 write(*,*)
'Error reading abscf_gas.nc: abscf_co2: rcode=',ircode
1924 tran_hi_others(:) = tran_hi_others(:) * exp( - abscf(:,j)*q
1925 dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 / &
1926 6.0225e+23 / 1.0e-06)
1938 vmrm(i)= vmrm(i)*g_other(i)
1947 nrhid = ncvid(ncid,
'abscf_n2o', ircode)
1948 CALL ncvgt (ncid, nrhid, start, cnt, abscf, ircode)
1949 if (ircode .ne.0)
then
1950 write(*,*)
'Error reading abscf_gas.nc: abscf_n2o: rcode=',ircode
1962 tran_hi_others(:) = tran_hi_others(:) * exp( - abscf(:,j)*q
1963 dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 / &
1964 6.0225e+23 / 1.0e-06)
1975 vmrm(i)= vmrm(i)*g_other(i)
1984 nrhid = ncvid(ncid,
'abscf_co', ircode)
1985 CALL ncvgt (ncid, nrhid, start, cnt, abscf, ircode)
1986 if (ircode .ne.0)
then
1987 write(*,*)
'Error reading abscf_gas.nc: abscf_co: rcode=',ircode
1999 tran_hi_others(:) = tran_hi_others(:) * exp( - abscf(:,j)*q
2000 dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 / &
2001 6.0225e+23 / 1.0e-06)
2025 vmrm(i)=sclch4*1.6*1.0e-06
2026 vmrm(i)= vmrm(i)*g_other(i)
2035 nrhid = ncvid(ncid,
'abscf_ch4', ircode)
2036 CALL ncvgt (ncid, nrhid, start, cnt, abscf, ircode)
2037 if (ircode .ne.0)
then
2038 write(*,*)
'Error reading abscf_gas.nc: abscf_ch4: rcode=',ircode
2050 tran_hi_others(:) = tran_hi_others(:) * exp( - abscf(:,j)*q
2051 dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 / &
2052 6.0225e+23 / 1.0e-06)
2071 vmrm(i)= vmrm(i)*g_other(i)
2080 nrhid = ncvid(ncid,
'abscf_o2', ircode)
2081 CALL ncvgt (ncid, nrhid, start, cnt, abscf, ircode)
2082 if (ircode .ne.0)
then
2083 write(*,*)
'Error reading abscf_gas.nc: abscf_o2: rcode=',ircode
2100 tran_hi_others(1:9000) = tran_hi_others(1:9000) * exp( - abscf
2101 dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 / &
2102 6.0225e+23 / 1.0e-06)
2104 tran_hi_others(9001:106600) = tran_hi_others(9001:106600) *
2105 dp(j-k_surf+1)*vmrm(j-k_surf+1)*scl_o2 *28.966/ &
2106 6.0225e+23 / 1.0e-06)
2108 tran_hi_others(106601:np_hi) = tran_hi_others(106601:np_hi)
2109 dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 / &
2110 6.0225e+23 / 1.0e-06)
2116 CALL ncclos(ncid, rcode)
2125 vmrm(i) = (vmr(i)+vmr(i+1))/2.0
2129 vmrm(i) = vmrm(i)*g_vap(i)
2186 include
'COMMONS_INC.f'
2189 dimension trncal(1024)
2190 dimension wavobs(1024),fwhm(1024)
2191 dimension dp(25), pm(25), tm(25), vmrm(25)
2193 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2195 dimension o3cf(5001)
2196 COMMON /o3cf_init1/ o3cf
2198 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
2199 COMMON /getinput4/ wavobs,fwhm
2200 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2201 COMMON /init_speccal3/ nh2o
2202 COMMON /init_speccal5/ dp,pm,tm,vmrm
2204 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2205 COMMON /trancal1/ trncal,vaptt
2206 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
2207 COMMON /chnlratio1/ r094,r114
2222 trntbl(j,i)=trncal(j)
2285 include
'COMMONS_INC.f'
2286 include
'netcdf.inc'
2288 dimension trncal(1024)
2289 dimension wavobs(1024),fwhm(1024)
2290 dimension dp(25), pm(25), tm(25), vmrm(25)
2291 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2294 dimension trans(1024)
2295 dimension trncv(1024)
2296 dimension trnstd_sm(1050)
2299 COMMON /getinput4/ wavobs,fwhm
2300 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2301 COMMON /model_adj1/ clmvap,q
2302 COMMON /init_speccal5/ dp,pm,tm,vmrm
2303 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2304 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2305 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2306 COMMON /trancal1/ trncal,vaptt
2308 dimension g_vap(25), g_other(25)
2309 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
2311 COMMON /model_adj4/ k_surf
2313 INTEGER start(2)/1,1/
2314 INTEGER cnt(2)/NP_HI,19/
2327 if (first.eq.1)
then
2328 ncid = ncopn(
'abscf_gas.nc',ncnowrit,ircode)
2335 nrhid = ncvid(ncid,
'abscf_h2o', ircode)
2336 CALL ncvgt (ncid, nrhid, start, cnt, abscf, ircode)
2337 if (ircode .ne.0)
then
2338 write(*,*)
'Error reading abscf_gas.nc: abscf_h2o: rcode=',ircode
2341 CALL ncclos(ncid, rcode)
2359 tran_hi(:) = tran_hi(:) * exp( - abscf(:,j) * q * &
2360 dp(j-k_surf+1)*vmrm(j-k_surf+1) * sh2o * 28.966 / &
2361 6.0225e+23 / 1.0e-06)
2368 tran_hi(:) = tran_hi(:)*tran_hi_others(:)
2386 vaptt = vap_slant_mdl * sh2o
2415 include
'COMMONS_INC.f'
2417 dimension tran_o3_std(5001)
2418 COMMON /init_speccal16/ tran_o3_std
2420 dimension tran_no2_std(5001)
2421 COMMON /init_speccal17/ tran_no2_std
2423 dimension wavobs(1024),fwhm(1024)
2424 COMMON /getinput4/ wavobs,fwhm
2426 dimension trncal(1024)
2427 COMMON /trancal1/ trncal,vaptt
2429 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2451 tran_med_index(j) = 0.0
2452 ncvtot_wavno = 2 * ncvhf_wavno(j) - 1
2456 DO 560 i = ncvhf_wavno(j), ncvtot_wavno
2458 exp( -const1*(float(i-ncvhf_wavno(j))*dwavno &
2459 /fwhm_wavno(j))**2.0)
2460 sumins = sumins + finstr_wavno(i)
2463 DO 565 i = 1, ncvhf_wavno(j)-1
2464 finstr_wavno(i) = finstr_wavno(ncvtot_wavno-i+1)
2465 sumins = sumins + finstr_wavno(i)
2468 sumins = sumins * dwavno
2470 DO 570 i = 1, ncvtot_wavno
2471 finstr_wavno(i) = finstr_wavno(i)*dwavno/sumins
2481 DO 491 k = index_med(j)-(ncvhf_wavno(j)-1), &
2482 index_med(j)+ncvhf_wavno(j)-1
2483 tran_med_index(j) = tran_med_index(j) + tran_hi(k)* &
2484 finstr_wavno(k-index_med(j)+ncvhf_wavno(j))
2493 tran_med(1) = tran_med_index(1)
2494 tran_med(np_med) = tran_med_index(np_med)
2497 IF(wavln_med_index(j).LE.wavln_med(j))
THEN
2498 tran_med(j) = tran_med_index(j)
2500 dlt = wavln_med_index(j) - wavln_med_index(j-1)
2501 fjm1 = (wavln_med_index(j) - wavln_med(j)) /dlt
2502 fj = (wavln_med(j) - wavln_med_index(j-1))/dlt
2503 tran_med(j) = fjm1*tran_med_index(j-1) + fj*tran_med_index(j)
2517 tran_std(i) = tran_o3_std(i) * tran_no2_std(i)
2520 DO i = npshif+1, np_std
2521 tran_std(i) = tran_std(i)*tran_med(i-npshif)
2538 ncvtot = 2 * ncvhf(j) - 1
2545 DO 1560 i = ncvhf(j), ncvtot
2547 exp( -const1*(float(i-ncvhf(j))*dwavln &
2549 sumins = sumins + finstr(i)
2552 DO 1565 i = 1, ncvhf(j)-1
2553 finstr(i) = finstr(ncvtot-i+1)
2554 sumins = sumins + finstr(i)
2557 sumins = sumins * dwavln
2559 DO 1570 i = 1, ncvtot
2560 finstr(i) = finstr(i)*dwavln/sumins
2572 CALL hunt(wavln_std, np_std, wavobs(j), ia)
2578 DO 1491 k = ia-(ncvhf(j)-1), ia+ncvhf(j)-1
2579 tran_ia = tran_ia + tran_std(k)* &
2580 finstr(k-ia+ncvhf(j))
2591 DO 1492 k = ia_p1-(ncvhf(j)-1), ia_p1+ncvhf(j)-1
2592 tran_iap1 = tran_iap1 + tran_std(k)* &
2593 finstr(k-ia_p1+ncvhf(j))
2598 dlt_ia = wavln_std(ia_p1) - wavln_std(ia)
2599 fia = (wavln_std(ia_p1) - wavobs(j)) /dlt_ia
2602 trncal(j) = fia*tran_ia + fia_p1*tran_iap1
2643 dimension trncal(1024)
2645 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
2646 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2647 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2648 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2649 COMMON /trancal1/ trncal,vaptt
2650 COMMON /chnlratio1/ r094,r114
2655 const1=const1+trncal(i)
2657 const1=const1/float(nb1)
2661 const2=const2+trncal(i)
2663 const2=const2/float(nb2)
2666 DO 575 i=istp94,iedp94
2667 const3=const3+trncal(i)
2669 const3=const3/float(nbp94)
2671 r094=const3/((wt1*const1) + (wt2*const2))
2675 const4=const4+trncal(i)
2677 const4=const4/float(nb3)
2681 const5=const5+trncal(i)
2683 const5=const5/float(nb4)
2686 DO 595 i=ist1p14,ied1p14
2687 const6=const6+trncal(i)
2689 const6=const6/float(nb1p14)
2691 r114=const6/((wt3*const4) + (wt4*const5))
2743 INTEGER LUN_IN, LUN_OUT, LUN_VAP, I_RET
2744 COMMON /inout_units/ lun_in, lun_out, lun_vap
2750 CHARACTER (LEN = 1000) :: FINAV,FOCUB,FOH2O
2751 INTEGER*2 BUFFER(8388608)
2752 INTEGER*2 H2OBUF(8388608)
2753 INTEGER SORDER,HDREC
2755 INTEGER I_Sample, J_Line
2761 INTEGER J, ISAMP, IBAND
2762 real*4 scalef,clmwvp
2764 dimension yirr(1024)
2765 COMMON /solar_irr1/yirr
2766 DATA pi/3.1415926535897/
2772 COMMON /proccube1/ yy
2773 COMMON /getinput11/hdrec,nsamps,nlines,nbands,sorder
2774 COMMON /getinput12/scalef
2777 COMMON /outcube/ focub
2778 COMMON /incube/ finav
2779 COMMON /outh2ovap/ foh2o
2780 COMMON /rjhdebug/ const1,const2,const3,const4,const5,const6, &
2782 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2783 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2784 open(90,file=
'atrem_yy_pix512line2000_before.txt',form=
'formatted'
2785 open(91,file=
'atrem_yy_pix512line2000_after.txt',form=
'formatted'
2804 DO 46 isamp= 1,nsamps
2805 offset = (isamp-1) * nbands
2806 DO 45 iband=1,nbands
2807 yy(iband) = buffer(offset + iband)
2811 IF((isamp.EQ.512).AND.(j.EQ.2000))
THEN
2814 49
WRITE(90,*) i,isamp,j,pi*yy(i)/(50*yirr(i))
2822 WRITE(91,
'(3i5,9F9.4,4I5)') i,isamp,j,yy(i), &
2823 r094co,r114co,const1,const2,const3, &
2824 const4,const5,const6,ja,jb,ist2,ied2
2831 DO 55 iband=1,nbands
2832 tbuf(iband)=scalef*yy(iband)
2833 buffer(offset + iband) = nint(tbuf(iband))
2839 h2obuf(isamp) = nint(1000.*clmwvp)
2908 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2909 dimension yirr(1024)
2912 dimension rotot(1050), ttot(1050), stot(1050)
2913 dimension finst2(100)
2915 dimension trncal(1024)
2918 dimension trncv(1024)
2920 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2921 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
2922 COMMON /getinput8/ imn,idy,iyr,ih,im,is
2923 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
2924 COMMON /init_speccal3/ nh2o
2925 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2926 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2927 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2928 COMMON /init_speccal10/ ncv2,ncvhf2,ncvtt2,istrt2,iend2,finst2
2929 COMMON /init_speccal11/ natot,nbtot,nctot,ndtot
2930 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2931 COMMON /trancal1/ trncal,vaptt
2932 COMMON /solar_irr1/yirr
2933 COMMON /proccube1/ yy
2934 COMMON /sixs1/ rotot, ttot, stot
2935 COMMON /rjhdebug/ const1,const2,const3,const4,const5,const6, &
2937 dimension g_vap(25), g_other(25)
2938 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
2941 CHARACTER (LEN = 80) :: NAME_INSTRU, NAMES(10)
2942 COMMON /getinput13/ name_instru,
names
2949 dimension speca(1024),specb(1024),specav(1024)
2957 DATA pi,dtorad /3.1415926,0.0174533/
2961 IF((name_instru.EQ.
names(1)).AND.(iyr.LE.2009))
THEN
2973 IF(iyr.LE.1989)
THEN
2980 IF((iyr.GE.1990).AND.(iyr.LE.1991))
THEN
2987 IF((iyr.GE.1992).AND.(iyr.LE.1994))
THEN
2994 IF((iyr.GE.1995).AND.(iyr.LE.2009))
THEN
3010 yy(i)=pi*yy(i)/(xfa*yirr(i))
3017 ELSE if ((nobs.GE.33).and.(nobs.LT.96))
THEN
3024 yy(i)=pi*yy(i)/(xfb*yirr(i))
3029 IF(nobs.GE.160)
THEN
3031 ELSE if ((nobs.GE.97).and.(nobs.LT.160))
THEN
3038 yy(i)=pi*yy(i)/(xfc*yirr(i))
3043 IF(nobs.GE.161)
THEN
3050 yy(i)=pi*yy(i)/(xfd*yirr(i))
3060 IF((name_instru.EQ.
names(1)).AND.(iyr.GE.2010))
THEN
3067 yy(i) = pi*yy(i) / (f_av_1 * yirr(i))
3071 yy(i) = pi*yy(i) / (f_av_2 * yirr(i))
3075 yy(i) = pi*yy(i) / (f_av_3 * yirr(i))
3082 IF(name_instru.EQ.
names(2))
THEN
3087 yy(i) = pi*yy(i) / (f_hydice * yirr(i))
3095 IF(name_instru.EQ.
names(3))
THEN
3100 yy(i) = pi*yy(i) / (f_hsi * yirr(i))
3108 IF(name_instru.EQ.
names(4))
THEN
3113 yy(i) = pi*yy(i) / (f_trwis * yirr(i))
3120 IF(name_instru.EQ.
names(6))
THEN
3126 yy(i) = pi*yy(i) / (f_hyperion_a * yirr(i))
3130 yy(i) = pi*yy(i) / (f_hyperion_b * yirr(i))
3137 IF(name_instru.EQ.
names(7))
THEN
3143 yy(i) = pi*yy(i) / (f_hico * yirr(i))
3150 IF(name_instru.EQ.
names(8))
THEN
3155 yy(i) = pi*yy(i) / (f_nis * yirr(i))
3162 IF(name_instru.EQ.
names(9))
THEN
3167 yy(i) = pi*yy(i) / (f_prism * yirr(i))
3180 const1=const1/float(nb1)
3186 const2=const2/float(nb2)
3189 DO 575 i=istp94,iedp94
3192 const3=const3/float(nbp94)
3194 r094co=const3/((wt1*const1) + (wt2*const2))
3197 IF(r094co.GT.1.0)
THEN
3200 const1=const1+1.0/yy(i)
3202 const1=const1/float(nb1)
3206 const2=const2+1.0/yy(i)
3208 const2=const2/float(nb2)
3211 DO 576 i=istp94,iedp94
3212 const3=const3+1.0/yy(i)
3214 const3=const3/float(nbp94)
3216 r094c=const3/((wt1*const1) + (wt2*const2))
3223 const4=const4/float(nb3)
3229 const5=const5/float(nb4)
3232 DO 595 i=ist1p14,ied1p14
3235 const6=const6/float(nb1p14)
3237 r114co=const6/((wt3*const4) + (wt4*const5))
3240 IF(r114co.GT.1.0)
THEN
3243 const4=const4+1.0/yy(i)
3245 const4=const4/float(nb3)
3249 const5=const5+1.0/yy(i)
3251 const5=const5/float(nb4)
3254 DO 596 i=ist1p14,ied1p14
3255 const6=const6+1.0/yy(i)
3257 const6=const6/float(nb1p14)
3259 r114c=const6/((wt3*const4) + (wt4*const5))
3262 CALL hunt(r0p94,nh2o,r094c,ja)
3263 IF (ja.GT.0.AND.ja.LT.60)
THEN
3264 dlta =r0p94(ja+1)-r0p94(ja)
3265 fja =(r0p94(ja+1)-r094c)/dlta
3266 fjap1 =(r094c-r0p94(ja))/dlta
3268 vaptta=fja*vaptot(ja)+fjap1*vaptot(ja+1)
3269 IF(r094co.GT.1.) vaptta=-vaptta
3271 IF(ja.LE.0) vaptta = vaptot(ja+1)
3272 IF(ja.GE.60) vaptta = vaptot(ja)
3275 IF(r094co.LE.1.)
THEN
3277 IF (ja.GT.0.AND.ja.LT.60)
THEN
3278 speca(i)=fja*trntbl(i,ja)+fjap1*trntbl(i,ja+1)
3280 IF(ja.LE.0) speca(i)=trntbl(i,ja+1)
3281 IF(ja.GE.60) speca(i)=trntbl(i,ja)
3286 IF(r094co.GT.1.)
THEN
3288 IF (ja.GT.0.AND.ja.LT.60)
THEN
3289 speca(i)=1.0/(fja*trntbl(i,ja)+fjap1*trntbl(i,ja+1))
3291 IF(ja.LE.0) speca(i)=1.0/trntbl(i,ja+1)
3292 IF(ja.GE.60) speca(i)=1.0/trntbl(i,ja)
3298 CALL hunt(r1p14,nh2o,r114c,jb)
3299 IF (jb.GT.0.AND.jb.LT.60)
THEN
3300 dltb =r1p14(jb+1)-r1p14(jb)
3301 fjb =(r1p14(jb+1)-r114c)/dltb
3302 fjbp1 =(r114c-r1p14(jb))/dltb
3304 vapttb=fjb*vaptot(jb)+fjbp1*vaptot(jb+1)
3305 IF(r114co.GT.1.) vapttb=-vapttb
3307 IF(jb.LE.0) vapttb = vaptot(jb+1)
3308 IF(jb.GE.60) vapttb = vaptot(jb)
3311 IF(r114co.LE.1.)
THEN
3313 IF (jb.GT.0.AND.jb.LT.60)
THEN
3314 specb(i)=fjb*trntbl(i,jb)+fjbp1*trntbl(i,jb+1)
3316 IF(jb.LE.0) specb(i)=trntbl(i,jb+1)
3317 IF(jb.GE.60) specb(i)=trntbl(i,jb)
3322 IF(r114co.GT.1.)
THEN
3324 IF (jb.GT.0.AND.jb.LT.60)
THEN
3325 specb(i)=1.0/(fjb*trntbl(i,jb)+fjbp1*trntbl(i,jb+1))
3327 IF(jb.LE.0) specb(i)=1.0/trntbl(i,jb+1)
3328 IF(jb.GE.60) specb(i)=1.0/trntbl(i,jb)
3334 clmwvp=0.5*(vaptta+vapttb)/g_vap_equiv
3338 specav(i)=0.5*(speca(i)+specb(i))
3341 yy(i) = yy(i) / specav(i)
3352 IF(dlt2.GT.dlt)
THEN
3356 DO 920 i=natot-2,natot+2
3357 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3360 DO 921 i=nbtot-2,nbtot+2
3361 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3364 DO 922 i=nctot-4,nctot+4
3365 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3368 DO 923 i=ndtot-7,nobs
3369 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3372 DO 3480 i=istrt2,iend2
3375 DO 3490 j=i-ncv2,i+ncv2
3376 trncv(i)=trncv(i)+yy(j)*finst2(j-ii+1)
3379 DO 3495 i=istrt2,iend2
3403 SUBROUTINE locate(xx,n,x,j)
3409 10
if(ju-jl.gt.1)
then
3411 if((xx(n).ge.xx(1)).eqv.(x.ge.xx(jm)))
then
3420 else if(x.eq.xx(n))
then
3445 SUBROUTINE cubspln(N,XORGN,YORGN,XINT,YINT)
3447 dimension xorgn(1050),yorgn(1050),y2(1050)
3448 dimension xint(1024),yint(1024)
3451 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
3460 CALL spline(xorgn,yorgn,n,yp1,ypn,y2)
3464 CALL splint(xorgn,yorgn,y2,n,x,y)
3500 subroutine spline(x,y,n,yp1,ypn,y2)
3503 real x(n),y(n),y2(n),u(nmax)
3504 real yp1,ypn,sig,p,qn,un
3505 if (yp1.gt..99e30)
then
3510 u(1)=(3./(x(2)-x(1)))*((y(2)-y(1))/(x(2)-x(1))-yp1)
3513 sig=(x(i)-x(i-1))/(x(i+1)-x(i-1))
3516 u(i)=(6.*((y(i+1)-y(i))/(x(i+1)-x(i))-(y(i)-y(i-1)) &
3517 /(x(i)-x(i-1)))/(x(i+1)-x(i-1))-sig*u(i-1))/p
3519 if (ypn.gt..99e30)
then
3524 un=(3./(x(n)-x(n-1)))*(ypn-(y(n)-y(n-1))/(x(n)-x(n-1)))
3526 y2(n)=(un-qn*u(n-1))/(qn*y2(n-1)+1.)
3528 y2(k)=y2(k)*y2(k+1)+u(k)
3559 subroutine splint(xa,ya,y2a,n,x,y)
3561 real xa(n),ya(n),y2a(n)
3565 1
if (khi-klo.gt.1)
then
3575 if (h.eq.0.) stop
'bad xa input.'
3578 y=a*ya(klo)+b*ya(khi)+ &
3579 ((a**3-a)*y2a(klo)+(b**3-b)*y2a(khi))*(h**2)/6.
3600 SUBROUTINE hunt(xx,n,x,jlo)
3605 ascnd=xx(n).ge.xx(1)
3606 if(jlo.le.0.or.jlo.gt.n)
then
3612 if(x.ge.xx(jlo).eqv.ascnd)
then
3616 else if(x.ge.xx(jhi).eqv.ascnd)
then
3626 else if(x.lt.xx(jlo).eqv.ascnd)
then
3632 3
if(jhi-jlo.eq.1)
then
3633 if(x.eq.xx(n))jlo=n-1
3638 if(x.ge.xx(jm).eqv.ascnd)
then
3664 SUBROUTINE suncor(IDAY,MONTH,IYR,TZ,DEC,HAZ)
3667 fjd=0.5+tz/6.283185307
3686 SUBROUTINE solcor(JD,FJD,RAS,DECS,GSDT,BZRO,P,SOLONG)
3691 g=-.026601523+.01720196977*d-1.95e-15*d*d -2.*pi*iyr
3692 xlms=4.881627938+.017202791266*d+3.95e-15*d*d-2.*pi*iyr
3693 obl=.409319747-6.2179e-9*d
3694 ecc=.01675104-1.1444e-9*d
3696 gsdt=1.739935476+2.*pi*
f/365.25+1.342027e-4*d/365.25
3697 gsdt=gsdt+6.2831853*(fjd-0.5)
3698 xlts=xlms+2.*ecc*sin(g)+1.25*ecc*ecc*sin(2.*g)
3699 sndc=sin(xlts)*sin(obl)
3701 csra=cos(xlts)/cos(decs)
3703 IF(sin(xlts).LT.0.) ras=2.*pi-ras
3704 omega=1.297906+6.66992e-7*d
3706 bzro=asin(.126199*sin(thetac))
3707 p=-atan(cos(xlts)*tan(obl))-atan(.127216*cos(thetac))
3708 xlmm=atan2(.992005*sin(thetac),cos(thetac))
3710 irot=(jdr+fjd)/25.38
3711 frot=(jdr+fjd)/25.38-irot
3712 solong=xlmm-2.*pi*frot+pi-3.e-4
3713 IF(solong.LT.0.) solong=solong+2.*pi
3714 IF(solong.GT.(2.*pi)) solong=solong-2.*pi
3734 FUNCTION julian(IDAY,MONTH,IYR)
3739 DATA md/0,31,59,90,120,151,181,212,243,273,304,334/
3741 IF(iyr.LT.100) iyr=iyr+1900
3745 i3=(jyr-400*i1-100*i2)/4
3746 julian=2305447+365*jyr+97*i1+24*i2+i3
3748 IF(mod(jyr,4).EQ.0)
leap=1
3749 IF(mod(jyr,100).EQ.0)
leap=0
3750 IF(mod(jyr,400).EQ.0)
leap=1
3771 SUBROUTINE hazel (H,D,A,E,XLAT)
3781 sne = sin(d)*sin(xlat)+cos(d)*cos(xlat)*cos(h)
3784 csa=(sin(xlat)*cos(h)*cos(d)-sin(d)*cos(xlat))
3807 dimension
list(1024)
3812 IF(
list(i).GT.elem)
GOTO 470
3817 IF (diff1.LT.diff2)
THEN