c c------------------------------------------------------------------ c Begin file /home/sting/foster/vid/getinp.f c------------------------------------------------------------------ c subroutine getinp include "vid.h" c call lexcon(histvol ,8HHISTVOL ,nhistvol) call lexcon(mtimes ,8HDDHHMM ,ntimes) call lexcon(iden ,8HIDEN ,niden) call lexcon(mkframes,8HMKFRAMES,nmkframe) call lexcon(jday1 ,8HJDAY1 ,njday1) call lexcon(ninterp ,8HINTERP ,nninterp) call lexcon(nfbetseg,8HNFBETSEG,nfbet) call lexcon(nfbegend,8HNFBEGEND,nbegend) call lexcon(ititles ,8HTITLES ,ntitles) call lexcon(iproj ,8HPROJ ,nproj) call lexcon(icella ,8HCELLA ,ncella) call lexcon(eradii ,8HERADII ,neradii) call lexcon(censatv ,8HCENSATV ,ncensatv) call lexcon(icolor ,8HCOLOR ,ncolor) call lexcon(nfixclr ,8HFIXCOLOR,nnfixclr) call lexcon(info ,8HINFO ,ninfo) call lexcon(kpbar ,8HKPBAR ,nkpbar) call lexcon(kpgraph ,8HKPGRAPH ,nkpgraph) call lexcon(slev ,8HLEVEL ,nlev) call lexcon(slt ,8HSLT ,nslt) call lexcon(ipltgcm ,8HPLTIGCM ,npltgcm) call lexcon(cint ,8HCINT ,ncint) call lexcon(cmin ,8HCMIN ,ncmin) call lexcon(cmax ,8HCMAX ,ncmax) call readlx(5,ierr) if (ierr.ne.1) then write(6,"(' ')") write(6,"(' >>> getinp readlx ierr=',i10)") ierr write(6,"(' ')") stop 'readlx' endif if (nhistvol.le.0) then write(6,"('>>> getinp: need histvols (HISTVOL)')") stop 'histvol' endif if (mod(nhistvol,3).ne.0) then write(6,"('>>> getinp: histvols should be 24-chars each:', + ' nhistvol=',i3)") nhistvol stop 'nhistvol' endif nvol = nhistvol/3 write(6,"('getinp: nvol=',i3)") nvol if (ntimes.le.0) then write(6,"('>>> getinp: need model times (DDHHMM)')") stop 'mtimes' endif if (mod(ntimes,3).ne.0) then write(6,"('>> getinp: model times should come in triplets ', + '(dd,hh,mm): ntimes=',i3)") ntimes stop 'ntimes' endif ntms = ntimes/3 if (ntms.gt.mxtms) then write(6,"('>>> getinp: too many model times (DDHHMM);', + ' ntms=',i3,' mxtms=',i3)") ntms,mxtms stop 'mxtms' endif c c Selected level may be zp or ht: c Assume zp if slev <= gcmzp(kmx), height otherwise: c if (nlev.le.0) then write(6,"('>>> getinp: need selected level (LEVEL)', + /'(may be zp(-ln(p/p0)) or ht(km)')") stop 'level' endif if (slev.le.gcmzp(kmx)) then istat = ixfind(gcmzp,kmx,slev,dzp) if (istat.lt.0) then write(6,"('>>> getinp: could not find index to slev (ZP)=', + f10.2,/' selected pressure slev must be ',f5.1, + ' < slev < ',f5.1)") slev,gcmzp(1),gcmzp(kmx) stop 'slev' endif endif c c Selected local time (center of projections): if (nslt.le.0) then slt = -1. elseif (slt.lt.0..or.slt.gt.24.) then write(6,"('>>> getinp: bad slt=',f10.3)") slt stop 'slt' endif if (npltgcm.ne.nflds) then write(6,"('>>> getinp: need ',i3,' field plot flags: got ', + i3)") nflds,npltgcm stop 'npltgcm' endif if (njday1.le.0) then write(6,"('>>> getinp: need jday1 (julian day corresponding', + ' to model day 1)')") stop 'jday1' endif c c Contour intervals, mins, maxs: if (ncint.le.0) then do i=1,nflds cint(i) = 0. enddo elseif (ncint.ne.nflds) then write(6,"('>>> getinp: need ',i3,' cint -- got ',i3)") + ncint,nflds stop 'ncint' endif if (ncmin.le.0) then do i=1,nflds cmin(i) = 1. enddo elseif (ncmin.ne.nflds) then write(6,"('>>> getinp: need ',i3,' cmin -- got ',i3)") + ncmin,nflds stop 'ncmin' endif if (ncmax.le.0) then do i=1,nflds cmax(i) = 0. enddo elseif (ncmax.ne.nflds) then write(6,"('>>> getinp: need ',i3,' cmax -- got ',i3)") + ncmax,nflds stop 'ncmax' endif if (ncolor.le.0) icolor = 0 if (ninfo.le.0) info = 0 if (nninterp.le.0) ninterp = 0 if (nfbet.le.0) nfbetseg = 1 if (nbegend.le.0) nfbegend = 0 nf = 0 do ip=1,nflds if (ipltgcm(ip).gt.0) nf = nf+1 enddo if (nproj.ne.nf) then write(6,"('>>> getinp: need 1 iproj for each field: nf=',i3, + ' nproj=',i3)") nf,nproj stop 'nproj' else do ip=1,nf if (iproj(ip).lt.1.or.iproj(ip).gt.2) then write(6,"('>>> getinp: unknown iproj=',i3,' ip=',i3, + ' will default to cylindrical equidistant')") + iproj(ip),ip endif enddo endif if (neradii.le.0) then write(6,"('getinp: defaulting eradii to 2')") eradii = 2. endif if (ncensatv.ne.2) then write(6,"('getinp: defaulting censatv to 70.,999.')") censatv(1) = 70. censatv(2) = 999. endif if (ncella.le.0) icella = 0 if (nkpbar.le.0.or.icolor.le.0) kpbar = 0 if (nkpgraph.le.0.or.icolor.le.0) kpgraph = 0 if (kpbar.gt.0.and.kpgraph.gt.0) then write(6,"('Cannot do both kpbar and kpgraph -- will ', + 'default to kpgraph')") kpgraph = 1 endif if (nmkframe.le.0) mkframes = 1 if (ntitles.le.0) then ititles(1) = -1 ititles(2) = -1 ititles(3) = -1 elseif (ntitles.ne.3) then write(6,"('>>> getinp: need 3 values for ntitles: got ',i3, + ' (ntitles is number of times to call ftitle',/, + ' for beginning, before each field, and at end')") ntitles write(6,"('(if ititles < 0, ftitle will be called abs(ititles)', + ' times as a test run)')") write(6,"('(if ititles > 0, ftitle will be called ititles ', + 'times as production run)')") write(6,"('(if ititles = 0, ftitle will not be called)')") stop 'ntitles' endif if (niden.le.0) then write(6,"('getinp: defaulting to iden=1 (cm-3)')") iden = 1 endif if (nnfixclr.le.0) nfixclr = 0 c return end