subroutine rf_hirspfco_101(craft, opt) c * Input HIRS Planck-function, band-correction, c and solar-correction coefficients c 'opt' is option to read second file that contains "spectrally shifted" forward c model coefficients and Planck function coefficients (1=original only, 2=shifted c and original) c .... version of 16.07.08 c craft = spacecraft, upper or lower case ... tirosn,noaa06,...,noaa18,metopa integer iuc1, iuc2, lenc, nc, nt, opt parameter (iuc1=70,iuc2=71,lenc=400,nc=20,nt=2) integer lenp, lenb, lens parameter (lenp=nc*(nt+3),lenb=lenc*4,lens=5) real pbuf, pbuf_shifted c common/hirpfc/cwn(nc),fk1(nc),fk2(nc),tc(nt,nc) common/hirpfc/pbuf(lenp) common/hirpfc_shifted/pbuf_shifted(lenp) real gh, dh common/hirgam/gh(nc),dh(nc) real csun common/hirsun/csun(lens) real*4 cbuf dimension cbuf(lenc) character*160 errmsg character*17 cfile_orig, cfile_shft character*6 craft character*3 csat integer noff, irec, i, level, status c---------------------------------------------------------------------------------------- data cfile_orig/'hirscbnd_orig.dat'/ data cfile_shft/'hirscbnd_shft.dat'/ c---------------------------------------------------------------------------------------- if(opt .eq. 1 .or. opt .eq. 2) then c Open file containing "unshifted" (original) forward model and Planck coefficients. open(iuc1,file=cfile_orig,recl=lenb,access='direct', + status='old',err=100) if(opt .eq. 2) then c Open file containing "shifted" forward model and Planck coefficients. open(iuc2,file=cfile_shft,recl=lenb,access='direct', + status='old',err=200) end if else c Invalid option. go to 300 end if c---------------------------------------------------------------------------------------- c Get 3-character ID and number for use in radiative transfer (forward model) code call getallsc(craft,csat,noff) irec=noff+1 c---------------------------------------------------------------------------------------- c Get "unshifted" (original) forward model and Planck coefficients. read(iuc1,rec=irec) cbuf close(iuc1) do i=1,lenp pbuf(i)=cbuf(i) enddo do i=1,nc gh(i)=cbuf(i+100) dh(i)=cbuf(i+120) enddo do i=1,lens csun(i)=cbuf(i+140) enddo c---------------------------------------------------------------------------------------- c Get "shifted" forward model and Planck coefficients. if(opt .eq. 2) then read(iuc2,rec=irec) cbuf close(iuc2) do i=1,lenp pbuf_shifted(i)=cbuf(i) enddo end if c---------------------------------------------------------------------------------------- c Successful completion. return c---------------------------------------------------------------------------------------- c Error messages. c---------------------------------------------------------------------------------------- 100 level = 3 status = -1 write( errmsg,'('' Cannot open coefficient files for original FM - aborting'')') call message( 'rf_hirspfco_101', errmsg, status, level ) return 200 level = 3 status = -1 write( errmsg,'('' Cannot open coefficient files for shifted FM - aborting'')') call message( 'rf_hirspfco_101', errmsg, status, level ) return 300 level = 3 status = -1 write( errmsg,'('' Invalid option in call to rf_hirspfco_101 - aborting'')') call message( 'rf_hirspfco_101', errmsg, status, level ) return c---------------------------------------------------------------------------------------- end