1 | MODULE paramLMDZ_phy_mod |
---|
2 | |
---|
3 | ! Olivier 13/07/2016 |
---|
4 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
5 | |
---|
6 | CONTAINS |
---|
7 | |
---|
8 | SUBROUTINE ini_paramLMDZ_phy(dtime,nid_ctesGCM) |
---|
9 | |
---|
10 | USE clesphys_mod_h |
---|
11 | USE iophy |
---|
12 | USE dimphy |
---|
13 | USE ioipsl, only: histbeg, histvert, histdef, histend, ymds2ju |
---|
14 | USE mod_phys_lmdz_mpi_data, ONLY: is_mpi_root |
---|
15 | USE geometry_mod, ONLY: longitude_deg, latitude_deg |
---|
16 | USE mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, klon_glo |
---|
17 | USE time_phylmdz_mod, ONLY: annee_ref, day_ref, itau_phy, pdtphys |
---|
18 | USE mod_phys_lmdz_transfert_para, ONLY: gather, bcast |
---|
19 | |
---|
20 | USE yomcst_mod_h |
---|
21 | IMPLICIT NONE |
---|
22 | |
---|
23 | |
---|
24 | |
---|
25 | REAL, INTENT(OUT) :: dtime |
---|
26 | INTEGER, INTENT(OUT) :: nid_ctesGCM |
---|
27 | |
---|
28 | REAL,DIMENSION(klon_glo) :: rlat_glo |
---|
29 | REAL,DIMENSION(klon_glo) :: rlon_glo |
---|
30 | INTEGER i, idayref, ISW, itau_w |
---|
31 | REAL zstophy, zout |
---|
32 | REAL zx_lon(nbp_lon,nbp_lat) |
---|
33 | REAL zx_lat(nbp_lon,nbp_lat) |
---|
34 | |
---|
35 | CHARACTER*1 ch1 |
---|
36 | INTEGER nhori |
---|
37 | INTEGER, PARAMETER :: np=1 |
---|
38 | |
---|
39 | REAL zjulian |
---|
40 | SAVE zjulian |
---|
41 | !$OMP THREADPRIVATE(zjulian) |
---|
42 | |
---|
43 | !IM Implemente en modes sequentiel et parallele |
---|
44 | |
---|
45 | CALL gather(latitude_deg,rlat_glo) |
---|
46 | CALL bcast(rlat_glo) |
---|
47 | CALL gather(longitude_deg,rlon_glo) |
---|
48 | CALL bcast(rlon_glo) |
---|
49 | |
---|
50 | !$OMP MASTER |
---|
51 | IF (is_mpi_root) THEN |
---|
52 | ! |
---|
53 | ! zstophy = pdtphys |
---|
54 | ! zout = -1 |
---|
55 | !--OB modified for daily output |
---|
56 | zstophy = 86400. |
---|
57 | zout = 86400. |
---|
58 | ! |
---|
59 | idayref = day_ref |
---|
60 | CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian) |
---|
61 | ! |
---|
62 | CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,rlon_glo,zx_lon) |
---|
63 | IF (nbp_lon.GT.1) THEN |
---|
64 | DO i = 1, nbp_lon |
---|
65 | zx_lon(i,1) = rlon_glo(i+1) |
---|
66 | zx_lon(i,nbp_lat) = rlon_glo(i+1) |
---|
67 | ENDDO |
---|
68 | ENDIF |
---|
69 | ! |
---|
70 | CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,rlat_glo,zx_lat) |
---|
71 | ! |
---|
72 | CALL histbeg("paramLMDZ_phy.nc", & |
---|
73 | np,zx_lon(np:np,1), np,zx_lat(1,np:np), & |
---|
74 | 1,1,1,1, & |
---|
75 | itau_phy, zjulian, dtime, & |
---|
76 | nhori, nid_ctesGCM) |
---|
77 | ! |
---|
78 | CALL histdef(nid_ctesGCM, "R_ecc", & |
---|
79 | "Excentricite","-", & |
---|
80 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
81 | "ave(X)", zstophy,zout) |
---|
82 | ! |
---|
83 | CALL histdef(nid_ctesGCM, "R_peri", & |
---|
84 | "Equinoxe","-", & |
---|
85 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
86 | "ave(X)", zstophy,zout) |
---|
87 | ! |
---|
88 | CALL histdef(nid_ctesGCM, "R_incl", & |
---|
89 | "Inclinaison","deg", & |
---|
90 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
91 | "ave(X)", zstophy,zout) |
---|
92 | ! |
---|
93 | CALL histdef(nid_ctesGCM, "solaire", & |
---|
94 | "Constante solaire","W/m2", & |
---|
95 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
96 | "ave(X)", zstophy,zout) |
---|
97 | ! |
---|
98 | #ifdef CPP_RRTM |
---|
99 | IF (iflag_rrtm.EQ.1) THEN |
---|
100 | DO ISW=1, NSW |
---|
101 | WRITE(ch1,'(i1)') ISW |
---|
102 | CALL histdef(nid_ctesGCM, "rsun"//ch1, & |
---|
103 | "Fraction constante solaire bande "//ch1,"W/m2", & |
---|
104 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
105 | "ave(X)", zstophy,zout) |
---|
106 | ENDDO |
---|
107 | ENDIF |
---|
108 | #endif |
---|
109 | ! |
---|
110 | CALL histdef(nid_ctesGCM, "co2_ppm", & |
---|
111 | "Concentration du CO2", "ppm", & |
---|
112 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
113 | "ave(X)", zstophy,zout) |
---|
114 | ! |
---|
115 | CALL histdef(nid_ctesGCM, "CH4_ppb", & |
---|
116 | "Concentration du CH4", "ppb", & |
---|
117 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
118 | "ave(X)", zstophy,zout) |
---|
119 | ! |
---|
120 | CALL histdef(nid_ctesGCM, "N2O_ppb", & |
---|
121 | "Concentration du N2O", "ppb", & |
---|
122 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
123 | "ave(X)", zstophy,zout) |
---|
124 | ! |
---|
125 | CALL histdef(nid_ctesGCM, "CFC11_ppt", & |
---|
126 | "Concentration du CFC11", "ppt", & |
---|
127 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
128 | "ave(X)", zstophy,zout) |
---|
129 | ! |
---|
130 | CALL histdef(nid_ctesGCM, "CFC12_ppt", & |
---|
131 | "Concentration du CFC12", "ppt", & |
---|
132 | 1,1,nhori, 1,1,1, -99, 32, & |
---|
133 | "ave(X)", zstophy,zout) |
---|
134 | ! |
---|
135 | CALL histend(nid_ctesGCM) |
---|
136 | |
---|
137 | ENDIF !(is_mpi_root) |
---|
138 | !$OMP END MASTER |
---|
139 | |
---|
140 | END SUBROUTINE ini_paramLMDZ_phy |
---|
141 | |
---|
142 | !================================================================= |
---|
143 | |
---|
144 | SUBROUTINE write_paramLMDZ_phy(itap,nid_ctesGCM,ok_sync) |
---|
145 | |
---|
146 | USE mod_phys_lmdz_mpi_data, ONLY: is_mpi_root |
---|
147 | USE time_phylmdz_mod, ONLY: day_step_phy, annee_ref, itau_phy, start_time |
---|
148 | USE mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, klon_glo |
---|
149 | |
---|
150 | USE iophy |
---|
151 | USE ioipsl, ONLY: histwrite, histsync |
---|
152 | |
---|
153 | #ifdef CPP_RRTM |
---|
154 | USE YOESW, ONLY : RSUN |
---|
155 | #endif |
---|
156 | |
---|
157 | USE clesphys_mod_h |
---|
158 | USE yomcst_mod_h |
---|
159 | IMPLICIT NONE |
---|
160 | |
---|
161 | |
---|
162 | |
---|
163 | INTEGER, INTENT(IN) :: itap, nid_ctesGCM |
---|
164 | LOGICAL, INTENT(IN) :: ok_sync |
---|
165 | |
---|
166 | INTEGER itau_w, ISW |
---|
167 | INTEGER ndex2d(nbp_lon*nbp_lat) |
---|
168 | REAL :: zx_tmp_0d(1,1) |
---|
169 | INTEGER, PARAMETER :: np=1 |
---|
170 | |
---|
171 | CHARACTER*1 ch1 |
---|
172 | |
---|
173 | !$OMP MASTER |
---|
174 | IF (is_mpi_root) THEN |
---|
175 | ! |
---|
176 | ndex2d = 0 |
---|
177 | itau_w = itau_phy + itap + int(start_time * day_step_phy) |
---|
178 | ! |
---|
179 | ! Variables globales |
---|
180 | ! |
---|
181 | zx_tmp_0d=R_ecc |
---|
182 | CALL histwrite(nid_ctesGCM,"R_ecc",itau_w, & |
---|
183 | zx_tmp_0d,np,ndex2d) |
---|
184 | ! |
---|
185 | zx_tmp_0d=R_peri |
---|
186 | CALL histwrite(nid_ctesGCM,"R_peri",itau_w, & |
---|
187 | zx_tmp_0d,np,ndex2d) |
---|
188 | ! |
---|
189 | zx_tmp_0d=R_incl |
---|
190 | CALL histwrite(nid_ctesGCM,"R_incl",itau_w, & |
---|
191 | zx_tmp_0d,np,ndex2d) |
---|
192 | ! |
---|
193 | zx_tmp_0d=solaire |
---|
194 | CALL histwrite(nid_ctesGCM,"solaire",itau_w, & |
---|
195 | zx_tmp_0d,np,ndex2d) |
---|
196 | ! |
---|
197 | #ifdef CPP_RRTM |
---|
198 | IF (iflag_rrtm.EQ.1) THEN |
---|
199 | DO ISW=1, NSW |
---|
200 | WRITE(ch1,'(i1)') ISW |
---|
201 | zx_tmp_0d=RSUN(ISW) |
---|
202 | CALL histwrite(nid_ctesGCM,"rsun"//ch1,itau_w, & |
---|
203 | zx_tmp_0d,np,ndex2d) |
---|
204 | ENDDO |
---|
205 | ENDIF |
---|
206 | #endif |
---|
207 | ! |
---|
208 | zx_tmp_0d=co2_ppm |
---|
209 | CALL histwrite(nid_ctesGCM,"co2_ppm",itau_w, & |
---|
210 | zx_tmp_0d,np,ndex2d) |
---|
211 | ! |
---|
212 | zx_tmp_0d=CH4_ppb |
---|
213 | CALL histwrite(nid_ctesGCM,"CH4_ppb",itau_w, & |
---|
214 | zx_tmp_0d,np,ndex2d) |
---|
215 | ! |
---|
216 | zx_tmp_0d=N2O_ppb |
---|
217 | CALL histwrite(nid_ctesGCM,"N2O_ppb",itau_w, & |
---|
218 | zx_tmp_0d,np,ndex2d) |
---|
219 | ! |
---|
220 | zx_tmp_0d=CFC11_ppt |
---|
221 | CALL histwrite(nid_ctesGCM,"CFC11_ppt",itau_w, & |
---|
222 | zx_tmp_0d,np,ndex2d) |
---|
223 | ! |
---|
224 | zx_tmp_0d=CFC12_ppt |
---|
225 | CALL histwrite(nid_ctesGCM,"CFC12_ppt",itau_w, & |
---|
226 | zx_tmp_0d,np,ndex2d) |
---|
227 | ! |
---|
228 | !================================================================= |
---|
229 | ! |
---|
230 | IF (ok_sync) THEN |
---|
231 | call histsync(nid_ctesGCM) |
---|
232 | ENDIF |
---|
233 | |
---|
234 | ENDIF !(is_mpi_root) then |
---|
235 | !$OMP END MASTER |
---|
236 | |
---|
237 | END SUBROUTINE write_paramLMDZ_phy |
---|
238 | |
---|
239 | END MODULE paramLMDZ_phy_mod |
---|