c------------------------------------------------------------------------------- c Driver program for example #1: c c Magnetic field along Magsat dawn colatitude profile at 430 km using constant, c user supplied values of Dst and F10.7 indices. c------------------------------------------------------------------------------- implicit none integer i,j 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 unit(1)=11 ! logical unit for model coefficients load(1)=.true. ! set to initially read model coefficients indx(1)=.false. ! get Dst from argument indx(2)=.false. ! get solar flux from argument gmut =.true. ! compute MUT from UT cord =.false. ! use geocentric coordinates pred(1)=.true. ! compute internal B fields pred(2)=.true. ! compute magnetospheric B field pred(3)=.true. ! compute ionospheric B field pred(4)=.true. ! compute toroidal B field for... pred(5)=.true. ! ...Magsat pred(6)=.true. ! ...dawn LT curr =.false. ! no current density J fields computed coef =.false. ! no coefficients generated nhmf(1)=13 ! n_max for "core field" nhmf(2)=40 ! n_max for "crustal field" nlmf(1)=1 ! n_min for "core_field" nlmf(2)=14 ! n_min for "crustal field" ut =1980.d0 ! constant UT (years) phi =0.d0 ! constant longitude alt =430.d0 ! constant altitude dst =-10.d0 ! constant Dst f107 =200.d0 ! constant solar flux perr =1 ! error print flag oerr =6 ! error logical unit cerr =0 ! error flag c end CM4 assignments ---------------------------------------------------------- c begin profile loop ----------------------------------------------------------- do i=1,179 theta=dble(i) 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 write(*,1000) theta,(bmdl(j,1),j=1,3) write(*,1001) (bmdl(j,2),j=1,3) write(*,1002) (bmdl(j,3),j=1,3) write(*,1003) (bmdl(j,4),j=1,3) write(*,1004) (bmdl(j,5),j=1,3) write(*,1005) (bmdl(j,6),j=1,3) write(*,1006) (bmdl(j,7),j=1,3) end do c end profile loop ------------------------------------------------------------- stop 1000 format(1x,f5.1,' Core B_xyz ',3f10.2) 1001 format(6x, ' Crust B_xyz ',3f10.2) 1002 format(6x, ' Mag_pri B_xyz ',3f10.2) 1003 format(6x, ' Mag_ind B_xyz ',3f10.2) 1004 format(6x, ' Ion_pri B_xyz ',3f10.2) 1005 format(6x, ' Ion_ind B_xyz ',3f10.2) 1006 format(6x, ' Tor B_xyz ',3f10.2) end include '../cm4field.f'