1 | MODULE etat0_limit_unstruct_mod |
---|
2 | |
---|
3 | LOGICAL, SAVE :: create_etat0_limit |
---|
4 | !$OMP THREADPRIVATE(create_etat0_limit) |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | CONTAINS |
---|
10 | |
---|
11 | SUBROUTINE init_etat0_limit_unstruct |
---|
12 | #ifdef CPP_XIOS |
---|
13 | USE xios |
---|
14 | USE mod_phys_lmdz_para |
---|
15 | USE mod_grid_phy_lmdz |
---|
16 | USE ioipsl, ONLY : getin, ioget_year_len |
---|
17 | USE time_phylmdz_mod, ONLY : annee_ref |
---|
18 | IMPLICIT NONE |
---|
19 | |
---|
20 | INTEGER :: iflag_phys,i |
---|
21 | INTEGER :: ndays |
---|
22 | REAL,ALLOCATABLE :: value(:) |
---|
23 | |
---|
24 | IF (grid_type==unstructured) THEN |
---|
25 | IF (is_master) CALL getin("iflag_phys",iflag_phys) |
---|
26 | CALL bcast(iflag_phys) |
---|
27 | |
---|
28 | IF (is_master) CALL getin('create_etat0_limit',create_etat0_limit) |
---|
29 | CALL bcast(create_etat0_limit) |
---|
30 | |
---|
31 | ndays=ioget_year_len(annee_ref) |
---|
32 | ALLOCATE(value(ndays)) |
---|
33 | DO i=1,ndays |
---|
34 | value(i)=i-1 |
---|
35 | ENDDO |
---|
36 | |
---|
37 | IF (is_omp_master) CALL xios_set_axis_attr("time_year",n_glo=ndays,value=value) |
---|
38 | |
---|
39 | IF (create_etat0_limit) THEN |
---|
40 | IF (iflag_phys<100) THEN |
---|
41 | IF (is_omp_master) CALL xios_set_fieldgroup_attr("etat0_limit_read",read_access=.TRUE.,enabled=.TRUE.) |
---|
42 | IF (is_omp_master) CALL xios_set_filegroup_attr("etat0_limit_read",enabled=.TRUE.) |
---|
43 | ENDIF |
---|
44 | IF (is_omp_master) CALL xios_set_file_attr("limit_write",enabled=.TRUE.) |
---|
45 | ENDIF |
---|
46 | |
---|
47 | ENDIF |
---|
48 | |
---|
49 | #endif |
---|
50 | END SUBROUTINE init_etat0_limit_unstruct |
---|
51 | |
---|
52 | SUBROUTINE create_etat0_limit_unstruct |
---|
53 | #ifdef CPP_XIOS |
---|
54 | USE mod_grid_phy_lmdz |
---|
55 | USE create_etat0_unstruct_mod |
---|
56 | USE create_limit_unstruct_mod |
---|
57 | USE phyaqua_mod |
---|
58 | USE mod_phys_lmdz_para |
---|
59 | USE ioipsl, ONLY : getin |
---|
60 | USE dimphy |
---|
61 | USE xios |
---|
62 | IMPLICIT NONE |
---|
63 | INTEGER :: iflag_phys |
---|
64 | |
---|
65 | IF (grid_type==unstructured) THEN |
---|
66 | |
---|
67 | IF (is_master) CALL getin("iflag_phys",iflag_phys) |
---|
68 | CALL bcast(iflag_phys) |
---|
69 | |
---|
70 | IF (iflag_phys<100) THEN |
---|
71 | IF ( create_etat0_limit) THEN |
---|
72 | CALL create_etat0_unstruct |
---|
73 | CALL create_limit_unstruct |
---|
74 | IF (is_omp_master) THEN |
---|
75 | CALL xios_context_finalize() |
---|
76 | CALL xios_set_current_context("icosagcm") ! very bad, need to find an other solution |
---|
77 | CALL xios_context_finalize() |
---|
78 | CALL xios_finalize() |
---|
79 | ENDIF |
---|
80 | !$OMP BARRIER |
---|
81 | STOP 'create_etat0_limit_unstruct, Initial state file are created, all is fine' |
---|
82 | ENDIF |
---|
83 | ELSE |
---|
84 | IF (create_etat0_limit) THEN |
---|
85 | CALL iniaqua(klon,iflag_phys) |
---|
86 | IF (is_omp_master) THEN |
---|
87 | CALL xios_context_finalize() |
---|
88 | CALL xios_set_current_context("icosagcm") ! very bad, need to find an other solution |
---|
89 | CALL xios_context_finalize() |
---|
90 | CALL xios_finalize() |
---|
91 | ENDIF |
---|
92 | !$OMP BARRIER |
---|
93 | STOP 'create_etat0_limit_unstruct, Initial state file are created, all is fine' |
---|
94 | ENDIF |
---|
95 | ENDIF |
---|
96 | ENDIF |
---|
97 | |
---|
98 | #endif |
---|
99 | END SUBROUTINE create_etat0_limit_unstruct |
---|
100 | |
---|
101 | END MODULE etat0_limit_unstruct_mod |
---|
102 | |
---|