c------------------------------------------------------------------------------- c Driver program for example #2: c c Create a time series of external and induced B at Furstenfeldbruck (FUR) c observatory during May of 1994. Sample field every 30 min and get Dst and c F10.7 from files. c------------------------------------------------------------------------------- implicit none integer i,j,iday,iutday c begin CM4 declarations ------------------------------------------------------- character*80 path(3) integer unit(3) logical load(3),indx(2),gmut,cord,pred(6),curr,coef integer nhmf(2),nlmf(2),perr,oerr,cerr real*8 ut,mut,theta,phi,alt,dst,f107,bmdl(3,7),jmdl(3,4) real*8 gmdl(1) ! note, an array of length one c end CM4 declarations --------------------------------------------------------- c begin CM4 assignments -------------------------------------------------------- path(1)='../umdl.CM4' ! path for model coefficients path(2)='../Dst_all.wdc' ! path for Dst path(3)='../F107_3mon.plt' ! path for solar flux unit(1)=11 ! logical unit for model coefficients unit(2)=12 ! logical unit for Dst unit(3)=13 ! logical unit for solar flux load(1)=.true. ! set to initially read model coefficients load(2)=.true. ! set to initially read Dst load(3)=.true. ! set to initially read solar flux indx(1)=.true. ! get Dst from file indx(2)=.true. ! get solar flux from file gmut =.true. ! compute MUT from UT cord =.true. ! use geodetic coordinates pred(1)=.false. ! don't compute internal B fields pred(2)=.true. ! compute magnetospheric B field pred(3)=.true. ! compute ionospheric B field pred(4)=.false. ! don't compute toroidal B field... pred(5)=.false. ! ... pred(6)=.false. ! ... curr =.false. ! no current density J fields computed coef =.false. ! no coefficients generated nhmf(1)=0 ! ... nhmf(2)=0 ! ... nlmf(1)=1 ! ... nlmf(2)=1 ! ... theta =41.84d0 ! FUR colatitude phi =11.28d0 ! FUR longitude alt =0.56d0 ! FUR altitude perr =1 ! error print flag oerr =6 ! error logical unit cerr =0 ! error flag c end CM4 assignments ---------------------------------------------------------- c begin time series loop ------------------------------------------------------- ut=1994.d0+120.d0/365.d0 ! 1 May 1994 0000 UT do i=1,1488 ! one-half hours in 31 days call cm4field (path,unit,load,indx,gmut,cord,pred,curr,coef, 1 nhmf,nlmf,ut,mut,theta,phi,alt,dst,f107,bmdl, 2 jmdl,gmdl,perr,oerr,cerr) ! ^ ! |____ note that a dummy array variable of length ! one may be used for gmdl when coef=.false. if (cerr.gt.49) stop iday=(i-1)/48+1 iutday=mod((5*(i-1)/10)*100,2400)+30*mod(i-1,2) write(*,1000) iday,iutday,(bmdl(j,3),j=1,3) write(*,1001) (bmdl(j,4),j=1,3) write(*,1002) (bmdl(j,5),j=1,3) write(*,1003) (bmdl(j,6),j=1,3) ut=ut+5.70776d-05 ! increment by 30 min. end do c end time series loop --------------------------------------------------------- stop 1000 format( 1x,i2,' May 1994, ',i4,' UT Mag_pri B_xyz ',3f10.2) 1001 format(23x, ' Mag_ind B_xyz ',3f10.2) 1002 format(23x, ' Ion_pri B_xyz ',3f10.2) 1003 format(23x, ' Ion_ind B_xyz ',3f10.2) end include '../cm4field.f'