Changeset 1031 for palm/trunk/SOURCE
- Timestamp:
- Oct 19, 2012 2:35:30 PM (12 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 10 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 -
palm/trunk/SOURCE/check_parameters.f90
r1020 r1031 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! check of netcdf4 parallel file support 7 7 ! 8 8 ! Former revisions: … … 2847 2847 2848 2848 ENDDO 2849 ENDIF 2850 2851 ! 2852 !-- Set output format string (used in header) 2853 IF ( netcdf_output ) THEN 2854 2855 SELECT CASE ( netcdf_data_format ) 2856 CASE ( 1 ) 2857 output_format_netcdf = 'netCDF classic' 2858 CASE ( 2 ) 2859 output_format_netcdf = 'netCDF 64bit offset' 2860 CASE ( 3 ) 2861 output_format_netcdf = 'netCDF4/HDF5' 2862 CASE ( 4 ) 2863 output_format_netcdf = 'netCDF4/HDF5 classic' 2864 CASE ( 5 ) 2865 output_format_netcdf = 'parallel netCDF4/HDF5' 2866 CASE ( 6 ) 2867 output_format_netcdf = 'parallel netCDF4/HDF5 classic' 2868 2869 END SELECT 2849 2870 2850 2871 ENDIF … … 2882 2903 !-- Check the NetCDF data format 2883 2904 #if ! defined ( __check ) 2884 IF ( netcdf_data_format > 2 ) THEN2905 IF ( netcdf_data_format > 2 .AND. netcdf_data_format < 5 ) THEN 2885 2906 #if defined( __netcdf4 ) 2886 2907 CONTINUE 2887 2908 #else 2888 message_string = ' NetCDF: NetCDF4 format requested but no ' // &2909 message_string = 'netCDF: netCDF4 format requested but no ' // & 2889 2910 'cpp-directive __netcdf4 given & switch ' // & 2890 2911 'back to 64-bit offset format' … … 2893 2914 #endif 2894 2915 ENDIF 2916 IF ( netcdf_data_format > 4 ) THEN 2917 #if defined( __netcdf4 ) && defined( __netcdf4_parallel ) 2918 CONTINUE 2919 #else 2920 message_string = 'netCDF: netCDF4 parallel output requested but no ' // & 2921 'cpp-directive __netcdf4_parallel given & switch ' // & 2922 'back to netCDF4 non-parallel output' 2923 CALL message( 'check_parameters', 'PA0099', 0, 1, 0, 6, 0 ) 2924 netcdf_data_format = netcdf_data_format - 2 2895 2925 #endif 2896 ! 2926 ENDIF 2927 #endif 2897 2928 2898 2929 #if ! defined( __check ) 2930 ! 2899 2931 !-- Check netcdf precison 2900 2932 ldum = .FALSE. -
palm/trunk/SOURCE/close_file.f90
r965 r1031 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! netCDF4 without parallel file support implemented 7 7 ! 8 8 ! Former revisions: … … 189 189 190 190 IF ( netcdf_output .AND. & 191 ( myid == 0 .OR. netcdf_data_format > 2) ) THEN191 ( myid == 0 .OR. netcdf_data_format > 4 ) ) THEN 192 192 nc_stat = NF90_CLOSE( id_set_xy(0) ) 193 193 CALL handle_netcdf_error( 'close_file', 44 ) … … 197 197 198 198 IF ( netcdf_output .AND. & 199 ( myid == 0 .OR. netcdf_data_format > 2) ) THEN199 ( myid == 0 .OR. netcdf_data_format > 4 ) ) THEN 200 200 nc_stat = NF90_CLOSE( id_set_xz(0) ) 201 201 CALL handle_netcdf_error( 'close_file', 45 ) … … 205 205 206 206 IF ( netcdf_output .AND. & 207 ( myid == 0 .OR. netcdf_data_format > 2) ) THEN207 ( myid == 0 .OR. netcdf_data_format > 4 ) ) THEN 208 208 nc_stat = NF90_CLOSE( id_set_yz(0) ) 209 209 CALL handle_netcdf_error( 'close_file', 46 ) … … 227 227 228 228 IF ( netcdf_output .AND. & 229 ( myid == 0 .OR. netcdf_data_format > 2) ) THEN229 ( myid == 0 .OR. netcdf_data_format > 4 ) ) THEN 230 230 nc_stat = NF90_CLOSE( id_set_3d(0) ) 231 231 CALL handle_netcdf_error( 'close_file', 49 ) … … 256 256 257 257 IF ( netcdf_output .AND. & 258 ( myid == 0 .OR. netcdf_data_format > 2) ) THEN258 ( myid == 0 .OR. netcdf_data_format > 4 ) ) THEN 259 259 nc_stat = NF90_CLOSE( id_set_xy(1) ) 260 260 CALL handle_netcdf_error( 'close_file', 52 ) … … 264 264 265 265 IF ( netcdf_output .AND. & 266 ( myid == 0 .OR. netcdf_data_format > 2) ) THEN266 ( myid == 0 .OR. netcdf_data_format > 4 ) ) THEN 267 267 nc_stat = NF90_CLOSE( id_set_xz(1) ) 268 268 CALL handle_netcdf_error( 'close_file', 352 ) … … 272 272 273 273 IF ( netcdf_output .AND. & 274 ( myid == 0 .OR. netcdf_data_format > 2) ) THEN274 ( myid == 0 .OR. netcdf_data_format > 4 ) ) THEN 275 275 nc_stat = NF90_CLOSE( id_set_yz(1) ) 276 276 CALL handle_netcdf_error( 'close_file', 353 ) … … 280 280 281 281 IF ( netcdf_output .AND. & 282 ( myid == 0 .OR. netcdf_data_format > 2) ) THEN282 ( myid == 0 .OR. netcdf_data_format > 4 ) ) THEN 283 283 nc_stat = NF90_CLOSE( id_set_3d(1) ) 284 284 CALL handle_netcdf_error( 'close_file', 353 ) … … 288 288 289 289 IF ( netcdf_output .AND. & 290 ( myid == 0 .OR. netcdf_data_format > 2) ) THEN290 ( myid == 0 .OR. netcdf_data_format > 4 ) ) THEN 291 291 ! 292 292 !-- decompose fid into mid and av -
palm/trunk/SOURCE/data_output_2d.f90
r1008 r1031 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! netCDF4 without parallel file support implemented 7 7 ! 8 8 ! Former revisions: … … 44 44 ! 45 45 ! 493 2010-03-01 08:30:24Z raasch 46 ! NetCDF4 support (parallel output)46 ! netCDF4 support (parallel output) 47 47 ! 48 48 ! 367 2009-08-25 08:35:52Z maronga 49 ! simulated_time in NetCDF output replaced by time_since_reference_point.50 ! Output of NetCDF messages with aid of message handling routine.49 ! simulated_time in netCDF output replaced by time_since_reference_point. 50 ! Output of netCDF messages with aid of message handling routine. 51 51 ! Bugfix: averaging along z is not allowed for 2d quantities (e.g. u* and z0) 52 52 ! Output of messages replaced by message handling routine. … … 85 85 ! Description: 86 86 ! ------------ 87 ! Data output of horizontal cross-sections in NetCDF format or binary format87 ! Data output of horizontal cross-sections in netCDF format or binary format 88 88 ! compatible to old graphic software iso2d. 89 89 ! Attention: The position of the sectional planes is still not always computed … … 146 146 147 147 ! 148 !-- Classic and 64bit offset NetCDF output is done only on PE0. 149 !-- netCDF4/HDF5 output is done in parallel on all PEs. 150 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 2 ) ) & 148 !-- Parallel netCDF4/HDF5 output is done on all PEs, all other on PE0 only 149 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 4 ) ) & 151 150 THEN 152 151 CALL check_open( 101+av*10 ) … … 169 168 170 169 ! 171 !-- Classic and 64bit offset NetCDF output is done only on PE0. 172 !-- netCDF4/HDF5 output may be done in parallel on all PEs. 173 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 2 ) ) & 170 !-- Parallel netCDF4/HDF5 output is done on all PEs, all other on PE0 only 171 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 4 ) ) & 174 172 THEN 175 173 CALL check_open( 102+av*10 ) … … 193 191 194 192 ! 195 !-- Classic and 64bit offset NetCDF output is done only on PE0. 196 !-- netCDF4/HDF5 output may be done in parallel on all PEs. 197 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 2 ) ) & 193 !-- Parallel netCDF4/HDF5 output is done on all PEs, all other on PE0 only 194 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 4 ) ) & 198 195 THEN 199 196 CALL check_open( 103+av*10 ) … … 703 700 704 701 ! 705 !-- Update the NetCDF xy cross section time axis706 IF ( myid == 0 .OR. netcdf_data_format > 2) THEN702 !-- Update the netCDF xy cross section time axis 703 IF ( myid == 0 .OR. netcdf_data_format > 4 ) THEN 707 704 IF ( simulated_time /= do2d_xy_last_time(av) ) THEN 708 705 do2d_xy_time_count(av) = do2d_xy_time_count(av) + 1 709 706 do2d_xy_last_time(av) = simulated_time 710 707 IF ( ( .NOT. data_output_2d_on_each_pe .AND. & 711 netcdf_output ) .OR. netcdf_data_format > 2) &708 netcdf_output ) .OR. netcdf_data_format > 4 ) & 712 709 THEN 713 710 #if defined( __netcdf ) … … 747 744 748 745 #if defined( __parallel ) 749 IF ( netcdf_output .AND. netcdf_data_format > 2) THEN750 ! 751 !-- Output in NetCDF4/HDF5 format.746 IF ( netcdf_output .AND. netcdf_data_format > 4 ) THEN 747 ! 748 !-- Parallel output in netCDF4/HDF5 format. 752 749 !-- Do not output redundant ghost point data except for the 753 750 !-- boundaries of the total domain. … … 951 948 CASE ( 'xz' ) 952 949 ! 953 !-- Update the NetCDF xz cross section time axis954 IF ( myid == 0 .OR. netcdf_data_format > 2) THEN950 !-- Update the netCDF xz cross section time axis 951 IF ( myid == 0 .OR. netcdf_data_format > 4 ) THEN 955 952 956 953 IF ( simulated_time /= do2d_xz_last_time(av) ) THEN … … 958 955 do2d_xz_last_time(av) = simulated_time 959 956 IF ( ( .NOT. data_output_2d_on_each_pe .AND. & 960 netcdf_output ) .OR. netcdf_data_format > 2) &957 netcdf_output ) .OR. netcdf_data_format > 4 ) & 961 958 THEN 962 959 #if defined( __netcdf ) … … 1016 1013 1017 1014 #if defined( __parallel ) 1018 IF ( netcdf_output .AND. netcdf_data_format > 2) THEN1015 IF ( netcdf_output .AND. netcdf_data_format > 4 ) THEN 1019 1016 ! 1020 1017 !-- ATTENTION: The following lines are a workaround, because 1021 1018 !-- independet output does not work with the 1022 !-- current NetCDF4 installation. Therefore, data1019 !-- current netCDF4 installation. Therefore, data 1023 1020 !-- are transferred from PEs having the cross 1024 1021 !-- sections to other PEs along y having no cross … … 1049 1046 1050 1047 ! 1051 !-- Output in NetCDF4/HDF5 format.1048 !-- Output in netCDF4/HDF5 format. 1052 1049 !-- Output only on those PEs where the respective cross 1053 1050 !-- sections reside. Cross sections averaged along y are … … 1261 1258 CASE ( 'yz' ) 1262 1259 ! 1263 !-- Update the NetCDF yz cross section time axis1264 IF ( myid == 0 .OR. netcdf_data_format > 2) THEN1260 !-- Update the netCDF yz cross section time axis 1261 IF ( myid == 0 .OR. netcdf_data_format > 4 ) THEN 1265 1262 1266 1263 IF ( simulated_time /= do2d_yz_last_time(av) ) THEN … … 1268 1265 do2d_yz_last_time(av) = simulated_time 1269 1266 IF ( ( .NOT. data_output_2d_on_each_pe .AND. & 1270 netcdf_output ) .OR. netcdf_data_format > 2) &1267 netcdf_output ) .OR. netcdf_data_format > 4 ) & 1271 1268 THEN 1272 1269 #if defined( __netcdf ) … … 1325 1322 1326 1323 #if defined( __parallel ) 1327 IF ( netcdf_output .AND. netcdf_data_format > 2) THEN1324 IF ( netcdf_output .AND. netcdf_data_format > 4 ) THEN 1328 1325 ! 1329 1326 !-- ATTENTION: The following lines are a workaround, because 1330 1327 !-- independet output does not work with the 1331 !-- current NetCDF4 installation. Therefore, data1328 !-- current netCDF4 installation. Therefore, data 1332 1329 !-- are transferred from PEs having the cross 1333 1330 !-- sections to other PEs along y having no cross … … 1358 1355 1359 1356 ! 1360 !-- Output in NetCDF4/HDF5 format.1357 !-- Output in netCDF4/HDF5 format. 1361 1358 !-- Output only on those PEs where the respective cross 1362 1359 !-- sections reside. Cross sections averaged along x are -
palm/trunk/SOURCE/data_output_3d.f90
r1008 r1031 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! netCDF4 without parallel file support implemented 7 7 ! 8 8 ! Former revisions: … … 45 45 ! 46 46 ! 493 2010-03-01 08:30:24Z raasch 47 ! NetCDF4 support (parallel output)47 ! netCDF4 support (parallel output) 48 48 ! 49 49 ! 355 2009-07-17 01:03:01Z letzel 50 ! simulated_time in NetCDF output replaced by time_since_reference_point.51 ! Output of NetCDF messages with aid of message handling routine.50 ! simulated_time in netCDF output replaced by time_since_reference_point. 51 ! Output of netCDF messages with aid of message handling routine. 52 52 ! Output of messages replaced by message handling routine. 53 53 ! Bugfix: to_be_resorted => s_av for time-averaged scalars … … 75 75 ! Description: 76 76 ! ------------ 77 ! Output of the 3D-arrays in NetCDF and/or AVS format.77 ! Output of the 3D-arrays in netCDF and/or AVS format. 78 78 !------------------------------------------------------------------------------! 79 79 … … 113 113 !-- Open output file. 114 114 !-- Also creates coordinate and fld-file for AVS. 115 !-- For classic or 64bit NetCDF output or output of other (old) data formats,115 !-- For classic or 64bit netCDF output or output of other (old) data formats, 116 116 !-- for a run on more than one PE, each PE opens its own file and 117 117 !-- writes the data of its subdomain in binary format (regardless of the format … … 119 119 !-- file by combine_plot_fields in the format requested by the user (netcdf 120 120 !-- and/or avs). 121 !-- For NetCDF4/HDF5 output, data is written in parallel into one file.121 !-- For netCDF4/HDF5 output, data is written in parallel into one file. 122 122 IF ( netcdf_output ) THEN 123 IF ( netcdf_data_format < 3) THEN123 IF ( netcdf_data_format < 5 ) THEN 124 124 CALL check_open( 30 ) 125 125 IF ( myid == 0 ) CALL check_open( 106+av*10 ) … … 136 136 137 137 ! 138 !-- Update the NetCDF time axis138 !-- Update the netCDF time axis 139 139 #if defined( __netcdf ) 140 IF ( myid == 0 .OR. netcdf_data_format > 2) THEN140 IF ( myid == 0 .OR. netcdf_data_format > 4 ) THEN 141 141 do3d_time_count(av) = do3d_time_count(av) + 1 142 142 IF ( netcdf_output ) THEN … … 456 456 #if defined( __parallel ) 457 457 IF ( netcdf_output ) THEN 458 IF ( netcdf_data_format < 3) THEN459 ! 460 !-- Classic or 64bit format. Data is output in parallel in FORTRAN461 !-- binary format here, and later collected into one file by458 IF ( netcdf_data_format < 5 ) THEN 459 ! 460 !-- Non-parallel netCDF output. Data is output in parallel in 461 !-- FORTRAN binary format here, and later collected into one file by 462 462 !-- combine_plot_fields 463 463 IF ( myid == 0 ) THEN … … 478 478 #if defined( __netcdf ) 479 479 ! 480 !-- Output in NetCDF4/HDF5 format.480 !-- Parallel output in netCDF4/HDF5 format. 481 481 !-- Do not output redundant ghost point data except for the 482 482 !-- boundaries of the total domain. -
palm/trunk/SOURCE/data_output_mask.f90
r1008 r1031 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! netCDF4 without parallel file support implemented 7 7 ! 8 8 ! Former revisions: … … 35 35 ! Description: 36 36 ! ------------ 37 ! Masked data output in NetCDF format for current mask (current value of mid).37 ! Masked data output in netCDF format for current mask (current value of mid). 38 38 !------------------------------------------------------------------------------! 39 39 … … 72 72 ! 73 73 !-- Open output file. 74 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 2) ) &74 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 4 ) ) & 75 75 THEN 76 76 CALL check_open( 200+mid+av*max_masks ) … … 88 88 89 89 ! 90 !-- Update the NetCDF time axis.90 !-- Update the netCDF time axis. 91 91 domask_time_count(mid,av) = domask_time_count(mid,av) + 1 92 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 2) ) &92 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 4 ) ) & 93 93 THEN 94 94 nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_time_mask(mid,av), & … … 106 106 ! 107 107 !-- Reallocate local_pf on PE 0 since its shape changes during MPI exchange 108 IF ( netcdf_data_format < 3.AND. myid == 0 .AND. if > 1 ) THEN108 IF ( netcdf_data_format < 5 .AND. myid == 0 .AND. if > 1 ) THEN 109 109 DEALLOCATE( local_pf ) 110 110 ALLOCATE( local_pf(mask_size_l(mid,1),mask_size_l(mid,2), & … … 366 366 !-- I/O block. I/O methods are implemented 367 367 !-- (1) for parallel execution 368 !-- a. with NetCDF 4 parallel I/O-enabled library369 !-- b. with NetCDF 3 library368 !-- a. with netCDF 4 parallel I/O-enabled library 369 !-- b. with netCDF 3 library 370 370 !-- (2) for serial execution. 371 371 !-- The choice of method depends on the correct setting of preprocessor 372 !-- directives __parallel and __netcdf4 as well as on the parameter372 !-- directives __parallel and __netcdf4_parallel as well as on the parameter 373 373 !-- netcdf_data_format. 374 374 #if defined( __parallel ) 375 #if defined( __netcdf4 )376 IF ( netcdf_data_format > 2) THEN377 ! 378 !-- (1) a. Parallel I/O using NetCDF 4 (not yet tested)375 #if defined( __netcdf4_parallel ) 376 IF ( netcdf_data_format > 4 ) THEN 377 ! 378 !-- (1) a. Parallel I/O using netCDF 4 (not yet tested) 379 379 nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), & 380 380 id_var_domask(mid,av,if), & … … 463 463 !-- fast so that PE0 may receive wrong data on tag 0. 464 464 CALL MPI_BARRIER( comm2d, ierr ) 465 #if defined( __netcdf4 )465 #if defined( __netcdf4_parallel ) 466 466 ENDIF 467 467 #endif -
palm/trunk/SOURCE/header.f90
r1017 r1031 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! output of netCDF data format modified 7 7 ! 8 8 ! Former revisions: … … 730 730 output_format = '' 731 731 IF ( netcdf_output ) THEN 732 IF ( netcdf_data_format == 1 ) THEN 733 output_format = 'NetCDF classic' 734 ELSE 735 output_format = 'NetCDF 64bit offset' 736 ENDIF 732 output_format = output_format_netcdf 737 733 ENDIF 738 734 WRITE ( io, 344 ) output_format … … 801 797 output_format = '' 802 798 IF ( netcdf_output ) THEN 803 IF ( netcdf_data_format == 1 ) THEN 804 output_format = 'NetCDF classic' 805 ELSEIF ( netcdf_data_format == 2 ) THEN 806 output_format = 'NetCDF 64bit offset' 807 ELSEIF ( netcdf_data_format == 3 ) THEN 808 output_format = 'NetCDF4/HDF5' 809 ELSEIF ( netcdf_data_format == 4 ) THEN 810 output_format = 'NetCDF4/HDF5 clasic' 811 ENDIF 799 output_format = output_format_netcdf 812 800 ENDIF 813 801 IF ( iso2d_output ) THEN 814 802 IF ( netcdf_output ) THEN 815 output_format = TRIM( output_format ) // ' and iso2d'803 output_format = TRIM( output_format_netcdf ) // ' and iso2d' 816 804 ELSE 817 805 output_format = 'iso2d' … … 962 950 output_format = '' 963 951 IF ( netcdf_output ) THEN 964 IF ( netcdf_data_format == 1 ) THEN 965 output_format = 'NetCDF classic' 966 ELSEIF ( netcdf_data_format == 2 ) THEN 967 output_format = 'NetCDF 64bit offset' 968 ELSEIF ( netcdf_data_format == 3 ) THEN 969 output_format = 'NetCDF4/HDF5' 970 ELSEIF ( netcdf_data_format == 4 ) THEN 971 output_format = 'NetCDF4/HDF5 clasic' 972 ENDIF 952 output_format = output_format_netcdf 973 953 ENDIF 974 954 IF ( avs_output ) THEN 975 955 IF ( netcdf_output ) THEN 976 output_format = TRIM( output_format ) // ' and avs'956 output_format = TRIM( output_format_netcdf ) // ' and avs' 977 957 ELSE 978 958 output_format = 'avs' … … 1058 1038 ENDIF 1059 1039 1060 output_format = ' '1040 output_format = ' ' 1061 1041 IF ( netcdf_output ) THEN 1062 IF ( netcdf_data_format == 1 ) THEN 1063 output_format = 'NetCDF classic' 1064 ELSEIF ( netcdf_data_format == 2 ) THEN 1065 output_format = 'NetCDF 64bit offset' 1066 ELSEIF ( netcdf_data_format == 3 ) THEN 1067 output_format = 'NetCDF4/HDF5' 1068 ELSEIF ( netcdf_data_format == 4 ) THEN 1069 output_format = 'NetCDF4/HDF5 clasic' 1070 ENDIF 1042 output_format = output_format_netcdf 1071 1043 ENDIF 1072 1044 WRITE ( io, 344 ) output_format … … 1122 1094 output_format = '' 1123 1095 IF ( netcdf_output ) THEN 1124 IF ( netcdf_data_format == 1 ) THEN 1125 output_format = 'NetCDF classic' 1126 ELSE 1127 output_format = 'NetCDF 64bit offset' 1128 ENDIF 1096 output_format = output_format_netcdf 1129 1097 ENDIF 1130 1098 WRITE ( io, 344 ) output_format … … 1190 1158 WRITE ( io, 370 ) 1191 1159 1192 output_format = ' '1160 output_format = ' ' 1193 1161 IF ( netcdf_output ) THEN 1194 IF ( netcdf_data_format == 1 ) THEN 1195 output_format = 'NetCDF classic' 1196 ELSE 1197 output_format = 'NetCDF 64bit offset' 1198 ENDIF 1162 output_format = output_format_netcdf 1199 1163 ENDIF 1200 1164 WRITE ( io, 344 ) output_format … … 1532 1496 IF ( dt_write_particle_data /= 9999999.9 ) THEN 1533 1497 WRITE ( io, 485 ) dt_write_particle_data 1534 output_format = ' '1498 output_format = ' ' 1535 1499 IF ( netcdf_output ) THEN 1536 1500 IF ( netcdf_data_format > 1 ) THEN -
palm/trunk/SOURCE/init_masks.f90
r997 r1031 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! netCDF4 without parallel file support implemented 7 7 ! 8 8 ! Former revisions: … … 82 82 ! 83 83 !-- Parallel mask output not yet tested 84 IF ( netcdf_data_format > 2) THEN84 IF ( netcdf_data_format > 4 ) THEN 85 85 message_string = 'netCDF file formats '// & 86 86 '3 (netCDF 4) and 4 (netCDF 4 Classic model)'// & … … 127 127 ! 128 128 !-- Global arrays are required by define_netcdf_header. 129 IF ( myid == 0 .OR. netcdf_data_format > 2) THEN129 IF ( myid == 0 .OR. netcdf_data_format > 4 ) THEN 130 130 ALLOCATE( mask_i_global(max_masks,nx+1), & 131 131 mask_j_global(max_masks,ny+1), & … … 412 412 CALL MPI_BARRIER( comm2d, ierr ) 413 413 414 IF ( netcdf_data_format > 2 ) THEN414 IF ( netcdf_data_format > 4 ) THEN 415 415 416 416 CALL MPI_BCAST( mask_i_global(mid,:), nx+1, MPI_INTEGER, 0, comm2d, & -
palm/trunk/SOURCE/modules.f90
r1017 r1031 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! +output_format_netcdf 7 7 ! 8 8 ! Former revisions: … … 523 523 return_addres, return_username, & 524 524 timestep_scheme = 'runge-kutta-3' 525 CHARACTER (LEN=40) :: avs_data_file, topography = 'flat' 525 CHARACTER (LEN=40) :: avs_data_file, output_format_netcdf, & 526 topography = 'flat' 526 527 CHARACTER (LEN=64) :: host = ' ' 527 528 CHARACTER (LEN=80) :: log_message, run_identifier -
palm/trunk/SOURCE/netcdf.f90
r993 r1031 7 7 ! Current revisions: 8 8 ! ------------------ 9 ! 9 ! netCDF4 without parallel file support implemented, new routines 10 ! create_netcdf_file and open_write_netcdf_file at end 10 11 ! 11 12 ! Former revisions: … … 27 28 ! 28 29 ! 951 2012-07-19 14:22:52Z hoffmann 29 ! cross_profiles, profile_rows, profile_columns are written to NetCDF header30 ! cross_profiles, profile_rows, profile_columns are written to netCDF header 30 31 ! 31 32 ! 771 2011-10-27 10:56:21Z heinze … … 41 42 ! 42 43 ! 519 2010-03-19 05:30:02Z raasch 43 ! particle number defined as unlimited dimension in case of NetCDF4 output,44 ! special characters like * and " are now allowed for NetCDF variable names,44 ! particle number defined as unlimited dimension in case of netCDF4 output, 45 ! special characters like * and " are now allowed for netCDF variable names, 45 46 ! replacement of these characters removed, routine clean_netcdf_varname 46 47 ! removed 47 48 ! 48 49 ! 493 2010-03-01 08:30:24Z raasch 49 ! Extensions for NetCDF4 output50 ! Extensions for netCDF4 output 50 51 ! 51 52 ! 410 2009-12-04 17:05:40Z letzel … … 53 54 ! 54 55 ! 359 2009-08-19 16:56:44Z letzel 55 ! for extended NetCDF files, the updated title attribute includes an update of56 ! for extended netCDF files, the updated title attribute includes an update of 56 57 ! time_average_text where appropriate. 57 ! Bugfix for extended NetCDF files: In order to avoid 'data mode' errors if58 ! Bugfix for extended netCDF files: In order to avoid 'data mode' errors if 58 59 ! updated attributes are larger than their original size, NF90_PUT_ATT is called 59 60 ! in 'define mode' enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a 60 61 ! possible performance loss; an alternative strategy would be to ensure equal 61 62 ! attribute size in a job chain. 62 ! NetCDF unit attribute in timeseries output in case of statistic63 ! netCDF unit attribute in timeseries output in case of statistic 63 64 ! regions added. 64 ! Output of NetCDF messages with aid of message handling routine.65 ! Output of netCDF messages with aid of message handling routine. 65 66 ! Output of messages replaced by message handling routine. 66 67 ! Typographical errors fixed. … … 95 96 ! In case of extend = .FALSE.: 96 97 ! Define all necessary dimensions, axes and variables for the different 97 ! NetCDF datasets. This subroutine is called from check_open after a new98 ! dataset is created. It leaves the open NetCDF files ready to write.98 ! netCDF datasets. This subroutine is called from check_open after a new 99 ! dataset is created. It leaves the open netCDF files ready to write. 99 100 ! 100 101 ! In case of extend = .TRUE.: … … 163 164 IF ( .NOT. init_netcdf ) THEN 164 165 ! 165 !-- Check and set accuracy for NetCDF output. First set default value166 !-- Check and set accuracy for netCDF output. First set default value 166 167 nc_precision = NF90_REAL4 167 168 … … 547 548 548 549 ! 549 !-- Leave NetCDF define mode550 !-- Leave netCDF define mode 550 551 nc_stat = NF90_ENDDEF( id_set_mask(mid,av) ) 551 552 CALL handle_netcdf_error( 'netcdf', 498 ) … … 683 684 684 685 IF ( TRIM( var_list ) /= TRIM( var_list_old ) ) THEN 685 WRITE ( message_string, * ) ' NetCDF file for ', TRIM( var ), &686 WRITE ( message_string, * ) 'netCDF file for ', TRIM( var ), & 686 687 ' data for mask', mid, ' from previous run found,', & 687 688 '&but this file cannot be extended due to variable ', & … … 710 711 711 712 IF ( mask_size(mid,3) /= nz_old ) THEN 712 WRITE ( message_string, * ) ' NetCDF file for ', TRIM( var ), &713 WRITE ( message_string, * ) 'netCDF file for ', TRIM( var ), & 713 714 ' data for mask', mid, ' from previous run found,', & 714 715 '&but this file cannot be extended due to mismatch in ', & … … 748 749 749 750 IF ( last_time_coordinate(1) >= simulated_time ) THEN 750 WRITE ( message_string, * ) ' NetCDF file for ', TRIM( var ), &751 WRITE ( message_string, * ) 'netCDF file for ', TRIM( var ), & 751 752 ' data for mask', mid, ' from previous run found,', & 752 753 '&but this file cannot be extended because the current ', & … … 792 793 nc_stat = NF90_ENDDEF( id_set_mask(mid,av) ) 793 794 CALL handle_netcdf_error( 'netcdf', 518 ) 794 WRITE ( message_string, * ) ' NetCDF file for ', TRIM( var ), &795 WRITE ( message_string, * ) 'netCDF file for ', TRIM( var ), & 795 796 ' data for mask', mid, ' from previous run found.', & 796 797 '&This file will be extended.' … … 1055 1056 'units', TRIM( do3d_unit(av,i) ) ) 1056 1057 CALL handle_netcdf_error( 'netcdf', 357 ) 1057 #if defined( __netcdf4 )1058 #if defined( __netcdf4_parallel ) 1058 1059 ! 1059 1060 !-- Set collective io operations for parallel io 1060 IF ( netcdf_data_format > 2) THEN1061 IF ( netcdf_data_format > 4 ) THEN 1061 1062 nc_stat = NF90_VAR_PAR_ACCESS( id_set_3d(av), & 1062 1063 id_var_do3d(av,i), & … … 1081 1082 1082 1083 ! 1083 !-- Leave NetCDF define mode1084 !-- Leave netCDF define mode 1084 1085 nc_stat = NF90_ENDDEF( id_set_3d(av) ) 1085 1086 CALL handle_netcdf_error( 'netcdf', 82 ) … … 1188 1189 1189 1190 IF ( TRIM( var_list ) /= TRIM( var_list_old ) ) THEN 1190 message_string = ' NetCDF file for volume data ' // &1191 message_string = 'netCDF file for volume data ' // & 1191 1192 TRIM( var ) // ' from previous run found,' // & 1192 1193 '&but this file cannot be extended due to' // & … … 1213 1214 1214 1215 IF ( nz_do3d-nzb+1 /= nz_old ) THEN 1215 message_string = ' NetCDF file for volume data ' // &1216 message_string = 'netCDF file for volume data ' // & 1216 1217 TRIM( var ) // ' from previous run found,' // & 1217 1218 '&but this file cannot be extended due to' // & … … 1249 1250 1250 1251 IF ( last_time_coordinate(1) >= simulated_time ) THEN 1251 message_string = ' NetCDF file for volume data ' // &1252 message_string = 'netCDF file for volume data ' // & 1252 1253 TRIM( var ) // ' from previous run found,' // & 1253 1254 '&but this file cannot be extended becaus' // & … … 1270 1271 id_var_do3d(av,i) ) 1271 1272 CALL handle_netcdf_error( 'netcdf', 95 ) 1272 #if defined( __netcdf4 )1273 #if defined( __netcdf4_parallel ) 1273 1274 ! 1274 1275 !-- Set collective io operations for parallel io 1275 IF ( netcdf_data_format > 2) THEN1276 IF ( netcdf_data_format > 4 ) THEN 1276 1277 nc_stat = NF90_VAR_PAR_ACCESS( id_set_3d(av), & 1277 1278 id_var_do3d(av,i), & … … 1304 1305 nc_stat = NF90_ENDDEF( id_set_3d(av) ) 1305 1306 CALL handle_netcdf_error( 'netcdf', 430 ) 1306 message_string = ' NetCDF file for volume data ' // &1307 message_string = 'netCDF file for volume data ' // & 1307 1308 TRIM( var ) // ' from previous run found.' // & 1308 1309 '&This file will be extended.' … … 1621 1622 'units', TRIM( do2d_unit(av,i) ) ) 1622 1623 CALL handle_netcdf_error( 'netcdf', 354 ) 1623 #if defined( __netcdf4 )1624 #if defined( __netcdf4_parallel ) 1624 1625 ! 1625 1626 !-- Set collective io operations for parallel io 1626 IF ( netcdf_data_format > 2) THEN1627 IF ( netcdf_data_format > 4 ) THEN 1627 1628 nc_stat = NF90_VAR_PAR_ACCESS( id_set_xy(av), & 1628 1629 id_var_do2d(av,i), & … … 1649 1650 1650 1651 ! 1651 !-- Leave NetCDF define mode1652 !-- Leave netCDF define mode 1652 1653 nc_stat = NF90_ENDDEF( id_set_xy(av) ) 1653 1654 CALL handle_netcdf_error( 'netcdf', 122 ) … … 1794 1795 1795 1796 IF ( TRIM( var_list ) /= TRIM( var_list_old ) ) THEN 1796 message_string = ' NetCDF file for cross-sections ' // &1797 message_string = 'netCDF file for cross-sections ' // & 1797 1798 TRIM( var ) // ' from previous run found,' // & 1798 1799 '& but this file cannot be extended due to' // & … … 1827 1828 1828 1829 IF ( ns /= ns_old ) THEN 1829 message_string = ' NetCDF file for cross-sections ' // &1830 message_string = 'netCDF file for cross-sections ' // & 1830 1831 TRIM( var ) // ' from previous run found,' // & 1831 1832 '&but this file cannot be extended due to' // & … … 1848 1849 IF ( section(i,1) /= -1 ) THEN 1849 1850 IF ( zu(section(i,1)) /= netcdf_data(i) ) THEN 1850 message_string = ' NetCDF file for cross-sections ' // &1851 message_string = 'netCDF file for cross-sections ' // & 1851 1852 TRIM( var ) // ' from previous run found,' // & 1852 1853 '&but this file cannot be extended' // & … … 1861 1862 ELSE 1862 1863 IF ( -1.0 /= netcdf_data(i) ) THEN 1863 message_string = ' NetCDF file for cross-sections ' // &1864 message_string = 'netCDF file for cross-sections ' // & 1864 1865 TRIM( var ) // ' from previous run found,' // & 1865 1866 '&but this file cannot be extended' // & … … 1901 1902 1902 1903 IF ( last_time_coordinate(1) >= simulated_time ) THEN 1903 message_string = ' NetCDF file for cross sections ' // &1904 message_string = 'netCDF file for cross sections ' // & 1904 1905 TRIM( var ) // ' from previous run found,' // & 1905 1906 '&but this file cannot be extended becaus' // & … … 1923 1924 id_var_do2d(av,i) ) 1924 1925 CALL handle_netcdf_error( 'netcdf', 138 ) 1925 #if defined( __netcdf4 )1926 #if defined( __netcdf4_parallel ) 1926 1927 ! 1927 1928 !-- Set collective io operations for parallel io 1928 IF ( netcdf_data_format > 2) THEN1929 IF ( netcdf_data_format > 4 ) THEN 1929 1930 nc_stat = NF90_VAR_PAR_ACCESS( id_set_xy(av), & 1930 1931 id_var_do2d(av,i), & … … 1958 1959 nc_stat = NF90_ENDDEF( id_set_xy(av) ) 1959 1960 CALL handle_netcdf_error( 'netcdf', 432 ) 1960 message_string = ' NetCDF file for cross-sections ' // &1961 message_string = 'netCDF file for cross-sections ' // & 1961 1962 TRIM( var ) // ' from previous run found.' // & 1962 1963 '&This file will be extended.' … … 2205 2206 'units', TRIM( do2d_unit(av,i) ) ) 2206 2207 CALL handle_netcdf_error( 'netcdf', 355 ) 2207 #if defined( __netcdf4 )2208 #if defined( __netcdf4_parallel ) 2208 2209 ! 2209 2210 !-- Set independent io operations for parallel io. Collective io 2210 2211 !-- is only allowed in case of a 1d-decomposition along x, because 2211 2212 !-- otherwise, not all PEs have output data. 2212 IF ( netcdf_data_format > 2) THEN2213 IF ( netcdf_data_format > 4 ) THEN 2213 2214 IF ( npey == 1 ) THEN 2214 2215 nc_stat = NF90_VAR_PAR_ACCESS( id_set_xz(av), & … … 2217 2218 ELSE 2218 2219 ! 2219 !-- ATTENTION: Due to a probable bug in the NetCDF42220 !-- ATTENTION: Due to a probable bug in the netCDF4 2220 2221 !-- installation, independet output does not work 2221 2222 !-- A workaround is used in data_output_2d on those … … 2249 2250 2250 2251 ! 2251 !-- Leave NetCDF define mode2252 !-- Leave netCDF define mode 2252 2253 nc_stat = NF90_ENDDEF( id_set_xz(av) ) 2253 2254 CALL handle_netcdf_error( 'netcdf', 162 ) … … 2364 2365 2365 2366 IF ( TRIM( var_list ) /= TRIM( var_list_old ) ) THEN 2366 message_string = ' NetCDF file for cross-sections ' // &2367 message_string = 'netCDF file for cross-sections ' // & 2367 2368 TRIM( var ) // ' from previous run found,' // & 2368 2369 '& but this file cannot be extended due to' // & … … 2397 2398 2398 2399 IF ( ns /= ns_old ) THEN 2399 message_string = ' NetCDF file for cross-sections ' // &2400 message_string = 'netCDF file for cross-sections ' // & 2400 2401 TRIM( var ) // ' from previous run found,' // & 2401 2402 '&but this file cannot be extended due to' // & … … 2418 2419 IF ( section(i,2) /= -1 ) THEN 2419 2420 IF ( ( ( section(i,2) + 0.5 ) * dy ) /= netcdf_data(i) ) THEN 2420 message_string = ' NetCDF file for cross-sections ' // &2421 message_string = 'netCDF file for cross-sections ' // & 2421 2422 TRIM( var ) // ' from previous run found,' // & 2422 2423 '&but this file cannot be extended' // & … … 2431 2432 ELSE 2432 2433 IF ( -1.0 /= netcdf_data(i) ) THEN 2433 message_string = ' NetCDF file for cross-sections ' // &2434 message_string = 'netCDF file for cross-sections ' // & 2434 2435 TRIM( var ) // ' from previous run found,' // & 2435 2436 '&but this file cannot be extended' // & … … 2471 2472 2472 2473 IF ( last_time_coordinate(1) >= simulated_time ) THEN 2473 message_string = ' NetCDF file for cross sections ' // &2474 message_string = 'netCDF file for cross sections ' // & 2474 2475 TRIM( var ) // ' from previous run found,' // & 2475 2476 '&but this file cannot be extended becaus' // & … … 2493 2494 id_var_do2d(av,i) ) 2494 2495 CALL handle_netcdf_error( 'netcdf', 177 ) 2495 #if defined( __netcdf4 )2496 #if defined( __netcdf4_parallel ) 2496 2497 ! 2497 2498 !-- Set independent io operations for parallel io. Collective io 2498 2499 !-- is only allowed in case of a 1d-decomposition along x, because 2499 2500 !-- otherwise, not all PEs have output data. 2500 IF ( netcdf_data_format > 2) THEN2501 IF ( netcdf_data_format > 4 ) THEN 2501 2502 IF ( npey == 1 ) THEN 2502 2503 nc_stat = NF90_VAR_PAR_ACCESS( id_set_xz(av), & … … 2505 2506 ELSE 2506 2507 ! 2507 !-- ATTENTION: Due to a probable bug in the NetCDF42508 !-- ATTENTION: Due to a probable bug in the netCDF4 2508 2509 !-- installation, independet output does not work 2509 2510 !-- A workaround is used in data_output_2d on those … … 2544 2545 nc_stat = NF90_ENDDEF( id_set_xz(av) ) 2545 2546 CALL handle_netcdf_error( 'netcdf', 434 ) 2546 message_string = ' NetCDF file for cross-sections ' // &2547 message_string = 'netCDF file for cross-sections ' // & 2547 2548 TRIM( var ) // ' from previous run found.' // & 2548 2549 '&This file will be extended.' … … 2791 2792 'units', TRIM( do2d_unit(av,i) ) ) 2792 2793 CALL handle_netcdf_error( 'netcdf', 356 ) 2793 #if defined( __netcdf4 )2794 #if defined( __netcdf4_parallel ) 2794 2795 ! 2795 2796 !-- Set independent io operations for parallel io. Collective io 2796 2797 !-- is only allowed in case of a 1d-decomposition along y, because 2797 2798 !-- otherwise, not all PEs have output data. 2798 IF ( netcdf_data_format > 2) THEN2799 IF ( netcdf_data_format > 4 ) THEN 2799 2800 IF ( npex == 1 ) THEN 2800 2801 nc_stat = NF90_VAR_PAR_ACCESS( id_set_yz(av), & … … 2803 2804 ELSE 2804 2805 ! 2805 !-- ATTENTION: Due to a probable bug in the NetCDF42806 !-- ATTENTION: Due to a probable bug in the netCDF4 2806 2807 !-- installation, independet output does not work 2807 2808 !-- A workaround is used in data_output_2d on those … … 2835 2836 2836 2837 ! 2837 !-- Leave NetCDF define mode2838 !-- Leave netCDF define mode 2838 2839 nc_stat = NF90_ENDDEF( id_set_yz(av) ) 2839 2840 CALL handle_netcdf_error( 'netcdf', 201 ) … … 2948 2949 2949 2950 IF ( TRIM( var_list ) /= TRIM( var_list_old ) ) THEN 2950 message_string = ' NetCDF file for cross-sections ' // &2951 message_string = 'netCDF file for cross-sections ' // & 2951 2952 TRIM( var ) // ' from previous run found,' // & 2952 2953 '& but this file cannot be extended due to' // & … … 2981 2982 2982 2983 IF ( ns /= ns_old ) THEN 2983 message_string = ' NetCDF file for cross-sections ' // &2984 message_string = 'netCDF file for cross-sections ' // & 2984 2985 TRIM( var ) // ' from previous run found,' // & 2985 2986 '&but this file cannot be extended due to' // & … … 3002 3003 IF ( section(i,3) /= -1 ) THEN 3003 3004 IF ( ( ( section(i,3) + 0.5 ) * dx ) /= netcdf_data(i) ) THEN 3004 message_string = ' NetCDF file for cross-sections ' // &3005 message_string = 'netCDF file for cross-sections ' // & 3005 3006 TRIM( var ) // ' from previous run found,' // & 3006 3007 '&but this file cannot be extended' // & … … 3015 3016 ELSE 3016 3017 IF ( -1.0 /= netcdf_data(i) ) THEN 3017 message_string = ' NetCDF file for cross-sections ' // &3018 message_string = 'netCDF file for cross-sections ' // & 3018 3019 TRIM( var ) // ' from previous run found,' // & 3019 3020 '&but this file cannot be extended' // & … … 3055 3056 3056 3057 IF ( last_time_coordinate(1) >= simulated_time ) THEN 3057 message_string = ' NetCDF file for cross sections ' // &3058 message_string = 'netCDF file for cross sections ' // & 3058 3059 TRIM( var ) // ' from previous run found,' // & 3059 3060 '&but this file cannot be extended becaus' // & … … 3077 3078 id_var_do2d(av,i) ) 3078 3079 CALL handle_netcdf_error( 'netcdf', 216 ) 3079 #if defined( __netcdf4 )3080 #if defined( __netcdf4_parallel ) 3080 3081 ! 3081 3082 !-- Set independent io operations for parallel io. Collective io 3082 3083 !-- is only allowed in case of a 1d-decomposition along y, because 3083 3084 !-- otherwise, not all PEs have output data. 3084 IF ( netcdf_data_format > 2) THEN3085 IF ( netcdf_data_format > 4 ) THEN 3085 3086 IF ( npex == 1 ) THEN 3086 3087 nc_stat = NF90_VAR_PAR_ACCESS( id_set_yz(av), & … … 3089 3090 ELSE 3090 3091 ! 3091 !-- ATTENTION: Due to a probable bug in the NetCDF43092 !-- ATTENTION: Due to a probable bug in the netCDF4 3092 3093 !-- installation, independet output does not work 3093 3094 !-- A workaround is used in data_output_2d on those … … 3128 3129 nc_stat = NF90_ENDDEF( id_set_yz(av) ) 3129 3130 CALL handle_netcdf_error( 'netcdf', 436 ) 3130 message_string = ' NetCDF file for cross-sections ' // &3131 message_string = 'netCDF file for cross-sections ' // & 3131 3132 TRIM( var ) // ' from previous run found.' // & 3132 3133 '&This file will be extended.' … … 3432 3433 3433 3434 ! 3434 !-- Leave NetCDF define mode3435 !-- Leave netCDF define mode 3435 3436 nc_stat = NF90_ENDDEF( id_set_pr ) 3436 3437 CALL handle_netcdf_error( 'netcdf', 238 ) … … 3478 3479 3479 3480 IF ( TRIM( var_list ) /= TRIM( var_list_old ) ) THEN 3480 message_string = ' NetCDF file for vertical profiles ' // &3481 message_string = 'netCDF file for vertical profiles ' // & 3481 3482 'from previous run found,' // & 3482 3483 '& but this file cannot be extended due to' // & … … 3512 3513 3513 3514 IF ( last_time_coordinate(1) >= simulated_time ) THEN 3514 message_string = ' NetCDF file for vertical profiles ' // &3515 message_string = 'netCDF file for vertical profiles ' // & 3515 3516 'from previous run found,' // & 3516 3517 '&but this file cannot be extended becaus' // & … … 3578 3579 nc_stat = NF90_ENDDEF( id_set_pr ) 3579 3580 CALL handle_netcdf_error( 'netcdf', 438 ) 3580 message_string = ' NetCDF file for vertical profiles ' // &3581 message_string = 'netCDF file for vertical profiles ' // & 3581 3582 'from previous run found.' // & 3582 3583 '&This file will be extended.' … … 3667 3668 3668 3669 ! 3669 !-- Leave NetCDF define mode3670 !-- Leave netCDF define mode 3670 3671 nc_stat = NF90_ENDDEF( id_set_ts ) 3671 3672 CALL handle_netcdf_error( 'netcdf', 259 ) … … 3700 3701 3701 3702 IF ( TRIM( var_list ) /= TRIM( var_list_old ) ) THEN 3702 message_string = ' NetCDF file for time series ' // &3703 message_string = 'netCDF file for time series ' // & 3703 3704 'from previous run found,' // & 3704 3705 '& but this file cannot be extended due to' // & … … 3734 3735 3735 3736 IF ( last_time_coordinate(1) >= simulated_time ) THEN 3736 message_string = ' NetCDF file for time series ' // &3737 message_string = 'netCDF file for time series ' // & 3737 3738 'from previous run found,' // & 3738 3739 '&but this file cannot be extended becaus' // & … … 3783 3784 nc_stat = NF90_ENDDEF( id_set_ts ) 3784 3785 CALL handle_netcdf_error( 'netcdf', 440 ) 3785 message_string = ' NetCDF file for time series ' // &3786 message_string = 'netCDF file for time series ' // & 3786 3787 'from previous run found.' // & 3787 3788 '&This file will be extended.' … … 3982 3983 3983 3984 ! 3984 !-- Leave NetCDF define mode3985 !-- Leave netCDF define mode 3985 3986 nc_stat = NF90_ENDDEF( id_set_sp ) 3986 3987 CALL handle_netcdf_error( 'netcdf', 292 ) … … 4060 4061 4061 4062 IF ( TRIM( var_list ) /= TRIM( var_list_old ) ) THEN 4062 message_string = ' NetCDF file for spectra ' // &4063 message_string = 'netCDF file for spectra ' // & 4063 4064 'from previous run found,' // & 4064 4065 '& but this file cannot be extended due to' // & … … 4094 4095 4095 4096 IF ( ns /= ns_old ) THEN 4096 message_string = ' NetCDF file for spectra ' // &4097 message_string = 'netCDF file for spectra ' // & 4097 4098 ' from previous run found,' // & 4098 4099 '&but this file cannot be extended due to' // & … … 4114 4115 DO i = 1, ns 4115 4116 IF ( zu(comp_spectra_level(i)) /= netcdf_data(i) ) THEN 4116 message_string = ' NetCDF file for spectra ' // &4117 message_string = 'netCDF file for spectra ' // & 4117 4118 ' from previous run found,' // & 4118 4119 '&but this file cannot be extended due to' // & … … 4152 4153 4153 4154 IF ( last_time_coordinate(1) >= simulated_time ) THEN 4154 message_string = ' NetCDF file for spectra ' // &4155 message_string = 'netCDF file for spectra ' // & 4155 4156 'from previous run found,' // & 4156 4157 '&but this file cannot be extended becaus' // & … … 4216 4217 nc_stat = NF90_ENDDEF( id_set_sp ) 4217 4218 CALL handle_netcdf_error( 'netcdf', 442 ) 4218 message_string = ' NetCDF file for spectra ' // &4219 message_string = 'netCDF file for spectra ' // & 4219 4220 'from previous run found.' // & 4220 4221 '&This file will be extended.' … … 4251 4252 ELSE 4252 4253 ! 4253 !-- NetCDF4 allows more than one unlimited dimension4254 !-- netCDF4 allows more than one unlimited dimension 4254 4255 nc_stat = NF90_DEF_DIM( id_set_prt, 'particle_number', & 4255 4256 NF90_UNLIMITED, id_dim_prtnum) … … 4296 4297 4297 4298 ! 4298 !-- Leave NetCDF define mode4299 !-- Leave netCDF define mode 4299 4300 nc_stat = NF90_ENDDEF( id_set_prt ) 4300 4301 CALL handle_netcdf_error( 'netcdf', 322 ) … … 4327 4328 4328 4329 IF ( last_time_coordinate(1) >= simulated_time ) THEN 4329 message_string = ' NetCDF file for particles ' // &4330 message_string = 'netCDF file for particles ' // & 4330 4331 'from previous run found,' // & 4331 4332 '&but this file cannot be extended becaus' // & … … 4355 4356 ENDDO 4356 4357 4357 message_string = ' NetCDF file for particles ' // &4358 message_string = 'netCDF file for particles ' // & 4358 4359 'from previous run found.' // & 4359 4360 '&This file will be extended.' … … 4439 4440 4440 4441 ! 4441 !-- Leave NetCDF define mode4442 !-- Leave netCDF define mode 4442 4443 nc_stat = NF90_ENDDEF( id_set_pts ) 4443 4444 CALL handle_netcdf_error( 'netcdf', 404 ) … … 4477 4478 4478 4479 IF ( TRIM( var_list ) /= TRIM( var_list_old ) ) THEN 4479 message_string = ' NetCDF file for particle time series ' // &4480 message_string = 'netCDF file for particle time series ' // & 4480 4481 'from previous run found,' // & 4481 4482 '& but this file cannot be extended due to' // & … … 4511 4512 4512 4513 IF ( last_time_coordinate(1) >= simulated_time ) THEN 4513 message_string = ' NetCDF file for particle time series ' // &4514 message_string = 'netCDF file for particle time series ' // & 4514 4515 'from previous run found,' // & 4515 4516 '&but this file cannot be extended becaus' // & … … 4564 4565 nc_stat = NF90_ENDDEF( id_set_pts ) 4565 4566 CALL handle_netcdf_error( 'netcdf', 444 ) 4566 message_string = ' NetCDF file for particle time series ' // &4567 message_string = 'netCDF file for particle time series ' // & 4567 4568 'from previous run found.' // & 4568 4569 '&This file will be extended.' … … 4581 4582 4582 4583 4583 SUBROUTINE handle_netcdf_error( routine_name, errno )4584 SUBROUTINE create_netcdf_file( filename , id, parallel, errno ) 4584 4585 #if defined( __netcdf ) 4585 4586 4586 4587 !------------------------------------------------------------------------------! 4587 ! 4588 ! Description: 4589 ! ------------ 4590 ! Creates a netCDF file and give back the id. The parallel flag has to be TRUE 4591 ! for parallel netCDF output support. 4592 !------------------------------------------------------------------------------! 4593 4594 USE control_parameters 4595 USE netcdf 4596 USE netcdf_control 4597 USE pegrid 4598 4599 IMPLICIT NONE 4600 4601 CHARACTER (LEN=*), INTENT(IN) :: filename 4602 INTEGER, INTENT(IN) :: errno 4603 INTEGER, INTENT(OUT) :: id 4604 LOGICAL, INTENT(IN) :: parallel 4605 4606 4607 ! 4608 !-- Create a new netCDF output file with requested netCDF format 4609 IF ( netcdf_data_format == 1 ) THEN 4610 ! 4611 !-- Classic netCDF format 4612 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id ) 4613 4614 ELSEIF ( netcdf_data_format == 2 ) THEN 4615 ! 4616 !-- 64bit-offset format 4617 nc_stat = NF90_CREATE( filename, & 4618 OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ), id ) 4619 4620 #if defined( __netcdf4 ) 4621 ELSEIF ( netcdf_data_format == 3 .OR. & 4622 ( .NOT. parallel .AND. netcdf_data_format == 5 ) ) THEN 4623 ! 4624 !-- netCDF4/HDF5 format 4625 nc_stat = NF90_CREATE( filename, OR( NF90_NOCLOBBER, NF90_NETCDF4 ), id ) 4626 4627 ELSEIF ( netcdf_data_format == 4 .OR. & 4628 ( .NOT. parallel .AND. netcdf_data_format == 6 ) ) THEN 4629 ! 4630 !-- netCDF4/HDF5 format with classic model flag 4631 nc_stat = NF90_CREATE( filename, & 4632 OR( NF90_NOCLOBBER, & 4633 OR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), id ) 4634 4635 #if defined( __netcdf4_parallel ) 4636 ELSEIF ( netcdf_data_format == 5 .AND. parallel ) THEN 4637 ! 4638 !-- netCDF4/HDF5 format, parallel 4639 nc_stat = NF90_CREATE( filename, OR( NF90_NOCLOBBER, NF90_NETCDF4 ), & 4640 id, COMM = comm2d, INFO = MPI_INFO_NULL ) 4641 4642 ELSEIF ( netcdf_data_format == 6 .AND. parallel ) THEN 4643 ! 4644 !-- netCDF4/HDF5 format with classic model flag, parallel 4645 nc_stat = NF90_CREATE( filename, & 4646 OR( NF90_NOCLOBBER, & 4647 OR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), & 4648 id, COMM = comm2d, INFO = MPI_INFO_NULL ) 4649 4650 #endif 4651 #endif 4652 ENDIF 4653 4654 CALL handle_netcdf_error( 'create_netcdf_file', errno ) 4655 #endif 4656 END SUBROUTINE create_netcdf_file 4657 4658 4659 SUBROUTINE open_write_netcdf_file( filename, id, parallel, errno ) 4660 #if defined( __netcdf ) 4661 4662 !------------------------------------------------------------------------------! 4663 ! Description: 4664 ! ------------ 4665 ! Opens an existing netCDF file for writing and gives back the id. 4666 ! The parallel flag has to be TRUE for parallel netCDF output support. 4667 !------------------------------------------------------------------------------! 4668 4669 USE control_parameters 4670 USE netcdf 4671 USE netcdf_control 4672 USE pegrid 4673 4674 IMPLICIT NONE 4675 4676 CHARACTER (LEN=*), INTENT(IN) :: filename 4677 INTEGER, INTENT(IN) :: errno 4678 INTEGER, INTENT(OUT) :: id 4679 LOGICAL, INTENT(IN) :: parallel 4680 4681 4682 IF ( netcdf_data_format < 5 .OR. .NOT. parallel ) THEN 4683 nc_stat = NF90_OPEN( filename, NF90_WRITE, id ) 4684 #if defined( __netcdf4 ) 4685 #if defined( __netcdf4par ) 4686 ELSEIF ( netcdf_data_format > 4 .AND. parallel ) THEN 4687 nc_stat = NF90_OPEN( filename, NF90_WRITE, id, COMM = comm2d, & 4688 INFO = MPI_INFO_NULL ) 4689 #endif 4690 #endif 4691 ENDIF 4692 4693 CALL handle_netcdf_error( 'open_write_netcdf_file', errno ) 4694 #endif 4695 END SUBROUTINE open_write_netcdf_file 4696 4697 4698 SUBROUTINE handle_netcdf_error( routine_name, errno ) 4699 #if defined( __netcdf ) 4700 4701 !------------------------------------------------------------------------------! 4588 4702 ! Description: 4589 4703 ! ------------
Note: See TracChangeset
for help on using the changeset viewer.