00001
00002
00003 MODULE trigonometry_grav_phi
00004 use phys_constant, only : nnpg, long
00005 use grid_parameter, only : npg, nlg
00006 use coordinate_grav_phi, only : phig, hphig
00007 use make_array_2d
00008 implicit none
00009 real(long) :: sinphig(0:nnpg), cosphig(0:nnpg)
00010 real(long) :: hsinphig(nnpg), hcosphig(nnpg)
00011 real(long), pointer :: sinmpg(:,:), cosmpg(:,:)
00012 real(long), pointer :: hsinmpg(:,:), hcosmpg(:,:)
00013 contains
00014
00015 subroutine allocate_trig_grav_mphi
00016 implicit none
00017 call alloc_array2d(sinmpg, 0, nlg, 0, npg)
00018 call alloc_array2d(cosmpg, 0, nlg, 0, npg)
00019 call alloc_array2d(hsinmpg, 0, nlg, 1, npg)
00020 call alloc_array2d(hcosmpg, 0, nlg, 1, npg)
00021 end subroutine allocate_trig_grav_mphi
00022 subroutine trig_grav_phi
00023 IMPLICIT NONE
00024 INTEGER :: ip, nn
00025 Real(long) :: fnn
00026 DO ip = 0, npg
00027 sinphig(ip) = SIN(phig(ip))
00028 cosphig(ip) = COS(phig(ip))
00029 DO nn = 0, nlg
00030 fnn = Real(nn)
00031 sinmpg(nn,ip) = SIN(fnn*phig(ip))
00032 cosmpg(nn,ip) = COS(fnn*phig(ip))
00033 END DO
00034 END DO
00035 DO ip = 1, npg
00036 hsinphig(ip) = SIN(hphig(ip))
00037 hcosphig(ip) = COS(hphig(ip))
00038 DO nn = 0, nlg
00039 fnn = Real(nn)
00040 hsinmpg(nn,ip) = SIN(fnn*hphig(ip))
00041 hcosmpg(nn,ip) = COS(fnn*hphig(ip))
00042 END DO
00043 END DO
00044 end subroutine trig_grav_phi
00045 end module trigonometry_grav_phi