Changeset 359 for palm/trunk/SOURCE/netcdf.f90
- Timestamp:
- Aug 19, 2009 4:56:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf.f90
r292 r359 7 7 ! Current revisions: 8 8 ! ------------------ 9 ! For extended NetCDF files, the updated title attribute includes an update of 10 ! time_average_text where appropriate. 11 ! Bugfix for extended NetCDF files: In order to avoid 'data mode' errors if 12 ! updated attributes are larger than their original size, NF90_PUT_ATT is called 13 ! in 'define mode' enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a 14 ! possible performance loss; an alternative strategy would be to ensure equal 15 ! attribute size in a job chain. 9 16 ! NetCDF unit attribute in timeseries output in case of statistic 10 17 ! regions added. … … 650 657 651 658 ! 652 !-- Change the title attribute on file 659 !-- Update the title attribute on file 660 !-- In order to avoid 'data mode' errors if updated attributes are larger 661 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 662 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 663 !-- performance loss due to data copying; an alternative strategy would be 664 !-- to ensure equal attribute size. Maybe revise later. 665 IF ( av == 0 ) THEN 666 time_average_text = ' ' 667 ELSE 668 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 669 averaging_interval 670 ENDIF 671 nc_stat = NF90_REDEF( id_set_3d(av) ) 672 CALL handle_netcdf_error( 'netcdf', 429 ) 653 673 nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'title', & 654 TRIM( run_description_header ) ) 674 TRIM( run_description_header ) // & 675 TRIM( time_average_text ) ) 655 676 CALL handle_netcdf_error( 'netcdf', 96 ) 677 nc_stat = NF90_ENDDEF( id_set_3d(av) ) 678 CALL handle_netcdf_error( 'netcdf', 430 ) 656 679 message_string = 'NetCDF file for volume data ' // & 657 680 TRIM( var ) // ' from previous run found.' // & … … 1276 1299 1277 1300 ! 1278 !-- Change the title attribute on file 1301 !-- Update the title attribute on file 1302 !-- In order to avoid 'data mode' errors if updated attributes are larger 1303 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 1304 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 1305 !-- performance loss due to data copying; an alternative strategy would be 1306 !-- to ensure equal attribute size in a job chain. Maybe revise later. 1307 IF ( av == 0 ) THEN 1308 time_average_text = ' ' 1309 ELSE 1310 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 1311 averaging_interval 1312 ENDIF 1313 nc_stat = NF90_REDEF( id_set_xy(av) ) 1314 CALL handle_netcdf_error( 'netcdf', 431 ) 1279 1315 nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'title', & 1280 TRIM( run_description_header ) ) 1316 TRIM( run_description_header ) // & 1317 TRIM( time_average_text ) ) 1281 1318 CALL handle_netcdf_error( 'netcdf', 139 ) 1319 nc_stat = NF90_ENDDEF( id_set_xy(av) ) 1320 CALL handle_netcdf_error( 'netcdf', 432 ) 1282 1321 message_string = 'NetCDF file for cross-sections ' // & 1283 1322 TRIM( var ) // ' from previous run found.' // & … … 1798 1837 1799 1838 ! 1800 !-- Change the title attribute on file 1839 !-- Update the title attribute on file 1840 !-- In order to avoid 'data mode' errors if updated attributes are larger 1841 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 1842 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 1843 !-- performance loss due to data copying; an alternative strategy would be 1844 !-- to ensure equal attribute size in a job chain. Maybe revise later. 1845 IF ( av == 0 ) THEN 1846 time_average_text = ' ' 1847 ELSE 1848 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 1849 averaging_interval 1850 ENDIF 1851 nc_stat = NF90_REDEF( id_set_xz(av) ) 1852 CALL handle_netcdf_error( 'netcdf', 433 ) 1801 1853 nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'title', & 1802 TRIM( run_description_header ) ) 1854 TRIM( run_description_header ) // & 1855 TRIM( time_average_text ) ) 1803 1856 CALL handle_netcdf_error( 'netcdf', 178 ) 1857 nc_stat = NF90_ENDDEF( id_set_xz(av) ) 1858 CALL handle_netcdf_error( 'netcdf', 434 ) 1804 1859 message_string = 'NetCDF file for cross-sections ' // & 1805 1860 TRIM( var ) // ' from previous run found.' // & … … 2318 2373 2319 2374 ! 2320 !-- Change the title attribute on file 2375 !-- Update the title attribute on file 2376 !-- In order to avoid 'data mode' errors if updated attributes are larger 2377 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 2378 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 2379 !-- performance loss due to data copying; an alternative strategy would be 2380 !-- to ensure equal attribute size in a job chain. Maybe revise later. 2381 IF ( av == 0 ) THEN 2382 time_average_text = ' ' 2383 ELSE 2384 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 2385 averaging_interval 2386 ENDIF 2387 nc_stat = NF90_REDEF( id_set_yz(av) ) 2388 CALL handle_netcdf_error( 'netcdf', 435 ) 2321 2389 nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'title', & 2322 TRIM( run_description_header ) ) 2390 TRIM( run_description_header ) // & 2391 TRIM( time_average_text ) ) 2323 2392 CALL handle_netcdf_error( 'netcdf', 217 ) 2393 nc_stat = NF90_ENDDEF( id_set_yz(av) ) 2394 CALL handle_netcdf_error( 'netcdf', 436 ) 2324 2395 message_string = 'NetCDF file for cross-sections ' // & 2325 2396 TRIM( var ) // ' from previous run found.' // & … … 2611 2682 2612 2683 ! 2613 !-- Change the title attribute on file 2684 !-- Update the title attribute on file 2685 !-- In order to avoid 'data mode' errors if updated attributes are larger 2686 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 2687 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 2688 !-- performance loss due to data copying; an alternative strategy would be 2689 !-- to ensure equal attribute size in a job chain. Maybe revise later. 2690 IF ( averaging_interval_pr == 0.0 ) THEN 2691 time_average_text = ' ' 2692 ELSE 2693 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 2694 averaging_interval_pr 2695 ENDIF 2696 nc_stat = NF90_REDEF( id_set_pr ) 2697 CALL handle_netcdf_error( 'netcdf', 437 ) 2614 2698 nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'title', & 2615 TRIM( run_description_header ) ) 2699 TRIM( run_description_header ) // & 2700 TRIM( time_average_text ) ) 2616 2701 CALL handle_netcdf_error( 'netcdf', 248 ) 2702 nc_stat = NF90_ENDDEF( id_set_pr ) 2703 CALL handle_netcdf_error( 'netcdf', 438 ) 2617 2704 message_string = 'NetCDF file for vertical profiles ' // & 2618 2705 'from previous run found.' // & … … 2817 2904 2818 2905 ! 2819 !-- Change the title attribute on file 2906 !-- Update the title attribute on file 2907 !-- In order to avoid 'data mode' errors if updated attributes are larger 2908 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 2909 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 2910 !-- performance loss due to data copying; an alternative strategy would be 2911 !-- to ensure equal attribute size in a job chain. Maybe revise later. 2912 nc_stat = NF90_REDEF( id_set_ts ) 2913 CALL handle_netcdf_error( 'netcdf', 439 ) 2820 2914 nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title', & 2821 2915 TRIM( run_description_header ) ) 2822 2916 CALL handle_netcdf_error( 'netcdf', 267 ) 2917 nc_stat = NF90_ENDDEF( id_set_ts ) 2918 CALL handle_netcdf_error( 'netcdf', 440 ) 2823 2919 message_string = 'NetCDF file for time series ' // & 2824 2920 'from previous run found.' // & … … 3230 3326 3231 3327 ! 3232 !-- Change the title attribute on file 3328 !-- Update the title attribute on file 3329 !-- In order to avoid 'data mode' errors if updated attributes are larger 3330 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 3331 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 3332 !-- performance loss due to data copying; an alternative strategy would be 3333 !-- to ensure equal attribute size in a job chain. Maybe revise later. 3334 nc_stat = NF90_REDEF( id_set_sp ) 3335 CALL handle_netcdf_error( 'netcdf', 441 ) 3233 3336 IF ( averaging_interval_sp /= 0.0 ) THEN 3234 3337 WRITE (time_average_text,'('', '',F7.1,'' s average'')') & … … 3247 3350 ENDIF 3248 3351 CALL handle_netcdf_error( 'netcdf', 309 ) 3352 nc_stat = NF90_ENDDEF( id_set_sp ) 3353 CALL handle_netcdf_error( 'netcdf', 442 ) 3249 3354 message_string = 'NetCDF file for spectra ' // & 3250 3355 'from previous run found.' // & … … 3586 3691 3587 3692 ! 3588 !-- Change the title attribute on file 3693 !-- Update the title attribute on file 3694 !-- In order to avoid 'data mode' errors if updated attributes are larger 3695 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 3696 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 3697 !-- performance loss due to data copying; an alternative strategy would be 3698 !-- to ensure equal attribute size in a job chain. Maybe revise later. 3699 nc_stat = NF90_REDEF( id_set_pts ) 3700 CALL handle_netcdf_error( 'netcdf', 443 ) 3589 3701 nc_stat = NF90_PUT_ATT( id_set_pts, NF90_GLOBAL, 'title', & 3590 3702 TRIM( run_description_header ) ) 3591 3703 CALL handle_netcdf_error( 'netcdf', 411 ) 3704 nc_stat = NF90_ENDDEF( id_set_pts ) 3705 CALL handle_netcdf_error( 'netcdf', 444 ) 3592 3706 message_string = 'NetCDF file for particle time series ' // & 3593 3707 'from previous run found.' // &
Note: See TracChangeset
for help on using the changeset viewer.