Based on the CONVERT subroutine from [1]. Unnormalizes the C,S coefficients.
Note
Coded from [1] with some modifications.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nmodel | |||
real(kind=wp), | intent(inout), | dimension(nmodel,0:nmodel) | :: | cnm | ||
real(kind=wp), | intent(inout), | dimension(nmodel,0:nmodel) | :: | snm |
subroutine convert(nmodel,cnm,snm) implicit none integer,intent(in) :: nmodel real(wp),dimension(nmodel,0:nmodel),intent(inout) :: cnm real(wp),dimension(nmodel,0:nmodel),intent(inout) :: snm integer :: n,m real(wp) :: t1,t2 do n = 1, nmodel !JW : this could be 2,nmodel ... t1 = 2*n+1 cnm(n,0) = sqrt(t1)*cnm(n,0) do m = 1, n t2 = sqrt(FL(n-m)*t1*two / FL(n+m)) cnm(n,m) = t2*cnm(n,m) snm(n,m) = t2*snm(n,m) end do end do end subroutine convert