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
405 dimension h(25), t(25), p(25), vmr(25)
406 dimension wavobs(1024),fwhm(1024)
407 dimension tpvmr(7,81)
408 CHARACTER*1 LATHEM, LNGHEM
410 CHARACTER (LEN = 1000) :: FINAV,FOCUB,FOH2O
415 CHARACTER (LEN = 1000) :: FINPWV,FTPVMR
417 CHARACTER (LEN = 1000) :: FOUT1
421 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
422 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
423 COMMON /getinput4/ wavobs,fwhm
424 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
425 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
426 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
427 COMMON /getinput8/ imn,idy,iyr,ih,im,is
428 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
429 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
430 COMMON /getinput11/hdrec,nsamps,nlines,nbands,sorder
431 COMMON /getinput12/scalef
432 COMMON /tpvmr_init1/ tpvmr
435 COMMON /outcube/ focub
436 COMMON /incube/ finav
437 COMMON /outh2ovap/ foh2o
440 CHARACTER (LEN = 80) :: NAME_INSTRU, NAMES(10)
441 COMMON /getinput13/ name_instru,
names
444 COMMON /getinput14/ xpss, xppp
446 REAL XVIEWD, XVIEWM, XVIEWS
447 REAL XAZMUD, XAZMUM, XAZMUS
448 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
453 READ(5,627) name_instru
464 names(4) =
'TRWIS-III'
466 names(6) =
'Hyperion'
473 print*,
'Instrument Name: ', name_instru
481 READ (5,*) imn,idy,iyr,ih,im,is
482 IF((imn.LT.1).OR.(imn.GT.12).OR.(idy.LT.1).OR.(idy.GT.31).OR.
483 & (iyr.LT.1987).OR.(iyr.GT.2020))
THEN
484 WRITE(*,*)
'Invalid date:',imn,idy,iyr
485 WRITE(*,*)
'Format is MM DD YYYY where 0<MM<12, 0<DD<32,
489 IF((ih.LT.0).OR.(ih.GT.24).OR.(im.LT.0).OR.(im.GT.60).OR.
490 & (is.LT.0).OR.(is.GT.60))
THEN
491 WRITE(*,*)
'Invalid time:',ih,im,is
492 WRITE(*,*)
'Format is HH MM SS where 0<HH<24, 0<MM<60, SS<60.'
497 READ (5,*) xlatd,xlatm,xlats
498 IF((xlatd.GT.90).OR.(xlatm.GT.60).OR.(xlats.GT.60))
THEN
499 WRITE(*,*)
'Invalid latitude:',xlatd,xlatm,xlats
500 WRITE(*,*)
'Format: degrees minutes seconds'
501 WRITE(*,*)
'Valid values are degrees < 90, minutes < 60,
509 IF((lathem.NE.
'N').AND.(lathem.NE.
'S'))
THEN
510 WRITE(*,*)
'Invalid hemisphere value:',lathem
511 WRITE(*,*)
'Valid values are "N" or "S".'
516 READ (5,*) xlongd,xlongm,xlongs
517 IF((xlongd.GT.180).OR.(xlongm.GT.60).OR.(xlongs.GT.60))
THEN
518 WRITE(*,*)
'Invalid longitude:',xlongd,xlongm,xlongs
519 WRITE(*,*)
'Format: degrees minutes seconds'
520 WRITE(*,*)
'Valid values are degrees < 180 minutes < 60,
527 IF((lnghem.NE.
'E').AND.(lnghem.NE.
'W'))
THEN
528 WRITE(*,*)
'Invalid hemisphere:',lnghem
529 WRITE(*,*)
'Valid values are "E" or "W".'
534 READ (5,*) xviewd,xviewm,xviews
535 IF((xviewd.GT.90).OR.(xviewm.GT.60).OR.(xviews.GT.60))
THEN
536 WRITE(*,*)
'Invalid latitude:',xviewd,xviewm,xviews
537 WRITE(*,*)
'Format: degrees minutes seconds'
538 WRITE(*,*)
'Valid values are degrees < 90, minutes < 60,
545 READ (5,*) xazmud,xazmum,xazmus
546 IF((xazmud.GT.360.).OR.(xazmum.GT.60).OR.(xazmus.GT.60))
THEN
547 WRITE(*,*)
'Invalid view azimuth ang.:',xazmud,xazmum,xazmus
548 WRITE(*,*)
'Format: degrees minutes seconds'
549 WRITE(*,*)
'Valid values are degrees < 360, minutes < 60,
559 IF((dlt.LT.0.0005).OR.(dlt.GT.0.1))
THEN
560 WRITE(*,*)
'Invalid spectral resolution value:',dlt
561 WRITE(*,*)
'Valid values are 0.0005-0.1 micron.'
575 OPEN(11,file=finpwv,status=
'OLD',iostat=istat)
577 WRITE(*,*)
'wavelength file did not open
578 &successfully:',finpwv
589 READ(11,*,
END=520) X,WAVOBS(I)
591 READ(11,*,
END=520) X,WAVOBS(I), FWHM(I)
600 IF((ans.NE.0).AND.(ans.NE.1))
THEN
601 WRITE(*,*)
'Invalid value to indicate whether the channel ratio
602 & parameters should be read:',ans
603 WRITE(*,*)
'Valid values: 0=no 1=yes.'
617 114
READ(*,*)wndow1, nb1, wndow2, nb2, wp94c, nbp94
619 IF((wndow1.LT.0.6).OR.(wndow1.GT.2.5))
THEN
620 WRITE(*,*)
'Invalid wavelength position for first atmospheric
621 & window in the .94-um region:',wndow1
622 WRITE(*,*)
'Valid values are 0.6-2.5.'
626 IF((nb1.LT.1).OR.(nb1.GT.50))
THEN
627 WRITE(*,*)
'Invalid number of channels for first wavelength
628 &position in the .94-um region:',nb1
629 WRITE(*,*)
'Valid values are 1-50.'
633 IF((wndow2.LT.0.6).OR.(wndow2.GT.2.5))
THEN
634 WRITE(*,*)
'Invalid wavelength position for second atmospheric
635 & window in the .94-um region:',wndow2
636 WRITE(*,*)
'Valid values are 0.6-2.5.'
640 IF((nb2.LT.1).OR.(nb2.GT.50))
THEN
641 WRITE(*,*)
'Invalid number of channels for second wavelength
642 &position in the .94-um region:',nb2
643 WRITE(*,*)
'Valid values are 1-50.'
647 IF((wp94c.LE.wndow1).OR.(wp94c.GE.wndow2))
THEN
648 WRITE(*,*)
'Invalid water vapor wavelength position for
649 & the .94-um region:',wp94c
650 WRITE(*,*)
'Valid range is:',wndow1,
' < value < ',
655 IF((nbp94.LT.1).OR.(nbp94.GT.90))
THEN
656 WRITE(*,*)
'Invalid number of channels for water vapor
657 &wavelength position in the .94-um region:',nbp94
658 WRITE(*,*)
'Valid values are 1-90.'
673 READ(*,*)wndow3, nb3, wndow4, nb4, w1p14c, nb1p14
675 IF((wndow3.LT.0.6).OR.(wndow3.GT.2.5))
THEN
676 WRITE(*,*)
'Invalid wavelength position for first atmospheric
677 & window in the 1.14-um region:',wndow3
678 WRITE(*,*)
'Valid values are 0.6-2.5'
682 IF((nb3.LT.1).OR.(nb3.GT.50))
THEN
683 WRITE(*,*)
'Invalid number of channels for first wavelength
684 &position in the 1.14-um region:',nb3
685 WRITE(*,*)
'Valid values are 1-50.'
689 IF((wndow4.LT.0.6).OR.(wndow4.GT.2.5))
THEN
690 WRITE(*,*)
'Invalid wavelength position for second atmospheric
691 & window in the 1.14-um region:',wndow4
692 WRITE(*,*)
'Valid values are 0.6-2.5'
696 IF((nb4.LT.1).OR.(nb4.GT.50))
THEN
697 WRITE(*,*)
'Invalid number of channels for second wavelength
698 &position in the 1.14-um region:',nb4
699 WRITE(*,*)
'Valid values are 1-50.'
703 IF((w1p14c.LE.wndow3).OR.(w1p14c.GE.wndow4))
THEN
704 WRITE(*,*)
'Invalid water vapor wavelength position for
706 WRITE(*,*)
'Valid range is:',wndow3,
' < value <',
711 IF((nb1p14.LT.1).OR.(nb1p14.GT.110))
THEN
712 WRITE(*,*)
'Invalid number of channels for water vapor
713 &wavelength position in the 1.14-um region:',nb1p14
714 WRITE(*,*)
'Valid values are 1-110.'
745 IF((model.LT.1).OR.(model.GT.7))
THEN
746 WRITE(*,*)
'Invalid atmospheric model value:',model
747 WRITE(*,*)
'Valid values are 1-7.'
756 OPEN(20,file=ftpvmr,status=
'OLD',iostat=istat)
758 WRITE(*,*)
'Atmospheric model file did not open
759 & successfully:',ftpvmr
765 IF((nb.LE.0).OR.(nb.GT.25))
THEN
766 WRITE(*,*)
'Invalid number of boundaries:',nb
767 WRITE(*,*)
'Valid values are 1-25.'
771 READ(20,*) h(i),p(i),t(i),vmr(i)
773 CLOSE(20,iostat=istat)
780 h(i) = tpvmr(model,2+(4*(i-1)))
781 p(i) = tpvmr(model,3+(4*(i-1)))
782 t(i) = tpvmr(model,4+(4*(i-1)))
783 vmr(i) = tpvmr(model,5+(4*(i-1)))
806 READ(*,*)ih2ovp, ico2, io3, in2o, ico, ich4, io2, ino2
807 IF((ih2ovp.NE.0).AND.(ih2ovp.NE.1))
THEN
808 WRITE(*,*)
'Invalid selection for H2O vapor:',ih2ovp
809 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
813 IF((ico2.NE.0).AND.(ico2.NE.1))
THEN
814 WRITE(*,*)
'Invalid selection for CO2:',ico2
815 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
819 IF((io3.NE.0).AND.(io3.NE.1))
THEN
820 WRITE(*,*)
'Invalid selection for O3:',io3
821 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
825 IF((in2o.NE.0).AND.(in2o.NE.1))
THEN
826 WRITE(*,*)
'Invalid selection for N2O:',in2o
827 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
831 IF((ico.NE.0).AND.(ico.NE.1))
THEN
832 WRITE(*,*)
'Invalid selection for CO:',ico
833 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
837 IF((ich4.NE.0).AND.(ich4.NE.1))
THEN
838 WRITE(*,*)
'Invalid selection for CH4:',ich4
839 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
843 IF((io2.NE.0).AND.(io2.NE.1))
THEN
844 WRITE(*,*)
'Invalid selection for O2:',io2
845 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
849 IF((ino2.NE.0).AND.(ino2.NE.1))
THEN
850 WRITE(*,*)
'Invalid selection for NO2:',ino2
851 WRITE(*,*)
'Valid values: 0=no, 1=yes.'
859 IF((vrto3.LT.0.1).OR.(vrto3.GT.0.6))
THEN
860 WRITE(*,*)
'Invalid vertical column amount of ozone:',vrto3
861 WRITE(*,*)
'Valid values are 0.1-0.6.'
862 WRITE(*,*)
'Reasonable values are 0.28-0.55.'
873 IF((iaer.LT.0).OR.(iaer.GT.6))
THEN
874 WRITE(*,*)
'Invalid aerosol model value:',iaer
875 WRITE(*,*)
'Valid values are 0-3.'
883 IF((v.LT.0).OR.(v.GT.300))
THEN
884 WRITE(*,*)
'Invalid visibility value:',v
885 WRITE(*,*)
'Value must be greater than 0 and less than 300.'
892 IF((taer55.GT.10.).OR.(taer55.LE.0))
THEN
893 WRITE(*,*)
'Invalid aerosol optical depth at 550 nm: ',taer55
894 WRITE(*,*)
'Valid values are between 0 and 10.'
904 IF((hsurf.LT.0).OR.(hsurf.GT.h(nb-1)))
THEN
905 WRITE(*,*)
'Invalid surface elevation value:',hsurf
906 WRITE(*,*)
'Value must be less than the maximum elevation in
907 & the atmospheric model.'
912 IF(xppp .LT. hsurf)
THEN
913 WRITE(*,*)
'Invalid plane altitude:',xppp
914 WRITE(*,*)
'Plane altitude must be greater than the bottom
915 & surface elevation.'
926 CALL openinfile(lun_in, i_ret)
929 WRITE(*,*)
'Input image file did not open
930 & successfully:',finav
937 IF((ans.NE.0).AND.(ans.NE.1))
THEN
938 WRITE(*,*)
'Invalid value to indicate whether the cube
939 & dimensions should be read:',ans
940 WRITE(*,*)
'Valid values: 0=no 1=yes.'
946 READ(*,*) hdrec, nsamps, nlines, nbands, sorder
947 IF ((hdrec.LT.0).OR.(nsamps.LE.0).OR.
948 & (nlines.LE.0).OR.(nbands.LE.0).OR.
949 & (sorder.LE.0).OR.(sorder.GT.2))
THEN
950 WRITE(*,*)
'Invalid cube parameters:',hdrec,nsamps,nlines,
952 WRITE(*,*)
'Values must be greater than or equal to 1 and
953 &the storage order must be less than 3.'
954 WRITE(*,*)
'Storage Order (0=BSQ, 1=BIP, 2=BIL)'
955 WRITE(*,*)
' 0 = BSQ is not supported in this version of ATREM'
972 CALL openoutfile(lun_out, i_ret)
975 WRITE(*,*)
'Output image file did not open
976 & successfully:',focub
982 IF((dlt2.LT.0.).OR.(dlt2.GT.100.))
THEN
983 WRITE(*,*)
'Invalid output resolution value:',dlt2
984 WRITE(*,*)
'Valid values are 0-100 nm.'
990 IF((scalef.LT.1.).OR.(scalef.GT.32000.))
THEN
991 WRITE(*,*)
'Invalid output resolution value:',scalef
992 WRITE(*,*)
'Valid values are 1-32000 nm.'
1001 CALL openvapfile(lun_vap, i_ret)
1004 WRITE(*,*)
'Output water vapor file did not open
1005 & successfully:',foh2o
1014 OPEN(35,file=fout1,status=
'UNKNOWN',iostat=istat)
1016 WRITE(*,*)
'Output file did not open successfully:',fout1
1020 IF(good_data .NEQV. .true.)
THEN
1021 WRITE(*,*)
'**** ERROR: Invalid input detected. ****'
1076 include
'COMMONS_INC'
1079 dimension h(25), t(25), p(25), vmr(25)
1081 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1082 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
1083 COMMON /model_adj1/ clmvap,q
1085 dimension hp(25), tp(25), pp(25), vmrp(25)
1086 COMMON /model_adj2/ hp, tp, pp, vmrp
1087 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer,
1088 & dp_plane, dp_layer, clmvapp
1089 COMMON /model_adj4/ k_surf
1092 COMMON /getinput14/ xpss, xppp
1113 310 vmr(i)=vmr(i)*1.0e-06
1120 7455
IF(hsurf.EQ.h(i)) hsurf=h(i)+0.0001
1123 CALL locate(h,nb,hsurf,k)
1131 5237
FORMAT(2x,
'***WARNING: Surface elevation smaller then lowest'/
1132 & 2x,
'boundary of the model atmosphere.')
1143 tsurf=t(k)+(dhs/dhk)*(t(k+1)-t(k))
1144 vmrs =vmr(k)+(dhs/dhk)*(vmr(k+1)-vmr(k))
1147 psurf=p(k)*exp(-alog(p(k)/p(k+1))*dhs/dhk)
1178 damtvt=q*(p(i)-p(i+1))*(vmr(i)+vmr(i+1))/2.0
1179 amtvrt=amtvrt+damtvt
1182 clmvap=amtvrt/3.34e+22
1184 WRITE(*,*)
'Column vapor amount in model atmosphere from ground'
1185 WRITE(*,*)
' to space = ', clmvap,
' cm'
1211 IF(hplane.GE.100.0) hplane = 100. - 0.0001
1214 IF(hplane.GT.hp(1))
THEN
1219 7456
IF(hplane.EQ.hp(i)) hplane=hp(i)-0.0001
1222 CALL locate(hp,nb,hplane,kk)
1226 5239
FORMAT(2x,
'***WARNING: Plane altitude less then lowest'/
1227 & 2x,
'boundary of the model atmosphere.')
1232 dhkk = hp(kk+1) - hp(kk)
1233 dhss = hplane - hp(kk)
1236 tplane = tp(kk) + (dhss/dhkk)*(tp(kk+1)-tp(kk))
1237 vmrsp = vmrp(kk) + (dhss/dhkk)*(vmrp(kk+1)-vmrp(kk))
1240 pplane = pp(kk)*exp(-alog(pp(kk)/pp(kk+1))*dhss/dhkk)
1264 damtvtp=q*(pp(i)-pp(i+1))*(vmrp(i)+vmrp(i+1))/2.0
1265 amtvrtp=amtvrtp+damtvtp
1268 clmvapp=amtvrtp/3.34e+22
1270 WRITE(*,*)
'Column vapor below plane (CLMVAPP) = ',
1282 dvap_plane = q*(pp(k_plane) - pp(k_plane+1))*
1283 & (vmrp(k_plane) + vmrp(k_plane+1))/2.0 / 3.34e+22
1285 dvap_layer = q*(p(k_plane) - p(k_plane+1))*
1286 & (vmr(k_plane) + vmr(k_plane+1))/2.0 / 3.34e+22
1288 dp_plane = pp(k_plane) - pp(k_plane+1)
1289 dp_layer = p(k_plane) - p(k_plane+1)
1331 include
'COMMONS_INC'
1333 dimension vapvrt(60), vap_slant(60)
1336 dimension h(25), t(25), p(25), vmr(25)
1337 CHARACTER*1 LATHEM,LNGHEM
1344 DATA vapvrt/.00, .02, .06, .11, .16, .21, .26, .31, .36, .40,
1345 & .43, .46, .50, .54, .58, .62, .66, .70, .75, .80,
1346 & .86, .92, .98, 1.06,1.14, 1.22, 1.3, 1.4, 1.5, 1.6,
1347 & 1.7, 1.8, 1.9, 2.05, 2.2, 2.35, 2.55, 2.75, 2.95, 3.2,
1348 & 3.5, 3.8, 4.1, 4.4, 4.7, 5.0, 5.3, 5.6, 6.0, 6.4,
1349 & 7.0, 7.7, 8.5, 9.4,10.4, 11.6, 13.0, 15.0, 25.0, 50./
1351 DATA md/0,31,59,90,120,151,181,212,243,273,304,334/
1353 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1355 COMMON /getinput8/ imn,idy,iyr,ih,im,is
1356 COMMON /getinput9/ xlatd,xlatm,xlats,lathem
1357 COMMON /getinput10/xlongd,xlongm,xlongs,lnghem
1358 COMMON /model_adj1/ clmvap,q
1359 COMMON /geometry1/ solzni,solaz,obszni,obsphi,iday
1360 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1362 COMMON /model_adj3/ k_plane, dvap_plane, dvap_layer,
1363 & dp_plane, dp_layer, clmvapp
1365 dimension g_vap(25), g_other(25)
1366 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
1369 COMMON /getinput14/ xpss, xppp
1371 REAL XVIEWD, XVIEWM, XVIEWS
1372 REAL XAZMUD, XAZMUM, XAZMUS
1373 COMMON /getinput15/ xviewd,xviewm,xviews, xazmud,xazmum,xazmus
1383 vap_slant(i) = vapvrt(i) * 2.0
1389 tt=6.28318*((xh)/24+xm/1440+xs/86400)
1391 xlat = xlatd + xlatm/60.0 + xlats/3600.0
1392 xlong = xlongd + xlongm/60.0 + xlongs/3600.0
1396 IF(lathem.NE.
'N') xlat = -xlat
1397 IF(lnghem.NE.
'W') xlong = -xlong
1399 325 xlatr = xlat/57.2958
1400 xlongr = xlong/57.2958
1402 CALL suncor(idy,imn,iyr,
tt,dec,haz)
1403 CALL hazel(haz+
tt-xlongr,dec,solaz,el,xlatr)
1406 IF (el .LE. 0.)
THEN
1407 WRITE(*,*)
'ERROR: Sun is below the horizon!!!'
1408 WRITE(*,*)
'Check input date, time, latitude and longitude.'
1413 obszni = xviewd + xviewm/60.0 + xviews/3600.0
1414 obsphi = xazmud + xazmum/60.0 + xazmus/3600.0
1416 print*,
'OBSZNI = ',obszni,
' OBSPHI = ',obsphi,
' degrees'
1418 obszni = obszni / 57.2958
1419 obsphi = obsphi / 57.2958
1421 solzni = 90.0/57.2958 - el
1423 ggeom = 1./cos(solzni) + 1./cos(obszni)
1428 IF(hplane.LT.27.) go3 = ggeom - 1./cos(obszni)
1438 totlo3 = go3 * vrto3
1448 DO i = 1, k_plane - 1
1454 DO i = k_plane + 1, 25
1455 g_vap(i) = ggeom - 1./cos(obszni)
1456 g_other(i) = ggeom - 1./cos(obszni)
1461 g_vap(k_plane) = ggeom - 1./cos(obszni)
1462 & + dvap_plane/dvap_layer/cos(obszni)
1463 g_other(k_plane) = ggeom - 1./cos(obszni)
1464 & + dp_plane/dp_layer/cos(obszni)
1475 vap_slant_mdl = clmvap/cos(solzni) + clmvapp/cos(obszni)
1476 print*,
'VAP_SLANT_MDL =', vap_slant_mdl,
' cm'
1481 g_vap_equiv = vap_slant_mdl / clmvap
1485 ssh2o(i) = vap_slant(i) / vap_slant_mdl
1491 iday = md(imn) + idy
1492 lpyr = iyr - (4 * (iyr/4))
1493 IF((lpyr.EQ.0).AND.(iday.GT.59).AND.(imn.NE.2)) iday = iday + 1
1591 include
'COMMONS_INC'
1594 dimension h(25), t(25), p(25), vmr(25)
1596 dimension wavobs(1024),fwhm(1024)
1597 dimension dp(25), pm(25), tm(25), vmrm(25)
1598 dimension finst2(100)
1602 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
1603 COMMON /getinput3/ h,t,p,vmr,nb,nl,model,iaer,v,taer55,vrto3,sno2
1604 COMMON /getinput4/ wavobs,fwhm
1605 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
1606 COMMON /getinput6/ wndow1,wndow2,wp94c,wndow3,wndow4,w1p14c
1607 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
1608 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
1609 COMMON /model_adj1/ clmvap,q
1611 COMMON /init_speccal3/ nh2o
1612 COMMON /init_speccal5/ dp,pm,tm,vmrm
1613 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
1614 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
1615 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
1617 COMMON /init_speccal10/ ncv2,ncvhf2,ncvtt2,istrt2,iend2,finst2
1618 COMMON /init_speccal11/ natot,nbtot,nctot,ndtot
1620 dimension g_vap(25), g_other(25)
1621 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
1623 dimension o3cf(5001)
1624 COMMON /o3cf_init1/ o3cf
1626 dimension tran_o3_std(5001)
1627 COMMON /init_speccal16/ tran_o3_std
1629 dimension rno2cf(5001)
1630 COMMON /no2cf_init1/ rno2cf
1632 dimension tran_no2_std(5001)
1633 COMMON /init_speccal17/ tran_no2_std
1635 COMMON /model_adj4/ k_surf
1650 wavno_hi(i) = 3000. + float(i-1)*dwavno
1659 wavln_med(i) = vstart + float(i-1)*dwavln
1670 wavln_std(i) = 0.3 + float(i-1)*dwavln
1684 index_med(i) = ( (10000./wavln_med(i) - 3000.)/dwavno + 1.)
1695 wavln_med_index(i) = 10000. /(float(index_med(i)-1)*dwavno
1705 fwhm_wavno(i) = 10000.*dlt_med
1706 & /(wavln_med_index(i)*wavln_med_index(i))
1715 ncvhf_wavno(i) = ( facdlt * fwhm_wavno(i) / dwavno + 1.)
1727 ncvhf(i) = ( facdlt * fwhm(i) / dwavln + 1.)
1741 IF(dwvavr.LT.fwhm(i)) dwvavr = fwhm(i)
1749 cons2=dlt2*sqrt(3.1415926/const1)
1751 IF (dlt2 .NE. 0.0)
THEN
1753 DO 585 i=ncvhf2,ncvtt2
1754 finst2(i)=exp(-const1*(float(i-ncvhf2)*dwvavr/dlt2)**2.0)
1755 sumins=sumins+finst2(i)
1759 finst2(i)=finst2(ncvtt2-i+1)
1760 sumins=sumins+finst2(i)
1763 sumins=sumins*dwvavr
1766 finst2(i)=finst2(i)*dwvavr/sumins
1783 nctot=nchnla+nchnlb+nchnlc
1784 ndtot=nchnla+nchnlb+nchnlc+nchnld
1791 wndow1=wavobs(iwndw1)
1792 wndow2=wavobs(iwndw2)
1795 IF(jj.EQ.0) nb1=nb1+1
1797 IF(kk.EQ.0) nb2=nb2+1
1807 wp94c=wavobs(iwp94c)
1810 IF(ll.EQ.0) nbp94=nbp94+1
1812 istp94=iwp94c-nb3haf
1813 iedp94=iwp94c+nb3haf
1815 wt1=(wndow2-wp94c)/(wndow2-wndow1)
1816 wt2=(wp94c-wndow1)/(wndow2-wndow1)
1821 wndow3=wavobs(iwndw4)
1822 wndow4=wavobs(iwndw5)
1825 IF(jj.EQ.0) nb3=nb3+1
1827 IF(kk.EQ.0) nb4=nb4+1
1838 w1p14c=wavobs(iw1p14c)
1840 IF(ll.EQ.0) nb1p14=nb1p14+1
1842 ist1p14=iw1p14c-nb6haf
1843 ied1p14=iw1p14c+nb6haf
1845 wt3=(wndow4-w1p14c)/(wndow4-wndow3)
1846 wt4=(w1p14c-wndow3)/(wndow4-wndow3)
1857 tran_o3_std(i) = exp(-totlo3*o3cf(i))
1867 tran_o3_std(i) = 1.0
1876 vrtno2 = sno2 * vrtno2
1879 totno2 = gno2 * vrtno2
1883 tran_no2_std(i) = exp(-totno2*rno2cf(i))
1904 tran_no2_std(i) = 1.0
1914 pm(i)=(p(i)+p(i+1))/2.0
1915 tm(i)=(t(i)+t(i+1))/2.0
1936 tran_hi_others(i) = 1.0
1945 vmrm(i)=sclco2*355.0*1.0e-06
1949 vmrm(i)= vmrm(i)*g_other(i)
1952 OPEN(31,file=
'abscf_co2_PC',status=
'old',
1953 & form=
'unformatted',access=
'direct',recl=4*300000)
1955 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
1958 READ(31,rec=j+1) (a(i), i = 1, 300000)
1961 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
1962 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
1963 & 6.0225e+23 / 1.0e-06)
1976 vmrm(i)= vmrm(i)*g_other(i)
1979 OPEN(31,file=
'abscf_n2o_PC',status=
'old',
1980 & form=
'unformatted',access=
'direct',recl=4*300000)
1982 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
1985 READ(31,rec=j+1) (a(i), i = 1, 300000)
1988 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
1989 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
1990 & 6.0225e+23 / 1.0e-06)
2002 vmrm(i)= vmrm(i)*g_other(i)
2005 OPEN(31,file=
'abscf_co_PC',status=
'old',
2006 & form=
'unformatted',access=
'direct',recl=4*300000)
2008 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2011 READ(31,rec=j+1) (a(i), i = 1, 300000)
2014 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2015 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2016 & 6.0225e+23 / 1.0e-06)
2041 vmrm(i)=sclch4*1.6*1.0e-06
2042 vmrm(i)= vmrm(i)*g_other(i)
2045 OPEN(31,file=
'abscf_ch4_PC',status=
'old',
2046 & form=
'unformatted',access=
'direct',recl=4*300000)
2048 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2051 READ(31,rec=j+1) (a(i), i = 1, 300000)
2054 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2055 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2056 & 6.0225e+23 / 1.0e-06)
2068 vmrm(i)= vmrm(i)*g_other(i)
2071 OPEN(31,file=
'abscf_o2_PC',status=
'old',
2072 & form=
'unformatted',access=
'direct',recl=4*300000)
2074 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2077 READ(31,rec=j+1) (a(i), i = 1, 300000)
2080 tran_hi_others(i) = tran_hi_others(i) * exp( - a(i)*q*
2081 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * 28.966 /
2082 & 6.0225e+23 / 1.0e-06)
2096 vmrm(i) = (vmr(i)+vmr(i+1))/2.0
2100 vmrm(i) = vmrm(i)*g_vap(i)
2157 include
'COMMONS_INC'
2160 dimension trncal(1024)
2161 dimension wavobs(1024),fwhm(1024)
2162 dimension dp(25), pm(25), tm(25), vmrm(25)
2164 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2166 dimension o3cf(5001)
2167 COMMON /o3cf_init1/ o3cf
2169 COMMON /getinput1/ ih2ovp,ico2,io3,in2o,ico,ich4,io2,ino2
2170 COMMON /getinput4/ wavobs,fwhm
2171 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2172 COMMON /init_speccal3/ nh2o
2173 COMMON /init_speccal5/ dp,pm,tm,vmrm
2175 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2176 COMMON /trancal1/ trncal,vaptt
2177 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
2178 COMMON /chnlratio1/ r094,r114
2193 trntbl(j,i)=trncal(j)
2203 WRITE(35,77) (vaptot(i+(kk-1)*10),i=1,10)
2204 77
FORMAT(7x,10(1x,e11.4))
2205 WRITE(35,77) ( r0p94(i+(kk-1)*10),i=1,10)
2206 WRITE(35,77) ( r1p14(i+(kk-1)*10),i=1,10)
2208 385
WRITE(35,78) wavobs(ii),(trntbl(ii,i+(kk-1)*10),i=1,10)
2209 78
FORMAT(1x,f6.4,10(1x,e11.4))
2212 WRITE(35,77) (vaptot(i+nk*10),i=1,njdiff)
2213 WRITE(35,77) ( r0p94(i+nk*10),i=1,njdiff)
2214 WRITE(35,77) ( r1p14(i+nk*10),i=1,njdiff)
2216 IF(njdiff.GE.1)
THEN
2218 386
WRITE(35,78) wavobs(ii),(trntbl(ii,i+nk*10),i=1,njdiff)
2220 CLOSE(35,iostat=istat)
2256 include
'COMMONS_INC'
2259 dimension trncal(1024)
2260 dimension wavobs(1024),fwhm(1024)
2261 dimension dp(25), pm(25), tm(25), vmrm(25)
2262 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2265 dimension trans(1024)
2266 dimension trncv(1024)
2267 dimension trnstd_sm(1050)
2270 COMMON /getinput4/ wavobs,fwhm
2271 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2272 COMMON /model_adj1/ clmvap,q
2273 COMMON /init_speccal5/ dp,pm,tm,vmrm
2274 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2275 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2276 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2277 COMMON /trancal1/ trncal,vaptt
2279 dimension g_vap(25), g_other(25)
2280 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
2282 COMMON /model_adj4/ k_surf
2291 OPEN(31,file=
'abscf_h2o_PC',status=
'old',
2292 & form=
'unformatted',access=
'direct',recl=4*300000)
2294 READ(31,rec=1) (wavno_hi(i), i = 1, 300000)
2297 READ(31,rec=j+1) (a(i), i = 1, 300000)
2300 tran_hi(i) = tran_hi(i) * exp( - a(i) * q *
2301 & dp(j-k_surf+1)*vmrm(j-k_surf+1) * sh2o * 28.966 /
2302 & 6.0225e+23 / 1.0e-06)
2313 tran_hi(i) = tran_hi(i) * tran_hi_others(i)
2329 vaptt = vap_slant_mdl * sh2o
2358 include
'COMMONS_INC'
2360 dimension tran_o3_std(5001)
2361 COMMON /init_speccal16/ tran_o3_std
2363 dimension tran_no2_std(5001)
2364 COMMON /init_speccal17/ tran_no2_std
2366 dimension wavobs(1024),fwhm(1024)
2367 COMMON /getinput4/ wavobs,fwhm
2369 dimension trncal(1024)
2370 COMMON /trancal1/ trncal,vaptt
2372 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2394 tran_med_index(j) = 0.0
2395 ncvtot_wavno = 2 * ncvhf_wavno(j) - 1
2399 DO 560 i = ncvhf_wavno(j), ncvtot_wavno
2401 & exp( -const1*(float(i-ncvhf_wavno(j))*dwavno
2402 & /fwhm_wavno(j))**2.0)
2403 sumins = sumins + finstr_wavno(i)
2406 DO 565 i = 1, ncvhf_wavno(j)-1
2407 finstr_wavno(i) = finstr_wavno(ncvtot_wavno-i+1)
2408 sumins = sumins + finstr_wavno(i)
2411 sumins = sumins * dwavno
2413 DO 570 i = 1, ncvtot_wavno
2414 finstr_wavno(i) = finstr_wavno(i)*dwavno/sumins
2424 DO 491 k = index_med(j)-(ncvhf_wavno(j)-1),
2425 & index_med(j)+ncvhf_wavno(j)-1
2426 tran_med_index(j) = tran_med_index(j) + tran_hi(k)*
2427 & finstr_wavno(k-index_med(j)+ncvhf_wavno(j))
2436 tran_med(1) = tran_med_index(1)
2437 tran_med(np_med) = tran_med_index(np_med)
2440 IF(wavln_med_index(j).LE.wavln_med(j))
THEN
2441 tran_med(j) = tran_med_index(j)
2443 dlt = wavln_med_index(j) - wavln_med_index(j-1)
2444 fjm1 = (wavln_med_index(j) - wavln_med(j)) /dlt
2445 fj = (wavln_med(j) - wavln_med_index(j-1))/dlt
2446 tran_med(j) = fjm1*tran_med_index(j-1) + fj*tran_med_index(j)
2460 tran_std(i) = tran_o3_std(i) * tran_no2_std(i)
2463 DO i = npshif+1, np_std
2464 tran_std(i) = tran_std(i)*tran_med(i-npshif)
2481 ncvtot = 2 * ncvhf(j) - 1
2488 DO 1560 i = ncvhf(j), ncvtot
2490 & exp( -const1*(float(i-ncvhf(j))*dwavln
2492 sumins = sumins + finstr(i)
2495 DO 1565 i = 1, ncvhf(j)-1
2496 finstr(i) = finstr(ncvtot-i+1)
2497 sumins = sumins + finstr(i)
2500 sumins = sumins * dwavln
2502 DO 1570 i = 1, ncvtot
2503 finstr(i) = finstr(i)*dwavln/sumins
2515 CALL hunt(wavln_std, np_std, wavobs(j), ia)
2521 DO 1491 k = ia-(ncvhf(j)-1), ia+ncvhf(j)-1
2522 tran_ia = tran_ia + tran_std(k)*
2523 & finstr(k-ia+ncvhf(j))
2534 DO 1492 k = ia_p1-(ncvhf(j)-1), ia_p1+ncvhf(j)-1
2535 tran_iap1 = tran_iap1 + tran_std(k)*
2536 & finstr(k-ia_p1+ncvhf(j))
2541 dlt_ia = wavln_std(ia_p1) - wavln_std(ia)
2542 fia = (wavln_std(ia_p1) - wavobs(j)) /dlt_ia
2545 trncal(j) = fia*tran_ia + fia_p1*tran_iap1
2586 dimension trncal(1024)
2588 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
2589 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2590 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2591 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2592 COMMON /trancal1/ trncal,vaptt
2593 COMMON /chnlratio1/ r094,r114
2598 const1=const1+trncal(i)
2600 const1=const1/float(nb1)
2604 const2=const2+trncal(i)
2606 const2=const2/float(nb2)
2609 DO 575 i=istp94,iedp94
2610 const3=const3+trncal(i)
2612 const3=const3/float(nbp94)
2614 r094=const3/((wt1*const1) + (wt2*const2))
2618 const4=const4+trncal(i)
2620 const4=const4/float(nb3)
2624 const5=const5+trncal(i)
2626 const5=const5/float(nb4)
2629 DO 595 i=ist1p14,ied1p14
2630 const6=const6+trncal(i)
2632 const6=const6/float(nb1p14)
2634 r114=const6/((wt3*const4) + (wt4*const5))
2686 INTEGER LUN_IN, LUN_OUT, LUN_VAP, I_RET
2687 COMMON /inout_units/ lun_in, lun_out, lun_vap
2693 CHARACTER (LEN = 1000) :: FINAV,FOCUB,FOH2O
2694 INTEGER*2 BUFFER(8388608)
2695 INTEGER*2 H2OBUF(8388608)
2696 INTEGER SORDER,HDREC
2702 INTEGER J, ISAMP, IBAND
2703 real*4 scalef,clmwvp
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)
2736 DO 46 isamp= 1,nsamps
2737 offset = (isamp-1) * nbands
2738 DO 45 iband=1,nbands
2739 yy(iband) = buffer(offset + iband)
2753 DO 55 iband=1,nbands
2754 tbuf(iband)=scalef*yy(iband)
2755 buffer(offset + iband) = nint(tbuf(iband))
2761 h2obuf(isamp) = nint(1000.*clmwvp)
2779 CALL wt_slice(lun_out,nsamps,nbands,sorder,buffer)
2781 CALL wt_line(lun_vap,nsamps,h2obuf)
2827 dimension vaptot(60), r0p94(60), r1p14(60), trntbl(1024,60)
2828 dimension yirr(1024)
2831 dimension rotot(1050), ttot(1050), stot(1050)
2832 dimension finst2(100)
2834 dimension trncal(1024)
2837 dimension trncv(1024)
2839 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
2840 COMMON /getinput7/ nb1,nb2,nbp94,nb3,nb4,nb1p14
2841 COMMON /getinput8/ imn,idy,iyr,ih,im,is
2842 COMMON /geometry2/ gco2,go3,gn2o,gco,gch4,go2,ssh2o,totlo3,ggeom
2843 COMMON /init_speccal3/ nh2o
2844 COMMON /init_speccal6/ ist1,ied1,ist2,ied2,istp94,iedp94
2845 COMMON /init_speccal7/ ist3,ied3,ist4,ied4,ist1p14,ied1p14
2846 COMMON /init_speccal8/ wt1,wt2,wt3,wt4,ja
2847 COMMON /init_speccal10/ ncv2,ncvhf2,ncvtt2,istrt2,iend2,finst2
2848 COMMON /init_speccal11/ natot,nbtot,nctot,ndtot
2849 COMMON /tran_table1/ sh2o,vaptot,r0p94,r1p14,trntbl
2850 COMMON /trancal1/ trncal,vaptt
2851 COMMON /solar_irr1/yirr
2852 COMMON /proccube1/ yy
2853 COMMON /sixs1/ rotot, ttot, stot
2855 dimension g_vap(25), g_other(25)
2856 COMMON /geometry3/ g_vap, g_other, g_vap_equiv, vap_slant_mdl
2859 CHARACTER (LEN = 80) :: NAME_INSTRU, NAMES(10)
2860 COMMON /getinput13/ name_instru,
names
2867 dimension speca(1024),specb(1024),specav(1024)
2875 DATA pi,dtorad /3.1415926,0.0174533/
2879 IF((name_instru.EQ.
names(1)).AND.(iyr.LE.2009))
THEN
2891 IF(iyr.LE.1989)
THEN
2898 IF((iyr.GE.1990).AND.(iyr.LE.1991))
THEN
2905 IF((iyr.GE.1992).AND.(iyr.LE.1994))
THEN
2912 IF((iyr.GE.1995).AND.(iyr.LE.2009))
THEN
2928 yy(i)=
pi*yy(i)/(xfa*yirr(i))
2935 ELSE if ((nobs.GE.33).and.(nobs.LT.96))
THEN
2942 yy(i)=
pi*yy(i)/(xfb*yirr(i))
2947 IF(nobs.GE.160)
THEN
2949 ELSE if ((nobs.GE.97).and.(nobs.LT.160))
THEN
2956 yy(i)=
pi*yy(i)/(xfc*yirr(i))
2961 IF(nobs.GE.161)
THEN
2968 yy(i)=
pi*yy(i)/(xfd*yirr(i))
2978 IF((name_instru.EQ.
names(1)).AND.(iyr.GE.2010))
THEN
2985 yy(i) =
pi*yy(i) / (f_av_1 * yirr(i))
2989 yy(i) =
pi*yy(i) / (f_av_2 * yirr(i))
2993 yy(i) =
pi*yy(i) / (f_av_3 * yirr(i))
3000 IF(name_instru.EQ.
names(2))
THEN
3005 yy(i) =
pi*yy(i) / (f_hydice * yirr(i))
3013 IF(name_instru.EQ.
names(3))
THEN
3018 yy(i) =
pi*yy(i) / (f_hsi * yirr(i))
3026 IF(name_instru.EQ.
names(4))
THEN
3031 yy(i) =
pi*yy(i) / (f_trwis * yirr(i))
3038 IF(name_instru.EQ.
names(6))
THEN
3044 yy(i) =
pi*yy(i) / (f_hyperion_a * yirr(i))
3048 yy(i) =
pi*yy(i) / (f_hyperion_b * yirr(i))
3055 IF(name_instru.EQ.
names(7))
THEN
3061 yy(i) =
pi*yy(i) / (f_hico * yirr(i))
3068 IF(name_instru.EQ.
names(8))
THEN
3073 yy(i) =
pi*yy(i) / (f_nis * yirr(i))
3080 IF(name_instru.EQ.
names(9))
THEN
3085 yy(i) =
pi*yy(i) / (f_prism * yirr(i))
3099 const1=const1/float(nb1)
3105 const2=const2/float(nb2)
3108 DO 575 i=istp94,iedp94
3111 const3=const3/float(nbp94)
3113 r094co=const3/((wt1*const1) + (wt2*const2))
3116 IF(r094co.GT.1.0)
THEN
3119 const1=const1+1.0/yy(i)
3121 const1=const1/float(nb1)
3125 const2=const2+1.0/yy(i)
3127 const2=const2/float(nb2)
3130 DO 576 i=istp94,iedp94
3131 const3=const3+1.0/yy(i)
3133 const3=const3/float(nbp94)
3135 r094c=const3/((wt1*const1) + (wt2*const2))
3142 const4=const4/float(nb3)
3148 const5=const5/float(nb4)
3151 DO 595 i=ist1p14,ied1p14
3154 const6=const6/float(nb1p14)
3156 r114co=const6/((wt3*const4) + (wt4*const5))
3159 IF(r114co.GT.1.0)
THEN
3162 const4=const4+1.0/yy(i)
3164 const4=const4/float(nb3)
3168 const5=const5+1.0/yy(i)
3170 const5=const5/float(nb4)
3173 DO 596 i=ist1p14,ied1p14
3174 const6=const6+1.0/yy(i)
3176 const6=const6/float(nb1p14)
3178 r114c=const6/((wt3*const4) + (wt4*const5))
3181 CALL hunt(r0p94,nh2o,r094c,ja)
3182 IF (ja.GT.0.AND.ja.LT.60)
THEN
3183 dlta =r0p94(ja+1)-r0p94(ja)
3184 fja =(r0p94(ja+1)-r094c)/dlta
3185 fjap1 =(r094c-r0p94(ja))/dlta
3187 vaptta=fja*vaptot(ja)+fjap1*vaptot(ja+1)
3188 IF(r094co.GT.1.) vaptta=-vaptta
3190 IF(ja.LE.0) vaptta = vaptot(ja+1)
3191 IF(ja.GE.60) vaptta = vaptot(ja)
3194 IF(r094co.LE.1.)
THEN
3196 IF (ja.GT.0.AND.ja.LT.60)
THEN
3197 speca(i)=fja*trntbl(i,ja)+fjap1*trntbl(i,ja+1)
3199 IF(ja.LE.0) speca(i)=trntbl(i,ja+1)
3200 IF(ja.GE.60) speca(i)=trntbl(i,ja)
3205 IF(r094co.GT.1.)
THEN
3207 IF (ja.GT.0.AND.ja.LT.60)
THEN
3208 speca(i)=1.0/(fja*trntbl(i,ja)+fjap1*trntbl(i,ja+1))
3210 IF(ja.LE.0) speca(i)=1.0/trntbl(i,ja+1)
3211 IF(ja.GE.60) speca(i)=1.0/trntbl(i,ja)
3217 CALL hunt(r1p14,nh2o,r114c,jb)
3218 IF (jb.GT.0.AND.jb.LT.60)
THEN
3219 dltb =r1p14(jb+1)-r1p14(jb)
3220 fjb =(r1p14(jb+1)-r114c)/dltb
3221 fjbp1 =(r114c-r1p14(jb))/dltb
3223 vapttb=fjb*vaptot(jb)+fjbp1*vaptot(jb+1)
3224 IF(r114co.GT.1.) vapttb=-vapttb
3226 IF(jb.LE.0) vapttb = vaptot(jb+1)
3227 IF(jb.GE.60) vapttb = vaptot(jb)
3230 IF(r114co.LE.1.)
THEN
3232 IF (jb.GT.0.AND.jb.LT.60)
THEN
3233 specb(i)=fjb*trntbl(i,jb)+fjbp1*trntbl(i,jb+1)
3235 IF(jb.LE.0) specb(i)=trntbl(i,jb+1)
3236 IF(jb.GE.60) specb(i)=trntbl(i,jb)
3241 IF(r114co.GT.1.)
THEN
3243 IF (jb.GT.0.AND.jb.LT.60)
THEN
3244 specb(i)=1.0/(fjb*trntbl(i,jb)+fjbp1*trntbl(i,jb+1))
3246 IF(jb.LE.0) specb(i)=1.0/trntbl(i,jb+1)
3247 IF(jb.GE.60) specb(i)=1.0/trntbl(i,jb)
3253 clmwvp=0.5*(vaptta+vapttb)/g_vap_equiv
3257 specav(i)=0.5*(speca(i)+specb(i))
3258 trntmp=(yy(i)/specav(i))-rotot(i)
3259 yy(i)=trntmp/(ttot(i)+(stot(i)*trntmp))
3270 IF(dlt2.GT.dlt)
THEN
3274 DO 920 i=natot-2,natot+2
3275 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3278 DO 921 i=nbtot-2,nbtot+2
3279 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3282 DO 922 i=nctot-4,nctot+4
3283 IF(yy(i).LE.0.0) yy(i)=0.0
3286 DO 923 i=ndtot-7,nobs
3287 IF(yy(i).LE.0.0) yy(i)=yy(i-1)
3290 DO 3480 i=istrt2,iend2
3293 DO 3490 j=i-ncv2,i+ncv2
3294 trncv(i)=trncv(i)+yy(j)*finst2(j-ii+1)
3297 DO 3495 i=istrt2,iend2
3321 SUBROUTINE locate(xx,n,x,j)
3327 10
if(ju-jl.gt.1)
then
3329 if((xx(n).ge.xx(1)).eqv.(x.ge.xx(jm)))
then
3338 else if(x.eq.xx(n))
then
3363 SUBROUTINE cubspln(N,XORGN,YORGN,XINT,YINT)
3365 dimension xorgn(1050),yorgn(1050),y2(1050)
3366 dimension xint(1024),yint(1024)
3369 COMMON /getinput5/ nobs,hsurf,dlt,dlt2
3378 CALL spline(xorgn,yorgn,n,yp1,ypn,y2)
3382 CALL splint(xorgn,yorgn,y2,n,x,y)
3418 subroutine spline(x,y,n,yp1,ypn,y2)
3421 real x(n),y(n),y2(n),u(nmax)
3422 real yp1,ypn,sig,p,qn,un
3423 if (yp1.gt..99e30)
then
3428 u(1)=(3./(x(2)-x(1)))*((y(2)-y(1))/(x(2)-x(1))-yp1)
3431 sig=(x(i)-x(i-1))/(x(i+1)-x(i-1))
3434 u(i)=(6.*((y(i+1)-y(i))/(x(i+1)-x(i))-(y(i)-y(i-1))
3435 * /(x(i)-x(i-1)))/(x(i+1)-x(i-1))-sig*u(i-1))/p
3437 if (ypn.gt..99e30)
then
3442 un=(3./(x(n)-x(n-1)))*(ypn-(y(n)-y(n-1))/(x(n)-x(n-1)))
3444 y2(n)=(un-qn*u(n-1))/(qn*y2(n-1)+1.)
3446 y2(k)=y2(k)*y2(k+1)+u(k)
3477 subroutine splint(xa,ya,y2a,n,x,y)
3479 real xa(n),ya(n),y2a(n)
3483 1
if (khi-klo.gt.1)
then
3493 if (h.eq.0.) pause
'bad xa input.'
3496 y=a*ya(klo)+b*ya(khi)+
3497 * ((a**3-a)*y2a(klo)+(b**3-b)*y2a(khi))*(h**2)/6.
3518 SUBROUTINE hunt(xx,n,x,jlo)
3523 ascnd=xx(n).ge.xx(1)
3524 if(jlo.le.0.or.jlo.gt.n)
then
3530 if(x.ge.xx(jlo).eqv.ascnd)
then
3534 else if(x.ge.xx(jhi).eqv.ascnd)
then
3544 else if(x.lt.xx(jlo).eqv.ascnd)
then
3550 3
if(jhi-jlo.eq.1)
then
3551 if(x.eq.xx(n))jlo=n-1
3556 if(x.ge.xx(jm).eqv.ascnd)
then
3582 SUBROUTINE suncor(IDAY,MONTH,IYR,TZ,DEC,HAZ)
3585 fjd=0.5+tz/6.283185307
3604 SUBROUTINE solcor(JD,FJD,RAS,DECS,GSDT,BZRO,P,SOLONG)
3609 g=-.026601523+.01720196977*d-1.95e-15*d*d -2.*
pi*iyr
3610 xlms=4.881627938+.017202791266*d+3.95e-15*d*d-2.*
pi*iyr
3611 obl=.409319747-6.2179e-9*d
3612 ecc=.01675104-1.1444e-9*d
3614 gsdt=1.739935476+2.*
pi*
f/365.25+1.342027e-4*d/365.25
3615 gsdt=gsdt+6.2831853*(fjd-0.5)
3616 xlts=xlms+2.*ecc*sin(g)+1.25*ecc*ecc*sin(2.*g)
3617 sndc=sin(xlts)*sin(obl)
3619 csra=cos(xlts)/cos(decs)
3621 IF(sin(xlts).LT.0.) ras=2.*
pi-ras
3622 omega=1.297906+6.66992e-7*d
3624 bzro=asin(.126199*sin(thetac))
3625 p=-atan(cos(xlts)*tan(obl))-atan(.127216*cos(thetac))
3626 xlmm=atan2(.992005*sin(thetac),cos(thetac))
3628 irot=(jdr+fjd)/25.38
3629 frot=(jdr+fjd)/25.38-irot
3630 solong=xlmm-2.*
pi*frot+
pi-3.e-4
3631 IF(solong.LT.0.) solong=solong+2.*
pi
3632 IF(solong.GT.(2.*
pi)) solong=solong-2.*
pi
3652 FUNCTION julian(IDAY,MONTH,IYR)
3657 DATA md/0,31,59,90,120,151,181,212,243,273,304,334/
3659 IF(iyr.LT.100) iyr=iyr+1900
3663 i3=(jyr-400*i1-100*i2)/4
3664 julian=2305447+365*jyr+97*i1+24*i2+i3
3666 IF(mod(jyr,4).EQ.0)
leap=1
3667 IF(mod(jyr,100).EQ.0)
leap=0
3668 IF(mod(jyr,400).EQ.0)
leap=1
3689 SUBROUTINE hazel (H,D,A,E,XLAT)
3699 sne = sin(d)*sin(xlat)+cos(d)*cos(xlat)*cos(h)
3702 csa=(sin(xlat)*cos(h)*cos(d)-sin(d)*cos(xlat))
3725 dimension
list(1500)
3730 IF(
list(i).GT.elem)
GOTO 470
3735 IF (diff1.LT.diff2)
THEN