Changeset 1637 for LMDZ5/trunk/libf/bibio
- Timestamp:
- Jul 18, 2012, 5:35:21 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/bibio/nf95_gw_var_m.F90
r1635 r1637 200 200 !************************************ 201 201 202 subroutine nf95_gw_var_dble_1d(ncid, varid, values) 203 204 ! Double precision, the array has rank 1. 205 206 integer, intent(in):: ncid 207 integer, intent(in):: varid 208 double precision, pointer:: values(:) 202 !!$ subroutine nf95_gw_var_dble_1d(ncid, varid, values) 203 !!$ 204 !!$ ! Double precision, the array has rank 1. 205 !!$ 206 !!$ integer, intent(in):: ncid 207 !!$ integer, intent(in):: varid 208 !!$ double precision, pointer:: values(:) 209 !!$ 210 !!$ ! Variables local to the procedure: 211 !!$ integer nclen 212 !!$ integer, pointer:: dimids(:) 213 !!$ 214 !!$ !--------------------- 215 !!$ 216 !!$ call nf95_inquire_variable(ncid, varid, dimids=dimids) 217 !!$ 218 !!$ if (size(dimids) /= 1) then 219 !!$ print *, "nf95_gw_var_dble_1d:" 220 !!$ print *, "varid = ", varid 221 !!$ print *, "rank of NetCDF variable is ", size(dimids), ", not 1" 222 !!$ stop 1 223 !!$ end if 224 !!$ 225 !!$ call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen) 226 !!$ deallocate(dimids) ! pointer 227 !!$ 228 !!$ allocate(values(nclen)) 229 !!$ if (nclen /= 0) call NF95_GET_VAR(ncid, varid, values) 230 !!$ 231 !!$ end subroutine nf95_gw_var_dble_1d 232 !!$ 233 !!$ !************************************ 234 !!$ 235 !!$ subroutine nf95_gw_var_dble_3d(ncid, varid, values) 236 !!$ 237 !!$ ! Double precision, the array has rank 3. 238 !!$ 239 !!$ integer, intent(in):: ncid 240 !!$ integer, intent(in):: varid 241 !!$ double precision, pointer:: values(:, :, :) 242 !!$ 243 !!$ ! Variables local to the procedure: 244 !!$ integer nclen1, nclen2, nclen3 245 !!$ integer, pointer:: dimids(:) 246 !!$ 247 !!$ !--------------------- 248 !!$ 249 !!$ call nf95_inquire_variable(ncid, varid, dimids=dimids) 250 !!$ 251 !!$ if (size(dimids) /= 3) then 252 !!$ print *, "nf95_gw_var_dble_3d:" 253 !!$ print *, "varid = ", varid 254 !!$ print *, "rank of NetCDF variable is ", size(dimids), ", not 3" 255 !!$ stop 1 256 !!$ end if 257 !!$ 258 !!$ call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen1) 259 !!$ call nf95_inquire_dimension(ncid, dimids(2), nclen=nclen2) 260 !!$ call nf95_inquire_dimension(ncid, dimids(3), nclen=nclen3) 261 !!$ deallocate(dimids) ! pointer 262 !!$ 263 !!$ allocate(values(nclen1, nclen2, nclen3)) 264 !!$ if (nclen1 * nclen2 * nclen3 /= 0) call NF95_GET_VAR(ncid, varid, values) 265 !!$ 266 !!$ end subroutine nf95_gw_var_dble_3d 267 !!$ 268 !************************************ 269 270 subroutine nf95_gw_var_int_1d(ncid, varid, values) 271 272 ! Integer type, the array has rank 1. 273 274 integer, intent(in):: ncid 275 integer, intent(in):: varid 276 integer, pointer:: values(:) 209 277 210 278 ! Variables local to the procedure: … … 217 285 218 286 if (size(dimids) /= 1) then 219 print *, "nf95_gw_var_ dble_1d:"287 print *, "nf95_gw_var_int_1d:" 220 288 print *, "varid = ", varid 221 289 print *, "rank of NetCDF variable is ", size(dimids), ", not 1" 222 290 stop 1 223 291 end if 224 292 … … 229 297 if (nclen /= 0) call NF95_GET_VAR(ncid, varid, values) 230 298 231 end subroutine nf95_gw_var_ dble_1d232 233 !************************************ 234 235 subroutine nf95_gw_var_ dble_3d(ncid, varid, values)236 237 ! Double precision, the array has rank 3.238 239 integer, intent(in):: ncid 240 integer, intent(in):: varid 241 double precision, pointer:: values(:, :, :)299 end subroutine nf95_gw_var_int_1d 300 301 !************************************ 302 303 subroutine nf95_gw_var_int_3d(ncid, varid, values) 304 305 ! Integer type, the array has rank 3. 306 307 integer, intent(in):: ncid 308 integer, intent(in):: varid 309 integer, pointer:: values(:, :, :) 242 310 243 311 ! Variables local to the procedure: … … 250 318 251 319 if (size(dimids) /= 3) then 252 print *, "nf95_gw_var_ dble_3d:"320 print *, "nf95_gw_var_int_3d:" 253 321 print *, "varid = ", varid 254 322 print *, "rank of NetCDF variable is ", size(dimids), ", not 3" … … 264 332 if (nclen1 * nclen2 * nclen3 /= 0) call NF95_GET_VAR(ncid, varid, values) 265 333 266 end subroutine nf95_gw_var_dble_3d267 268 !************************************269 270 subroutine nf95_gw_var_int_1d(ncid, varid, values)271 272 ! Integer type, the array has rank 1.273 274 integer, intent(in):: ncid275 integer, intent(in):: varid276 integer, pointer:: values(:)277 278 ! Variables local to the procedure:279 integer nclen280 integer, pointer:: dimids(:)281 282 !---------------------283 284 call nf95_inquire_variable(ncid, varid, dimids=dimids)285 286 if (size(dimids) /= 1) then287 print *, "nf95_gw_var_int_1d:"288 print *, "varid = ", varid289 print *, "rank of NetCDF variable is ", size(dimids), ", not 1"290 stop 1291 end if292 293 call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen)294 deallocate(dimids) ! pointer295 296 allocate(values(nclen))297 if (nclen /= 0) call NF95_GET_VAR(ncid, varid, values)298 299 end subroutine nf95_gw_var_int_1d300 301 !************************************302 303 subroutine nf95_gw_var_int_3d(ncid, varid, values)304 305 ! Integer type, the array has rank 3.306 307 integer, intent(in):: ncid308 integer, intent(in):: varid309 integer, pointer:: values(:, :, :)310 311 ! Variables local to the procedure:312 integer nclen1, nclen2, nclen3313 integer, pointer:: dimids(:)314 315 !---------------------316 317 call nf95_inquire_variable(ncid, varid, dimids=dimids)318 319 if (size(dimids) /= 3) then320 print *, "nf95_gw_var_int_3d:"321 print *, "varid = ", varid322 print *, "rank of NetCDF variable is ", size(dimids), ", not 3"323 stop 1324 end if325 326 call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen1)327 call nf95_inquire_dimension(ncid, dimids(2), nclen=nclen2)328 call nf95_inquire_dimension(ncid, dimids(3), nclen=nclen3)329 deallocate(dimids) ! pointer330 331 allocate(values(nclen1, nclen2, nclen3))332 if (nclen1 * nclen2 * nclen3 /= 0) call NF95_GET_VAR(ncid, varid, values)333 334 334 end subroutine nf95_gw_var_int_3d 335 335
Note: See TracChangeset
for help on using the changeset viewer.