Program s2_grf2

program s2_grf2

        ! Uses
    use s2_types_mod
    use s2_error_mod
    use s2_sky_mod
    use s2_distn_mod
    use s2_pl_mod

        ! Calls
    call parse_options
    call s2_error
    call s2_pl_free
    call s2_pl_get_spec
    call s2_sky_compute_map
    call s2_sky_free
    call s2_sky_io_fits_write
    call s2_sky_write_map_file
    call system_clock

        ! Variables
    character (len=*), parameter :: MAP_FILE = 'map'
    character (len=*), parameter :: SKY_FILE = 'sky'
    character (len=S2_STRING_LEN) :: file_type_str = MAP_FILE
    character (len=S2_STRING_LEN) :: filename_out_a = 'a.tmp'
    character (len=S2_STRING_LEN) :: filename_out_b = 'b.tmp'
    character (len=S2_STRING_LEN) :: filename_al
    character (len=S2_STRING_LEN) :: filename_bl
    character (len=S2_STRING_LEN) :: filename_xl
    logical :: scale_al = .false.
    logical :: scale_bl = .false.
    logical :: scale_xl = .false.
    integer :: ncomment_al = 0
    integer :: ncomment_bl = 0
    integer :: ncomment_xl = 0
    logical :: line_nos
    integer :: seed = 0
    logical :: seed_set = .false.
    real (kind=s2_sp) :: MEAN_ZERO = 0e0
    real (kind=s2_sp) :: STD_UNIT = 1e0
    integer :: l
    integer :: m
    integer :: fail
    integer :: nside
    integer :: lmin
    integer :: lmax
    logical :: nside_set = .false.
    real (kind=s2_dp) :: a
    real (kind=s2_dp) :: b
    real (kind=s2_dp) :: c
    real (kind=s2_dp) :: xr
    real (kind=s2_dp) :: yr
    real (kind=s2_dp) :: xi
    real (kind=s2_dp) :: yi
    type (s2_pl) :: a_cl
    type (s2_pl) :: b_cl
    type (s2_pl) :: x_cl
    real (kind=s2_dp), allocatable, dimension (:) :: al
    real (kind=s2_dp), allocatable, dimension (:) :: bl
    real (kind=s2_dp), allocatable, dimension (:) :: xl
    real (kind=s2_sp), allocatable, dimension (:) :: al_sp
    real (kind=s2_sp), allocatable, dimension (:) :: bl_sp
    real (kind=s2_sp), allocatable, dimension (:) :: xl_sp
    complex (kind=s2_spc), allocatable, dimension (:,:) :: alm
    complex (kind=s2_spc), allocatable, dimension (:,:) :: blm
    type (s2_sky) :: a_sky
    type (s2_sky) :: b_sky

        ! Subroutines and functions
    subroutine parse_options ()

end program s2_grf2
Simulate two Gaussian random fields (GRFs) on the sky that satisfy individual and cross power spectra.

Notes:

Usage: s2_grf2

Author: J. D. McEwen (mcewen@mrao.cam.ac.uk)

Version: 0.1 - August 2005


Description of Variables

MAP_FILE

character (len=*), parameter :: MAP_FILE = 'map'

SKY_FILE

character (len=*), parameter :: SKY_FILE = 'sky'

file_type_str

character (len=S2_STRING_LEN) :: file_type_str = MAP_FILE

filename_out_a

character (len=S2_STRING_LEN) :: filename_out_a = 'a.tmp'

filename_out_b

character (len=S2_STRING_LEN) :: filename_out_b = 'b.tmp'

filename_al

character (len=S2_STRING_LEN) :: filename_al

filename_bl

character (len=S2_STRING_LEN) :: filename_bl

filename_xl

character (len=S2_STRING_LEN) :: filename_xl

scale_al

logical :: scale_al = .false.

scale_bl

logical :: scale_bl = .false.

scale_xl

logical :: scale_xl = .false.

ncomment_al

integer :: ncomment_al = 0

ncomment_bl

integer :: ncomment_bl = 0

ncomment_xl

integer :: ncomment_xl = 0

line_nos

logical :: line_nos

seed

integer :: seed = 0

seed_set

logical :: seed_set = .false.

MEAN_ZERO

real (kind=s2_sp) :: MEAN_ZERO = 0e0

STD_UNIT

real (kind=s2_sp) :: STD_UNIT = 1e0

l

integer :: l

m

integer :: m

fail

integer :: fail

nside

integer :: nside

lmin

integer :: lmin

lmax

integer :: lmax

nside_set

logical :: nside_set = .false.

a

real (kind=s2_dp) :: a

b

real (kind=s2_dp) :: b

c

real (kind=s2_dp) :: c

xr

real (kind=s2_dp) :: xr

yr

real (kind=s2_dp) :: yr

xi

real (kind=s2_dp) :: xi

yi

real (kind=s2_dp) :: yi

a_cl

type (s2_pl) :: a_cl

b_cl

type (s2_pl) :: b_cl

x_cl

type (s2_pl) :: x_cl

al

real (kind=s2_dp), allocatable, dimension (:) :: al

bl

real (kind=s2_dp), allocatable, dimension (:) :: bl

xl

real (kind=s2_dp), allocatable, dimension (:) :: xl

al_sp

real (kind=s2_sp), allocatable, dimension (:) :: al_sp

bl_sp

real (kind=s2_sp), allocatable, dimension (:) :: bl_sp

xl_sp

real (kind=s2_sp), allocatable, dimension (:) :: xl_sp

alm

complex (kind=s2_spc), allocatable, dimension (:,:) :: alm

blm

complex (kind=s2_spc), allocatable, dimension (:,:) :: blm

a_sky

type (s2_sky) :: a_sky

b_sky

type (s2_sky) :: b_sky

Description of Subroutines and Functions

parse_options

subroutine parse_options ()
    ! Calls: getArgument
end subroutine parse_options
Parse the options passed when program called.

Author: J. D. McEwen (mcewen@mrao.cam.ac.uk)

Version: 0.1 - November 2004