New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
nctools.F90 in branches/UKMO/icebergs_restart_single_file/NEMOGCM/TOOLS/OBSTOOLS/src – NEMO

source: branches/UKMO/icebergs_restart_single_file/NEMOGCM/TOOLS/OBSTOOLS/src/nctools.F90 @ 6019

Last change on this file since 6019 was 6019, checked in by timgraham, 8 years ago

Reinstated svn keywords before upgrading to head of trunk

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1#define __MYFILE__ 'nctools.F90'
2MODULE nctools
3
4   ! Utility subroutines for netCDF access
5   ! Modified    : MAB (nf90, handle_error, LINE&FILE)
6   ! Modifled    : KSM (new shorter name)
7
8   USE netcdf
9
10   PUBLIC ldebug_netcdf, nchdlerr
11   LOGICAL :: ldebug_netcdf = .FALSE.  ! Debug switch for netcdf
12
13CONTAINS
14
15   SUBROUTINE nchdlerr(status,lineno,filename)
16     
17      ! Error handler for netCDF access
18      IMPLICIT NONE
19
20
21      INTEGER :: status ! netCDF return status
22      INTEGER :: lineno ! Line number (usually obtained from
23                        !  preprocessing __LINE__,__MYFILE__)
24      CHARACTER(len=*),OPTIONAL :: filename
25
26      IF (status/=nf90_noerr) THEN
27         WRITE(*,*)'Netcdf error, code ',status
28         IF (PRESENT(filename)) THEN
29            WRITE(*,*)'In file ',filename,' in line ',lineno
30         ELSE
31            WRITE(*,*)'In line ',lineno
32         END IF
33         WRITE(*,'(2A)')' Error message : ',nf90_strerror(status)
34         CALL abort
35      ENDIF
36
37   END SUBROUTINE nchdlerr
38
39!----------------------------------------------------------------------
40END MODULE nctools
Note: See TracBrowser for help on using the repository browser.