Changeset 1327 for palm/trunk/SOURCE/data_output_2d.f90
- Timestamp:
- Mar 21, 2014 11:00:16 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/data_output_2d.f90
r1321 r1327 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! parts concerning iso2d output removed, 23 ! -netcdf output queries 23 24 ! 24 25 ! Former revisions: … … 101 102 do2d_xz_last_time, do2d_xz_n, do2d_xz_time_count, & 102 103 do2d_yz_last_time, do2d_yz_n, do2d_yz_time_count, & 103 ibc_uv_b, icloud_scheme, io_blocks, io_group, iso2d_output,&104 message_string, netcdf_data_format, netcdf_output,&104 ibc_uv_b, icloud_scheme, io_blocks, io_group, & 105 message_string, netcdf_data_format, & 105 106 ntdim_2d_xy, ntdim_2d_xz, ntdim_2d_yz, psolver, section, & 106 107 simulated_time, simulated_time_chr, time_since_reference_point … … 236 237 ! 237 238 !-- Parallel netCDF4/HDF5 output is done on all PEs, all other on PE0 only 238 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 4 ) ) & 239 THEN 239 IF ( myid == 0 .OR. netcdf_data_format > 4 ) THEN 240 240 CALL check_open( 101+av*10 ) 241 241 ENDIF … … 245 245 ELSE 246 246 IF ( myid == 0 ) THEN 247 IF ( iso2d_output ) CALL check_open( 21 )248 247 #if defined( __parallel ) 249 248 ALLOCATE( total_2d(-nbgp:nx+nbgp,-nbgp:ny+nbgp) ) … … 269 268 ! 270 269 !-- Parallel netCDF4/HDF5 output is done on all PEs, all other on PE0 only 271 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 4 ) ) & 272 THEN 270 IF ( myid == 0 .OR. netcdf_data_format > 4 ) THEN 273 271 CALL check_open( 102+av*10 ) 274 272 ENDIF … … 278 276 ELSE 279 277 IF ( myid == 0 ) THEN 280 IF ( iso2d_output ) CALL check_open( 22 )281 278 #if defined( __parallel ) 282 279 ALLOCATE( total_2d(-nbgp:nx+nbgp,nzb:nzt+1) ) … … 302 299 ! 303 300 !-- Parallel netCDF4/HDF5 output is done on all PEs, all other on PE0 only 304 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 4 ) ) & 305 THEN 301 IF ( myid == 0 .OR. netcdf_data_format > 4 ) THEN 306 302 CALL check_open( 103+av*10 ) 307 303 ENDIF … … 311 307 ELSE 312 308 IF ( myid == 0 ) THEN 313 IF ( iso2d_output ) CALL check_open( 23 )314 309 #if defined( __parallel ) 315 310 ALLOCATE( total_2d(-nbgp:ny+nbgp,nzb:nzt+1) ) … … 882 877 do2d_xy_last_time(av) = simulated_time 883 878 IF ( myid == 0 ) THEN 884 IF ( ( .NOT. data_output_2d_on_each_pe .AND.&885 netcdf_output ) .OR. netcdf_data_format > 4 )&879 IF ( .NOT. data_output_2d_on_each_pe & 880 .OR. netcdf_data_format > 4 ) & 886 881 THEN 887 882 #if defined( __netcdf ) … … 921 916 922 917 #if defined( __parallel ) 923 IF ( netcdf_ output .AND. netcdf_data_format > 4 ) THEN918 IF ( netcdf_data_format > 4 ) THEN 924 919 ! 925 920 !-- Parallel output in netCDF4/HDF5 format. … … 947 942 !-- Output of partial arrays on each PE 948 943 #if defined( __netcdf ) 949 IF ( netcdf_output .AND.myid == 0 ) THEN944 IF ( myid == 0 ) THEN 950 945 WRITE ( 21 ) time_since_reference_point, & 951 946 do2d_xy_time_count(av), av … … 994 989 ENDDO 995 990 ! 996 !-- Output of the total cross-section.997 IF ( iso2d_output ) THEN998 WRITE (21) total_2d(-nbgp:nx+nbgp,-nbgp:ny+nbgp)999 ENDIF1000 !1001 991 !-- Relocate the local array for the next loop increment 1002 992 DEALLOCATE( local_2d ) … … 1004 994 1005 995 #if defined( __netcdf ) 1006 IF ( netcdf_output ) THEN 1007 IF ( two_d ) THEN 1008 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1009 id_var_do2d(av,if), & 1010 total_2d(0:nx+1,0:ny+1), & 1011 start = (/ 1, 1, 1, do2d_xy_time_count(av) /), & 1012 count = (/ nx+2, ny+2, 1, 1 /) ) 1013 ELSE 1014 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1015 id_var_do2d(av,if), & 1016 total_2d(0:nx+1,0:ny+1), & 1017 start = (/ 1, 1, is, do2d_xy_time_count(av) /), & 1018 count = (/ nx+2, ny+2, 1, 1 /) ) 1019 ENDIF 1020 CALL handle_netcdf_error( 'data_output_2d', 54 ) 996 IF ( two_d ) THEN 997 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 998 id_var_do2d(av,if), & 999 total_2d(0:nx+1,0:ny+1), & 1000 start = (/ 1, 1, 1, do2d_xy_time_count(av) /), & 1001 count = (/ nx+2, ny+2, 1, 1 /) ) 1002 ELSE 1003 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1004 id_var_do2d(av,if), & 1005 total_2d(0:nx+1,0:ny+1), & 1006 start = (/ 1, 1, is, do2d_xy_time_count(av) /), & 1007 count = (/ nx+2, ny+2, 1, 1 /) ) 1021 1008 ENDIF 1009 CALL handle_netcdf_error( 'data_output_2d', 54 ) 1022 1010 #endif 1023 1011 … … 1043 1031 ENDIF 1044 1032 #else 1045 IF ( iso2d_output ) THEN 1046 WRITE (21) local_2d(nxl:nxr+1,nys:nyn+1) 1033 #if defined( __netcdf ) 1034 IF ( two_d ) THEN 1035 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1036 id_var_do2d(av,if), & 1037 local_2d(nxl:nxr+1,nys:nyn+1), & 1038 start = (/ 1, 1, 1, do2d_xy_time_count(av) /), & 1039 count = (/ nx+2, ny+2, 1, 1 /) ) 1040 ELSE 1041 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1042 id_var_do2d(av,if), & 1043 local_2d(nxl:nxr+1,nys:nyn+1), & 1044 start = (/ 1, 1, is, do2d_xy_time_count(av) /), & 1045 count = (/ nx+2, ny+2, 1, 1 /) ) 1047 1046 ENDIF 1048 #if defined( __netcdf ) 1049 IF ( netcdf_output ) THEN 1050 IF ( two_d ) THEN 1051 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1052 id_var_do2d(av,if), & 1053 local_2d(nxl:nxr+1,nys:nyn+1), & 1054 start = (/ 1, 1, 1, do2d_xy_time_count(av) /), & 1055 count = (/ nx+2, ny+2, 1, 1 /) ) 1056 ELSE 1057 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1058 id_var_do2d(av,if), & 1059 local_2d(nxl:nxr+1,nys:nyn+1), & 1060 start = (/ 1, 1, is, do2d_xy_time_count(av) /), & 1061 count = (/ nx+2, ny+2, 1, 1 /) ) 1062 ENDIF 1063 CALL handle_netcdf_error( 'data_output_2d', 447 ) 1064 ENDIF 1047 CALL handle_netcdf_error( 'data_output_2d', 447 ) 1065 1048 #endif 1066 1049 #endif 1067 1050 do2d_xy_n = do2d_xy_n + 1 1068 !1069 !-- Write LOCAL parameter set for ISO2D.1070 IF ( myid == 0 .AND. iso2d_output ) THEN1071 IF ( section(is,s) /= -1 ) THEN1072 WRITE ( section_chr, '(''z = '',F7.2,'' m (GP '',I3, &1073 &'')'')' &1074 ) level_z(layer_xy), layer_xy1075 ELSE1076 section_chr = 'averaged along z'1077 ENDIF1078 IF ( av == 0 ) THEN1079 rtext = TRIM( do2d(av,if) ) // ' t = ' // &1080 TRIM( simulated_time_chr ) // ' ' // &1081 TRIM( section_chr )1082 ELSE1083 rtext = TRIM( do2d(av,if) ) // ' averaged t = ' // &1084 TRIM( simulated_time_chr ) // ' ' // &1085 TRIM( section_chr )1086 ENDIF1087 WRITE (27,LOCAL)1088 ENDIF1089 1051 ! 1090 1052 !-- For 2D-arrays (e.g. u*) only one cross-section is available. … … 1104 1066 do2d_xz_last_time(av) = simulated_time 1105 1067 IF ( myid == 0 ) THEN 1106 IF ( ( .NOT. data_output_2d_on_each_pe .AND.&1107 netcdf_output ) .OR. netcdf_data_format > 4 )&1068 IF ( .NOT. data_output_2d_on_each_pe & 1069 .OR. netcdf_data_format > 4 ) & 1108 1070 THEN 1109 1071 #if defined( __netcdf ) … … 1162 1124 1163 1125 #if defined( __parallel ) 1164 IF ( netcdf_ output .AND. netcdf_data_format > 4 ) THEN1126 IF ( netcdf_data_format > 4 ) THEN 1165 1127 ! 1166 1128 !-- Output in netCDF4/HDF5 format. … … 1192 1154 !-- index values. 1193 1155 #if defined( __netcdf ) 1194 IF ( netcdf_output .AND.myid == 0 ) THEN1156 IF ( myid == 0 ) THEN 1195 1157 WRITE ( 22 ) time_since_reference_point, & 1196 1158 do2d_xz_time_count(av), av … … 1258 1220 ENDDO 1259 1221 ! 1260 !-- Output of the total cross-section.1261 IF ( iso2d_output ) THEN1262 WRITE (22) total_2d(-nbgp:nx+nbgp,nzb:nzt+1)1263 ENDIF1264 !1265 1222 !-- Relocate the local array for the next loop increment 1266 1223 DEALLOCATE( local_2d ) … … 1268 1225 1269 1226 #if defined( __netcdf ) 1270 IF ( netcdf_output ) THEN 1271 nc_stat = NF90_PUT_VAR( id_set_xz(av), & 1272 id_var_do2d(av,if), & 1273 total_2d(0:nx+1,nzb:nzt+1),& 1274 start = (/ 1, is, 1, do2d_xz_time_count(av) /), & 1275 count = (/ nx+2, 1, nz+2, 1 /) ) 1276 CALL handle_netcdf_error( 'data_output_2d', 58 ) 1277 ENDIF 1227 nc_stat = NF90_PUT_VAR( id_set_xz(av), & 1228 id_var_do2d(av,if), & 1229 total_2d(0:nx+1,nzb:nzt+1),& 1230 start = (/ 1, is, 1, do2d_xz_time_count(av) /), & 1231 count = (/ nx+2, 1, nz+2, 1 /) ) 1232 CALL handle_netcdf_error( 'data_output_2d', 58 ) 1278 1233 #endif 1279 1234 … … 1310 1265 ENDIF 1311 1266 #else 1312 IF ( iso2d_output ) THEN1313 WRITE (22) local_2d(nxl:nxr+1,nzb:nzt+1)1314 ENDIF1315 1267 #if defined( __netcdf ) 1316 IF ( netcdf_output ) THEN 1317 nc_stat = NF90_PUT_VAR( id_set_xz(av), & 1318 id_var_do2d(av,if), & 1319 local_2d(nxl:nxr+1,nzb:nzt+1), & 1320 start = (/ 1, is, 1, do2d_xz_time_count(av) /), & 1321 count = (/ nx+2, 1, nz+2, 1 /) ) 1322 CALL handle_netcdf_error( 'data_output_2d', 451 ) 1323 ENDIF 1268 nc_stat = NF90_PUT_VAR( id_set_xz(av), & 1269 id_var_do2d(av,if), & 1270 local_2d(nxl:nxr+1,nzb:nzt+1), & 1271 start = (/ 1, is, 1, do2d_xz_time_count(av) /), & 1272 count = (/ nx+2, 1, nz+2, 1 /) ) 1273 CALL handle_netcdf_error( 'data_output_2d', 451 ) 1324 1274 #endif 1325 1275 #endif 1326 1276 do2d_xz_n = do2d_xz_n + 1 1327 !1328 !-- Write LOCAL-parameter set for ISO2D.1329 IF ( myid == 0 .AND. iso2d_output ) THEN1330 IF ( section(is,s) /= -1 ) THEN1331 WRITE ( section_chr, '(''y = '',F8.2,'' m (GP '',I3, &1332 &'')'')' &1333 ) section(is,s)*dy, section(is,s)1334 ELSE1335 section_chr = 'averaged along y'1336 ENDIF1337 IF ( av == 0 ) THEN1338 rtext = TRIM( do2d(av,if) ) // ' t = ' // &1339 TRIM( simulated_time_chr ) // ' ' // &1340 TRIM( section_chr )1341 ELSE1342 rtext = TRIM( do2d(av,if) ) // ' averaged t = ' // &1343 TRIM( simulated_time_chr ) // ' ' // &1344 TRIM( section_chr )1345 ENDIF1346 WRITE (28,LOCAL)1347 ENDIF1348 1277 1349 1278 CASE ( 'yz' ) … … 1356 1285 do2d_yz_last_time(av) = simulated_time 1357 1286 IF ( myid == 0 ) THEN 1358 IF ( ( .NOT. data_output_2d_on_each_pe .AND.&1359 netcdf_output ) .OR. netcdf_data_format > 4 )&1287 IF ( .NOT. data_output_2d_on_each_pe & 1288 .OR. netcdf_data_format > 4 ) & 1360 1289 THEN 1361 1290 #if defined( __netcdf ) … … 1414 1343 1415 1344 #if defined( __parallel ) 1416 IF ( netcdf_ output .AND. netcdf_data_format > 4 ) THEN1345 IF ( netcdf_data_format > 4 ) THEN 1417 1346 ! 1418 1347 !-- Output in netCDF4/HDF5 format. … … 1444 1373 !-- index values. 1445 1374 #if defined( __netcdf ) 1446 IF ( netcdf_output .AND.myid == 0 ) THEN1375 IF ( myid == 0 ) THEN 1447 1376 WRITE ( 23 ) time_since_reference_point, & 1448 1377 do2d_yz_time_count(av), av … … 1510 1439 ENDDO 1511 1440 ! 1512 !-- Output of the total cross-section.1513 IF ( iso2d_output ) THEN1514 WRITE (23) total_2d(0:ny+1,nzb:nzt+1)1515 ENDIF1516 !1517 1441 !-- Relocate the local array for the next loop increment 1518 1442 DEALLOCATE( local_2d ) … … 1520 1444 1521 1445 #if defined( __netcdf ) 1522 IF ( netcdf_output ) THEN 1523 nc_stat = NF90_PUT_VAR( id_set_yz(av), & 1524 id_var_do2d(av,if), & 1525 total_2d(0:ny+1,nzb:nzt+1),& 1526 start = (/ is, 1, 1, do2d_yz_time_count(av) /), & 1527 count = (/ 1, ny+2, nz+2, 1 /) ) 1528 CALL handle_netcdf_error( 'data_output_2d', 61 ) 1529 ENDIF 1446 nc_stat = NF90_PUT_VAR( id_set_yz(av), & 1447 id_var_do2d(av,if), & 1448 total_2d(0:ny+1,nzb:nzt+1),& 1449 start = (/ is, 1, 1, do2d_yz_time_count(av) /), & 1450 count = (/ 1, ny+2, nz+2, 1 /) ) 1451 CALL handle_netcdf_error( 'data_output_2d', 61 ) 1530 1452 #endif 1531 1453 … … 1562 1484 ENDIF 1563 1485 #else 1564 IF ( iso2d_output ) THEN1565 WRITE (23) local_2d(nys:nyn+1,nzb:nzt+1)1566 ENDIF1567 1486 #if defined( __netcdf ) 1568 IF ( netcdf_output ) THEN 1569 nc_stat = NF90_PUT_VAR( id_set_yz(av), & 1570 id_var_do2d(av,if), & 1571 local_2d(nys:nyn+1,nzb:nzt+1), & 1572 start = (/ is, 1, 1, do2d_xz_time_count(av) /), & 1573 count = (/ 1, ny+2, nz+2, 1 /) ) 1574 CALL handle_netcdf_error( 'data_output_2d', 452 ) 1575 ENDIF 1487 nc_stat = NF90_PUT_VAR( id_set_yz(av), & 1488 id_var_do2d(av,if), & 1489 local_2d(nys:nyn+1,nzb:nzt+1), & 1490 start = (/ is, 1, 1, do2d_xz_time_count(av) /), & 1491 count = (/ 1, ny+2, nz+2, 1 /) ) 1492 CALL handle_netcdf_error( 'data_output_2d', 452 ) 1576 1493 #endif 1577 1494 #endif 1578 1495 do2d_yz_n = do2d_yz_n + 1 1579 !1580 !-- Write LOCAL-parameter set for ISO2D.1581 IF ( myid == 0 .AND. iso2d_output ) THEN1582 IF ( section(is,s) /= -1 ) THEN1583 WRITE ( section_chr, '(''x = '',F8.2,'' m (GP '',I3, &1584 &'')'')' &1585 ) section(is,s)*dx, section(is,s)1586 ELSE1587 section_chr = 'averaged along x'1588 ENDIF1589 IF ( av == 0 ) THEN1590 rtext = TRIM( do2d(av,if) ) // ' t = ' // &1591 TRIM( simulated_time_chr ) // ' ' // &1592 TRIM( section_chr )1593 ELSE1594 rtext = TRIM( do2d(av,if) ) // ' averaged t = ' // &1595 TRIM( simulated_time_chr ) // ' ' // &1596 TRIM( section_chr )1597 ENDIF1598 WRITE (29,LOCAL)1599 ENDIF1600 1496 1601 1497 END SELECT … … 1609 1505 !-- the performance of the parallel output. 1610 1506 #if defined( __netcdf ) 1611 IF ( netcdf_ output .AND. netcdf_data_format > 4 ) THEN1507 IF ( netcdf_data_format > 4 ) THEN 1612 1508 1613 1509 SELECT CASE ( mode )
Note: See TracChangeset
for help on using the changeset viewer.