Changeset 1329
- Timestamp:
- 11/15/17 12:51:25 (7 years ago)
- Location:
- XIOS/dev/branch_openmp
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/bld.cfg
r1328 r1329 42 42 bld::target test_remap.exe 43 43 bld::target test_remap_ref.exe 44 bld::target test_remap_omp.exe 44 45 #bld::target test_unstruct_omp.exe 45 46 #bld::target test_netcdf_omp.exe -
XIOS/dev/branch_openmp/src/test/test_remap_omp.f90
r1220 r1329 3 3 USE xios 4 4 USE mod_wait 5 useomp_lib5 USE omp_lib 6 6 USE netcdf 7 7 … … 37 37 INTEGER :: varid 38 38 INTEGER :: ts 39 INTEGER :: i,j , provided39 INTEGER :: i,j 40 40 INTEGER,PARAMETER :: llm=5, interpolatedLlm = 4, llm2 = 6 41 41 DOUBLE PRECISION, PARAMETER :: missing_value = 100000 42 43 CALL MPI_INIT_THREAD(3, provided, ierr) 42 INTEGER :: provided 43 44 CALL MPI_INIT_THREAD(3, provided, ierr) 44 45 if(provided .NE. 3) then 45 46 print*, "provided thread level = ", provided … … 47 48 endif 48 49 CALL init_wait 49 50 50 51 CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 51 52 CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr) 52 53 if(rank < size-2) then 53 54 !$omp parallel default(firstprivate) firstprivate(dtime)54 55 !$omp parallel default(firstprivate) 55 56 56 57 !!! XIOS Initialization (get the local communicator) … … 63 64 size = size*omp_get_num_threads() 64 65 65 66 print*, "rank = ", rank, " size = ", size 67 66 68 !$omp critical (open_file) 67 69 ierr=NF90_OPEN(src_file, NF90_NOWRITE, ncid) 68 !$omp end critical (open_file) 69 70 ierr=NF90_INQ_VARID(ncid,"bounds_lon",varid) 71 ierr=NF90_INQUIRE_VARIABLE(ncid, varid, dimids=dimids) 70 ierr=NF90_INQ_VARID(ncid,"bounds_lon",varid) 71 ierr=NF90_INQUIRE_VARIABLE(ncid, varid,dimids=dimids) 72 72 ierr=NF90_INQUIRE_DIMENSION(ncid, dimids(1), len=src_nvertex) 73 73 ierr=NF90_INQUIRE_DIMENSION(ncid, dimids(2), len=src_ni_glo) … … 82 82 src_ibegin= remain * (div+1) + (rank-remain) * div ; 83 83 ENDIF 84 85 if(src_ni .LE. 0) CALL MPI_ABORT()86 87 84 88 85 ALLOCATE(src_lon(src_ni), src_lon_tmp(src_ni)) … … 98 95 ALLOCATE(lval1(interpolatedLlm)) 99 96 ALLOCATE(lval2(llm2)) 100 lval2 = 0101 lval=0102 lval1=0103 97 104 98 ierr=NF90_INQ_VARID(ncid,"lon",varid) … … 147 141 ENDDO 148 142 149 !$omp critical (open_file) 143 print*, "ID = ", rank, "src_ni = ", "src_nvertex = ", src_nvertex, "src_ni_glo = ", src_ni_glo 144 150 145 ierr=NF90_OPEN(dst_file, NF90_NOWRITE, ncid) 151 !$omp end critical (open_file)152 153 154 146 ierr=NF90_INQ_VARID(ncid,"bounds_lon",varid) 155 147 ierr=NF90_INQUIRE_VARIABLE(ncid, varid,dimids=dimids) … … 167 159 ENDIF 168 160 169 if(dst_ni .LE. 0) CALL MPI_ABORT()170 171 161 ALLOCATE(dst_lon(dst_ni)) 172 162 ALLOCATE(dst_lat(dst_ni)) … … 182 172 ierr=NF90_INQ_VARID(ncid,"bounds_lat",varid) 183 173 ierr=NF90_GET_VAR(ncid,varid, dst_boundslat, start=(/1,dst_ibegin+1/),count=(/dst_nvertex,dst_ni/)) 184 185 !$omp barrier 174 175 !$omp end critical (open_file) 176 177 !$omp barrier 186 178 187 179 !$omp master … … 191 183 !$omp barrier 192 184 193 194 185 CALL xios_context_initialize("test",comm) 195 186 CALL xios_get_handle("test",ctx_hdl) 196 187 CALL xios_set_current_context(ctx_hdl) 197 188 198 189 CALL xios_set_domain_attr("src_domain", ni_glo=src_ni_glo, ibegin=src_ibegin, ni=src_ni, type="unstructured") 199 190 CALL xios_set_domain_attr("src_domain", lonvalue_1D=src_lon, latvalue_1D=src_lat, & … … 216 207 bounds_lon_1D=src_boundslon, bounds_lat_1D=src_boundslat, nvertex=src_nvertex) 217 208 209 218 210 dtime%second = 3600 219 220 211 CALL xios_set_timestep(dtime) 221 212 222 213 CALL xios_close_context_definition() 223 214 print *, "xios_close_context_definition OK " 215 224 216 CALL xios_get_domain_attr("src_domain_regular_read", ni=src_tmp_ni, nj=src_tmp_nj) 225 217 ALLOCATE(tmp_field_0(src_tmp_ni*src_tmp_nj)) … … 257 249 CALL wait_us(5000) ; 258 250 ENDDO 259 251 260 252 CALL xios_context_finalize() 261 253 … … 263 255 DEALLOCATE(dst_lon, dst_lat, dst_boundslon,dst_boundslat) 264 256 DEALLOCATE(tmp_field_0, tmp_field_1, tmp_field_2) 265 257 266 258 CALL xios_finalize() 267 259 … … 277 269 278 270 !$omp end parallel 279 280 281 else 271 else 282 272 283 273 CALL xios_init_server 284 print *, "Server : xios_finalize " 285 286 endif 274 print *, "Server : xios_finalize ", rank 275 276 endif 277 278 287 279 288 280 CALL MPI_FINALIZE(ierr) … … 293 285 294 286 287
Note: See TracChangeset
for help on using the changeset viewer.