subroutine used for field line tracing in shellg. calls entry point feldi in geomagnetic field subroutine feldg
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(shellig_type), | intent(inout) | :: | me | |||
real(kind=wp), | intent(inout), | dimension(7) | :: | p | ||
real(kind=wp), | intent(out) | :: | bq | |||
real(kind=wp), | intent(out) | :: | r |
subroutine stoer(me, p, bq, r) class(shellig_type), intent(inout) :: me real(wp), dimension(7), intent(inout) :: p real(wp), intent(out) :: bq real(wp), intent(out) :: r real(wp) :: dr, dsq, dx, dxm, dy, dym, dz, & dzm, fli, q, rq, wr, xm, ym, zm ! xm,ym,zm are geomagnetic cartesian inverse co-ordinates zm = P(3) fli = P(1) * P(1) + P(2) * P(2) + 1.0e-15_wp R = 0.5_wp * (fli + sqrt(fli * fli + (zm + zm)**2)) rq = R * R wr = sqrt(R) xm = P(1) * wr ym = P(2) * wr ! transform to geographic co-ordinate system me%Xi(1) = xm * u(1, 1) + ym * u(1, 2) + zm * u(1, 3) me%Xi(2) = xm * u(2, 1) + ym * u(2, 2) + zm * u(2, 3) me%Xi(3) = xm * u(3, 1) + zm * u(3, 3) ! compute derivatives ! Changed from CALL FELDI(XI,H); XI, H are in COMMON block; results ! are the same; dkb Feb 1998. ! JW : feb 2024 : xi, h now class variables. call me%feldi() q = me%H(1) / rq dx = me%H(3) + me%H(3) + q * me%Xi(1) dy = me%H(4) + me%H(4) + q * me%Xi(2) dz = me%H(2) + me%H(2) + q * me%Xi(3) ! transform back to geomagnetic co-ordinate system dxm = u(1, 1) * dx + u(2, 1) * dy + u(3, 1) * dz dym = u(1, 2) * dx + u(2, 2) * dy dzm = u(1, 3) * dx + u(2, 3) * dy + u(3, 3) * dz dr = (xm * dxm + ym * dym + zm * dzm) / R ! form slowly varying expressions P(4) = (wr * dxm - 0.5_wp * P(1) * dr) / (R * dzm) P(5) = (wr * dym - 0.5_wp * P(2) * dr) / (R * dzm) dsq = rq * (dxm * dxm + dym * dym + dzm * dzm) Bq = dsq * rq * rq P(6) = sqrt(dsq / (rq + 3.0_wp * zm * zm)) P(7) = P(6) * (rq + zm * zm) / (rq * dzm) end subroutine stoer