Index: palm/trunk/SOURCE/check_open.f90
===================================================================
--- palm/trunk/SOURCE/check_open.f90	(revision 247)
+++ palm/trunk/SOURCE/check_open.f90	(revision 263)
@@ -4,4 +4,5 @@
 ! Current revisions:
 ! -----------------
+! Output of NetCDF messages with aid of message handling routine.
 ! Output of messages replaced by message handling routine
 !
@@ -697,5 +698,6 @@
 !--          Open an existing NetCDF file for output 
              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_xy(av) )
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 20 )
+
+             CALL handle_netcdf_error( 'check_open', 20 )
 !
 !--          Read header information and set all ids. If there is a mismatch
@@ -708,5 +710,5 @@
              IF ( .NOT. netcdf_extend )  THEN
                 nc_stat = NF90_CLOSE( id_set_xy(av) )
-                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 21 )
+                CALL handle_netcdf_error( 'check_open', 21 )
                 CALL local_system( 'rm ' // TRIM( filename ) )
              ENDIF
@@ -731,5 +733,5 @@
                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_xy(av) )
              ENDIF
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 22 )
+             CALL handle_netcdf_error( 'check_open', 22 )
 !
 !--          Define the header
@@ -758,5 +760,5 @@
 !--          Open an existing NetCDF file for output 
              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_xz(av) )
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 23 )
+             CALL handle_netcdf_error( 'check_open', 23 )
 !
 !--          Read header information and set all ids. If there is a mismatch
@@ -769,5 +771,5 @@
              IF ( .NOT. netcdf_extend )  THEN
                 nc_stat = NF90_CLOSE( id_set_xz(av) )
-                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 24 )
+                CALL handle_netcdf_error( 'check_open', 24 )
                 CALL local_system( 'rm ' // TRIM( filename ) )
              ENDIF
@@ -792,5 +794,5 @@
                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_xz(av) )
              ENDIF
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 25 )
+             CALL handle_netcdf_error( 'check_open', 25 )
 !
 !--          Define the header
@@ -819,5 +821,5 @@
 !--          Open an existing NetCDF file for output 
              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_yz(av) )
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 26 )
+             CALL handle_netcdf_error( 'check_open', 26 )
 !
 !--          Read header information and set all ids. If there is a mismatch
@@ -830,5 +832,5 @@
              IF ( .NOT. netcdf_extend )  THEN
                 nc_stat = NF90_CLOSE( id_set_yz(av) )
-                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 27 )
+                CALL handle_netcdf_error( 'check_open', 27 )
                 CALL local_system( 'rm ' // TRIM( filename ) )
              ENDIF
@@ -853,5 +855,5 @@
                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_yz(av) )
              ENDIF
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 28 )
+             CALL handle_netcdf_error( 'check_open', 28 )
 !
 !--          Define the header
@@ -874,5 +876,5 @@
 !--          Open an existing NetCDF file for output 
              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_pr )
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 29 )
+             CALL handle_netcdf_error( 'check_open', 29 )
 !
 !--          Read header information and set all ids. If there is a mismatch
@@ -885,5 +887,5 @@
              IF ( .NOT. netcdf_extend )  THEN
                 nc_stat = NF90_CLOSE( id_set_pr )
-                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 30 )
+                CALL handle_netcdf_error( 'check_open', 30 )
                 CALL local_system( 'rm ' // TRIM( filename ) )
              ENDIF
@@ -908,5 +910,5 @@
                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pr )
              ENDIF
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 31 )
+             CALL handle_netcdf_error( 'check_open', 31 )
 !
 !--          Define the header
@@ -929,5 +931,5 @@
 !--          Open an existing NetCDF file for output 
              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_ts )
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 32 )
+             CALL handle_netcdf_error( 'check_open', 32 )
 !
 !--          Read header information and set all ids. If there is a mismatch
@@ -940,5 +942,5 @@
              IF ( .NOT. netcdf_extend )  THEN
                 nc_stat = NF90_CLOSE( id_set_ts )
-                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 33 )
+                CALL handle_netcdf_error( 'check_open', 33 )
                 CALL local_system( 'rm ' // TRIM( filename ) )
              ENDIF
@@ -963,5 +965,5 @@
                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_ts )
              ENDIF
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 34 )
+             CALL handle_netcdf_error( 'check_open', 34 )
 !
 !--          Define the header
@@ -991,5 +993,5 @@
 !--          Open an existing NetCDF file for output 
              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_3d(av) )
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 35 )
+             CALL handle_netcdf_error( 'check_open', 35 )
 !
 !--          Read header information and set all ids. If there is a mismatch
@@ -1002,5 +1004,5 @@
              IF ( .NOT. netcdf_extend )  THEN
                 nc_stat = NF90_CLOSE( id_set_3d(av) )
-                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 36 )
+                CALL handle_netcdf_error( 'check_open', 36 )
                 CALL local_system('rm ' // TRIM( filename ) )
              ENDIF
@@ -1025,5 +1027,5 @@
                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_3d(av) )
              ENDIF
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 37 )
+             CALL handle_netcdf_error( 'check_open', 37 )
 !
 !--          Define the header
@@ -1047,5 +1049,6 @@
 !--          Open an existing NetCDF file for output 
              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_sp )
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 38 )
+             CALL handle_netcdf_error( 'check_open', 38 )
+
 !
 !--          Read header information and set all ids. If there is a mismatch
@@ -1058,5 +1061,5 @@
              IF ( .NOT. netcdf_extend )  THEN
                 nc_stat = NF90_CLOSE( id_set_sp )
-                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 39 )
+                CALL handle_netcdf_error( 'check_open', 39 )
                 CALL local_system( 'rm ' // TRIM( filename ) )
              ENDIF
@@ -1081,5 +1084,5 @@
                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_sp )
              ENDIF
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 40 )
+             CALL handle_netcdf_error( 'check_open', 40 )
 !
 !--          Define the header
@@ -1106,5 +1109,5 @@
 !--          Open an existing NetCDF file for output 
              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_prt )
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 41 )
+             CALL handle_netcdf_error( 'check_open', 41 )
 !
 !--          Read header information and set all ids. If there is a mismatch
@@ -1117,5 +1120,5 @@
              IF ( .NOT. netcdf_extend )  THEN
                 nc_stat = NF90_CLOSE( id_set_prt )
-                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 42 )
+                CALL handle_netcdf_error( 'check_open', 42 )
                 CALL local_system( 'rm ' // filename )
              ENDIF
@@ -1157,5 +1160,5 @@
                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_prt )
              ENDIF
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 43 )
+             CALL handle_netcdf_error( 'check_open', 43 )  
 
 !
@@ -1179,5 +1182,5 @@
 !--          Open an existing NetCDF file for output 
              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_pts )
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 393 )
+             CALL handle_netcdf_error( 'check_open', 393 )
 !
 !--          Read header information and set all ids. If there is a mismatch
@@ -1190,5 +1193,5 @@
              IF ( .NOT. netcdf_extend )  THEN
                 nc_stat = NF90_CLOSE( id_set_pts )
-                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 394 )
+                CALL handle_netcdf_error( 'check_open', 394 )
                 CALL local_system( 'rm ' // TRIM( filename ) )
              ENDIF
@@ -1213,5 +1216,5 @@
                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pts )
              ENDIF
-             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 395 )
+             CALL handle_netcdf_error( 'check_open', 395 )
 !
 !--          Define the header
