source: codes/icosagcm/devel/src/icosa_init.f90 @ 879

Last change on this file since 879 was 864, checked in by dubos, 5 years ago

devel : missing piece of previous commit

File size: 2.4 KB
RevLine 
[348]1MODULE icosa_init_mod
2
3CONTAINS
4
5  SUBROUTINE icosa_init
6  USE icosa
[835]7  USE signature_mod
[348]8  USE timeloop_gcm_mod
9  USE disvert_mod
10  USE etat0_mod
11  USE wind_mod
12  USE mpipara
13  USE omp_para
14  USE vertical_interp_mod
15  USE trace
16  USE output_field_mod
17  USE xios_mod
18  USE write_field_mod
19  USE physics_mod
[379]20  USE tracer_mod
[483]21  USE restart_mod
22  USE etat0_mod
[583]23  USE diagflux_mod
[714]24  USE profiling_mod
[830]25  USE init_grid_param_mod
[864]26  USE compute_geometry_mod
[348]27  IMPLICIT NONE
28 
[714]29    CALL init_profiling
[348]30    CALL init_mpipara
[835]31    IF(is_mpi_master) CALL print_signature
[348]32    CALL trace_off
33    CALL xios_init
34    CALL init_earth_const 
35    CALL init_grid_param(is_mpi_master)
36    CALL init_omp_para(is_mpi_master)
[846]37    IF(grid_type == grid_ico) CALL compute_metric
[348]38    CALL compute_domain
39    CALL init_transfert
40    CALL init_writefield
41    CALL init_trace
42
43  !$OMP PARALLEL 
44    CALL switch_omp_no_distrib_level
[864]45    CALL compute_geometry
[348]46    CALL check_total_area
47 
48    CALL init_disvert 
49    CALL init_vertical_interp
[379]50    CALL init_tracer
51   
[348]52    CALL WriteField("Ai",geom%Ai)
53 
54    IF (is_mpi_root) CALL write_apbp
55    CALL init_time
[483]56    CALL init_restart
57    CALL init_etat0
[348]58
59    CALL output_field_init
60    CALL init_timeloop
[726]61
62  !$OMP END PARALLEL
63
[348]64    CALL init_physics
[583]65
[726]66  !$OMP PARALLEL
67 
[583]68    CALL init_diagflux
[714]69    CALL zero_du_phys
[348]70    CALL timeloop
71    CALL switch_omp_no_distrib_level
72  !$OMP END PARALLEL
73
74    CALL output_field_finalize
75    CALL close_files
76    CALL close_time_counter
77    CALL finalize_mpipara
78
79  CONTAINS
[813]80 
[348]81    SUBROUTINE check_total_area
82    IMPLICIT NONE
[846]83    INTEGER :: ind,i,j,ij
[348]84    REAL(rstd) :: vect(3,6)
85    REAL(rstd) :: centr(3),dist   
86    REAL(rstd) :: tot_sum=0
87
88    !$OMP BARRIER
89    !$OMP MASTER
[846]90    IF(grid_type == grid_ico) THEN
91       DO ind=1,ndomain
92          CALL swap_dimensions(ind)
93          CALL swap_geometry(ind)
94          DO j=jj_begin,jj_end
95             DO i=ii_begin,ii_end
96                ij=(j-1)*iim+i
97                IF (domain(ind)%own(i,j)) tot_sum=tot_sum+Ai(ij)
98             ENDDO
[348]99          ENDDO
[846]100       ENDDO
101    END IF
102    IF (is_mpi_root) PRINT *," Diff surf",1-tot_sum/(4*Pi*radius*radius)
[348]103    !$OMP END MASTER
104   
105    END SUBROUTINE check_total_area
106 
107  END SUBROUTINE icosa_init
108
[642]109  SUBROUTINE force_recompile_unstructured
110    USE timestep_unstructured_mod
[686]111    USE transport_unstructured_mod
[642]112  END SUBROUTINE force_recompile_unstructured
113
[348]114END MODULE icosa_init_mod
Note: See TracBrowser for help on using the repository browser.