C+ C NAME: C t3d_grid_fnc C PURPOSE: C Defines statement function for conversion between heliographic coordinates C and array index and v.v. in tomography program. C RESTRICTIONS: C Contains statement functions, so must be called at the end C of the declaration section. C PROCEDURE: C Statement functions for converting between modified Carrington variables and latitudes C (deg) and array indices. C nLng, nLat will usually be provided as arguments to the subroutine using this include file. C Note that the following variable must be defined before the functions are called C nLng1=nLng-1 C nLat1=nLat-1 C XCrange=XCend-XCbeg C C XCindx : X=XCbeg -> I=nLng X=XCend -> I=1 C XCvar : I=nLng -> X=XCbeg I=1 -> X=XCend C C XCmod : maps any XC value into the range [XCbeg,XCend] by a mod(XCrange) operation C C XLindx : X=-90 -> J=1 X=90 -> J=nLat C XLdeg : J=1 -> X=-90 J=nLat -> X=90 C- XCindx(X) = nLng-(X-XCbeg)/XCrange*nLng1 XCvar (I) = XCbeg+1.*(nLng-I)/nLng1*XCrange ! Integer input !XCvarX(X) = XCbeg+ (nLng-X)/nLng1*XCrange ! Real input (used in ExtractMap only) XCmod (X) = XCbeg+mod(mod(X-XCbeg,XCrange)+XCrange,XCrange) XLindx(X) = 1+((X+90.)/180.)*nLat1 ! Latitude (deg) -> index in [1,nLat] XLdeg (J) = 90.*(-1.+2.*(J-1)/nLat1) ! Index in [1,nLat]-> latitude (deg) RRindx(R) = 1+(R-RR)/dRR RRhght(I) = RR+(I- 1)*dRR TTindx(T) = 1+(T-TT)*dTTi TTtime(I) = TT+(I- 1)*dTT