Ignore:
Timestamp:
Oct 19, 2012 2:35:30 PM (11 years ago)
Author:
raasch
Message:

netCDF4 without parallel file support implemented
additional define string netcdf4_parallel is required to switch on parallel file support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/check_open.f90

    r965 r1031  
    44! Current revisions:
    55! -----------------
    6 !
     6! netCDF4 without parallel file support implemented,
     7! opening of netCDF files are done by new routines create_netcdf_file and
     8! open_write_netcdf_file
    79!
    810! Former revisions:
     
    3739!
    3840! 519 2010-03-19 05:30:02Z raasch
    39 ! NetCDF4 support for particle data
     41! netCDF4 support for particle data
    4042!
    4143! 493 2010-03-01 08:30:24Z raasch
    42 ! NetCDF4 support (parallel output)
     44! netCDF4 support (parallel output)
    4345!
    4446! 410 2009-12-04 17:05:40Z letzel
     
    4648!
    4749! 277 2009-03-31 09:13:47Z heinze
    48 ! Output of NetCDF messages with aid of message handling routine.
     50! Output of netCDF messages with aid of message handling routine.
    4951! Output of messages replaced by message handling routine
    5052!
     
    5557!
    5658! 120 2007-10-17 11:54:43Z raasch
    57 ! Status of 3D-volume NetCDF data file only depends on switch netcdf_64bit_3d
     59! Status of 3D-volume netCDF data file only depends on switch netcdf_64bit_3d
    5860!
    5961! 105 2007-08-08 07:12:55Z raasch
     
    169171       CASE ( 101:103, 106, 111:113, 116, 201:200+2*max_masks )
    170172
    171           IF ( netcdf_data_format < 3 )  THEN
     173          IF ( netcdf_data_format < 5 )  THEN
    172174         
    173175             IF ( myid /= 0 )  THEN
     
    738740          ENDIF
    739741!
    740 !--       Inquire, if there is a NetCDF file from a previuos run. This should
     742!--       Inquire, if there is a netCDF file from a previuos run. This should
    741743!--       be opened for extension, if its dimensions and variables match the
    742744!--       actual run.
     
    745747          IF ( netcdf_extend )  THEN
    746748!
    747 !--          Open an existing NetCDF file for output
    748              IF ( netcdf_data_format < 3 )  THEN
    749                 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_xy(av) )
    750              ELSE
    751 #if defined( __netcdf4 )
    752                 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_xy(av), &
    753                                      COMM = comm2d, INFO = MPI_INFO_NULL )
    754 #endif
    755              ENDIF
    756 
    757              CALL handle_netcdf_error( 'check_open', 20 )
     749!--          Open an existing netCDF file for output
     750             CALL open_write_netcdf_file( filename, id_set_xy(av), .TRUE., 20 )
    758751!
    759752!--          Read header information and set all ids. If there is a mismatch
     
    774767          IF ( .NOT. netcdf_extend )  THEN
    775768!
    776 !--          Create a new NetCDF output file with requested NetCDF format
    777              IF ( netcdf_data_format == 1 )  THEN
    778 !
    779 !--             Classic NetCDF format
    780                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_xy(av) )
    781 
    782              ELSEIF ( netcdf_data_format == 2 )  THEN
    783 !
    784 !--             64bit-offset format
    785                 nc_stat = NF90_CREATE( filename,                               &
    786                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    787                                        id_set_xy(av) )
    788 
    789 #if defined( __netcdf4 )
    790              ELSEIF ( netcdf_data_format == 3 )  THEN
    791 !
    792 !--             NetCDF4/HDF5 format
    793                 nc_stat = NF90_CREATE( filename,                               &
    794                                        OR( NF90_NOCLOBBER, NF90_NETCDF4 ),     &
    795                                        id_set_xy(av), COMM = comm2d,           &
    796                                        INFO = MPI_INFO_NULL )
    797 
    798              ELSEIF ( netcdf_data_format == 4 )  THEN
    799 !
    800 !--             NetCDF4/HDF5 format with classic model flag
    801                 nc_stat = NF90_CREATE( filename,                               &
    802                                        OR( NF90_NOCLOBBER,                     &
    803                                         OR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), &
    804                                        id_set_xy(av), COMM = comm2d,           &
    805                                        INFO = MPI_INFO_NULL )
    806 #endif
    807              ENDIF
    808 
    809              CALL handle_netcdf_error( 'check_open', 22 )
     769!--          Create a new netCDF output file with requested netCDF format
     770             CALL create_netcdf_file( filename, id_set_xy(av), .TRUE., 22 )
    810771
    811772!
     
    814775
    815776!
    816 !--          In case of parallel NetCDF output, create flag file which tells
     777!--          In case of parallel netCDF output, create flag file which tells
    817778!--          combine_plot_fields that nothing is to do.
    818              IF ( myid == 0  .AND.  netcdf_data_format > 2 )  THEN
     779             IF ( myid == 0  .AND.  netcdf_data_format > 4 )  THEN
    819780                OPEN( 99, FILE='NO_COMBINE_PLOT_FIELDS_XY' )
    820781                WRITE ( 99, '(A)' )  'no combine_plot_fields.x neccessary'
     
    835796          ENDIF
    836797!
    837 !--       Inquire, if there is a NetCDF file from a previuos run. This should
     798!--       Inquire, if there is a netCDF file from a previuos run. This should
    838799!--       be opened for extension, if its dimensions and variables match the
    839800!--       actual run.
     
    842803          IF ( netcdf_extend )  THEN
    843804!
    844 !--          Open an existing NetCDF file for output
    845              IF ( netcdf_data_format < 3 )  THEN
    846                 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_xz(av) )
    847              ELSE
    848 #if defined( __netcdf4 )
    849                 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_xz(av), &
    850                                      COMM = comm2d, INFO = MPI_INFO_NULL )
    851 #endif
    852              ENDIF
    853 
    854              CALL handle_netcdf_error( 'check_open', 23 )
     805!--          Open an existing netCDF file for output
     806             CALL open_write_netcdf_file( filename, id_set_xz(av), .TRUE., 23 )
    855807!
    856808!--          Read header information and set all ids. If there is a mismatch
     
    871823          IF ( .NOT. netcdf_extend )  THEN
    872824!
    873 !--          Create a new NetCDF output file with requested NetCDF format
    874              IF ( netcdf_data_format == 1 )  THEN
    875 !
    876 !--             Classic NetCDF format
    877                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_xz(av) )
    878 
    879              ELSEIF ( netcdf_data_format == 2 )  THEN
    880 !
    881 !--             64bit-offset format
    882                 nc_stat = NF90_CREATE( filename,                               &
    883                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    884                                        id_set_xz(av) )
    885 
    886 #if defined( __netcdf4 )
    887              ELSEIF ( netcdf_data_format == 3 )  THEN
    888 !
    889 !--             NetCDF4/HDF5 format
    890                 nc_stat = NF90_CREATE( filename,                               &
    891                                        OR( NF90_NOCLOBBER, NF90_NETCDF4 ),     &
    892                                        id_set_xz(av), COMM = comm2d,           &
    893                                        INFO = MPI_INFO_NULL )
    894 
    895              ELSEIF ( netcdf_data_format == 4 )  THEN
    896 !
    897 !--             NetCDF4/HDF5 format with classic model flag
    898                 nc_stat = NF90_CREATE( filename,                               &
    899                                        OR( NF90_NOCLOBBER,                     &
    900                                         OR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), &
    901                                        id_set_xz(av), COMM = comm2d,           &
    902                                        INFO = MPI_INFO_NULL )
    903 #endif
    904              ENDIF
    905 
    906              CALL handle_netcdf_error( 'check_open', 25 )
     825!--          Create a new netCDF output file with requested netCDF format
     826             CALL create_netcdf_file( filename, id_set_xz(av), .TRUE., 25 )
    907827
    908828!
     
    911831
    912832!
    913 !--          In case of parallel NetCDF output, create flag file which tells
     833!--          In case of parallel netCDF output, create flag file which tells
    914834!--          combine_plot_fields that nothing is to do.
    915              IF ( myid == 0  .AND.  netcdf_data_format > 2 )  THEN
     835             IF ( myid == 0  .AND.  netcdf_data_format > 4 )  THEN
    916836                OPEN( 99, FILE='NO_COMBINE_PLOT_FIELDS_XZ' )
    917837                WRITE ( 99, '(A)' )  'no combine_plot_fields.x neccessary'
     
    932852          ENDIF
    933853!
    934 !--       Inquire, if there is a NetCDF file from a previuos run. This should
     854!--       Inquire, if there is a netCDF file from a previuos run. This should
    935855!--       be opened for extension, if its dimensions and variables match the
    936856!--       actual run.
     
    939859          IF ( netcdf_extend )  THEN
    940860!
    941 !--          Open an existing NetCDF file for output
    942              IF ( netcdf_data_format < 3 )  THEN
    943                 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_yz(av) )
    944              ELSE
    945 #if defined( __netcdf4 )
    946                 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_yz(av), &
    947                                      COMM = comm2d, INFO = MPI_INFO_NULL )
    948 #endif
    949              ENDIF
    950              
    951              CALL handle_netcdf_error( 'check_open', 26 )
     861!--          Open an existing netCDF file for output
     862             CALL open_write_netcdf_file( filename, id_set_yz(av), .TRUE., 26 )
    952863!
    953864!--          Read header information and set all ids. If there is a mismatch
     
    968879          IF ( .NOT. netcdf_extend )  THEN
    969880!
    970 !--          Create a new NetCDF output file with requested NetCDF format
    971              IF ( netcdf_data_format == 1 )  THEN
    972 !
    973 !--             Classic NetCDF format
    974                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_yz(av) )
    975 
    976              ELSEIF ( netcdf_data_format == 2 )  THEN
    977 !
    978 !--             64bit-offset format
    979                 nc_stat = NF90_CREATE( filename,                               &
    980                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    981                                        id_set_yz(av) )
    982 
    983 #if defined( __netcdf4 )
    984              ELSEIF ( netcdf_data_format == 3 )  THEN
    985 !
    986 !--             NetCDF4/HDF5 format
    987                 nc_stat = NF90_CREATE( filename,                               &
    988                                        OR( NF90_NOCLOBBER, NF90_NETCDF4 ),     &
    989                                        id_set_yz(av), COMM = comm2d,           &
    990                                        INFO = MPI_INFO_NULL )
    991 
    992              ELSEIF ( netcdf_data_format == 4 )  THEN
    993 !
    994 !--             NetCDF4/HDF5 format with classic model flag
    995                 nc_stat = NF90_CREATE( filename,                               &
    996                                        OR( NF90_NOCLOBBER,                     &
    997                                         OR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), &
    998                                        id_set_yz(av), COMM = comm2d,           &
    999                                        INFO = MPI_INFO_NULL )
    1000 #endif
    1001              ENDIF
    1002 
    1003              CALL handle_netcdf_error( 'check_open', 28 )
     881!--          Create a new netCDF output file with requested netCDF format
     882             CALL create_netcdf_file( filename, id_set_yz(av), .TRUE., 28 )
    1004883
    1005884!
     
    1008887
    1009888!
    1010 !--          In case of parallel NetCDF output, create flag file which tells
     889!--          In case of parallel netCDF output, create flag file which tells
    1011890!--          combine_plot_fields that nothing is to do.
    1012              IF ( myid == 0  .AND.  netcdf_data_format > 2 )  THEN
     891             IF ( myid == 0  .AND.  netcdf_data_format > 4 )  THEN
    1013892                OPEN( 99, FILE='NO_COMBINE_PLOT_FIELDS_YZ' )
    1014893                WRITE ( 99, '(A)' )  'no combine_plot_fields.x neccessary'
     
    1024903
    1025904!
    1026 !--       Inquire, if there is a NetCDF file from a previuos run. This should
     905!--       Inquire, if there is a netCDF file from a previuos run. This should
    1027906!--       be opened for extension, if its variables match the actual run.
    1028907          INQUIRE( FILE=filename, EXIST=netcdf_extend )
     
    1030909          IF ( netcdf_extend )  THEN
    1031910!
    1032 !--          Open an existing NetCDF file for output
    1033              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_pr )
    1034              CALL handle_netcdf_error( 'check_open', 29 )
     911!--          Open an existing netCDF file for output
     912             CALL open_write_netcdf_file( filename, id_set_pr, .FALSE., 29 )
    1035913!
    1036914!--          Read header information and set all ids. If there is a mismatch
     
    1051929          IF ( .NOT. netcdf_extend )  THEN
    1052930!
    1053 !--          Create a new NetCDF output file
    1054              IF ( netcdf_data_format > 1 )  THEN
    1055                 nc_stat = NF90_CREATE( filename,                               &
    1056                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    1057                                        id_set_pr )
    1058              ELSE
    1059                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pr )
    1060              ENDIF
    1061              CALL handle_netcdf_error( 'check_open', 31 )
     931!--          Create a new netCDF output file with requested netCDF format
     932             CALL create_netcdf_file( filename, id_set_pr, .FALSE., 31 )
    1062933!
    1063934!--          Define the header
     
    1072943
    1073944!
    1074 !--       Inquire, if there is a NetCDF file from a previuos run. This should
     945!--       Inquire, if there is a netCDF file from a previuos run. This should
    1075946!--       be opened for extension, if its variables match the actual run.
    1076947          INQUIRE( FILE=filename, EXIST=netcdf_extend )
     
    1078949          IF ( netcdf_extend )  THEN
    1079950!
    1080 !--          Open an existing NetCDF file for output
    1081              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_ts )
    1082              CALL handle_netcdf_error( 'check_open', 32 )
     951!--          Open an existing netCDF file for output
     952             CALL open_write_netcdf_file( filename, id_set_ts, .FALSE., 32 )
    1083953!
    1084954!--          Read header information and set all ids. If there is a mismatch
     
    1099969          IF ( .NOT. netcdf_extend )  THEN
    1100970!
    1101 !--          Create a new NetCDF output file
    1102              IF ( netcdf_data_format > 1 )  THEN
    1103                 nc_stat = NF90_CREATE( filename,                               &
    1104                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    1105                                        id_set_ts )
    1106              ELSE
    1107                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_ts )
    1108              ENDIF
    1109              CALL handle_netcdf_error( 'check_open', 34 )
     971!--          Create a new netCDF output file with requested netCDF format
     972             CALL create_netcdf_file( filename, id_set_ts, .FALSE., 34 )
    1110973!
    1111974!--          Define the header
     
    1126989          ENDIF
    1127990!
    1128 !--       Inquire, if there is a NetCDF file from a previous run. This should
     991!--       Inquire, if there is a netCDF file from a previous run. This should
    1129992!--       be opened for extension, if its dimensions and variables match the
    1130993!--       actual run.
     
    1133996          IF ( netcdf_extend )  THEN
    1134997!
    1135 !--          Open an existing NetCDF file for output
    1136              IF ( netcdf_data_format < 3 )  THEN
    1137                 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_3d(av) )
    1138              ELSE
    1139 #if defined( __netcdf4 )
    1140                 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_3d(av), &
    1141                                      COMM = comm2d, INFO = MPI_INFO_NULL )
    1142 #endif
    1143              ENDIF
    1144              CALL handle_netcdf_error( 'check_open', 35 )
     998!--          Open an existing netCDF file for output
     999             CALL open_write_netcdf_file( filename, id_set_3d(av), .TRUE., 35 )
    11451000!
    11461001!--          Read header information and set all ids. If there is a mismatch
     
    11611016          IF ( .NOT. netcdf_extend )  THEN
    11621017!
    1163 !--          Create a new NetCDF output file with requested NetCDF format
    1164              IF ( netcdf_data_format == 1 )  THEN
    1165 !
    1166 !--             Classic NetCDF format
    1167                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_3d(av) )
    1168 
    1169              ELSEIF ( netcdf_data_format == 2 )  THEN
    1170 !
    1171 !--             64bit-offset format
    1172                 nc_stat = NF90_CREATE( filename,                               &
    1173                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    1174                                        id_set_3d(av) )
    1175 
    1176 #if defined( __netcdf4 )
    1177              ELSEIF ( netcdf_data_format == 3 )  THEN
    1178 !
    1179 !--             NetCDF4/HDF5 format
    1180                 nc_stat = NF90_CREATE( filename,                               &
    1181                                        OR( NF90_NOCLOBBER, NF90_NETCDF4 ),     &
    1182                                        id_set_3d(av), COMM = comm2d,           &
    1183                                        INFO = MPI_INFO_NULL )
    1184 
    1185              ELSEIF ( netcdf_data_format == 4 )  THEN
    1186 !
    1187 !--             NetCDF4/HDF5 format with classic model flag
    1188                 nc_stat = NF90_CREATE( filename,                               &
    1189                                        OR( NF90_NOCLOBBER,                     &
    1190                                         OR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), &
    1191                                        id_set_3d(av), COMM = comm2d,           &
    1192                                        INFO = MPI_INFO_NULL )
    1193 #endif
    1194              ENDIF
    1195 
    1196              CALL handle_netcdf_error( 'check_open', 37 )
     1018!--          Create a new netCDF output file with requested netCDF format
     1019             CALL create_netcdf_file( filename, id_set_3d(av), .TRUE., 37 )
    11971020
    11981021!
     
    12011024
    12021025!
    1203 !--          In case of parallel NetCDF output, create flag file which tells
     1026!--          In case of parallel netCDF output, create flag file which tells
    12041027!--          combine_plot_fields that nothing is to do.
    1205              IF ( myid == 0  .AND.  netcdf_data_format > 2 )  THEN
     1028             IF ( myid == 0  .AND.  netcdf_data_format > 4 )  THEN
    12061029                OPEN( 99, FILE='NO_COMBINE_PLOT_FIELDS_3D' )
    12071030                WRITE ( 99, '(A)' )  'no combine_plot_fields.x neccessary'
     
    12181041
    12191042!
    1220 !--       Inquire, if there is a NetCDF file from a previuos run. This should
     1043!--       Inquire, if there is a netCDF file from a previuos run. This should
    12211044!--       be opened for extension, if its variables match the actual run.
    12221045          INQUIRE( FILE=filename, EXIST=netcdf_extend )
     
    12241047          IF ( netcdf_extend )  THEN
    12251048!
    1226 !--          Open an existing NetCDF file for output
    1227              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_sp )
    1228              CALL handle_netcdf_error( 'check_open', 38 )
     1049!--          Open an existing netCDF file for output
     1050             CALL open_write_netcdf_file( filename, id_set_sp, .FALSE., 38 )
    12291051
    12301052!
     
    12461068          IF ( .NOT. netcdf_extend )  THEN
    12471069!
    1248 !--          Create a new NetCDF output file
    1249              IF ( netcdf_data_format > 1 )  THEN
    1250                 nc_stat = NF90_CREATE( filename,                               &
    1251                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    1252                                        id_set_sp )
    1253              ELSE
    1254                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_sp )
    1255              ENDIF
    1256              CALL handle_netcdf_error( 'check_open', 40 )
     1070!--          Create a new netCDF output file with requested netCDF format
     1071             CALL create_netcdf_file( filename, id_set_sp, .FALSE., 40 )
    12571072!
    12581073!--          Define the header
     
    12711086          ENDIF
    12721087!
    1273 !--       Inquire, if there is a NetCDF file from a previuos run. This should
     1088!--       Inquire, if there is a netCDF file from a previuos run. This should
    12741089!--       be opened for extension, if its variables match the actual run.
    12751090          INQUIRE( FILE=filename, EXIST=netcdf_extend )
     
    12771092          IF ( netcdf_extend )  THEN
    12781093!
    1279 !--          Open an existing NetCDF file for output
    1280              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_prt )
    1281              CALL handle_netcdf_error( 'check_open', 41 )
     1094!--          Open an existing netCDF file for output
     1095             CALL open_write_netcdf_file( filename, id_set_prt, .FALSE., 41 )
    12821096!
    12831097!--          Read header information and set all ids. If there is a mismatch
     
    13151129
    13161130!
    1317 !--          Create a new NetCDF output file with requested NetCDF format
    1318              IF ( netcdf_data_format == 1 )  THEN
    1319 !
    1320 !--             Classic NetCDF format
    1321                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_prt )
    1322 
    1323              ELSEIF ( netcdf_data_format == 2 )  THEN
    1324 !
    1325 !--             64bit-offset format
    1326                 nc_stat = NF90_CREATE( filename,                               &
    1327                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    1328                                        id_set_prt )
    1329 
    1330 #if defined( __netcdf4 )
    1331              ELSEIF ( netcdf_data_format == 3 )  THEN
    1332 !
    1333 !--             NetCDF4/HDF5 format, but no parallel output into a single file!
    1334                 nc_stat = NF90_CREATE( filename,                               &
    1335                                        OR( NF90_NOCLOBBER, NF90_NETCDF4 ),     &
    1336                                        id_set_prt )
    1337 
    1338              ELSEIF ( netcdf_data_format == 4 )  THEN
    1339 !
    1340 !--             NetCDF4/HDF5 format with classic model flag, but no parallel
    1341 !--             output into a single file!
    1342                 nc_stat = NF90_CREATE( filename,                               &
    1343                                        OR( NF90_NOCLOBBER,                     &
    1344                                         OR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), &
    1345                                        id_set_prt )
    1346 #endif
    1347              ENDIF
    1348              
    1349              CALL handle_netcdf_error( 'check_open', 43 ) 
     1131!--          Create a new netCDF output file with requested netCDF format
     1132             CALL create_netcdf_file( filename, id_set_prt, .FALSE., 43 )
    13501133
    13511134!
     
    13611144
    13621145!
    1363 !--       Inquire, if there is a NetCDF file from a previuos run. This should
     1146!--       Inquire, if there is a netCDF file from a previuos run. This should
    13641147!--       be opened for extension, if its variables match the actual run.
    13651148          INQUIRE( FILE=filename, EXIST=netcdf_extend )
     
    13671150          IF ( netcdf_extend )  THEN
    13681151!
    1369 !--          Open an existing NetCDF file for output
    1370              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_pts )
    1371              CALL handle_netcdf_error( 'check_open', 393 )
     1152!--          Open an existing netCDF file for output
     1153             CALL open_write_netcdf_file( filename, id_set_pts, .FALSE., 393 )
    13721154!
    13731155!--          Read header information and set all ids. If there is a mismatch
     
    13881170          IF ( .NOT. netcdf_extend )  THEN
    13891171!
    1390 !--          Create a new NetCDF output file
    1391              IF ( netcdf_data_format > 1 )  THEN
    1392                 nc_stat = NF90_CREATE( filename,                               &
    1393                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    1394                                        id_set_pts )
    1395              ELSE
    1396                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pts )
    1397              ENDIF
    1398              CALL handle_netcdf_error( 'check_open', 395 )
     1172!--          Create a new netCDF output file with requested netCDF format
     1173             CALL create_netcdf_file( filename, id_set_pts, .FALSE., 395 )
    13991174!
    14001175!--          Define the header
     
    14191194          ENDIF
    14201195!
    1421 !--       Inquire, if there is a NetCDF file from a previuos run. This should
     1196!--       Inquire, if there is a netCDF file from a previuos run. This should
    14221197!--       be opened for extension, if its dimensions and variables match the
    14231198!--       actual run.
     
    14261201          IF ( netcdf_extend )  THEN
    14271202!
    1428 !--          Open an existing NetCDF file for output
    1429 #if defined( __netcdf4 )
    1430              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_mask(mid,av), &
    1431                                   COMM = comm2d, INFO = MPI_INFO_NULL )
    1432 #else
    1433              nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_mask(mid,av) )
    1434 #endif
    1435              CALL handle_netcdf_error( 'check_open', 456 )
     1203!--          Open an existing netCDF file for output
     1204             CALL open_write_netcdf_file( filename, id_set_mask(mid,av), &
     1205                                          .TRUE., 456 )
    14361206!
    14371207!--          Read header information and set all ids. If there is a mismatch
     
    14521222          IF ( .NOT. netcdf_extend )  THEN
    14531223!
    1454 !--          Create a new NetCDF output file with requested NetCDF format
    1455              IF ( netcdf_data_format == 1 )  THEN
    1456 !
    1457 !--             Classic NetCDF format
    1458                 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, &
    1459                                        id_set_mask(mid,av) )
    1460 
    1461              ELSEIF ( netcdf_data_format == 2 )  THEN
    1462 !
    1463 !--             64bit-offset format
    1464                 nc_stat = NF90_CREATE( filename,                               &
    1465                                        OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    1466                                        id_set_mask(mid,av) )
    1467 
    1468 
    1469 #if defined( __netcdf4 )
    1470              ELSEIF ( netcdf_data_format == 3 )  THEN
    1471 !
    1472 !--             NetCDF4/HDF5 format
    1473                 nc_stat = NF90_CREATE( filename,                               &
    1474                                        OR( NF90_NOCLOBBER, NF90_NETCDF4 ),     &
    1475                                        id_set_mask(mid,av), COMM = comm2d,     &
    1476                                        INFO = MPI_INFO_NULL )
    1477 
    1478              ELSEIF ( netcdf_data_format == 4 )  THEN
    1479 !
    1480 !--             NetCDF4/HDF5 format with classic model flag
    1481                 nc_stat = NF90_CREATE( filename,                               &
    1482                                        OR( NF90_NOCLOBBER,                     &
    1483                                         OR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), &
    1484                                        id_set_mask(mid,av), COMM = comm2d,     &
    1485                                        INFO = MPI_INFO_NULL )
    1486 #endif
    1487              ENDIF
    1488 
    1489              CALL handle_netcdf_error( 'check_open', 458 )
     1224!--          Create a new netCDF output file with requested netCDF format
     1225             CALL create_netcdf_file( filename, id_set_mask(mid,av), .TRUE., 458 )
    14901226!
    14911227!--          Define the header
Note: See TracChangeset for help on using the changeset viewer.