c c------------------------------------------------------------------ c Begin file /home/sting/foster/gonz/getinp.f c------------------------------------------------------------------ c subroutine getinp dimension icnt(10) c include 'tgcmparam.h' include 'input.h' include 'gonz.h' c call lexcon(histvol ,8HHISTVOL ,icnt(1)) call lexcon(chtms ,8HDDHHMM ,icnt(2)) call lexcon(iden ,8HIDEN ,icnt(3)) call lexcon(slon ,8HSLON ,nlon) call lexcon(shts ,8HSHTS ,nhts) call readlx(5,ierr) if (ierr.ne.1) then write(6,"(' ')") write(6,"(' >>> getinp readlx ierr=',i10)") ierr write(6,"(' ')") stop 'readlx' endif C C Iden = 1,2,3 for mass mixing ratios, number densities, or mass densiti C if (icnt(3).le.0) then write(6,"(' >>> getinp: no iden -- will default to iden=2')") iden = 2 endif if (iden.lt.1.or.iden.gt.3) then write(6,"(' >>> getinp: bad iden = ',i5,' -- will to default ', + 'to iden=2')") iden iden = 2 endif C C Histvol(s): C if (mod(icnt(1),3).ne.0) then write(6,"(' >>> getinp: need 3 names for each histvol: ', + ' icnt(1)=',i5)") icnt(1) stop 'histvol' endif nhvols = icnt(1)/3 if (nhvols.gt.mxvols) then write(6,"(' >>> getinp: nhvols.gt.mxvols: nhvols=',I3, + ' mxvols=',i3)") nhvols,mxvols stop 'nhvols' endif C C If middle name in ms path is RGR90 or HIST90, then it is new model C in which model time equals ut. In this case MTUT=1, otherwise C MTUT=0 C mtut = 0 do 50 iv=1,nhvols 50 if (histvol(2,iv).eq.'RGR90 '.or. + histvol(2,iv).eq.'RGR91 '.or. + histvol(2,iv).eq.'ECR91 '.or. + histvol(2,iv).eq.'HIST91 '.or. + histvol(2,iv).eq.'HIST90 ') mtut = 1 C C Number of desired times: C ntms = icnt(2) if (ntms.gt.mxtms) then write(6,"(' >>> getinp: too many times: mxtms=',I2,' ntms=', + I3)") mxtms,ntms stop 'ntms' endif if (ntms.le.0) then write(6,"(' >>> getinp: need at least one time: ntms=',I3)") + ntms stop 'ntms' endif c c Ut loop: c do 100 it=1,ntms read(chtms(it),"(2(i2,1x),i2)") md(it),mh(it),mm(it) if (mh(it).lt.0.or.mh(it).gt.23) then write(6,"(' >>> getinp: bad mh(',I2,') = ',I4)") it,mh(it) stop 'mh' endif if (mm(it).lt.0.or.mm(it).gt.59) then write(6,"(' >>> getinp: bad mm(',i2,') = ',i4)") it,mm(it) stop 'mm' endif C C Define ut's from model times: C (This can be removed when tgcm converts to ut) C mdut(it) = md(it) mhut(it) = mh(it)-12 mmut(it) = mm(it) if (mhut(it).lt.0) then mhut(it) = mh(it)+12 mdut(it) = md(it)-1 endif C C If MTUT=1 then model time = ut (RGR90 or later -- defined above) C if (mtut.eq.1) then mdut(it) = md(it) mhut(it) = mh(it) mmut(it) = mm(it) endif ut(it) = float(mhut(it))+float(mm(it))/60. 100 continue c c Selected lons: if (nlon.gt.mxlon) then write(6,"('>>> getinp: too many slon: nlon=',i3, + ' will default to ',i3,' lons')") mxlon nlon = mxlon elseif (nlon.le.0) then write(6,"('>>> getinp: no lons??')") stop 'nlon' else do i=1,nlon islon(i) = ixlon(slon(i)) if (islon(i).le.0) then write(6,"('>>> getinp warning: apparent error from ', + 'ixlon finding index to lon=',f9.3,' index=',i3)") + slon(i),islon(i) endif enddo endif c c Selected heights: if (nhts.gt.mxhts) then write(6,"('>>> getinp: too many shts: nhts=',i3, + ' will default to ',i3,' hts')") mxhts nhts = mxhts elseif (nhts.le.0) then write(6,"('>>> getinp: no hts??')") stop 'nhts' endif return end