-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.f90
92 lines (73 loc) · 2.63 KB
/
main.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
! =====================================================================
! LICORICE: Ly_alpha transfer part, on a fixed grid
! =====================================================================
PROGRAM TREECD
USE COSMOLOGY
USE FUNCTIONS
USE IO
USE TR_LY
USE TR_LY_UTILS
USE VARS
USE OMP_LIB
USE MPI
implicit none
integer :: ix,iy,iz
real(KIND=8):: a,x_in,x_out,Ho,nb_dens,cell_path,Ly_alpha_cross,cell_opt_depth,target_opt_depth,target_x,t_v,aa
! Open data files, read input parameters and initial system state,
! initialize system parameters, and start output.
! ----------------------------------------------------------------
CALL MPI_INIT_THREAD(MPI_THREAD_MULTIPLE,PROVIDED,ierror)
CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierror)
CALL MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierror)
IF((ierror==MPI_SUCCESS).and.(myrank==MASTER))then
print*,'MPI initialized'
END IF
call INPARM
!$OMP PARALLEL
call init_rando()
!$OMP END PARALLEL
IF((ierror==MPI_SUCCESS).and.(myrank==MASTER))then
open(50,FILE='dtb_moy.dat',STATUS='REPLACE')
open(44,FILE='sources.dat',STATUS='REPLACE')
print*,'"""""""""""""""""""""""""""""""""""""""""""""""""""""'
print*,' LICORICE: LOOP OVER THE SNAPSHOT FILES'
print*,'"""""""""""""""""""""""""""""""""""""""""""""""""""""'
END IF
do num_file=first_file,last_file
IF((ierror==MPI_SUCCESS).and.(myrank==MASTER))then
print*,'processing file:',num_file
END IF
call LICORICE_NEW_INPUT(num_file)
call expansion_factor(tnow,exp_fact,exp_fact_dot)
! Photons Lyman-alpha X; factor 0.5 because photons at the line center
! ENLEVER CA S'IL N'Y A PAS DE RAYONS X!!!!!!!!
!do ix=1,array_size
! do iy=1,array_size
! do iz=1,array_size
! diff_num(ix,iy,iz)=diff_num(ix,iy,iz)*1.0d65*0.5*1.3475d-7*cell(ix,iy,iz)%HI_number_density* &
! exp_fact**(-3.0)*exp_fact/exp_fact_dot
! enddo
! enddo
!enddo
CALL MPI_BARRIER(MPI_COMM_WORLD,ierror)
IF((ierror==MPI_SUCCESS).and.(myrank==MASTER))then
print*,'"""""""""""""""""""""""""""""""""""""""""""""""""""""'
print*,'redshift initial: ',1./exp_fact-1
print*,'exp_fact: ',exp_fact
print*,'tnow: ',tnow
print*,'"""""""""""""""""""""""""""""""""""""""""""""""""""""'
END IF
call CAST_PHOTONS_LY
IF((ierror==MPI_SUCCESS).and.(myrank==MASTER))then
print*,''
print*,'"""""""""""""""""""""""""""""""""""""""""""""""""""""'
print*,'"""""""""""""""""""""""""""""""""""""""""""""""""""""'
print*,''
END IF
enddo
IF((ierror==MPI_SUCCESS).and.(myrank==MASTER))then
close(50)
close(44)
END IF
CALL MPI_FINALIZE(ierror)
END PROGRAM