1 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
2 | ! |
---|
3 | ! This module contains the netCDF include file and a netcdf error |
---|
4 | ! handling routine. |
---|
5 | ! |
---|
6 | !----------------------------------------------------------------------- |
---|
7 | ! |
---|
8 | ! CVS:$Id: netcdf.F 2826 2010-12-10 11:14:21Z valcke $ |
---|
9 | ! |
---|
10 | ! Copyright (c) 1997, 1998 the Regents of the University of |
---|
11 | ! California. |
---|
12 | ! |
---|
13 | ! This software and ancillary information (herein called software) |
---|
14 | ! called SCRIP is made available under the terms described here. |
---|
15 | ! The software has been approved for release with associated |
---|
16 | ! LA-CC Number 98-45. |
---|
17 | ! |
---|
18 | ! Unless otherwise indicated, this software has been authored |
---|
19 | ! by an employee or employees of the University of California, |
---|
20 | ! operator of the Los Alamos National Laboratory under Contract |
---|
21 | ! No. W-7405-ENG-36 with the U.S. Department of Energy. The U.S. |
---|
22 | ! Government has rights to use, reproduce, and distribute this |
---|
23 | ! software. The public may copy and use this software without |
---|
24 | ! charge, provided that this Notice and any statement of authorship |
---|
25 | ! are reproduced on all copies. Neither the Government nor the |
---|
26 | ! University makes any warranty, express or implied, or assumes |
---|
27 | ! any liability or responsibility for the use of this software. |
---|
28 | ! |
---|
29 | ! If software is modified to produce derivative works, such modified |
---|
30 | ! software should be clearly marked, so as not to confuse it with |
---|
31 | ! the version available from Los Alamos National Laboratory. |
---|
32 | ! |
---|
33 | !*********************************************************************** |
---|
34 | |
---|
35 | module netcdf_mod |
---|
36 | |
---|
37 | !----------------------------------------------------------------------- |
---|
38 | |
---|
39 | use kinds_mod |
---|
40 | use constants |
---|
41 | |
---|
42 | implicit none |
---|
43 | |
---|
44 | #include <netcdf.inc> |
---|
45 | |
---|
46 | character(len=char_len), public :: s_cdf_filetype |
---|
47 | |
---|
48 | integer (kind=int_kind), public :: s_cdf_64bit_offset = nf_64bit_offset |
---|
49 | #ifdef CDF_64BIT_DATA |
---|
50 | integer (kind=int_kind), public :: s_cdf_64bit_data = nf_64bit_data |
---|
51 | #else |
---|
52 | integer (kind=int_kind), public :: s_cdf_64bit_data = nf_64bit_offset |
---|
53 | #endif |
---|
54 | |
---|
55 | !*********************************************************************** |
---|
56 | |
---|
57 | contains |
---|
58 | |
---|
59 | !*********************************************************************** |
---|
60 | |
---|
61 | subroutine netcdf_error_handler(istat) |
---|
62 | |
---|
63 | !----------------------------------------------------------------------- |
---|
64 | ! |
---|
65 | ! This routine provides a simple interface to netCDF error message |
---|
66 | ! routine. |
---|
67 | ! |
---|
68 | !----------------------------------------------------------------------- |
---|
69 | |
---|
70 | integer (kind=int_kind), intent(in) :: istat ! integer status returned by netCDF function call |
---|
71 | |
---|
72 | !----------------------------------------------------------------------- |
---|
73 | |
---|
74 | if (istat /= NF_NOERR) then |
---|
75 | WRITE(nulou,*)'Error in netCDF: ',nf_strerror(istat) |
---|
76 | stop |
---|
77 | endif |
---|
78 | |
---|
79 | !----------------------------------------------------------------------- |
---|
80 | |
---|
81 | end subroutine netcdf_error_handler |
---|
82 | |
---|
83 | !*********************************************************************** |
---|
84 | |
---|
85 | end module netcdf_mod |
---|
86 | |
---|
87 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|