Changeset 3927 for dynamico_lmdz/aquaplanet
- Timestamp:
- Apr 11, 2016, 4:36:45 PM (9 years ago)
- Location:
- dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/iophy.F90
r3849 r3927 78 78 79 79 #ifdef CPP_XIOS 80 CALL wxios_domain_param_unstructured 80 CALL wxios_domain_param_unstructured("dom_glo") 81 81 #endif 82 82 … … 160 160 ! Initialize the XIOS domain coreesponding to this process: 161 161 162 CALL wxios_domain_param("dom_glo", is_sequential, nbp_lon, jj_nb, nbp_lon, nbp_lat, & 163 1, nbp_lon, ii_begin, ii_end, jj_begin, jj_end, & 164 klon_mpi+2*(nbp_lon-1), data_ibegin, data_iend, & 165 io_lat, io_lon,is_south_pole,mpi_rank) 162 CALL wxios_domain_param("dom_glo") 166 163 #endif 167 164 !$OMP END MASTER -
dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/wxios.F90
r3900 r3927 240 240 ! Pour initialiser un domaine !!!!!!!!!!!!!!!!!!!! 241 241 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 242 SUBROUTINE wxios_domain_param(dom_id, is_sequential, ni, nj, ni_glo, nj_glo, & 243 ibegin, iend, ii_begin, ii_end, jbegin, jend, & 244 data_ni, data_ibegin, data_iend, & 245 io_lat, io_lon,is_south_pole,mpi_rank) 246 247 248 USE print_control_mod, ONLY : prt_level, lunout 249 IMPLICIT NONE 250 242 SUBROUTINE wxios_domain_param(dom_id) 243 USE dimphy, only: klon 244 USE mod_phys_lmdz_para, only: gather, bcast, & 245 jj_nb, jj_begin, jj_end, ii_begin, ii_end, & 246 mpi_size, mpi_rank, klon_mpi, & 247 is_sequential, is_south_pole 248 USE mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, klon_glo 249 USE print_control_mod, ONLY : prt_level, lunout 250 USE geometry_mod 251 IMPLICIT NONE 251 252 CHARACTER(len=*),INTENT(IN) :: dom_id ! domain identifier 252 LOGICAL,INTENT(IN) :: is_sequential ! flag 253 INTEGER,INTENT(IN) :: ni ! local MPI domain number of longitudes 254 INTEGER,INTENT(IN) :: nj ! local MPI domain number of latitudes 255 INTEGER,INTENT(IN) :: ni_glo ! global grid number of longitudes 256 INTEGER,INTENT(IN) :: nj_glo ! global grid number of latitudes 257 INTEGER,INTENT(IN) :: ibegin ! start index, on global grid, of local MPI domain 258 INTEGER,INTENT(IN) :: iend ! end index, on global grid, of local MPI domain 259 INTEGER,INTENT(IN) :: ii_begin ! i index at which local data starts (first row) 260 INTEGER,INTENT(IN) :: ii_end ! i index at which local data ends (last row) 261 INTEGER,INTENT(IN) :: jbegin ! start index, on global grid, of local MPI domain 262 INTEGER,INTENT(IN) :: jend ! end index, on global grid, of local MPI domain 263 INTEGER,INTENT(IN) :: data_ni 264 INTEGER,INTENT(IN) :: data_ibegin 265 INTEGER,INTENT(IN) :: data_iend 266 REAL,INTENT(IN) :: io_lat(:) ! latitudes (of global grid) 267 REAL,INTENT(IN) :: io_lon(:) ! longitudes (of global grid) 268 logical,intent(in) :: is_south_pole ! does this process include the south pole? 269 integer,intent(in) :: mpi_rank ! rank of process 270 253 254 REAL :: rlat_glo(klon_glo) 255 REAL :: rlon_glo(klon_glo) 256 REAL :: io_lat(nbp_lat) 257 REAL :: io_lon(nbp_lon) 258 LOGICAL :: mask(nbp_lon,jj_nb) !Masque pour les problèmes de recouvrement MPI 271 259 TYPE(xios_domain) :: dom 260 INTEGER :: i 272 261 LOGICAL :: boool 273 262 274 !Masque pour les problèmes de recouvrement MPI: 275 LOGICAL :: mask(ni,nj) 263 264 265 CALL gather(lat_degrees,rlat_glo) 266 CALL bcast(rlat_glo) 267 CALL gather(lon_degrees,rlon_glo) 268 CALL bcast(rlon_glo) 269 270 !$OMP MASTER 271 io_lat(1)=rlat_glo(1) 272 io_lat(nbp_lat)=rlat_glo(klon_glo) 273 IF ((nbp_lon*nbp_lat) > 1) then 274 DO i=2,nbp_lat-1 275 io_lat(i)=rlat_glo(2+(i-2)*nbp_lon) 276 ENDDO 277 ENDIF 278 279 IF (klon_glo == 1) THEN 280 io_lon(1)=rlon_glo(1) 281 ELSE 282 io_lon(1:nbp_lon)=rlon_glo(2:nbp_lon+1) 283 ENDIF 284 276 285 277 286 !On récupère le handle: 278 287 CALL xios_get_domain_handle(dom_id, dom) 279 288 280 IF (prt_level >= 10) THEN281 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," ni:",ni," ni_glo:", ni_glo, " nj:", nj, " nj_glo:", nj_glo282 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," ibegin:",ibegin," iend:", iend, " jbegin:", jbegin, " jend:", jend283 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," ii_begin:",ii_begin," ii_end:", ii_end284 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," Size io_lon:", SIZE(io_lon(ibegin:iend)), " io_lat:", SIZE(io_lat(jbegin:jend))285 ENDIF286 287 289 !On parametrise le domaine: 288 CALL xios_set_domain_attr_hdl(dom, ni_glo=n i_glo, ibegin=ibegin-1, ni=ni, type="rectilinear")289 CALL xios_set_domain_attr_hdl(dom, nj_glo=n j_glo, jbegin=jbegin-1, nj=nj, data_dim=2)290 CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon( ibegin:iend), latvalue_1d=io_lat(jbegin:jend))290 CALL xios_set_domain_attr_hdl(dom, ni_glo=nbp_lon, ibegin=0, ni=nbp_lon, type="rectilinear") 291 CALL xios_set_domain_attr_hdl(dom, nj_glo=nbp_lat, jbegin=jj_begin-1, nj=jj_nb, data_dim=2) 292 CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon(1:nbp_lon), latvalue_1d=io_lat(jj_begin:jj_end)) 291 293 292 294 IF (.NOT.is_sequential) THEN 293 295 mask(:,:)=.TRUE. 294 296 if (ii_begin>1) mask(1:ii_begin-1,1) = .FALSE. 295 if (ii_end<n i) mask(ii_end+1:ni,nj) = .FALSE.297 if (ii_end<nbp_lon) mask(ii_end+1:nbp_lon,jj_nb) = .FALSE. 296 298 ! special case for south pole 297 if ((ii_end .eq.1).and.(is_south_pole)) mask(1:ni,nj)=.true.299 if ((ii_end==1).and.(is_south_pole)) mask(1:nbp_lon,jj_nb)=.true. 298 300 IF (prt_level >= 10) THEN 299 301 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,1)=",mask(:,1) 300 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:, nj)=",mask(:,nj)302 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,jj_nb)=",mask(:,jj_nb) 301 303 ENDIF 302 304 CALL xios_set_domain_attr_hdl(dom, mask_2d=mask) … … 310 312 IF (prt_level >= 10) WRITE(lunout,*) "wxios_domain_param: Invalid domain: ", trim(dom_id) 311 313 END IF 314 !$OMP END MASTER 315 312 316 END SUBROUTINE wxios_domain_param 313 317 314 318 315 SUBROUTINE wxios_domain_param_unstructured 319 SUBROUTINE wxios_domain_param_unstructured(dom_id) 316 320 USE geometry_mod, ONLY : longitude, latitude, boundslon, boundslat,ind_cell_glo 317 321 USE mod_grid_phy_lmdz, ONLY : nvertex, klon_glo … … 319 323 USE nrtype, ONLY : PI 320 324 IMPLICIT NONE 325 CHARACTER(len=*),INTENT(IN) :: dom_id ! domain identifier 321 326 REAL :: lon_mpi(klon_mpi) 322 327 REAL :: lat_mpi(klon_mpi) … … 335 340 336 341 !$OMP MASTER 337 CALL xios_get_domaingroup_handle( "dom_glo", dom)342 CALL xios_get_domaingroup_handle(dom_id, dom) 338 343 339 344 !On parametrise le domaine:
Note: See TracChangeset
for help on using the changeset viewer.