! +-======-+ ! Copyright (c) 2003-2007 United States Government as represented by ! the Admistrator of the National Aeronautics and Space Administration. ! All Rights Reserved. ! ! THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, ! REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN ! COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS ! REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). ! THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN ! INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR ! REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, ! DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED ! HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE ! RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT. ! ! Government Agency: National Aeronautics and Space Administration ! Government Agency Original Software Designation: GSC-15354-1 ! Government Agency Original Software Title: GEOS-5 GCM Modeling Software ! User Registration Requested. Please Visit http://opensource.gsfc.nasa.gov ! Government Agency Point of Contact for Original Software: ! Dale Hithon, SRA Assistant, (301) 286-2691 ! ! +-======-+ program dyndot use m_dyn use m_ioutil, only : luavail use m_die, only: die implicit none character(len=*), parameter :: myname='dyndot' integer,parameter :: dyntype=5 integer,parameter :: nfiles=2 integer nymd, nhms, lu, n, freq, vectype, prec, ier, nstep integer i, nf, iarg, argc, ndim2, ndim3, intarg, iargc character(len=255) :: dynfile(nfiles) character(len=255) argv type(dyn_vect) w_1 type(dyn_vect) w_2 logical use_ps real :: total, dotp(5) integer im,jm,km,lm,k,rc integer im1,jm1,km1,lm1 integer im2,jm2,km2,lm2 logical adm(nfiles) logical pncf prec = 0 vectype = 5 use_ps=.false. ! default is to use delp adm=.false. pncf=.false. argc = iargc() if ( argc < 1 ) call usage_() nf=0 do i = 1, 32767 iarg = iarg + 1 if ( iarg .gt. argc ) exit call GetArg ( iarg, argv ) select case (argv) case ("-use_ps") use_ps = .true. case ("-adm1") adm(1) = .true. case ("-adm2") adm(2) = .true. case ("-pncf") pncf = .true. ! case ("-adm") ! if ( iarg+1 .gt. argc ) call usage_() ! iarg = iarg + 1 ! call GetArg ( iarg, argv ) ! read(argv,*) intarg ! if(intarg>0) adm(1)=.true. ! iarg = iarg + 1 ! call GetArg ( iarg, argv ) ! read(argv,*) intarg ! if(intarg>0) adm(2)=.true. case default nf = nf + 1 if ( nf .gt. nfiles ) call die(myname,'too many eta files') dynfile(nf) = trim(argv) end select enddo do nf=1,nfiles write(6,'(a,i3,2a)') "Dyn Vector ", nf , ": ", trim(dynfile(nf)) enddo call dyn_getdim ( trim(dynfile(1)), im1, jm1, km1, lm1, rc ) call dyn_getdim ( trim(dynfile(2)), im2, jm2, km2, lm2, rc ) if(km1/=km2) then ! ignore diff in lm for now print *, trim(myname), ': km/lm file 1 = ', km1,lm1 print *, trim(myname), ': km/lm file 2 = ', km2,lm2 call die(myname,'inconsistent km/lm') endif im=min(im1,im2) jm=min(jm1,jm2) km=min(km1,km2) lm=min(lm1,lm2) ndim2 = im*jm ! check dimensions and take proper action n=1 if ( im1==im2 .and. jm1==jm2 ) then call dyn_get ( trim(dynfile(1)), nymd, nhms, w_1, ier, timidx=n, & freq=freq, nstep=nstep, vectype=vectype, pncf=pncf ) call dyn_get ( trim(dynfile(2)), nymd, nhms, w_2, ier, timidx=n, & freq=freq, nstep=nstep, vectype=vectype, pncf=pncf ) else if (im1