00001
00002
00003
00004
00005 !> @file
00006 !!
00007 !! Computation of the table of true anomalies (orbital positions
00008 !! with respect to perihelion) over a Martian year.
00009 !!
00010 !! @section Copyright
00011 !!
00012 !! Copyright 2010, 2011 Ralf Greve, Bjoern Grieger, Oliver J. Stenzel
00013 !!
00014 !! @section License
00015 !!
00016 !! This file is part of MAIC-2.
00017 !!
00018 !! MAIC-2 is free software: you can redistribute it and/or modify
00019 !! it under the terms of the GNU General Public License as published by
00020 !! the Free Software Foundation, either version 3 of the License, or
00021 !! (at your option) any later version.
00022 !!
00023 !! MAIC-2 is distributed in the hope that it will be useful,
00024 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00026 !! GNU General Public License for more details.
00027 !!
00028 !! You should have received a copy of the GNU General Public License
00029 !! along with MAIC-2. If not, see <http://www.gnu.org/licenses/>.
00030 !<
00031 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00032
00033
00034 !> Computation of the table of true anomalies (orbital positions
00035 !! with respect to perihelion) over a Martian year.
00036 !<------------------------------------------------------------------------------
00037 subroutine get_psi_tab(ecc, ave)
00038
00039 use maic2_types
00040 use maic2_variables
00041
00042 implicit none
00043
00044 real(dp), intent(in) :: ecc, ave
00045
00046 integer(i4b) :: iter, n
00047 real(dp) :: dtime_psi, factor, misfit
00048 real(dp), dimension(0:NTIME) :: ls_tab
00049
00050 dtime_psi = MARS_YEAR / real(NTIME,dp)
00051 factor = 2.0_dp*pi / MARS_YEAR
00052
00053 ls_tab(0) = 0
00054
00055
00056
00057 do iter=1, 5
00058
00059
00060
00061 do n=0, NTIME-1
00062 ls_tab(n+1) = ls_tab(n) &
00063 + dtime_psi*factor*(1.0_dp+ecc*cos(ls_tab(n)+ave))**2
00064 end do
00065
00066
00067
00068 misfit = 2.0_dp*pi/ls_tab(NTIME)
00069 factor = factor*misfit
00070
00071 end do
00072
00073
00074
00075 if ((misfit > 0.99_dp).and.(misfit < 1.01_dp)) then
00076 ls_tab = ls_tab*misfit
00077 else
00078 stop ' Subroutine get_psi_tab: Bad convergence of ls_tab!'
00079 end if
00080
00081 psi_tab = ls_tab + ave
00082
00083 end subroutine get_psi_tab
00084