|
Last change
on this file since 1155 was
1154,
checked in by lguez, 17 years ago
|
|
-- Added "NetCDF95" interface in "bibio".
-- NetCDF95 uses the module "typesizes", which is part of NetCDF, so we
exclude dependency on "typesizes" in "bld.cfg".
-- Added "assert_eq" and "assert" procedures, which are in the public
part of Numerical Recipes.
-- Added some interpolation and regridding utilities in "bibio".
-- Added the ability to read an ozone climatology from a NetCDF file.
-- Commented out unused variables and code in "etat0_netcdf".
-- Updated calls to NetCDF in "etat0_netcdf": from Fortran 77
interface to Fortran 90 interface.
-- Removed useless "deallocate" at the end of "etat0_netcdf".
-- Corrected some declarations not conforming to Fortran standard, such
as "integer*4", or obsolescent such as "character*4".
-- Replaced some calls to not-standard function "float" by calls to
"real".
-- On Brodie at IDRIS, the NetCDF library compiled with OpenMP should
be used. Changed path in "arch-SX8_BRODIE.path".
-- Added warning for incompatibility of debugging options and OpenMP
parallelization in "makelmdz_fcm".
|
|
File size:
1.1 KB
|
| Rev | Line | |
|---|
| [1154] | 1 | ! $Id$ |
|---|
| 2 | module handle_err_m |
|---|
| 3 | |
|---|
| 4 | implicit none |
|---|
| 5 | |
|---|
| 6 | contains |
|---|
| 7 | |
|---|
| 8 | subroutine handle_err(message, ncerr, ncid, varid) |
|---|
| 9 | |
|---|
| 10 | use netcdf, only: nf90_strerror, nf90_noerr, nf90_close |
|---|
| 11 | |
|---|
| 12 | character(len=*), intent(in):: message |
|---|
| 13 | ! (should include name of calling procedure) |
|---|
| 14 | |
|---|
| 15 | integer, intent(in):: ncerr |
|---|
| 16 | |
|---|
| 17 | integer, intent(in), optional :: ncid |
|---|
| 18 | ! (Provide this argument if you want "handle_err" to try to close |
|---|
| 19 | ! the file.) |
|---|
| 20 | |
|---|
| 21 | integer, intent(in), optional :: varid |
|---|
| 22 | |
|---|
| 23 | ! Variable local to the procedure: |
|---|
| 24 | integer ncerr_close |
|---|
| 25 | |
|---|
| 26 | !------------------- |
|---|
| 27 | |
|---|
| 28 | if (ncerr /= nf90_noerr) then |
|---|
| 29 | print *, message, ":" |
|---|
| 30 | if (present(varid)) print *, "varid = ", varid |
|---|
| 31 | print *, trim(nf90_strerror(ncerr)) |
|---|
| 32 | if (present(ncid)) then |
|---|
| 33 | ! Try to close, to leave the file in a consistent state: |
|---|
| 34 | ncerr_close = nf90_close(ncid) |
|---|
| 35 | ! (do not call "nf95_close", we do not want to recurse) |
|---|
| 36 | if (ncerr_close /= nf90_noerr) then |
|---|
| 37 | print *, "nf90_close:" |
|---|
| 38 | print *, trim(nf90_strerror(ncerr_close)) |
|---|
| 39 | end if |
|---|
| 40 | end if |
|---|
| 41 | stop 1 |
|---|
| 42 | end if |
|---|
| 43 | |
|---|
| 44 | end subroutine handle_err |
|---|
| 45 | |
|---|
| 46 | end module handle_err_m |
|---|
Note: See
TracBrowser
for help on using the repository browser.