1 | MODULE icosa_init_mod |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | CONTAINS |
---|
6 | |
---|
7 | SUBROUTINE icosa_init |
---|
8 | USE icosa |
---|
9 | USE timeloop_gcm_mod |
---|
10 | USE disvert_mod |
---|
11 | USE etat0_mod |
---|
12 | USE wind_mod |
---|
13 | USE mpipara |
---|
14 | USE omp_para |
---|
15 | USE vertical_interp_mod |
---|
16 | USE trace |
---|
17 | USE output_field_mod |
---|
18 | USE xios_mod |
---|
19 | USE write_field_mod |
---|
20 | USE physics_mod |
---|
21 | USE tracer_mod |
---|
22 | IMPLICIT NONE |
---|
23 | |
---|
24 | CALL init_mpipara |
---|
25 | CALL trace_off |
---|
26 | CALL xios_init |
---|
27 | CALL init_earth_const |
---|
28 | CALL init_grid_param(is_mpi_master) |
---|
29 | CALL init_omp_para(is_mpi_master) |
---|
30 | CALL compute_metric |
---|
31 | CALL compute_domain |
---|
32 | CALL init_transfert |
---|
33 | CALL init_writefield |
---|
34 | CALL init_trace |
---|
35 | |
---|
36 | !$OMP PARALLEL |
---|
37 | CALL switch_omp_no_distrib_level |
---|
38 | CALL compute_geometry |
---|
39 | CALL check_total_area |
---|
40 | |
---|
41 | CALL init_disvert |
---|
42 | CALL init_vertical_interp |
---|
43 | CALL init_tracer |
---|
44 | |
---|
45 | CALL WriteField("Ai",geom%Ai) |
---|
46 | |
---|
47 | IF (is_mpi_root) CALL write_apbp |
---|
48 | CALL init_time |
---|
49 | |
---|
50 | CALL output_field_init |
---|
51 | CALL init_timeloop |
---|
52 | !$OMP END PARALLEL |
---|
53 | |
---|
54 | CALL init_physics |
---|
55 | |
---|
56 | !$OMP PARALLEL |
---|
57 | CALL timeloop |
---|
58 | CALL switch_omp_no_distrib_level |
---|
59 | !$OMP END PARALLEL |
---|
60 | |
---|
61 | CALL output_field_finalize |
---|
62 | CALL close_files |
---|
63 | CALL close_time_counter |
---|
64 | CALL finalize_mpipara |
---|
65 | |
---|
66 | CONTAINS |
---|
67 | |
---|
68 | SUBROUTINE check_total_area |
---|
69 | IMPLICIT NONE |
---|
70 | TYPE(t_field),POINTER,SAVE :: sum_ne(:) |
---|
71 | TYPE(t_field),POINTER,SAVE :: sum_ne_glo(:) |
---|
72 | REAL(rstd),POINTER :: pt_sum_ne(:) |
---|
73 | INTEGER :: ind,i,j,k,n |
---|
74 | REAL(rstd) :: vect(3,6) |
---|
75 | REAL(rstd) :: centr(3),dist |
---|
76 | REAL(rstd) :: tot_sum=0 |
---|
77 | |
---|
78 | CALL allocate_field(sum_ne,field_T,type_real) |
---|
79 | |
---|
80 | !$OMP BARRIER |
---|
81 | !$OMP MASTER |
---|
82 | DO ind=1,ndomain |
---|
83 | |
---|
84 | pt_sum_ne=sum_ne(ind) |
---|
85 | |
---|
86 | CALL swap_dimensions(ind) |
---|
87 | CALL swap_geometry(ind) |
---|
88 | |
---|
89 | DO j=jj_begin,jj_end |
---|
90 | DO i=ii_begin,ii_end |
---|
91 | n=(j-1)*iim+i |
---|
92 | pt_sum_ne(n)=0 |
---|
93 | DO k=1,6 |
---|
94 | pt_sum_ne(n)=pt_sum_ne(n)+ne(n,k) |
---|
95 | ENDDO |
---|
96 | IF (domain(ind)%own(i,j)) tot_sum=tot_sum+Ai(n) |
---|
97 | ENDDO |
---|
98 | ENDDO |
---|
99 | ENDDO |
---|
100 | |
---|
101 | IF (is_mpi_root) PRINT *," Diff surf",1-tot_sum/(4*Pi*radius*radius) |
---|
102 | !$OMP END MASTER |
---|
103 | |
---|
104 | END SUBROUTINE check_total_area |
---|
105 | |
---|
106 | END SUBROUTINE icosa_init |
---|
107 | |
---|
108 | END MODULE icosa_init_mod |
---|