Interpolates linearly, in time, between two spherical harmonic models.
The coefficients (GH) of the resulting model, at date DATE, are computed by linearly interpolating between the coefficients of the earlier model (GH1), at date DTE1, and those of the later model (GH2), at date DTE2. If one model is smaller than the other, the interpolation is performed with the missing coefficients assumed to be 0.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | date |
Date of resulting model (in decimal year) |
||
real(kind=wp), | intent(in) | :: | dte1 |
Date of earlier model |
||
integer, | intent(in) | :: | nmax1 |
Maximum degree and order of earlier model |
||
real(kind=wp), | intent(in) | :: | gh1(*) |
Schmidt quasi-normal internal spherical harmonic coefficients of earlier model |
||
real(kind=wp), | intent(in) | :: | dte2 |
Date of later model |
||
integer, | intent(in) | :: | nmax2 |
Maximum degree and order of later model |
||
real(kind=wp), | intent(in) | :: | gh2(*) |
Schmidt quasi-normal internal spherical harmonic coefficients of later model |
||
integer, | intent(out) | :: | nmax |
Maximum degree and order of resulting model |
||
real(kind=wp), | intent(out) | :: | gh(*) |
Coefficients of resulting model |
subroutine intershc(date, dte1, nmax1, gh1, dte2, nmax2, gh2, nmax, gh) real(wp), intent(in) :: date !! Date of resulting model (in decimal year) real(wp), intent(in) :: dte1 !! Date of earlier model integer, intent(in) :: nmax1 !! Maximum degree and order of earlier model real(wp), intent(in) :: gh1(*) !! Schmidt quasi-normal internal spherical harmonic coefficients of earlier model real(wp), intent(in) :: dte2 !! Date of later model integer, intent(in) :: nmax2 !! Maximum degree and order of later model real(wp), intent(in) :: gh2(*) !! Schmidt quasi-normal internal spherical harmonic coefficients of later model real(wp), intent(out) :: gh(*) !! Coefficients of resulting model integer, intent(out) :: nmax !! Maximum degree and order of resulting model real(wp) :: factor integer :: i, k, l factor = (date - dte1) / (dte2 - dte1) if (nmax1 == nmax2) then k = nmax1 * (nmax1 + 2) nmax = nmax1 elseif (nmax1 > nmax2) then k = nmax2 * (nmax2 + 2) l = nmax1 * (nmax1 + 2) do i = k + 1, l gh(i) = gh1(i) + factor * (-gh1(i)) end do nmax = nmax1 else k = nmax1 * (nmax1 + 2) l = nmax2 * (nmax2 + 2) do i = k + 1, l gh(i) = factor * gh2(i) end do nmax = nmax2 end if do i = 1, k gh(i) = gh1(i) + factor * (gh2(i) - gh1(i)) end do end subroutine intershc