Changeset 3413 for LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm
- Timestamp:
- Nov 12, 2018, 1:52:29 PM (6 years ago)
- Location:
- LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/readaerosolstrato1_rrtm.F90
r2744 r3413 2 2 ! $Id: readaerosolstrato1_rrtm.F90 2526 2016-05-26 22:13:40Z oboucher $ 3 3 ! 4 4 5 SUBROUTINE readaerosolstrato1_rrtm(debut) 5 6 … … 9 10 10 11 USE phys_cal_mod, ONLY : mth_cur 11 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid2dTo1d_glo 12 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 13 USE mod_phys_lmdz_omp_data, ONLY : is_omp_root 12 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid2dTo1d_glo, grid_type, unstructured 14 13 USE mod_phys_lmdz_para 15 14 USE phys_state_var_mod … … 19 18 USE YOERAD, ONLY : NLW 20 19 USE YOMCST 20 USE xios 21 21 22 22 IMPLICIT NONE … … 45 45 REAL, ALLOCATABLE:: tauaerstrat_mois(:, :, :) 46 46 REAL, ALLOCATABLE:: tauaerstrat_mois_glo(:, :) 47 REAL, ALLOCATABLE:: tauaerstrat_mpi(:, :) 47 48 48 49 ! For NetCDF: … … 102 103 n_lat = size(latitude) 103 104 print *, 'LAT aerosol strato=', n_lat, latitude 104 IF (n_lat.NE.nbp_lat) THEN 105 print *,'Le nombre de lat n est pas egal a nbp_lat' 106 STOP 107 ENDIF 108 105 106 IF (grid_type/=unstructured) THEN 107 IF (n_lat.NE.nbp_lat) THEN 108 print *,'Le nombre de lat n est pas egal a nbp_lat' 109 STOP 110 ENDIF 111 ENDIF 112 109 113 CALL nf95_inq_varid(ncid_in, "LON", varid) 110 114 CALL nf95_gw_var(ncid_in, varid, longitude) 111 115 n_lon = size(longitude) 112 116 print *, 'LON aerosol strato=', n_lon, longitude 113 IF (n_lon.NE.nbp_lon) THEN 114 print *,'Le nombre de lon n est pas egal a nbp_lon' 115 STOP 116 ENDIF 117 117 118 IF (grid_type/=unstructured) THEN 119 IF (n_lon.NE.nbp_lon) THEN 120 print *,'Le nombre de lon n est pas egal a nbp_lon' 121 STOP 122 ENDIF 123 ENDIF 124 125 118 126 CALL nf95_inq_varid(ncid_in, "TIME", varid) 119 127 CALL nf95_gw_var(ncid_in, varid, time) … … 144 152 !---reduce to a klon_glo grid 145 153 CALL grid2dTo1d_glo(tauaerstrat_mois,tauaerstrat_mois_glo) 146 154 155 ELSE 156 ALLOCATE(tauaerstrat_mois(0,0,0)) 147 157 ENDIF !--is_mpi_root and is_omp_root 148 158 … … 153 163 154 164 !--scatter on all proc 155 CALL scatter(tauaerstrat_mois_glo,tau_aer_strat) 156 165 166 IF (grid_type==unstructured) THEN 167 IF (is_omp_master) THEN 168 ALLOCATE(tauaerstrat_mpi(klon_mpi,klev)) 169 CALL xios_send_field("taustrat_in",tauaerstrat_mois) 170 CALL xios_recv_field("taustrat_out",tauaerstrat_mpi) 171 ELSE 172 ALLOCATE(tauaerstrat_mpi(0,0)) 173 ENDIF 174 CALL scatter_omp(tauaerstrat_mpi,tau_aer_strat) 175 ELSE 176 CALL scatter(tauaerstrat_mois_glo,tau_aer_strat) 177 ENDIF 178 157 179 IF (is_mpi_root.AND.is_omp_root) THEN 158 180 ! -
LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90
r2744 r3413 2 2 ! $Id: readaerosolstrato2_rrtm.F90 2526 2016-05-26 22:13:40Z oboucher $ 3 3 ! 4 4 5 SUBROUTINE readaerosolstrato2_rrtm(debut) 5 6 … … 9 10 10 11 USE phys_cal_mod, ONLY : mth_cur 11 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid2dTo1d_glo 12 USE mod_phys_lmdz_mpi_data , ONLY : is_mpi_root13 USE mod_phys_lmdz_omp_data , ONLY : is_omp_root12 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid2dTo1d_glo, grid_type, unstructured 13 USE mod_phys_lmdz_mpi_data 14 USE mod_phys_lmdz_omp_data 14 15 USE mod_phys_lmdz_para 15 16 USE phys_state_var_mod … … 19 20 USE YOERAD, ONLY : NLW 20 21 USE YOMCST 21 22 USE xios 22 23 IMPLICIT NONE 23 24 … … 65 66 REAL, ALLOCATABLE:: cgaerstrat_mois_glo(:, :, :) 66 67 REAL, ALLOCATABLE:: taulwaerstrat_mois_glo(:, :, :) 68 REAL, ALLOCATABLE:: tauaerstrat_mpi(:, :, :) 69 REAL, ALLOCATABLE:: pizaerstrat_mpi(:, :, :) 70 REAL, ALLOCATABLE:: cgaerstrat_mpi(:, :, :) 71 REAL, ALLOCATABLE:: taulwaerstrat_mpi(:, :, :) 67 72 68 73 ! For NetCDF: … … 107 112 CALL nf95_gw_var(ncid_in, varid, latitude) 108 113 n_lat = size(latitude) 109 IF (n_lat.NE.nbp_lat) THEN 110 print *, 'latitude=', n_lat, nbp_lat 111 abort_message='Le nombre de lat n est pas egal a nbp_lat' 112 CALL abort_physic(modname,abort_message,1) 114 115 IF (grid_type/=unstructured) THEN 116 IF (n_lat.NE.nbp_lat) THEN 117 print *, 'latitude=', n_lat, nbp_lat 118 abort_message='Le nombre de lat n est pas egal a nbp_lat' 119 CALL abort_physic(modname,abort_message,1) 120 ENDIF 113 121 ENDIF 114 122 … … 134 142 ALLOCATE(cgaerstrat(n_lat, n_lev, n_wav, n_month)) 135 143 136 ALLOCATE(tauaerstrat_mois(n_lon, n_lat, n_lev, n_wav))137 ALLOCATE(pizaerstrat_mois(n_lon, n_lat, n_lev, n_wav))138 ALLOCATE(cgaerstrat_mois(n_lon, n_lat, n_lev, n_wav))139 140 ALLOCATE(tauaerstrat_mois_glo(klon_glo, n_lev, n_wav))141 ALLOCATE(pizaerstrat_mois_glo(klon_glo, n_lev, n_wav))142 ALLOCATE(cgaerstrat_mois_glo(klon_glo, n_lev, n_wav))143 144 144 !--reading stratospheric aerosol tau per layer 145 145 CALL nf95_inq_varid(ncid_in, "TAU_SUN", varid) … … 159 159 CALL nf95_close(ncid_in) 160 160 161 162 IF (grid_type/=unstructured) THEN 163 ALLOCATE(tauaerstrat_mois(n_lon, n_lat, n_lev, n_wav)) 164 ALLOCATE(pizaerstrat_mois(n_lon, n_lat, n_lev, n_wav)) 165 ALLOCATE(cgaerstrat_mois(n_lon, n_lat, n_lev, n_wav)) 166 167 ALLOCATE(tauaerstrat_mois_glo(klon_glo, n_lev, n_wav)) 168 ALLOCATE(pizaerstrat_mois_glo(klon_glo, n_lev, n_wav)) 169 ALLOCATE(cgaerstrat_mois_glo(klon_glo, n_lev, n_wav)) 161 170 !--select the correct month 162 171 !--and copy into 1st longitude 163 tauaerstrat_mois(1,:,:,:) = tauaerstrat(:,:,:,mth_cur)164 pizaerstrat_mois(1,:,:,:) = pizaerstrat(:,:,:,mth_cur)165 cgaerstrat_mois(1,:,:,:) = cgaerstrat(:,:,:,mth_cur)172 tauaerstrat_mois(1,:,:,:) = tauaerstrat(:,:,:,mth_cur) 173 pizaerstrat_mois(1,:,:,:) = pizaerstrat(:,:,:,mth_cur) 174 cgaerstrat_mois(1,:,:,:) = cgaerstrat(:,:,:,mth_cur) 166 175 167 176 !--copy longitudes 168 DO i=2, n_lon169 tauaerstrat_mois(i,:,:,:) = tauaerstrat_mois(1,:,:,:)170 pizaerstrat_mois(i,:,:,:) = pizaerstrat_mois(1,:,:,:)171 cgaerstrat_mois(i,:,:,:) = cgaerstrat_mois(1,:,:,:)172 ENDDO177 DO i=2, n_lon 178 tauaerstrat_mois(i,:,:,:) = tauaerstrat_mois(1,:,:,:) 179 pizaerstrat_mois(i,:,:,:) = pizaerstrat_mois(1,:,:,:) 180 cgaerstrat_mois(i,:,:,:) = cgaerstrat_mois(1,:,:,:) 181 ENDDO 173 182 174 183 !---reduce to a klon_glo grid 175 DO band=1, NSW176 CALL grid2dTo1d_glo(tauaerstrat_mois(:,:,:,band),tauaerstrat_mois_glo(:,:,band))177 CALL grid2dTo1d_glo(pizaerstrat_mois(:,:,:,band),pizaerstrat_mois_glo(:,:,band))178 CALL grid2dTo1d_glo(cgaerstrat_mois(:,:,:,band),cgaerstrat_mois_glo(:,:,band))179 ENDDO180 184 DO band=1, NSW 185 CALL grid2dTo1d_glo(tauaerstrat_mois(:,:,:,band),tauaerstrat_mois_glo(:,:,band)) 186 CALL grid2dTo1d_glo(pizaerstrat_mois(:,:,:,band),pizaerstrat_mois_glo(:,:,band)) 187 CALL grid2dTo1d_glo(cgaerstrat_mois(:,:,:,band),cgaerstrat_mois_glo(:,:,band)) 188 ENDDO 189 ENDIF 181 190 !--Now LW optical properties 182 191 ! 192 183 193 CALL nf95_open("taulwstrat.2D.nc", nf90_nowrite, ncid_in) 184 194 … … 194 204 CALL nf95_gw_var(ncid_in, varid, latitude) 195 205 n_lat = size(latitude) 196 IF (n_lat.NE.nbp_lat) THEN 197 abort_message='Le nombre de lat n est pas egal a nbp_lat' 198 CALL abort_physic(modname,abort_message,1) 199 ENDIF 200 206 207 IF (grid_type/=unstructured) THEN 208 IF (n_lat.NE.nbp_lat) THEN 209 abort_message='Le nombre de lat n est pas egal a nbp_lat' 210 CALL abort_physic(modname,abort_message,1) 211 ENDIF 212 ENDIF 213 201 214 CALL nf95_inq_varid(ncid_in, "TIME", varid) 202 215 CALL nf95_gw_var(ncid_in, varid, time) … … 217 230 218 231 ALLOCATE(taulwaerstrat(n_lat, n_lev, n_wav, n_month)) 219 ALLOCATE(taulwaerstrat_mois(n_lon, n_lat, n_lev, n_wav))220 ALLOCATE(taulwaerstrat_mois_glo(klon_glo, n_lev, n_wav))221 232 222 233 !--reading stratospheric aerosol lw tau per layer … … 227 238 CALL nf95_close(ncid_in) 228 239 240 IF (grid_type/=unstructured) THEN 241 242 ALLOCATE(taulwaerstrat_mois(n_lon, n_lat, n_lev, n_wav)) 243 ALLOCATE(taulwaerstrat_mois_glo(klon_glo, n_lev, n_wav)) 244 229 245 !--select the correct month 230 246 !--and copy into 1st longitude 231 taulwaerstrat_mois(1,:,:,:) = taulwaerstrat(:,:,:,mth_cur)247 taulwaerstrat_mois(1,:,:,:) = taulwaerstrat(:,:,:,mth_cur) 232 248 !--copy longitudes 233 DO i=2, n_lon234 taulwaerstrat_mois(i,:,:,:) = taulwaerstrat_mois(1,:,:,:)235 ENDDO249 DO i=2, n_lon 250 taulwaerstrat_mois(i,:,:,:) = taulwaerstrat_mois(1,:,:,:) 251 ENDDO 236 252 237 253 !---reduce to a klon_glo grid 238 DO band=1, NLW 239 CALL grid2dTo1d_glo(taulwaerstrat_mois(:,:,:,band),taulwaerstrat_mois_glo(:,:,band)) 240 ENDDO 241 254 DO band=1, NLW 255 CALL grid2dTo1d_glo(taulwaerstrat_mois(:,:,:,band),taulwaerstrat_mois_glo(:,:,band)) 256 ENDDO 257 ENDIF 258 242 259 ELSE !--proc other than mpi_root and omp_root 243 260 !--dummy allocation needed for debug mode … … 248 265 ALLOCATE(taulwaerstrat_mois_glo(1,1,1)) 249 266 267 ALLOCATE(tauaerstrat(0,0,0,12)) 268 ALLOCATE(pizaerstrat(0,0,0,12)) 269 ALLOCATE(cgaerstrat(0,0,0,12)) 270 ALLOCATE(taulwaerstrat(0,0,0,12)) 271 272 250 273 ENDIF !--is_mpi_root and is_omp_root 251 274 … … 255 278 mth_pre=mth_cur 256 279 280 IF (grid_type==unstructured) THEN 281 282 IF (is_omp_master) THEN 283 ALLOCATE(tauaerstrat_mpi(klon_mpi, klev, NSW)) 284 ALLOCATE(pizaerstrat_mpi(klon_mpi, klev, NSW)) 285 ALLOCATE(cgaerstrat_mpi(klon_mpi, klev, NSW)) 286 ALLOCATE(taulwaerstrat_mpi(klon_mpi, klev, NLW)) 287 288 CALL xios_send_field("tauaerstrat_in",SPREAD(tauaerstrat(:,:,:,mth_cur),1,8)) 289 CALL xios_recv_field("tauaerstrat_out",tauaerstrat_mpi) 290 CALL xios_send_field("pizaerstrat_in",SPREAD(pizaerstrat(:,:,:,mth_cur),1,8)) 291 CALL xios_recv_field("pizaerstrat_out",pizaerstrat_mpi) 292 CALL xios_send_field("cgaerstrat_in",SPREAD(cgaerstrat(:,:,:,mth_cur),1,8)) 293 CALL xios_recv_field("cgaerstrat_out",cgaerstrat_mpi) 294 CALL xios_send_field("taulwaerstrat_in",SPREAD(taulwaerstrat(:,:,:,mth_cur),1,8)) 295 CALL xios_recv_field("taulwaerstrat_out",taulwaerstrat_mpi) 296 ELSE 297 ALLOCATE(tauaerstrat_mpi(0, 0, 0)) 298 ALLOCATE(pizaerstrat_mpi(0, 0, 0)) 299 ALLOCATE(cgaerstrat_mpi(0, 0, 0)) 300 ALLOCATE(taulwaerstrat_mpi(0, 0, 0)) 301 ENDIF 302 303 CALL scatter_omp(tauaerstrat_mpi,tau_aer_strat) 304 CALL scatter_omp(pizaerstrat_mpi,piz_aer_strat) 305 CALL scatter_omp(cgaerstrat_mpi,cg_aer_strat) 306 CALL scatter_omp(taulwaerstrat_mpi,taulw_aer_strat) 307 ELSE 308 257 309 !--scatter on all proc 258 CALL scatter(tauaerstrat_mois_glo,tau_aer_strat) 259 CALL scatter(pizaerstrat_mois_glo,piz_aer_strat) 260 CALL scatter(cgaerstrat_mois_glo,cg_aer_strat) 261 CALL scatter(taulwaerstrat_mois_glo,taulw_aer_strat) 310 CALL scatter(tauaerstrat_mois_glo,tau_aer_strat) 311 CALL scatter(pizaerstrat_mois_glo,piz_aer_strat) 312 CALL scatter(cgaerstrat_mois_glo,cg_aer_strat) 313 CALL scatter(taulwaerstrat_mois_glo,taulw_aer_strat) 314 315 DEALLOCATE(tauaerstrat_mois, pizaerstrat_mois, cgaerstrat_mois) 316 DEALLOCATE(taulwaerstrat_mois) 317 ENDIF 262 318 263 319 IF (is_mpi_root.AND.is_omp_root) THEN 264 ! 265 DEALLOCATE(tauaerstrat, pizaerstrat, cgaerstrat) 266 DEALLOCATE(tauaerstrat_mois, pizaerstrat_mois, cgaerstrat_mois) 267 DEALLOCATE(taulwaerstrat,taulwaerstrat_mois) 268 ! 269 ENDIF !--is_mpi_root and is_omp_root 270 271 DEALLOCATE(tauaerstrat_mois_glo,pizaerstrat_mois_glo,cgaerstrat_mois_glo) 272 DEALLOCATE(taulwaerstrat_mois_glo) 320 DEALLOCATE(tauaerstrat, pizaerstrat, cgaerstrat,taulwaerstrat) 321 ENDIF 322 273 323 274 324 !$OMP BARRIER
Note: See TracChangeset
for help on using the changeset viewer.