Changeset 1031 for palm/trunk/SOURCE/check_open.f90
- Timestamp:
- Oct 19, 2012 2:35:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/check_open.f90
r965 r1031 4 4 ! Current revisions: 5 5 ! ----------------- 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 7 9 ! 8 10 ! Former revisions: … … 37 39 ! 38 40 ! 519 2010-03-19 05:30:02Z raasch 39 ! NetCDF4 support for particle data41 ! netCDF4 support for particle data 40 42 ! 41 43 ! 493 2010-03-01 08:30:24Z raasch 42 ! NetCDF4 support (parallel output)44 ! netCDF4 support (parallel output) 43 45 ! 44 46 ! 410 2009-12-04 17:05:40Z letzel … … 46 48 ! 47 49 ! 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. 49 51 ! Output of messages replaced by message handling routine 50 52 ! … … 55 57 ! 56 58 ! 120 2007-10-17 11:54:43Z raasch 57 ! Status of 3D-volume NetCDF data file only depends on switch netcdf_64bit_3d59 ! Status of 3D-volume netCDF data file only depends on switch netcdf_64bit_3d 58 60 ! 59 61 ! 105 2007-08-08 07:12:55Z raasch … … 169 171 CASE ( 101:103, 106, 111:113, 116, 201:200+2*max_masks ) 170 172 171 IF ( netcdf_data_format < 3) THEN173 IF ( netcdf_data_format < 5 ) THEN 172 174 173 175 IF ( myid /= 0 ) THEN … … 738 740 ENDIF 739 741 ! 740 !-- Inquire, if there is a NetCDF file from a previuos run. This should742 !-- Inquire, if there is a netCDF file from a previuos run. This should 741 743 !-- be opened for extension, if its dimensions and variables match the 742 744 !-- actual run. … … 745 747 IF ( netcdf_extend ) THEN 746 748 ! 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 ) 758 751 ! 759 752 !-- Read header information and set all ids. If there is a mismatch … … 774 767 IF ( .NOT. netcdf_extend ) THEN 775 768 ! 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 ) 810 771 811 772 ! … … 814 775 815 776 ! 816 !-- In case of parallel NetCDF output, create flag file which tells777 !-- In case of parallel netCDF output, create flag file which tells 817 778 !-- combine_plot_fields that nothing is to do. 818 IF ( myid == 0 .AND. netcdf_data_format > 2) THEN779 IF ( myid == 0 .AND. netcdf_data_format > 4 ) THEN 819 780 OPEN( 99, FILE='NO_COMBINE_PLOT_FIELDS_XY' ) 820 781 WRITE ( 99, '(A)' ) 'no combine_plot_fields.x neccessary' … … 835 796 ENDIF 836 797 ! 837 !-- Inquire, if there is a NetCDF file from a previuos run. This should798 !-- Inquire, if there is a netCDF file from a previuos run. This should 838 799 !-- be opened for extension, if its dimensions and variables match the 839 800 !-- actual run. … … 842 803 IF ( netcdf_extend ) THEN 843 804 ! 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 ) 855 807 ! 856 808 !-- Read header information and set all ids. If there is a mismatch … … 871 823 IF ( .NOT. netcdf_extend ) THEN 872 824 ! 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 ) 907 827 908 828 ! … … 911 831 912 832 ! 913 !-- In case of parallel NetCDF output, create flag file which tells833 !-- In case of parallel netCDF output, create flag file which tells 914 834 !-- combine_plot_fields that nothing is to do. 915 IF ( myid == 0 .AND. netcdf_data_format > 2) THEN835 IF ( myid == 0 .AND. netcdf_data_format > 4 ) THEN 916 836 OPEN( 99, FILE='NO_COMBINE_PLOT_FIELDS_XZ' ) 917 837 WRITE ( 99, '(A)' ) 'no combine_plot_fields.x neccessary' … … 932 852 ENDIF 933 853 ! 934 !-- Inquire, if there is a NetCDF file from a previuos run. This should854 !-- Inquire, if there is a netCDF file from a previuos run. This should 935 855 !-- be opened for extension, if its dimensions and variables match the 936 856 !-- actual run. … … 939 859 IF ( netcdf_extend ) THEN 940 860 ! 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 ) 952 863 ! 953 864 !-- Read header information and set all ids. If there is a mismatch … … 968 879 IF ( .NOT. netcdf_extend ) THEN 969 880 ! 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 ) 1004 883 1005 884 ! … … 1008 887 1009 888 ! 1010 !-- In case of parallel NetCDF output, create flag file which tells889 !-- In case of parallel netCDF output, create flag file which tells 1011 890 !-- combine_plot_fields that nothing is to do. 1012 IF ( myid == 0 .AND. netcdf_data_format > 2) THEN891 IF ( myid == 0 .AND. netcdf_data_format > 4 ) THEN 1013 892 OPEN( 99, FILE='NO_COMBINE_PLOT_FIELDS_YZ' ) 1014 893 WRITE ( 99, '(A)' ) 'no combine_plot_fields.x neccessary' … … 1024 903 1025 904 ! 1026 !-- Inquire, if there is a NetCDF file from a previuos run. This should905 !-- Inquire, if there is a netCDF file from a previuos run. This should 1027 906 !-- be opened for extension, if its variables match the actual run. 1028 907 INQUIRE( FILE=filename, EXIST=netcdf_extend ) … … 1030 909 IF ( netcdf_extend ) THEN 1031 910 ! 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 ) 1035 913 ! 1036 914 !-- Read header information and set all ids. If there is a mismatch … … 1051 929 IF ( .NOT. netcdf_extend ) THEN 1052 930 ! 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 ) 1062 933 ! 1063 934 !-- Define the header … … 1072 943 1073 944 ! 1074 !-- Inquire, if there is a NetCDF file from a previuos run. This should945 !-- Inquire, if there is a netCDF file from a previuos run. This should 1075 946 !-- be opened for extension, if its variables match the actual run. 1076 947 INQUIRE( FILE=filename, EXIST=netcdf_extend ) … … 1078 949 IF ( netcdf_extend ) THEN 1079 950 ! 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 ) 1083 953 ! 1084 954 !-- Read header information and set all ids. If there is a mismatch … … 1099 969 IF ( .NOT. netcdf_extend ) THEN 1100 970 ! 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 ) 1110 973 ! 1111 974 !-- Define the header … … 1126 989 ENDIF 1127 990 ! 1128 !-- Inquire, if there is a NetCDF file from a previous run. This should991 !-- Inquire, if there is a netCDF file from a previous run. This should 1129 992 !-- be opened for extension, if its dimensions and variables match the 1130 993 !-- actual run. … … 1133 996 IF ( netcdf_extend ) THEN 1134 997 ! 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 ) 1145 1000 ! 1146 1001 !-- Read header information and set all ids. If there is a mismatch … … 1161 1016 IF ( .NOT. netcdf_extend ) THEN 1162 1017 ! 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 ) 1197 1020 1198 1021 ! … … 1201 1024 1202 1025 ! 1203 !-- In case of parallel NetCDF output, create flag file which tells1026 !-- In case of parallel netCDF output, create flag file which tells 1204 1027 !-- combine_plot_fields that nothing is to do. 1205 IF ( myid == 0 .AND. netcdf_data_format > 2) THEN1028 IF ( myid == 0 .AND. netcdf_data_format > 4 ) THEN 1206 1029 OPEN( 99, FILE='NO_COMBINE_PLOT_FIELDS_3D' ) 1207 1030 WRITE ( 99, '(A)' ) 'no combine_plot_fields.x neccessary' … … 1218 1041 1219 1042 ! 1220 !-- Inquire, if there is a NetCDF file from a previuos run. This should1043 !-- Inquire, if there is a netCDF file from a previuos run. This should 1221 1044 !-- be opened for extension, if its variables match the actual run. 1222 1045 INQUIRE( FILE=filename, EXIST=netcdf_extend ) … … 1224 1047 IF ( netcdf_extend ) THEN 1225 1048 ! 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 ) 1229 1051 1230 1052 ! … … 1246 1068 IF ( .NOT. netcdf_extend ) THEN 1247 1069 ! 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 ) 1257 1072 ! 1258 1073 !-- Define the header … … 1271 1086 ENDIF 1272 1087 ! 1273 !-- Inquire, if there is a NetCDF file from a previuos run. This should1088 !-- Inquire, if there is a netCDF file from a previuos run. This should 1274 1089 !-- be opened for extension, if its variables match the actual run. 1275 1090 INQUIRE( FILE=filename, EXIST=netcdf_extend ) … … 1277 1092 IF ( netcdf_extend ) THEN 1278 1093 ! 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 ) 1282 1096 ! 1283 1097 !-- Read header information and set all ids. If there is a mismatch … … 1315 1129 1316 1130 ! 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 ) 1350 1133 1351 1134 ! … … 1361 1144 1362 1145 ! 1363 !-- Inquire, if there is a NetCDF file from a previuos run. This should1146 !-- Inquire, if there is a netCDF file from a previuos run. This should 1364 1147 !-- be opened for extension, if its variables match the actual run. 1365 1148 INQUIRE( FILE=filename, EXIST=netcdf_extend ) … … 1367 1150 IF ( netcdf_extend ) THEN 1368 1151 ! 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 ) 1372 1154 ! 1373 1155 !-- Read header information and set all ids. If there is a mismatch … … 1388 1170 IF ( .NOT. netcdf_extend ) THEN 1389 1171 ! 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 ) 1399 1174 ! 1400 1175 !-- Define the header … … 1419 1194 ENDIF 1420 1195 ! 1421 !-- Inquire, if there is a NetCDF file from a previuos run. This should1196 !-- Inquire, if there is a netCDF file from a previuos run. This should 1422 1197 !-- be opened for extension, if its dimensions and variables match the 1423 1198 !-- actual run. … … 1426 1201 IF ( netcdf_extend ) THEN 1427 1202 ! 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 ) 1436 1206 ! 1437 1207 !-- Read header information and set all ids. If there is a mismatch … … 1452 1222 IF ( .NOT. netcdf_extend ) THEN 1453 1223 ! 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 ) 1490 1226 ! 1491 1227 !-- Define the header
Note: See TracChangeset
for help on using the changeset viewer.