Changeset 263 for palm/trunk/SOURCE
- Timestamp:
- Mar 18, 2009 12:26:04 PM (16 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/CURRENT_MODIFICATIONS
r262 r263 22 22 Changed: 23 23 ------- 24 Output of NetCDF messages with aid of message handling routine. 25 (check_open, close_file, data_output_2d, data_output_3d, 26 data_output_profiles, data_output_ptseries, data_output_spectra, 27 data_output_tseries, netcdf, output_particles_netcdf) 24 28 25 29 Output of messages replaced by message handling routine. … … 39 43 user_init_grid, user_parin, write_var_list) 40 44 41 advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart, check_open, check_parameters, c oriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_spectra, eqn_state_seawater, fft_xy, flow_statistics, header, init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid,netcdf, parin, plant_canopy_model, poisfft_hybrid, poismg, read_3d_binary, read_var_list, sort_particles, user_check_parameters, user_header, user_init_grid, user_parin, surface_coupler, temperton_fft, timestep, user_actions, user_data_output_dvrp, user_dvrp_coltab, user_init_grid, user_init_plant_canopy, user_parin, user_read_restart_data, user_spectra, write_var_list45 advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart, check_open, check_parameters, close_file, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_ptseries, data_output_spectra, data_output_tseries, eqn_state_seawater, fft_xy, flow_statistics, header, init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid, netcdf, output_particles_netcdf, parin, plant_canopy_model, poisfft_hybrid, poismg, read_3d_binary, read_var_list, sort_particles, user_check_parameters, user_header, user_init_grid, user_parin, surface_coupler, temperton_fft, timestep, user_actions, user_data_output_dvrp, user_dvrp_coltab, user_init_grid, user_init_plant_canopy, user_parin, user_read_restart_data, user_spectra, write_var_list 42 46 43 47 -
palm/trunk/SOURCE/advec_particles.f90
r262 r263 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! Output of NetCDF messages with aid of message handling routine. 6 7 ! Output of messages replaced by message handling routine 7 8 ! Bugfix: error in check, if particles moved further than one subdomain length. … … 3594 3595 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_time_prt, (/ simulated_time /), & 3595 3596 start = (/ prt_time_count /), count = (/ 1 /) ) 3596 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(1 )3597 CALL handle_netcdf_error( 'output_particles_netcdf', 1 ) 3597 3598 3598 3599 ! … … 3601 3602 (/ number_of_particles /), & 3602 3603 start = (/ prt_time_count /), count = (/ 1 /) ) 3603 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(2 )3604 CALL handle_netcdf_error( 'output_particles_netcdf', 2 ) 3604 3605 3605 3606 ! … … 3608 3609 start = (/ 1, prt_time_count /), & 3609 3610 count = (/ maximum_number_of_particles /) ) 3610 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(3 )3611 CALL handle_netcdf_error( 'output_particles_netcdf', 3 ) 3611 3612 3612 3613 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(2), particles%dvrp_psize, & 3613 3614 start = (/ 1, prt_time_count /), & 3614 3615 count = (/ maximum_number_of_particles /) ) 3615 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(4 )3616 CALL handle_netcdf_error( 'output_particles_netcdf', 4 ) 3616 3617 3617 3618 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(3), particles%origin_x, & 3618 3619 start = (/ 1, prt_time_count /), & 3619 3620 count = (/ maximum_number_of_particles /) ) 3620 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(5 )3621 CALL handle_netcdf_error( 'output_particles_netcdf', 5 ) 3621 3622 3622 3623 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(4), particles%origin_y, & 3623 3624 start = (/ 1, prt_time_count /), & 3624 3625 count = (/ maximum_number_of_particles /) ) 3625 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(6 )3626 CALL handle_netcdf_error( 'output_particles_netcdf', 6 ) 3626 3627 3627 3628 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(5), particles%origin_z, & 3628 3629 start = (/ 1, prt_time_count /), & 3629 3630 count = (/ maximum_number_of_particles /) ) 3630 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(7 )3631 CALL handle_netcdf_error( 'output_particles_netcdf', 7 ) 3631 3632 3632 3633 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(6), particles%radius, & 3633 3634 start = (/ 1, prt_time_count /), & 3634 3635 count = (/ maximum_number_of_particles /) ) 3635 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(8 )3636 CALL handle_netcdf_error( 'output_particles_netcdf', 8 ) 3636 3637 3637 3638 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(7), particles%speed_x, & 3638 3639 start = (/ 1, prt_time_count /), & 3639 3640 count = (/ maximum_number_of_particles /) ) 3640 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(9 )3641 CALL handle_netcdf_error( 'output_particles_netcdf', 9 ) 3641 3642 3642 3643 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(8), particles%speed_y, & 3643 3644 start = (/ 1, prt_time_count /), & 3644 3645 count = (/ maximum_number_of_particles /) ) 3645 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(10 )3646 CALL handle_netcdf_error( 'output_particles_netcdf', 10 ) 3646 3647 3647 3648 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(9), particles%speed_z, & 3648 3649 start = (/ 1, prt_time_count /), & 3649 3650 count = (/ maximum_number_of_particles /) ) 3650 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(11 )3651 CALL handle_netcdf_error( 'output_particles_netcdf', 11 ) 3651 3652 3652 3653 nc_stat = NF90_PUT_VAR( id_set_prt,id_var_prt(10),particles%weight_factor,& 3653 3654 start = (/ 1, prt_time_count /), & 3654 3655 count = (/ maximum_number_of_particles /) ) 3655 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(12 )3656 CALL handle_netcdf_error( 'output_particles_netcdf', 12 ) 3656 3657 3657 3658 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(11), particles%x, & 3658 3659 start = (/ 1, prt_time_count /), & 3659 3660 count = (/ maximum_number_of_particles /) ) 3660 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(13 )3661 CALL handle_netcdf_error( 'output_particles_netcdf', 13 ) 3661 3662 3662 3663 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(12), particles%y, & 3663 3664 start = (/ 1, prt_time_count /), & 3664 3665 count = (/ maximum_number_of_particles /) ) 3665 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(14 )3666 CALL handle_netcdf_error( 'output_particles_netcdf', 14 ) 3666 3667 3667 3668 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(13), particles%z, & 3668 3669 start = (/ 1, prt_time_count /), & 3669 3670 count = (/ maximum_number_of_particles /) ) 3670 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(15 )3671 CALL handle_netcdf_error( 'output_particles_netcdf', 15 ) 3671 3672 3672 3673 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(14), particles%color, & 3673 3674 start = (/ 1, prt_time_count /), & 3674 3675 count = (/ maximum_number_of_particles /) ) 3675 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(16 )3676 CALL handle_netcdf_error( 'output_particles_netcdf', 16 ) 3676 3677 3677 3678 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(15), particles%group, & 3678 3679 start = (/ 1, prt_time_count /), & 3679 3680 count = (/ maximum_number_of_particles /) ) 3680 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(17 )3681 CALL handle_netcdf_error( 'output_particles_netcdf', 17 ) 3681 3682 3682 3683 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(16), particles%tailpoints, & 3683 3684 start = (/ 1, prt_time_count /), & 3684 3685 count = (/ maximum_number_of_particles /) ) 3685 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(18 )3686 CALL handle_netcdf_error( 'output_particles_netcdf', 18 ) 3686 3687 3687 3688 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(17), particles%tail_id, & 3688 3689 start = (/ 1, prt_time_count /), & 3689 3690 count = (/ maximum_number_of_particles /) ) 3690 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(19 )3691 CALL handle_netcdf_error( 'output_particles_netcdf', 19 ) 3691 3692 3692 3693 #endif -
palm/trunk/SOURCE/check_open.f90
r247 r263 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! Output of NetCDF messages with aid of message handling routine. 6 7 ! Output of messages replaced by message handling routine 7 8 ! … … 697 698 !-- Open an existing NetCDF file for output 698 699 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_xy(av) ) 699 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 20 ) 700 701 CALL handle_netcdf_error( 'check_open', 20 ) 700 702 ! 701 703 !-- Read header information and set all ids. If there is a mismatch … … 708 710 IF ( .NOT. netcdf_extend ) THEN 709 711 nc_stat = NF90_CLOSE( id_set_xy(av) ) 710 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(21 )712 CALL handle_netcdf_error( 'check_open', 21 ) 711 713 CALL local_system( 'rm ' // TRIM( filename ) ) 712 714 ENDIF … … 731 733 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_xy(av) ) 732 734 ENDIF 733 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(22 )735 CALL handle_netcdf_error( 'check_open', 22 ) 734 736 ! 735 737 !-- Define the header … … 758 760 !-- Open an existing NetCDF file for output 759 761 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_xz(av) ) 760 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(23 )762 CALL handle_netcdf_error( 'check_open', 23 ) 761 763 ! 762 764 !-- Read header information and set all ids. If there is a mismatch … … 769 771 IF ( .NOT. netcdf_extend ) THEN 770 772 nc_stat = NF90_CLOSE( id_set_xz(av) ) 771 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(24 )773 CALL handle_netcdf_error( 'check_open', 24 ) 772 774 CALL local_system( 'rm ' // TRIM( filename ) ) 773 775 ENDIF … … 792 794 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_xz(av) ) 793 795 ENDIF 794 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(25 )796 CALL handle_netcdf_error( 'check_open', 25 ) 795 797 ! 796 798 !-- Define the header … … 819 821 !-- Open an existing NetCDF file for output 820 822 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_yz(av) ) 821 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(26 )823 CALL handle_netcdf_error( 'check_open', 26 ) 822 824 ! 823 825 !-- Read header information and set all ids. If there is a mismatch … … 830 832 IF ( .NOT. netcdf_extend ) THEN 831 833 nc_stat = NF90_CLOSE( id_set_yz(av) ) 832 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(27 )834 CALL handle_netcdf_error( 'check_open', 27 ) 833 835 CALL local_system( 'rm ' // TRIM( filename ) ) 834 836 ENDIF … … 853 855 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_yz(av) ) 854 856 ENDIF 855 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(28 )857 CALL handle_netcdf_error( 'check_open', 28 ) 856 858 ! 857 859 !-- Define the header … … 874 876 !-- Open an existing NetCDF file for output 875 877 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_pr ) 876 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(29 )878 CALL handle_netcdf_error( 'check_open', 29 ) 877 879 ! 878 880 !-- Read header information and set all ids. If there is a mismatch … … 885 887 IF ( .NOT. netcdf_extend ) THEN 886 888 nc_stat = NF90_CLOSE( id_set_pr ) 887 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(30 )889 CALL handle_netcdf_error( 'check_open', 30 ) 888 890 CALL local_system( 'rm ' // TRIM( filename ) ) 889 891 ENDIF … … 908 910 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pr ) 909 911 ENDIF 910 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(31 )912 CALL handle_netcdf_error( 'check_open', 31 ) 911 913 ! 912 914 !-- Define the header … … 929 931 !-- Open an existing NetCDF file for output 930 932 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_ts ) 931 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(32 )933 CALL handle_netcdf_error( 'check_open', 32 ) 932 934 ! 933 935 !-- Read header information and set all ids. If there is a mismatch … … 940 942 IF ( .NOT. netcdf_extend ) THEN 941 943 nc_stat = NF90_CLOSE( id_set_ts ) 942 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(33 )944 CALL handle_netcdf_error( 'check_open', 33 ) 943 945 CALL local_system( 'rm ' // TRIM( filename ) ) 944 946 ENDIF … … 963 965 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_ts ) 964 966 ENDIF 965 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(34 )967 CALL handle_netcdf_error( 'check_open', 34 ) 966 968 ! 967 969 !-- Define the header … … 991 993 !-- Open an existing NetCDF file for output 992 994 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_3d(av) ) 993 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(35 )995 CALL handle_netcdf_error( 'check_open', 35 ) 994 996 ! 995 997 !-- Read header information and set all ids. If there is a mismatch … … 1002 1004 IF ( .NOT. netcdf_extend ) THEN 1003 1005 nc_stat = NF90_CLOSE( id_set_3d(av) ) 1004 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(36 )1006 CALL handle_netcdf_error( 'check_open', 36 ) 1005 1007 CALL local_system('rm ' // TRIM( filename ) ) 1006 1008 ENDIF … … 1025 1027 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_3d(av) ) 1026 1028 ENDIF 1027 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(37 )1029 CALL handle_netcdf_error( 'check_open', 37 ) 1028 1030 ! 1029 1031 !-- Define the header … … 1047 1049 !-- Open an existing NetCDF file for output 1048 1050 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_sp ) 1049 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 38 ) 1051 CALL handle_netcdf_error( 'check_open', 38 ) 1052 1050 1053 ! 1051 1054 !-- Read header information and set all ids. If there is a mismatch … … 1058 1061 IF ( .NOT. netcdf_extend ) THEN 1059 1062 nc_stat = NF90_CLOSE( id_set_sp ) 1060 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(39 )1063 CALL handle_netcdf_error( 'check_open', 39 ) 1061 1064 CALL local_system( 'rm ' // TRIM( filename ) ) 1062 1065 ENDIF … … 1081 1084 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_sp ) 1082 1085 ENDIF 1083 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(40 )1086 CALL handle_netcdf_error( 'check_open', 40 ) 1084 1087 ! 1085 1088 !-- Define the header … … 1106 1109 !-- Open an existing NetCDF file for output 1107 1110 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_prt ) 1108 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(41 )1111 CALL handle_netcdf_error( 'check_open', 41 ) 1109 1112 ! 1110 1113 !-- Read header information and set all ids. If there is a mismatch … … 1117 1120 IF ( .NOT. netcdf_extend ) THEN 1118 1121 nc_stat = NF90_CLOSE( id_set_prt ) 1119 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(42 )1122 CALL handle_netcdf_error( 'check_open', 42 ) 1120 1123 CALL local_system( 'rm ' // filename ) 1121 1124 ENDIF … … 1157 1160 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_prt ) 1158 1161 ENDIF 1159 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 43 )1162 CALL handle_netcdf_error( 'check_open', 43 ) 1160 1163 1161 1164 ! … … 1179 1182 !-- Open an existing NetCDF file for output 1180 1183 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_pts ) 1181 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(393 )1184 CALL handle_netcdf_error( 'check_open', 393 ) 1182 1185 ! 1183 1186 !-- Read header information and set all ids. If there is a mismatch … … 1190 1193 IF ( .NOT. netcdf_extend ) THEN 1191 1194 nc_stat = NF90_CLOSE( id_set_pts ) 1192 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(394 )1195 CALL handle_netcdf_error( 'check_open', 394 ) 1193 1196 CALL local_system( 'rm ' // TRIM( filename ) ) 1194 1197 ENDIF … … 1213 1216 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pts ) 1214 1217 ENDIF 1215 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(395 )1218 CALL handle_netcdf_error( 'check_open', 395 ) 1216 1219 ! 1217 1220 !-- Define the header -
palm/trunk/SOURCE/close_file.f90
r4 r263 2 2 3 3 !------------------------------------------------------------------------------! 4 ! Actualrevisions:4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! Output of NetCDF messages with aid of message handling routine. 7 7 ! 8 8 ! Former revisions: … … 403 403 IF ( myid == 0 .AND. netcdf_output ) THEN 404 404 nc_stat = NF90_CLOSE( id_set_xy(0) ) 405 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(44 )405 CALL handle_netcdf_error( 'close_file', 44 ) 406 406 ENDIF 407 407 … … 410 410 IF ( myid == 0 .AND. netcdf_output ) THEN 411 411 nc_stat = NF90_CLOSE( id_set_xz(0) ) 412 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(45 )412 CALL handle_netcdf_error( 'close_file', 45 ) 413 413 ENDIF 414 414 … … 417 417 IF ( myid == 0 .AND. netcdf_output ) THEN 418 418 nc_stat = NF90_CLOSE( id_set_yz(0) ) 419 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(46 )419 CALL handle_netcdf_error( 'close_file', 46 ) 420 420 ENDIF 421 421 … … 424 424 IF ( myid == 0 .AND. netcdf_output ) THEN 425 425 nc_stat = NF90_CLOSE( id_set_pr ) 426 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(47 )426 CALL handle_netcdf_error( 'close_file', 47 ) 427 427 ENDIF 428 428 … … 431 431 IF ( myid == 0 .AND. netcdf_output ) THEN 432 432 nc_stat = NF90_CLOSE( id_set_ts ) 433 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(48 )433 CALL handle_netcdf_error( 'close_file', 48 ) 434 434 ENDIF 435 435 … … 438 438 IF ( myid == 0 .AND. netcdf_output ) THEN 439 439 nc_stat = NF90_CLOSE( id_set_3d(0) ) 440 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(49 )440 CALL handle_netcdf_error( 'close_file', 49 ) 441 441 ENDIF 442 442 … … 445 445 IF ( myid == 0 .AND. netcdf_output ) THEN 446 446 nc_stat = NF90_CLOSE( id_set_sp ) 447 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(50 )447 CALL handle_netcdf_error( 'close_file', 50 ) 448 448 ENDIF 449 449 … … 452 452 IF ( netcdf_output ) THEN 453 453 nc_stat = NF90_CLOSE( id_set_prt ) 454 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(51 )454 CALL handle_netcdf_error( 'close_file', 51 ) 455 455 ENDIF 456 456 … … 459 459 IF ( netcdf_output ) THEN 460 460 nc_stat = NF90_CLOSE( id_set_pts ) 461 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(412 )461 CALL handle_netcdf_error( 'close_file', 412 ) 462 462 ENDIF 463 463 … … 466 466 IF ( myid == 0 .AND. netcdf_output ) THEN 467 467 nc_stat = NF90_CLOSE( id_set_xy(1) ) 468 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(52 )468 CALL handle_netcdf_error( 'close_file', 52 ) 469 469 ENDIF 470 470 … … 473 473 IF ( myid == 0 .AND. netcdf_output ) THEN 474 474 nc_stat = NF90_CLOSE( id_set_xz(1) ) 475 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(352 )475 CALL handle_netcdf_error( 'close_file', 352 ) 476 476 ENDIF 477 477 … … 480 480 IF ( myid == 0 .AND. netcdf_output ) THEN 481 481 nc_stat = NF90_CLOSE( id_set_yz(1) ) 482 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(353 )482 CALL handle_netcdf_error( 'close_file', 353 ) 483 483 ENDIF 484 484 … … 487 487 IF ( myid == 0 .AND. netcdf_output ) THEN 488 488 nc_stat = NF90_CLOSE( id_set_3d(1) ) 489 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(353 )489 CALL handle_netcdf_error( 'close_file', 353 ) 490 490 ENDIF 491 491 -
palm/trunk/SOURCE/data_output_2d.f90
r254 r263 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! Output of NetCDF messages with aid of message handling routine. 6 7 ! Output of messages replaced by message handling routine. 7 8 ! … … 568 569 start = (/ do2d_xy_time_count(av) /), & 569 570 count = (/ 1 /) ) 570 IF ( nc_stat /= NF90_NOERR ) THEN 571 CALL handle_netcdf_error( 53 ) 572 ENDIF 571 CALL handle_netcdf_error( 'data_output_2d', 53 ) 573 572 #endif 574 573 ENDIF … … 666 665 count = (/ nx+2, ny+2, 1, 1 /) ) 667 666 ENDIF 668 IF ( nc_stat /= NF90_NOERR ) & 669 CALL handle_netcdf_error( 54 ) 667 CALL handle_netcdf_error( 'data_output_2d', 54 ) 670 668 ENDIF 671 669 #endif … … 708 706 count = (/ nx+2, ny+2, 1, 1 /) ) 709 707 ENDIF 710 IF ( nc_stat /= NF90_NOERR ) & 711 CALL handle_netcdf_error( 55 ) 708 CALL handle_netcdf_error( 'data_output_2d', 55 ) 712 709 ENDIF 713 710 #endif … … 758 755 start = (/ do2d_xz_time_count(av) /), & 759 756 count = (/ 1 /) ) 760 IF ( nc_stat /= NF90_NOERR ) THEN 761 CALL handle_netcdf_error( 56 ) 762 ENDIF 757 CALL handle_netcdf_error( 'data_output_2d', 56 ) 763 758 #endif 764 759 ENDIF … … 882 877 start = (/ 1, is, 1, do2d_xz_time_count(av) /), & 883 878 count = (/ nx+2, 1, nz+2, 1 /) ) 884 IF ( nc_stat /= NF90_NOERR ) & 885 CALL handle_netcdf_error( 57 ) 879 CALL handle_netcdf_error( 'data_output_2d', 57 ) 886 880 ENDIF 887 881 #endif … … 926 920 start = (/ 1, is, 1, do2d_xz_time_count(av) /), & 927 921 count = (/ nx+2, 1, nz+2, 1 /) ) 928 IF ( nc_stat /= NF90_NOERR ) & 929 CALL handle_netcdf_error( 58 ) 922 CALL handle_netcdf_error( 'data_output_2d', 58 ) 930 923 ENDIF 931 924 #endif … … 969 962 start = (/ do2d_yz_time_count(av) /), & 970 963 count = (/ 1 /) ) 971 IF ( nc_stat /= NF90_NOERR ) THEN 972 CALL handle_netcdf_error( 59 ) 973 ENDIF 964 CALL handle_netcdf_error( 'data_output_2d', 59 ) 974 965 #endif 975 966 ENDIF … … 1093 1084 start = (/ is, 1, 1, do2d_yz_time_count(av) /), & 1094 1085 count = (/ 1, ny+2, nz+2, 1 /) ) 1095 IF ( nc_stat /= NF90_NOERR ) & 1096 CALL handle_netcdf_error( 60 ) 1086 CALL handle_netcdf_error( 'data_output_2d', 60 ) 1097 1087 ENDIF 1098 1088 #endif … … 1137 1127 start = (/ is, 1, 1, do2d_xz_time_count(av) /), & 1138 1128 count = (/ 1, ny+2, nz+2, 1 /) ) 1139 IF ( nc_stat /= NF90_NOERR ) & 1140 CALL handle_netcdf_error( 61 ) 1129 CALL handle_netcdf_error( 'data_output_2d', 61 ) 1141 1130 ENDIF 1142 1131 #endif -
palm/trunk/SOURCE/data_output_3d.f90
r254 r263 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! Output of NetCDF messages with aid of message handling routine. 6 7 ! Output of messages replaced by message handling routine. 7 8 ! … … 95 96 start = (/ do3d_time_count(av) /), & 96 97 count = (/ 1 /) ) 97 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(1009 )98 CALL handle_netcdf_error( 'data_output_3d', 1009 ) 98 99 ENDIF 99 100 #endif … … 385 386 start = (/ 1, 1, 1, do3d_time_count(av) /), & 386 387 count = (/ nx+2, ny+2, nz_do3d-nzb+1, 1 /) ) 387 IF ( nc_stat /= NF90_NOERR) CALL handle_netcdf_error(1010 )388 CALL handle_netcdf_error( 'data_output_3d', 1010 ) 388 389 ENDIF 389 390 #endif -
palm/trunk/SOURCE/data_output_profiles.f90
r254 r263 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! Output of NetCDF messages with aid of message handling routine. 6 7 ! Output of messages replaced by message handling routine. 7 8 ! … … 117 118 (/ 0.0 /), start = (/ 1 /), & 118 119 count = (/ 1 /) ) 119 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(329 )120 CALL handle_netcdf_error( 'data_output_profiles', 329 ) 120 121 output_for_t0 = .TRUE. 121 122 EXIT … … 128 129 (/ hom_sum(nzb,18,normalizing_region) /), & 129 130 start = (/ 1 /), count = (/ 1 /) ) 130 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(330 )131 CALL handle_netcdf_error( 'data_output_profiles', 330 ) 131 132 132 133 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(2), & ! ws2 133 134 (/ hom_sum(nzb+8,pr_palm,normalizing_region)**2 /), & 134 135 start = (/ 1 /), count = (/ 1 /) ) 135 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 331 ) 136 136 CALL handle_netcdf_error( 'data_output_profiles', 331 ) 137 137 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(3), & ! tsw2 138 138 (/ hom_sum(nzb+3,pr_palm,normalizing_region)**2 /), & 139 139 start = (/ 1 /), count = (/ 1 /) ) 140 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 332 ) 141 140 CALL handle_netcdf_error( 'data_output_profiles', 332 ) 142 141 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(4), & ! ws3 143 142 (/ hom_sum(nzb+8,pr_palm,normalizing_region)**3 /), & 144 143 start = (/ 1 /), count = (/ 1 /) ) 145 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(333 )144 CALL handle_netcdf_error( 'data_output_profiles', 333 ) 146 145 147 146 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(5), & ! ws2tsw … … 149 148 hom_sum(nzb+3,pr_palm,normalizing_region) /), & 150 149 start = (/ 1 /), count = (/ 1 /) ) 151 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(334 )150 CALL handle_netcdf_error( 'data_output_profiles', 334 ) 152 151 153 152 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(6), & ! wstsw2 … … 155 154 hom_sum(nzb+3,pr_palm,normalizing_region)**2 /), & 156 155 start = (/ 1 /), count = (/ 1 /) ) 157 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(335 )156 CALL handle_netcdf_error( 'data_output_profiles', 335 ) 158 157 159 158 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(7), & ! z_i 160 159 (/ hom_sum(nzb+6,pr_palm,normalizing_region) /), & 161 160 start = (/ 1 /), count = (/ 1 /) ) 162 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(336 )161 CALL handle_netcdf_error( 'data_output_profiles', 336 ) 163 162 #endif 164 163 ENDIF … … 197 196 start = (/ 1, 1 /), & 198 197 count = (/ nzt-nzb+2, 1 /) ) 199 IF ( nc_stat /= NF90_NOERR ) & 200 CALL handle_netcdf_error( 337 ) 198 CALL handle_netcdf_error( 'data_output_profiles', 337 ) 201 199 #endif 202 200 ENDIF … … 361 359 start = (/ dopr_time_count /), & 362 360 count = (/ 1 /) ) 363 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(338 )361 CALL handle_netcdf_error( 'data_output_profiles', 338 ) 364 362 365 363 ! … … 369 367 start = (/ dopr_time_count /), & 370 368 count = (/ 1 /) ) 371 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(339 )369 CALL handle_netcdf_error( 'data_output_profiles', 339 ) 372 370 373 371 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(2), & ! ws2 … … 375 373 start = (/ dopr_time_count /), & 376 374 count = (/ 1 /) ) 377 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(340 )375 CALL handle_netcdf_error( 'data_output_profiles', 340 ) 378 376 379 377 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(3), & ! tsw2 … … 381 379 start = (/ dopr_time_count /), & 382 380 count = (/ 1 /) ) 383 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(341 )381 CALL handle_netcdf_error( 'data_output_profiles', 341 ) 384 382 385 383 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(4), & ! ws3 … … 387 385 start = (/ dopr_time_count /), & 388 386 count = (/ 1 /) ) 389 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(342 )387 CALL handle_netcdf_error( 'data_output_profiles', 342 ) 390 388 391 389 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(5), & ! ws2tsw … … 394 392 start = (/ dopr_time_count /), & 395 393 count = (/ 1 /) ) 396 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(343 )397 394 CALL handle_netcdf_error( 'data_output_profiles', 343 ) 395 398 396 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(6), & ! wstsw2 399 397 (/ hom_sum(nzb+8,pr_palm,normalizing_region) * & … … 401 399 start = (/ dopr_time_count /), & 402 400 count = (/ 1 /) ) 403 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(344 )401 CALL handle_netcdf_error( 'data_output_profiles', 344 ) 404 402 405 403 nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(7), & ! z_i … … 407 405 start = (/ dopr_time_count /), & 408 406 count = (/ 1 /) ) 409 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(345 )407 CALL handle_netcdf_error( 'data_output_profiles', 345 ) 410 408 #endif 411 409 ENDIF … … 443 441 start = (/ 1, dopr_time_count /), & 444 442 count = (/ nzt-nzb+2, 1 /) ) 445 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(346 )443 CALL handle_netcdf_error( 'data_output_profiles', 346 ) 446 444 #endif 447 445 ENDIF -
palm/trunk/SOURCE/data_output_ptseries.f90
r77 r263 2 2 3 3 !------------------------------------------------------------------------------! 4 ! Actualrevisions:4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! Output of NetCDF messages with aid of message handling routine. 7 ! 7 8 ! 8 9 ! Former revisions: … … 57 58 (/ simulated_time /), & 58 59 start = (/ dopts_time_count /), count = (/ 1 /) ) 59 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(391 )60 CALL handle_netcdf_error( 'data_output_ptseries', 391 ) 60 61 #endif 61 62 … … 269 270 start = (/ dopts_time_count /), & 270 271 count = (/ 1 /) ) 271 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(392 )272 CALL handle_netcdf_error( 'data_output_ptseries', 392 ) 272 273 ENDDO 273 274 ENDDO -
palm/trunk/SOURCE/data_output_spectra.f90
r254 r263 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! Output of NetCDF messages with aid of message handling routine. 6 7 ! Output of messages replaced by message handling routine. 7 8 ! … … 66 67 nc_stat = NF90_PUT_VAR( id_set_sp, id_var_time_sp, (/ simulated_time /),& 67 68 start = (/ dosp_time_count /), count = (/ 1 /) ) 68 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(47 )69 CALL handle_netcdf_error( 'data_output_spectra', 47 ) 69 70 #endif 70 71 … … 225 226 start = (/ 1, k, dosp_time_count /), & 226 227 count = (/ nx/2, 1, 1 /) ) 227 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(348 )228 CALL handle_netcdf_error( 'data_output_spectra', 348 ) 228 229 229 230 ENDDO … … 243 244 start = (/ 1, k, dosp_time_count /), & 244 245 count = (/ ny/2, 1, 1 /) ) 245 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(349 )246 CALL handle_netcdf_error( 'data_output_spectra', 349 ) 246 247 247 248 ENDDO -
palm/trunk/SOURCE/data_output_tseries.f90
r77 r263 2 2 3 3 !------------------------------------------------------------------------------! 4 ! Actualrevisions:4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! Output of NetCDF messages with aid of message handling routine. 7 ! 7 8 ! 8 9 ! Former revisions: … … 66 67 start = (/ dots_time_count /), & 67 68 count = (/ 1 /) ) 68 IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error(350 )69 CALL handle_netcdf_error( 'data_output_tseries', 350 ) 69 70 #endif 70 71 ENDIF … … 82 83 start = (/ dots_time_count /), & 83 84 count = (/ 1 /) ) 84 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(351 )85 CALL handle_netcdf_error( 'data_output_tseries', 351 ) 85 86 ENDDO 86 87 ENDIF -
palm/trunk/SOURCE/netcdf.f90
r257 r263 7 7 ! Current revisions: 8 8 ! ------------------ 9 ! Output of NetCDF messages with aid of message handling routine. 9 10 ! Output of messages replaced by message handling routine. 10 11 ! … … 187 188 nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'Conventions', & 188 189 'COARDS' ) 189 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(62 )190 CALL handle_netcdf_error( 'netcdf', 62 ) 190 191 191 192 IF ( av == 0 ) THEN … … 198 199 TRIM( run_description_header ) // & 199 200 TRIM( time_average_text ) ) 200 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(63 )201 CALL handle_netcdf_error( 'netcdf', 63 ) 201 202 IF ( av == 1 ) THEN 202 203 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 203 204 nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'time_avg', & 204 205 TRIM( time_average_text ) ) 205 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(63 )206 CALL handle_netcdf_error( 'netcdf', 63 ) 206 207 ENDIF 207 208 … … 210 211 nc_stat = NF90_DEF_DIM( id_set_3d(av), 'time', NF90_UNLIMITED, & 211 212 id_dim_time_3d(av) ) 212 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(64 )213 CALL handle_netcdf_error( 'netcdf', 64 ) 213 214 214 215 nc_stat = NF90_DEF_VAR( id_set_3d(av), 'time', NF90_DOUBLE, & 215 216 id_dim_time_3d(av), id_var_time_3d(av) ) 216 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(65 )217 CALL handle_netcdf_error( 'netcdf', 65 ) 217 218 218 219 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_time_3d(av), 'units', & 219 220 'seconds') 220 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(66 )221 CALL handle_netcdf_error( 'netcdf', 66 ) 221 222 222 223 ! … … 225 226 nc_stat = NF90_DEF_DIM( id_set_3d(av), 'zu_3d', nz_do3d-nzb+1, & 226 227 id_dim_zu_3d(av) ) 227 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(67 )228 CALL handle_netcdf_error( 'netcdf', 67 ) 228 229 229 230 nc_stat = NF90_DEF_VAR( id_set_3d(av), 'zu_3d', NF90_DOUBLE, & 230 231 id_dim_zu_3d(av), id_var_zu_3d(av) ) 231 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(68 )232 CALL handle_netcdf_error( 'netcdf', 68 ) 232 233 233 234 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_zu_3d(av), 'units', & 234 235 'meters' ) 235 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(69 )236 CALL handle_netcdf_error( 'netcdf', 69 ) 236 237 237 238 ! … … 239 240 nc_stat = NF90_DEF_DIM( id_set_3d(av), 'zw_3d', nz_do3d-nzb+1, & 240 241 id_dim_zw_3d(av) ) 241 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(70 )242 CALL handle_netcdf_error( 'netcdf', 70 ) 242 243 243 244 nc_stat = NF90_DEF_VAR( id_set_3d(av), 'zw_3d', NF90_DOUBLE, & 244 245 id_dim_zw_3d(av), id_var_zw_3d(av) ) 245 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(71 )246 CALL handle_netcdf_error( 'netcdf', 71 ) 246 247 247 248 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_zw_3d(av), 'units', & 248 249 'meters' ) 249 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(72 )250 CALL handle_netcdf_error( 'netcdf', 72 ) 250 251 251 252 ! 252 253 !-- Define x-axis (for scalar position) 253 254 nc_stat = NF90_DEF_DIM( id_set_3d(av), 'x', nx+2, id_dim_x_3d(av) ) 254 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(73 )255 CALL handle_netcdf_error( 'netcdf', 73 ) 255 256 256 257 nc_stat = NF90_DEF_VAR( id_set_3d(av), 'x', NF90_DOUBLE, & 257 258 id_dim_x_3d(av), id_var_x_3d(av) ) 258 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(74 )259 CALL handle_netcdf_error( 'netcdf', 74 ) 259 260 260 261 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_x_3d(av), 'units', & 261 262 'meters' ) 262 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(75 )263 CALL handle_netcdf_error( 'netcdf', 75 ) 263 264 264 265 ! 265 266 !-- Define x-axis (for u position) 266 267 nc_stat = NF90_DEF_DIM( id_set_3d(av), 'xu', nx+2, id_dim_xu_3d(av) ) 267 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(358 )268 CALL handle_netcdf_error( 'netcdf', 358 ) 268 269 269 270 nc_stat = NF90_DEF_VAR( id_set_3d(av), 'xu', NF90_DOUBLE, & 270 271 id_dim_xu_3d(av), id_var_xu_3d(av) ) 271 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(359 )272 CALL handle_netcdf_error( 'netcdf', 359 ) 272 273 273 274 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_xu_3d(av), 'units', & 274 275 'meters' ) 275 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(360 )276 CALL handle_netcdf_error( 'netcdf', 360 ) 276 277 277 278 ! 278 279 !-- Define y-axis (for scalar position) 279 280 nc_stat = NF90_DEF_DIM( id_set_3d(av), 'y', ny+2, id_dim_y_3d(av) ) 280 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(76 )281 CALL handle_netcdf_error( 'netcdf', 76 ) 281 282 282 283 nc_stat = NF90_DEF_VAR( id_set_3d(av), 'y', NF90_DOUBLE, & 283 284 id_dim_y_3d(av), id_var_y_3d(av) ) 284 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(77 )285 CALL handle_netcdf_error( 'netcdf', 77 ) 285 286 286 287 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_y_3d(av), 'units', & 287 288 'meters' ) 288 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(78 )289 CALL handle_netcdf_error( 'netcdf', 78 ) 289 290 290 291 ! 291 292 !-- Define y-axis (for v position) 292 293 nc_stat = NF90_DEF_DIM( id_set_3d(av), 'yv', ny+2, id_dim_yv_3d(av) ) 293 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(361 )294 CALL handle_netcdf_error( 'netcdf', 361 ) 294 295 295 296 nc_stat = NF90_DEF_VAR( id_set_3d(av), 'yv', NF90_DOUBLE, & 296 297 id_dim_yv_3d(av), id_var_yv_3d(av) ) 297 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(362 )298 CALL handle_netcdf_error( 'netcdf', 362 ) 298 299 299 300 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_yv_3d(av), 'units', & 300 301 'meters' ) 301 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(363 )302 CALL handle_netcdf_error( 'netcdf', 363 ) 302 303 303 304 ! … … 310 311 (/ id_dim_x_3d(av), id_dim_y_3d(av) /), & 311 312 id_var_zusi_3d(av) ) 312 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(413 )313 CALL handle_netcdf_error( 'netcdf', 413 ) 313 314 314 315 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_zusi_3d(av), & 315 316 'units', 'meters' ) 316 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(414 )317 CALL handle_netcdf_error( 'netcdf', 414 ) 317 318 318 319 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_zusi_3d(av), & 319 320 'long_name', 'zu(nzb_s_inner)' ) 320 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(415 )321 CALL handle_netcdf_error( 'netcdf', 415 ) 321 322 322 323 ! … … 325 326 (/ id_dim_x_3d(av), id_dim_y_3d(av) /), & 326 327 id_var_zwwi_3d(av) ) 327 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(416 )328 CALL handle_netcdf_error( 'netcdf', 416 ) 328 329 329 330 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_zwwi_3d(av), & 330 331 'units', 'meters' ) 331 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(417 )332 CALL handle_netcdf_error( 'netcdf', 417 ) 332 333 333 334 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_zwwi_3d(av), & 334 335 'long_name', 'zw(nzb_w_inner)' ) 335 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(418 )336 CALL handle_netcdf_error( 'netcdf', 418 ) 336 337 337 338 ENDIF … … 422 423 var_list = TRIM( var_list ) // TRIM( do3d(av,i) ) // ';' 423 424 424 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(79 )425 CALL handle_netcdf_error( 'netcdf', 79 ) 425 426 ! 426 427 !-- Store the 'real' name of the variable (with *, for example) … … 429 430 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_do3d(av,i), & 430 431 'long_name', do3d(av,i) ) 431 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(80 )432 CALL handle_netcdf_error( 'netcdf', 80 ) 432 433 ! 433 434 !-- Define the variable's unit 434 435 nc_stat = NF90_PUT_ATT( id_set_3d(av), id_var_do3d(av,i), & 435 436 'units', TRIM( do3d_unit(av,i) ) ) 436 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(357 )437 CALL handle_netcdf_error( 'netcdf', 357 ) 437 438 438 439 i = i + 1 … … 449 450 nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'VAR_LIST', & 450 451 var_list ) 451 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(81 )452 CALL handle_netcdf_error( 'netcdf', 81 ) 452 453 453 454 ! 454 455 !-- Leave NetCDF define mode 455 456 nc_stat = NF90_ENDDEF( id_set_3d(av) ) 456 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(82 )457 CALL handle_netcdf_error( 'netcdf', 82 ) 457 458 458 459 ! … … 466 467 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_x_3d(av), netcdf_data, & 467 468 start = (/ 1 /), count = (/ nx+2 /) ) 468 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(83 )469 CALL handle_netcdf_error( 'netcdf', 83 ) 469 470 470 471 DO i = 0, nx+1 … … 475 476 netcdf_data, start = (/ 1 /), & 476 477 count = (/ nx+2 /) ) 477 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(385 )478 CALL handle_netcdf_error( 'netcdf', 385 ) 478 479 479 480 DEALLOCATE( netcdf_data ) … … 489 490 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_y_3d(av), netcdf_data, & 490 491 start = (/ 1 /), count = (/ ny+2 /)) 491 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(84 )492 CALL handle_netcdf_error( 'netcdf', 84 ) 492 493 493 494 DO i = 0, ny+1 … … 498 499 netcdf_data, start = (/ 1 /), & 499 500 count = (/ ny+2 /)) 500 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(387 )501 CALL handle_netcdf_error( 'netcdf', 387 ) 501 502 502 503 DEALLOCATE( netcdf_data ) … … 507 508 zu(nzb:nz_do3d), start = (/ 1 /), & 508 509 count = (/ nz_do3d-nzb+1 /) ) 509 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 85 ) 510 CALL handle_netcdf_error( 'netcdf', 85 ) 511 510 512 511 513 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zw_3d(av), & 512 514 zw(nzb:nz_do3d), start = (/ 1 /), & 513 515 count = (/ nz_do3d-nzb+1 /) ) 514 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(86 )516 CALL handle_netcdf_error( 'netcdf', 86 ) 515 517 516 518 … … 523 525 start = (/ 1, 1 /), & 524 526 count = (/ nx+2, ny+2 /) ) 525 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(419 )527 CALL handle_netcdf_error( 'netcdf', 419 ) 526 528 527 529 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av), & … … 529 531 start = (/ 1, 1 /), & 530 532 count = (/ nx+2, ny+2 /) ) 531 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(420 )533 CALL handle_netcdf_error( 'netcdf', 420 ) 532 534 533 535 ENDIF … … 542 544 nc_stat = NF90_GET_ATT( id_set_3d(av), NF90_GLOBAL, 'VAR_LIST', & 543 545 var_list_old ) 544 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(87 )546 CALL handle_netcdf_error( 'netcdf', 87 ) 545 547 546 548 var_list = ';' … … 571 573 !-- Get and compare the number of vertical gridpoints 572 574 nc_stat = NF90_INQ_VARID( id_set_3d(av), 'zu_3d', id_var_zu_3d(av) ) 573 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(88 )575 CALL handle_netcdf_error( 'netcdf', 88 ) 574 576 575 577 nc_stat = NF90_INQUIRE_VARIABLE( id_set_3d(av), id_var_zu_3d(av), & 576 578 dimids = id_dim_zu_3d_old ) 577 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(89 )579 CALL handle_netcdf_error( 'netcdf', 89 ) 578 580 id_dim_zu_3d(av) = id_dim_zu_3d_old(1) 579 581 580 582 nc_stat = NF90_INQUIRE_DIMENSION( id_set_3d(av), id_dim_zu_3d(av), & 581 583 len = nz_old ) 582 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(90 )584 CALL handle_netcdf_error( 'netcdf', 90 ) 583 585 584 586 IF ( nz_do3d-nzb+1 /= nz_old ) THEN … … 600 602 !-- on the file. 601 603 nc_stat = NF90_INQ_VARID( id_set_3d(av), 'time', id_var_time_3d(av) ) 602 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(91 )604 CALL handle_netcdf_error( 'netcdf', 91 ) 603 605 604 606 nc_stat = NF90_INQUIRE_VARIABLE( id_set_3d(av), id_var_time_3d(av), & 605 607 dimids = id_dim_time_old ) 606 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 92 ) 608 CALL handle_netcdf_error( 'netcdf', 92 ) 609 607 610 id_dim_time_3d(av) = id_dim_time_old(1) 608 611 609 612 nc_stat = NF90_INQUIRE_DIMENSION( id_set_3d(av), id_dim_time_3d(av), & 610 613 len = do3d_time_count(av) ) 611 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(93 )614 CALL handle_netcdf_error( 'netcdf', 93 ) 612 615 613 616 nc_stat = NF90_GET_VAR( id_set_3d(av), id_var_time_3d(av), & … … 615 618 start = (/ do3d_time_count(av) /), & 616 619 count = (/ 1 /) ) 617 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(94 )620 CALL handle_netcdf_error( 'netcdf', 94 ) 618 621 619 622 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 638 641 nc_stat = NF90_INQ_VARID( id_set_3d(av), TRIM( do3d(av,i) ), & 639 642 id_var_do3d(av,i) ) 640 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(95 )643 CALL handle_netcdf_error( 'netcdf', 95 ) 641 644 i = i + 1 642 645 ENDDO … … 646 649 nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'title', & 647 650 TRIM( run_description_header ) ) 648 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(96 )651 CALL handle_netcdf_error( 'netcdf', 96 ) 649 652 message_string = 'NetCDF file for volume data ' // & 650 653 TRIM( var ) // ' from previous run found.' // & … … 658 661 nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'Conventions', & 659 662 'COARDS' ) 660 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(97 )663 CALL handle_netcdf_error( 'netcdf', 97 ) 661 664 662 665 IF ( av == 0 ) THEN … … 669 672 TRIM( run_description_header ) // & 670 673 TRIM( time_average_text ) ) 671 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(98 )674 CALL handle_netcdf_error( 'netcdf', 98 ) 672 675 IF ( av == 1 ) THEN 673 676 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 674 677 nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'time_avg', & 675 678 TRIM( time_average_text ) ) 676 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(98 )679 CALL handle_netcdf_error( 'netcdf', 98 ) 677 680 ENDIF 678 681 … … 681 684 nc_stat = NF90_DEF_DIM( id_set_xy(av), 'time', NF90_UNLIMITED, & 682 685 id_dim_time_xy(av) ) 683 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(99 )686 CALL handle_netcdf_error( 'netcdf', 99 ) 684 687 685 688 nc_stat = NF90_DEF_VAR( id_set_xy(av), 'time', NF90_DOUBLE, & 686 689 id_dim_time_xy(av), id_var_time_xy(av) ) 687 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(100 )690 CALL handle_netcdf_error( 'netcdf', 100 ) 688 691 689 692 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_time_xy(av), 'units', & 690 693 'seconds') 691 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(101 )694 CALL handle_netcdf_error( 'netcdf', 101 ) 692 695 693 696 ! … … 707 710 !-- Define vertical coordinate grid (zu grid) 708 711 nc_stat = NF90_DEF_DIM( id_set_xy(av), 'zu_xy', ns, id_dim_zu_xy(av) ) 709 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(102 )712 CALL handle_netcdf_error( 'netcdf', 102 ) 710 713 711 714 nc_stat = NF90_DEF_VAR( id_set_xy(av), 'zu_xy', NF90_DOUBLE, & 712 715 id_dim_zu_xy(av), id_var_zu_xy(av) ) 713 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(103 )716 CALL handle_netcdf_error( 'netcdf', 103 ) 714 717 715 718 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_zu_xy(av), 'units', & 716 719 'meters' ) 717 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(104 )720 CALL handle_netcdf_error( 'netcdf', 104 ) 718 721 719 722 ! 720 723 !-- Define vertical coordinate grid (zw grid) 721 724 nc_stat = NF90_DEF_DIM( id_set_xy(av), 'zw_xy', ns, id_dim_zw_xy(av) ) 722 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(105 )725 CALL handle_netcdf_error( 'netcdf', 105 ) 723 726 724 727 nc_stat = NF90_DEF_VAR( id_set_xy(av), 'zw_xy', NF90_DOUBLE, & 725 728 id_dim_zw_xy(av), id_var_zw_xy(av) ) 726 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(106 )729 CALL handle_netcdf_error( 'netcdf', 106 ) 727 730 728 731 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_zw_xy(av), 'units', & 729 732 'meters' ) 730 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(107 )733 CALL handle_netcdf_error( 'netcdf', 107 ) 731 734 732 735 ! … … 735 738 nc_stat = NF90_DEF_DIM( id_set_xy(av), 'zu1_xy', 1, & 736 739 id_dim_zu1_xy(av) ) 737 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(108 )740 CALL handle_netcdf_error( 'netcdf', 108 ) 738 741 739 742 nc_stat = NF90_DEF_VAR( id_set_xy(av), 'zu1_xy', NF90_DOUBLE, & 740 743 id_dim_zu1_xy(av), id_var_zu1_xy(av) ) 741 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(109 )744 CALL handle_netcdf_error( 'netcdf', 109 ) 742 745 743 746 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_zu1_xy(av), 'units', & 744 747 'meters' ) 745 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(110 )748 CALL handle_netcdf_error( 'netcdf', 110 ) 746 749 747 750 ! … … 750 753 nc_stat = NF90_DEF_VAR( id_set_xy(av), 'ind_z_xy', NF90_DOUBLE, & 751 754 id_dim_zu_xy(av), id_var_ind_z_xy(av) ) 752 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(111 )755 CALL handle_netcdf_error( 'netcdf', 111 ) 753 756 754 757 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_ind_z_xy(av), 'units', & 755 758 'gridpoints') 756 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(112 )759 CALL handle_netcdf_error( 'netcdf', 112 ) 757 760 758 761 ! 759 762 !-- Define x-axis (for scalar position) 760 763 nc_stat = NF90_DEF_DIM( id_set_xy(av), 'x', nx+2, id_dim_x_xy(av) ) 761 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(113 )764 CALL handle_netcdf_error( 'netcdf', 113 ) 762 765 763 766 nc_stat = NF90_DEF_VAR( id_set_xy(av), 'x', NF90_DOUBLE, & 764 767 id_dim_x_xy(av), id_var_x_xy(av) ) 765 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 114 ) 768 CALL handle_netcdf_error( 'netcdf', 114 ) 769 766 770 767 771 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_x_xy(av), 'units', & 768 772 'meters' ) 769 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(115 )773 CALL handle_netcdf_error( 'netcdf', 115 ) 770 774 771 775 ! 772 776 !-- Define x-axis (for u position) 773 777 nc_stat = NF90_DEF_DIM( id_set_xy(av), 'xu', nx+2, id_dim_xu_xy(av) ) 774 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(388 )778 CALL handle_netcdf_error( 'netcdf', 388 ) 775 779 776 780 nc_stat = NF90_DEF_VAR( id_set_xy(av), 'xu', NF90_DOUBLE, & 777 781 id_dim_xu_xy(av), id_var_xu_xy(av) ) 778 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(389 )782 CALL handle_netcdf_error( 'netcdf', 389 ) 779 783 780 784 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_xu_xy(av), 'units', & 781 785 'meters' ) 782 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(390 )786 CALL handle_netcdf_error( 'netcdf', 390 ) 783 787 784 788 ! 785 789 !-- Define y-axis (for scalar position) 786 790 nc_stat = NF90_DEF_DIM( id_set_xy(av), 'y', ny+2, id_dim_y_xy(av) ) 787 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(116 )791 CALL handle_netcdf_error( 'netcdf', 116 ) 788 792 789 793 nc_stat = NF90_DEF_VAR( id_set_xy(av), 'y', NF90_DOUBLE, & 790 794 id_dim_y_xy(av), id_var_y_xy(av) ) 791 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(117 )795 CALL handle_netcdf_error( 'netcdf', 117 ) 792 796 793 797 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_y_xy(av), 'units', & 794 798 'meters' ) 795 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(118 )799 CALL handle_netcdf_error( 'netcdf', 118 ) 796 800 797 801 ! 798 802 !-- Define y-axis (for scalar position) 799 803 nc_stat = NF90_DEF_DIM( id_set_xy(av), 'yv', ny+2, id_dim_yv_xy(av) ) 800 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(364 )804 CALL handle_netcdf_error( 'netcdf', 364 ) 801 805 802 806 nc_stat = NF90_DEF_VAR( id_set_xy(av), 'yv', NF90_DOUBLE, & 803 807 id_dim_yv_xy(av), id_var_yv_xy(av) ) 804 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(365 )808 CALL handle_netcdf_error( 'netcdf', 365 ) 805 809 806 810 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_yv_xy(av), 'units', & 807 811 'meters' ) 808 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(366 )812 CALL handle_netcdf_error( 'netcdf', 366 ) 809 813 810 814 ! … … 817 821 (/ id_dim_x_xy(av), id_dim_y_xy(av) /), & 818 822 id_var_zusi_xy(av) ) 819 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(421 )823 CALL handle_netcdf_error( 'netcdf', 421 ) 820 824 821 825 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_zusi_xy(av), & 822 826 'units', 'meters' ) 823 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(422 )827 CALL handle_netcdf_error( 'netcdf', 422 ) 824 828 825 829 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_zusi_xy(av), & 826 830 'long_name', 'zu(nzb_s_inner)' ) 827 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(423 )831 CALL handle_netcdf_error( 'netcdf', 423 ) 828 832 829 833 ! … … 832 836 (/ id_dim_x_xy(av), id_dim_y_xy(av) /), & 833 837 id_var_zwwi_xy(av) ) 834 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(424 )838 CALL handle_netcdf_error( 'netcdf', 424 ) 835 839 836 840 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_zwwi_xy(av), & 837 841 'units', 'meters' ) 838 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(425 )842 CALL handle_netcdf_error( 'netcdf', 425 ) 839 843 840 844 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_zwwi_xy(av), & 841 845 'long_name', 'zw(nzb_w_inner)' ) 842 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(426 )846 CALL handle_netcdf_error( 'netcdf', 426 ) 843 847 844 848 ENDIF … … 953 957 ENDIF 954 958 955 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(119 )959 CALL handle_netcdf_error( 'netcdf', 119 ) 956 960 ! 957 961 !-- Store the 'real' name of the variable (with *, for example) … … 960 964 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_do2d(av,i), & 961 965 'long_name', do2d(av,i) ) 962 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(120 )966 CALL handle_netcdf_error( 'netcdf', 120 ) 963 967 ! 964 968 !-- Define the variable's unit 965 969 nc_stat = NF90_PUT_ATT( id_set_xy(av), id_var_do2d(av,i), & 966 970 'units', TRIM( do2d_unit(av,i) ) ) 967 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 354 )971 CALL handle_netcdf_error( 'netcdf', 354 ) 968 972 ENDIF 969 973 … … 981 985 nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'VAR_LIST', & 982 986 var_list ) 983 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 121 )987 CALL handle_netcdf_error( 'netcdf', 121 ) 984 988 985 989 ! 986 990 !-- Leave NetCDF define mode 987 991 nc_stat = NF90_ENDDEF( id_set_xy(av) ) 988 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 122 )992 CALL handle_netcdf_error( 'netcdf', 122 ) 989 993 990 994 ! … … 1004 1008 netcdf_data, start = (/ 1 /), & 1005 1009 count = (/ ns /) ) 1006 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(123 )1010 CALL handle_netcdf_error( 'netcdf', 123 ) 1007 1011 1008 1012 ! … … 1018 1022 netcdf_data, start = (/ 1 /), & 1019 1023 count = (/ ns /) ) 1020 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(124 )1024 CALL handle_netcdf_error( 'netcdf', 124 ) 1021 1025 1022 1026 ! … … 1026 1030 netcdf_data, start = (/ 1 /), & 1027 1031 count = (/ ns /) ) 1028 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(125 )1032 CALL handle_netcdf_error( 'netcdf', 125 ) 1029 1033 1030 1034 DEALLOCATE( netcdf_data ) … … 1035 1039 (/ zu(nzb+1) /), start = (/ 1 /), & 1036 1040 count = (/ 1 /) ) 1037 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(126 )1041 CALL handle_netcdf_error( 'netcdf', 126 ) 1038 1042 1039 1043 ! … … 1047 1051 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_x_xy(av), netcdf_data, & 1048 1052 start = (/ 1 /), count = (/ nx+2 /) ) 1049 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(127 )1053 CALL handle_netcdf_error( 'netcdf', 127 ) 1050 1054 1051 1055 DO i = 0, nx+1 … … 1056 1060 netcdf_data, start = (/ 1 /), & 1057 1061 count = (/ nx+2 /) ) 1058 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(367 )1062 CALL handle_netcdf_error( 'netcdf', 367 ) 1059 1063 1060 1064 DEALLOCATE( netcdf_data ) … … 1070 1074 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_y_xy(av), netcdf_data, & 1071 1075 start = (/ 1 /), count = (/ ny+2 /)) 1072 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(128 )1076 CALL handle_netcdf_error( 'netcdf', 128 ) 1073 1077 1074 1078 DO i = 0, ny+1 … … 1079 1083 netcdf_data, start = (/ 1 /), & 1080 1084 count = (/ ny+2 /)) 1081 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(368 )1085 CALL handle_netcdf_error( 'netcdf', 368 ) 1082 1086 1083 1087 DEALLOCATE( netcdf_data ) … … 1091 1095 start = (/ 1, 1 /), & 1092 1096 count = (/ nx+2, ny+2 /) ) 1093 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(427 )1097 CALL handle_netcdf_error( 'netcdf', 427 ) 1094 1098 1095 1099 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av), & … … 1097 1101 start = (/ 1, 1 /), & 1098 1102 count = (/ nx+2, ny+2 /) ) 1099 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(428 )1103 CALL handle_netcdf_error( 'netcdf', 428 ) 1100 1104 1101 1105 ENDIF … … 1111 1115 nc_stat = NF90_GET_ATT( id_set_xy(av), NF90_GLOBAL, 'VAR_LIST', & 1112 1116 var_list_old ) 1113 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(129 )1117 CALL handle_netcdf_error( 'netcdf', 129 ) 1114 1118 1115 1119 var_list = ';' … … 1152 1156 !-- Get and compare the number of horizontal cross sections 1153 1157 nc_stat = NF90_INQ_VARID( id_set_xy(av), 'zu_xy', id_var_zu_xy(av) ) 1154 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(130 )1158 CALL handle_netcdf_error( 'netcdf', 130 ) 1155 1159 1156 1160 nc_stat = NF90_INQUIRE_VARIABLE( id_set_xy(av), id_var_zu_xy(av), & 1157 1161 dimids = id_dim_zu_xy_old ) 1158 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(131 )1162 CALL handle_netcdf_error( 'netcdf', 131 ) 1159 1163 id_dim_zu_xy(av) = id_dim_zu_xy_old(1) 1160 1164 1161 1165 nc_stat = NF90_INQUIRE_DIMENSION( id_set_xy(av), id_dim_zu_xy(av), & 1162 1166 len = ns_old ) 1163 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(132 )1167 CALL handle_netcdf_error( 'netcdf', 132 ) 1164 1168 1165 1169 IF ( ns /= ns_old ) THEN … … 1180 1184 1181 1185 nc_stat = NF90_GET_VAR( id_set_xy(av), id_var_zu_xy(av), netcdf_data ) 1182 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(133 )1186 CALL handle_netcdf_error( 'netcdf', 133 ) 1183 1187 1184 1188 DO i = 1, ns … … 1218 1222 !-- on the file. 1219 1223 nc_stat = NF90_INQ_VARID( id_set_xy(av), 'time', id_var_time_xy(av) ) 1220 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(134 )1224 CALL handle_netcdf_error( 'netcdf', 134 ) 1221 1225 1222 1226 nc_stat = NF90_INQUIRE_VARIABLE( id_set_xy(av), id_var_time_xy(av), & 1223 1227 dimids = id_dim_time_old ) 1224 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(135 )1228 CALL handle_netcdf_error( 'netcdf', 135 ) 1225 1229 id_dim_time_xy(av) = id_dim_time_old(1) 1226 1230 1227 1231 nc_stat = NF90_INQUIRE_DIMENSION( id_set_xy(av), id_dim_time_xy(av), & 1228 1232 len = do2d_xy_time_count(av) ) 1229 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(136 )1233 CALL handle_netcdf_error( 'netcdf', 136 ) 1230 1234 1231 1235 nc_stat = NF90_GET_VAR( id_set_xy(av), id_var_time_xy(av), & … … 1233 1237 start = (/ do2d_xy_time_count(av) /), & 1234 1238 count = (/ 1 /) ) 1235 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(137 )1239 CALL handle_netcdf_error( 'netcdf', 137 ) 1236 1240 1237 1241 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 1259 1263 nc_stat = NF90_INQ_VARID( id_set_xy(av), netcdf_var_name, & 1260 1264 id_var_do2d(av,i) ) 1261 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(138 )1265 CALL handle_netcdf_error( 'netcdf', 138 ) 1262 1266 ENDIF 1263 1267 i = i + 1 … … 1268 1272 nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'title', & 1269 1273 TRIM( run_description_header ) ) 1270 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(139 )1274 CALL handle_netcdf_error( 'netcdf', 139 ) 1271 1275 message_string = 'NetCDF file for cross-sections ' // & 1272 1276 TRIM( var ) // ' from previous run found.' // & … … 1281 1285 nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'Conventions', & 1282 1286 'COARDS' ) 1283 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(140 )1287 CALL handle_netcdf_error( 'netcdf', 140 ) 1284 1288 1285 1289 IF ( av == 0 ) THEN … … 1292 1296 TRIM( run_description_header ) // & 1293 1297 TRIM( time_average_text ) ) 1294 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(141 )1298 CALL handle_netcdf_error( 'netcdf', 141 ) 1295 1299 IF ( av == 1 ) THEN 1296 1300 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 1297 1301 nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'time_avg', & 1298 1302 TRIM( time_average_text ) ) 1299 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(141 )1303 CALL handle_netcdf_error( 'netcdf', 141 ) 1300 1304 ENDIF 1301 1305 … … 1304 1308 nc_stat = NF90_DEF_DIM( id_set_xz(av), 'time', NF90_UNLIMITED, & 1305 1309 id_dim_time_xz(av) ) 1306 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(142 )1310 CALL handle_netcdf_error( 'netcdf', 142 ) 1307 1311 1308 1312 nc_stat = NF90_DEF_VAR( id_set_xz(av), 'time', NF90_DOUBLE, & 1309 1313 id_dim_time_xz(av), id_var_time_xz(av) ) 1310 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(143 )1314 CALL handle_netcdf_error( 'netcdf', 143 ) 1311 1315 1312 1316 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_time_xz(av), 'units', & 1313 1317 'seconds') 1314 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(144 )1318 CALL handle_netcdf_error( 'netcdf', 144 ) 1315 1319 1316 1320 ! … … 1330 1334 !-- Define y-axis (for scalar position) 1331 1335 nc_stat = NF90_DEF_DIM( id_set_xz(av), 'y_xz', ns, id_dim_y_xz(av) ) 1332 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(145 )1336 CALL handle_netcdf_error( 'netcdf', 145 ) 1333 1337 1334 1338 nc_stat = NF90_DEF_VAR( id_set_xz(av), 'y_xz', NF90_DOUBLE, & 1335 1339 id_dim_y_xz(av), id_var_y_xz(av) ) 1336 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(146 )1340 CALL handle_netcdf_error( 'netcdf', 146 ) 1337 1341 1338 1342 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_y_xz(av), 'units', & 1339 1343 'meters' ) 1340 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(147 )1344 CALL handle_netcdf_error( 'netcdf', 147 ) 1341 1345 1342 1346 ! 1343 1347 !-- Define y-axis (for v position) 1344 1348 nc_stat = NF90_DEF_DIM( id_set_xz(av), 'yv_xz', ns, id_dim_yv_xz(av) ) 1345 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(369 )1349 CALL handle_netcdf_error( 'netcdf', 369 ) 1346 1350 1347 1351 nc_stat = NF90_DEF_VAR( id_set_xz(av), 'yv_xz', NF90_DOUBLE, & 1348 1352 id_dim_yv_xz(av), id_var_yv_xz(av) ) 1349 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(370 )1353 CALL handle_netcdf_error( 'netcdf', 370 ) 1350 1354 1351 1355 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_yv_xz(av), 'units', & 1352 1356 'meters' ) 1353 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(371 )1357 CALL handle_netcdf_error( 'netcdf', 371 ) 1354 1358 1355 1359 ! … … 1358 1362 nc_stat = NF90_DEF_VAR( id_set_xz(av), 'ind_y_xz', NF90_DOUBLE, & 1359 1363 id_dim_y_xz(av), id_var_ind_y_xz(av) ) 1360 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(148 )1364 CALL handle_netcdf_error( 'netcdf', 148 ) 1361 1365 1362 1366 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_ind_y_xz(av), 'units', & 1363 1367 'gridpoints') 1364 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(149 )1368 CALL handle_netcdf_error( 'netcdf', 149 ) 1365 1369 1366 1370 ! 1367 1371 !-- Define x-axis (for scalar position) 1368 1372 nc_stat = NF90_DEF_DIM( id_set_xz(av), 'x', nx+2, id_dim_x_xz(av) ) 1369 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(150 )1373 CALL handle_netcdf_error( 'netcdf', 150 ) 1370 1374 1371 1375 nc_stat = NF90_DEF_VAR( id_set_xz(av), 'x', NF90_DOUBLE, & 1372 1376 id_dim_x_xz(av), id_var_x_xz(av) ) 1373 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(151 )1377 CALL handle_netcdf_error( 'netcdf', 151 ) 1374 1378 1375 1379 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_x_xz(av), 'units', & 1376 1380 'meters' ) 1377 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(152 )1381 CALL handle_netcdf_error( 'netcdf', 152 ) 1378 1382 1379 1383 ! 1380 1384 !-- Define x-axis (for u position) 1381 1385 nc_stat = NF90_DEF_DIM( id_set_xz(av), 'xu', nx+2, id_dim_xu_xz(av) ) 1382 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(372 )1386 CALL handle_netcdf_error( 'netcdf', 372 ) 1383 1387 1384 1388 nc_stat = NF90_DEF_VAR( id_set_xz(av), 'xu', NF90_DOUBLE, & 1385 1389 id_dim_xu_xz(av), id_var_xu_xz(av) ) 1386 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(373 )1390 CALL handle_netcdf_error( 'netcdf', 373 ) 1387 1391 1388 1392 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_xu_xz(av), 'units', & 1389 1393 'meters' ) 1390 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(374 )1394 CALL handle_netcdf_error( 'netcdf', 374 ) 1391 1395 1392 1396 ! 1393 1397 !-- Define the two z-axes (zu and zw) 1394 1398 nc_stat = NF90_DEF_DIM( id_set_xz(av), 'zu', nz+2, id_dim_zu_xz(av) ) 1395 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(153 )1399 CALL handle_netcdf_error( 'netcdf', 153 ) 1396 1400 1397 1401 nc_stat = NF90_DEF_VAR( id_set_xz(av), 'zu', NF90_DOUBLE, & 1398 1402 id_dim_zu_xz(av), id_var_zu_xz(av) ) 1399 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(154 )1403 CALL handle_netcdf_error( 'netcdf', 154 ) 1400 1404 1401 1405 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_zu_xz(av), 'units', & 1402 1406 'meters' ) 1403 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(155 )1407 CALL handle_netcdf_error( 'netcdf', 155 ) 1404 1408 1405 1409 nc_stat = NF90_DEF_DIM( id_set_xz(av), 'zw', nz+2, id_dim_zw_xz(av) ) 1406 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(156 )1410 CALL handle_netcdf_error( 'netcdf', 156 ) 1407 1411 1408 1412 nc_stat = NF90_DEF_VAR( id_set_xz(av), 'zw', NF90_DOUBLE, & 1409 1413 id_dim_zw_xz(av), id_var_zw_xz(av) ) 1410 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(157 )1414 CALL handle_netcdf_error( 'netcdf', 157 ) 1411 1415 1412 1416 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_zw_xz(av), 'units', & 1413 1417 'meters' ) 1414 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(158 )1418 CALL handle_netcdf_error( 'netcdf', 158 ) 1415 1419 1416 1420 … … 1502 1506 var_list = TRIM( var_list ) // TRIM( do2d(av,i) ) // ';' 1503 1507 1504 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(159 )1508 CALL handle_netcdf_error( 'netcdf', 159 ) 1505 1509 ! 1506 1510 !-- Store the 'real' name of the variable (with *, for example) … … 1509 1513 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_do2d(av,i), & 1510 1514 'long_name', do2d(av,i) ) 1511 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(160 )1515 CALL handle_netcdf_error( 'netcdf', 160 ) 1512 1516 ! 1513 1517 !-- Define the variable's unit 1514 1518 nc_stat = NF90_PUT_ATT( id_set_xz(av), id_var_do2d(av,i), & 1515 1519 'units', TRIM( do2d_unit(av,i) ) ) 1516 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(355 )1520 CALL handle_netcdf_error( 'netcdf', 355 ) 1517 1521 ENDIF 1518 1522 … … 1530 1534 nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'VAR_LIST', & 1531 1535 var_list ) 1532 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(161 )1536 CALL handle_netcdf_error( 'netcdf', 161 ) 1533 1537 1534 1538 ! 1535 1539 !-- Leave NetCDF define mode 1536 1540 nc_stat = NF90_ENDDEF( id_set_xz(av) ) 1537 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(162 )1541 CALL handle_netcdf_error( 'netcdf', 162 ) 1538 1542 1539 1543 ! … … 1552 1556 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_y_xz(av), netcdf_data, & 1553 1557 start = (/ 1 /), count = (/ ns /) ) 1554 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(163 )1558 CALL handle_netcdf_error( 'netcdf', 163 ) 1555 1559 1556 1560 ! … … 1566 1570 netcdf_data, start = (/ 1 /), & 1567 1571 count = (/ ns /) ) 1568 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(375 )1572 CALL handle_netcdf_error( 'netcdf', 375 ) 1569 1573 1570 1574 ! … … 1574 1578 netcdf_data, start = (/ 1 /), & 1575 1579 count = (/ ns /) ) 1576 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 164 ) 1580 CALL handle_netcdf_error( 'netcdf', 164 ) 1581 1577 1582 1578 1583 DEALLOCATE( netcdf_data ) … … 1588 1593 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_x_xz(av), netcdf_data, & 1589 1594 start = (/ 1 /), count = (/ nx+2 /) ) 1590 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(165 )1595 CALL handle_netcdf_error( 'netcdf', 165 ) 1591 1596 1592 1597 DO i = 0, nx+1 … … 1597 1602 netcdf_data, start = (/ 1 /), & 1598 1603 count = (/ nx+2 /) ) 1599 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 376)1604 CALL handle_netcdf_error( 'netcdf', 377 ) 1600 1605 1601 1606 DEALLOCATE( netcdf_data ) … … 1609 1614 netcdf_data, start = (/ 1 /), & 1610 1615 count = (/ nz+2 /) ) 1611 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(166 )1616 CALL handle_netcdf_error( 'netcdf', 166 ) 1612 1617 1613 1618 netcdf_data(0:nz+1) = zw(nzb:nzt+1) … … 1615 1620 netcdf_data, start = (/ 1 /), & 1616 1621 count = (/ nz+2 /) ) 1617 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(167 )1622 CALL handle_netcdf_error( 'netcdf', 167 ) 1618 1623 1619 1624 DEALLOCATE( netcdf_data ) … … 1629 1634 nc_stat = NF90_GET_ATT( id_set_xz(av), NF90_GLOBAL, 'VAR_LIST', & 1630 1635 var_list_old ) 1631 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(168 )1636 CALL handle_netcdf_error( 'netcdf', 168 ) 1632 1637 1633 1638 var_list = ';' … … 1670 1675 !-- Get and compare the number of vertical cross sections 1671 1676 nc_stat = NF90_INQ_VARID( id_set_xz(av), 'y_xz', id_var_y_xz(av) ) 1672 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(169 )1677 CALL handle_netcdf_error( 'netcdf', 169 ) 1673 1678 1674 1679 nc_stat = NF90_INQUIRE_VARIABLE( id_set_xz(av), id_var_y_xz(av), & 1675 1680 dimids = id_dim_y_xz_old ) 1676 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(170 )1681 CALL handle_netcdf_error( 'netcdf', 170 ) 1677 1682 id_dim_y_xz(av) = id_dim_y_xz_old(1) 1678 1683 1679 1684 nc_stat = NF90_INQUIRE_DIMENSION( id_set_xz(av), id_dim_y_xz(av), & 1680 1685 len = ns_old ) 1681 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(171 )1686 CALL handle_netcdf_error( 'netcdf', 171 ) 1682 1687 1683 1688 IF ( ns /= ns_old ) THEN … … 1698 1703 1699 1704 nc_stat = NF90_GET_VAR( id_set_xz(av), id_var_y_xz(av), netcdf_data ) 1700 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(172 )1705 CALL handle_netcdf_error( 'netcdf', 172 ) 1701 1706 1702 1707 DO i = 1, ns … … 1736 1741 !-- on the file. 1737 1742 nc_stat = NF90_INQ_VARID( id_set_xz(av), 'time', id_var_time_xz(av) ) 1738 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(173 )1743 CALL handle_netcdf_error( 'netcdf', 173 ) 1739 1744 1740 1745 nc_stat = NF90_INQUIRE_VARIABLE( id_set_xz(av), id_var_time_xz(av), & 1741 1746 dimids = id_dim_time_old ) 1742 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(174 )1747 CALL handle_netcdf_error( 'netcdf', 174 ) 1743 1748 id_dim_time_xz(av) = id_dim_time_old(1) 1744 1749 1745 1750 nc_stat = NF90_INQUIRE_DIMENSION( id_set_xz(av), id_dim_time_xz(av), & 1746 1751 len = do2d_xz_time_count(av) ) 1747 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(175 )1752 CALL handle_netcdf_error( 'netcdf', 175 ) 1748 1753 1749 1754 nc_stat = NF90_GET_VAR( id_set_xz(av), id_var_time_xz(av), & … … 1751 1756 start = (/ do2d_xz_time_count(av) /), & 1752 1757 count = (/ 1 /) ) 1753 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(176 )1758 CALL handle_netcdf_error( 'netcdf', 176 ) 1754 1759 1755 1760 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 1777 1782 nc_stat = NF90_INQ_VARID( id_set_xz(av), netcdf_var_name, & 1778 1783 id_var_do2d(av,i) ) 1779 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(177 )1784 CALL handle_netcdf_error( 'netcdf', 177 ) 1780 1785 ENDIF 1781 1786 i = i + 1 … … 1786 1791 nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'title', & 1787 1792 TRIM( run_description_header ) ) 1788 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(178 )1793 CALL handle_netcdf_error( 'netcdf', 178 ) 1789 1794 message_string = 'NetCDF file for cross-sections ' // & 1790 1795 TRIM( var ) // ' from previous run found.' // & … … 1799 1804 nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'Conventions', & 1800 1805 'COARDS' ) 1801 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(179 )1806 CALL handle_netcdf_error( 'netcdf', 179 ) 1802 1807 1803 1808 IF ( av == 0 ) THEN … … 1810 1815 TRIM( run_description_header ) // & 1811 1816 TRIM( time_average_text ) ) 1812 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(180 )1817 CALL handle_netcdf_error( 'netcdf', 180 ) 1813 1818 IF ( av == 1 ) THEN 1814 1819 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 1815 1820 nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'time_avg', & 1816 1821 TRIM( time_average_text ) ) 1817 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(180 )1822 CALL handle_netcdf_error( 'netcdf', 180 ) 1818 1823 ENDIF 1819 1824 … … 1822 1827 nc_stat = NF90_DEF_DIM( id_set_yz(av), 'time', NF90_UNLIMITED, & 1823 1828 id_dim_time_yz(av) ) 1824 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(181 )1829 CALL handle_netcdf_error( 'netcdf', 181 ) 1825 1830 1826 1831 nc_stat = NF90_DEF_VAR( id_set_yz(av), 'time', NF90_DOUBLE, & 1827 1832 id_dim_time_yz(av), id_var_time_yz(av) ) 1828 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(182 )1833 CALL handle_netcdf_error( 'netcdf', 182 ) 1829 1834 1830 1835 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_time_yz(av), 'units', & 1831 1836 'seconds') 1832 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(183 )1837 CALL handle_netcdf_error( 'netcdf', 183 ) 1833 1838 1834 1839 ! … … 1848 1853 !-- Define x axis (for scalar position) 1849 1854 nc_stat = NF90_DEF_DIM( id_set_yz(av), 'x_yz', ns, id_dim_x_yz(av) ) 1850 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(184 )1855 CALL handle_netcdf_error( 'netcdf', 184 ) 1851 1856 1852 1857 nc_stat = NF90_DEF_VAR( id_set_yz(av), 'x_yz', NF90_DOUBLE, & 1853 1858 id_dim_x_yz(av), id_var_x_yz(av) ) 1854 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(185 )1859 CALL handle_netcdf_error( 'netcdf', 185 ) 1855 1860 1856 1861 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_x_yz(av), 'units', & 1857 1862 'meters' ) 1858 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(186 )1863 CALL handle_netcdf_error( 'netcdf', 186 ) 1859 1864 1860 1865 ! 1861 1866 !-- Define x axis (for u position) 1862 1867 nc_stat = NF90_DEF_DIM( id_set_yz(av), 'xu_yz', ns, id_dim_xu_yz(av) ) 1863 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(377 )1868 CALL handle_netcdf_error( 'netcdf', 377 ) 1864 1869 1865 1870 nc_stat = NF90_DEF_VAR( id_set_yz(av), 'xu_yz', NF90_DOUBLE, & 1866 1871 id_dim_xu_yz(av), id_var_xu_yz(av) ) 1867 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(378 )1872 CALL handle_netcdf_error( 'netcdf', 378 ) 1868 1873 1869 1874 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_xu_yz(av), 'units', & 1870 1875 'meters' ) 1871 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(379 )1876 CALL handle_netcdf_error( 'netcdf', 379 ) 1872 1877 1873 1878 ! … … 1876 1881 nc_stat = NF90_DEF_VAR( id_set_yz(av), 'ind_x_yz', NF90_DOUBLE, & 1877 1882 id_dim_x_yz(av), id_var_ind_x_yz(av) ) 1878 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(187 )1883 CALL handle_netcdf_error( 'netcdf', 187 ) 1879 1884 1880 1885 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_ind_x_yz(av), 'units', & 1881 1886 'gridpoints') 1882 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(188 )1887 CALL handle_netcdf_error( 'netcdf', 188 ) 1883 1888 1884 1889 ! 1885 1890 !-- Define y-axis (for scalar position) 1886 1891 nc_stat = NF90_DEF_DIM( id_set_yz(av), 'y', ny+2, id_dim_y_yz(av) ) 1887 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(189 )1892 CALL handle_netcdf_error( 'netcdf', 189 ) 1888 1893 1889 1894 nc_stat = NF90_DEF_VAR( id_set_yz(av), 'y', NF90_DOUBLE, & 1890 1895 id_dim_y_yz(av), id_var_y_yz(av) ) 1891 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(190 )1896 CALL handle_netcdf_error( 'netcdf', 190 ) 1892 1897 1893 1898 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_y_yz(av), 'units', & 1894 1899 'meters' ) 1895 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(191 )1900 CALL handle_netcdf_error( 'netcdf', 191 ) 1896 1901 1897 1902 ! 1898 1903 !-- Define y-axis (for v position) 1899 1904 nc_stat = NF90_DEF_DIM( id_set_yz(av), 'yv', ny+2, id_dim_yv_yz(av) ) 1900 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(380 )1905 CALL handle_netcdf_error( 'netcdf', 380 ) 1901 1906 1902 1907 nc_stat = NF90_DEF_VAR( id_set_yz(av), 'yv', NF90_DOUBLE, & 1903 1908 id_dim_yv_yz(av), id_var_yv_yz(av) ) 1904 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(381 )1909 CALL handle_netcdf_error( 'netcdf', 381 ) 1905 1910 1906 1911 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_yv_yz(av), 'units', & 1907 1912 'meters' ) 1908 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(382 )1913 CALL handle_netcdf_error( 'netcdf', 382 ) 1909 1914 1910 1915 ! 1911 1916 !-- Define the two z-axes (zu and zw) 1912 1917 nc_stat = NF90_DEF_DIM( id_set_yz(av), 'zu', nz+2, id_dim_zu_yz(av) ) 1913 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(192 )1918 CALL handle_netcdf_error( 'netcdf', 192 ) 1914 1919 1915 1920 nc_stat = NF90_DEF_VAR( id_set_yz(av), 'zu', NF90_DOUBLE, & 1916 1921 id_dim_zu_yz(av), id_var_zu_yz(av) ) 1917 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(193 )1922 CALL handle_netcdf_error( 'netcdf', 193 ) 1918 1923 1919 1924 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_zu_yz(av), 'units', & 1920 1925 'meters' ) 1921 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(194 )1926 CALL handle_netcdf_error( 'netcdf', 194 ) 1922 1927 1923 1928 nc_stat = NF90_DEF_DIM( id_set_yz(av), 'zw', nz+2, id_dim_zw_yz(av) ) 1924 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(195 )1929 CALL handle_netcdf_error( 'netcdf', 195 ) 1925 1930 1926 1931 nc_stat = NF90_DEF_VAR( id_set_yz(av), 'zw', NF90_DOUBLE, & 1927 1932 id_dim_zw_yz(av), id_var_zw_yz(av) ) 1928 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(196 )1933 CALL handle_netcdf_error( 'netcdf', 196 ) 1929 1934 1930 1935 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_zw_yz(av), 'units', & 1931 1936 'meters' ) 1932 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(197 )1937 CALL handle_netcdf_error( 'netcdf', 197 ) 1933 1938 1934 1939 … … 2020 2025 var_list = TRIM( var_list ) // TRIM( do2d(av,i) ) // ';' 2021 2026 2022 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(198 )2027 CALL handle_netcdf_error( 'netcdf', 198 ) 2023 2028 ! 2024 2029 !-- Store the 'real' name of the variable (with *, for example) … … 2027 2032 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_do2d(av,i), & 2028 2033 'long_name', do2d(av,i) ) 2029 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(199 )2034 CALL handle_netcdf_error( 'netcdf', 199 ) 2030 2035 ! 2031 2036 !-- Define the variable's unit 2032 2037 nc_stat = NF90_PUT_ATT( id_set_yz(av), id_var_do2d(av,i), & 2033 2038 'units', TRIM( do2d_unit(av,i) ) ) 2034 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(356 )2039 CALL handle_netcdf_error( 'netcdf', 356 ) 2035 2040 ENDIF 2036 2041 … … 2048 2053 nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'VAR_LIST', & 2049 2054 var_list ) 2050 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(200 )2055 CALL handle_netcdf_error( 'netcdf', 200 ) 2051 2056 2052 2057 ! 2053 2058 !-- Leave NetCDF define mode 2054 2059 nc_stat = NF90_ENDDEF( id_set_yz(av) ) 2055 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(201 )2060 CALL handle_netcdf_error( 'netcdf', 201 ) 2056 2061 2057 2062 ! … … 2070 2075 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_x_yz(av), netcdf_data, & 2071 2076 start = (/ 1 /), count = (/ ns /) ) 2072 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 202 )2077 CALL handle_netcdf_error( 'netcdf', 202 ) 2073 2078 2074 2079 ! … … 2083 2088 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_xu_yz(av), netcdf_data, & 2084 2089 start = (/ 1 /), count = (/ ns /) ) 2085 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 383 )2090 CALL handle_netcdf_error( 'netcdf', 383 ) 2086 2091 2087 2092 ! … … 2091 2096 netcdf_data, start = (/ 1 /), & 2092 2097 count = (/ ns /) ) 2093 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 203 )2098 CALL handle_netcdf_error( 'netcdf', 203 ) 2094 2099 2095 2100 DEALLOCATE( netcdf_data ) … … 2105 2110 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_y_yz(av), netcdf_data, & 2106 2111 start = (/ 1 /), count = (/ ny+2 /) ) 2107 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 204 )2112 CALL handle_netcdf_error( 'netcdf', 204 ) 2108 2113 2109 2114 DO j = 0, ny+1 … … 2114 2119 netcdf_data, start = (/ 1 /), & 2115 2120 count = (/ ny+2 /) ) 2116 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 384 )2121 CALL handle_netcdf_error( 'netcdf', 384 ) 2117 2122 2118 2123 DEALLOCATE( netcdf_data ) … … 2126 2131 netcdf_data, start = (/ 1 /), & 2127 2132 count = (/ nz+2 /) ) 2128 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 205 )2133 CALL handle_netcdf_error( 'netcdf', 205 ) 2129 2134 2130 2135 netcdf_data(0:nz+1) = zw(nzb:nzt+1) … … 2132 2137 netcdf_data, start = (/ 1 /), & 2133 2138 count = (/ nz+2 /) ) 2134 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 206 )2139 CALL handle_netcdf_error( 'netcdf', 206 ) 2135 2140 2136 2141 DEALLOCATE( netcdf_data ) … … 2146 2151 nc_stat = NF90_GET_ATT( id_set_yz(av), NF90_GLOBAL, 'VAR_LIST', & 2147 2152 var_list_old ) 2148 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(207 )2153 CALL handle_netcdf_error( 'netcdf', 207 ) 2149 2154 2150 2155 var_list = ';' … … 2187 2192 !-- Get and compare the number of vertical cross sections 2188 2193 nc_stat = NF90_INQ_VARID( id_set_yz(av), 'x_yz', id_var_x_yz(av) ) 2189 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(208 )2194 CALL handle_netcdf_error( 'netcdf', 208 ) 2190 2195 2191 2196 nc_stat = NF90_INQUIRE_VARIABLE( id_set_yz(av), id_var_x_yz(av), & 2192 2197 dimids = id_dim_x_yz_old ) 2193 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(209 )2198 CALL handle_netcdf_error( 'netcdf', 209 ) 2194 2199 id_dim_x_yz(av) = id_dim_x_yz_old(1) 2195 2200 2196 2201 nc_stat = NF90_INQUIRE_DIMENSION( id_set_yz(av), id_dim_x_yz(av), & 2197 2202 len = ns_old ) 2198 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(210 )2203 CALL handle_netcdf_error( 'netcdf', 210 ) 2199 2204 2200 2205 IF ( ns /= ns_old ) THEN … … 2215 2220 2216 2221 nc_stat = NF90_GET_VAR( id_set_yz(av), id_var_x_yz(av), netcdf_data ) 2217 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(211 )2222 CALL handle_netcdf_error( 'netcdf', 211 ) 2218 2223 2219 2224 DO i = 1, ns … … 2253 2258 !-- on the file. 2254 2259 nc_stat = NF90_INQ_VARID( id_set_yz(av), 'time', id_var_time_yz(av) ) 2255 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(212 )2260 CALL handle_netcdf_error( 'netcdf', 212 ) 2256 2261 2257 2262 nc_stat = NF90_INQUIRE_VARIABLE( id_set_yz(av), id_var_time_yz(av), & 2258 2263 dimids = id_dim_time_old ) 2259 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(213 )2264 CALL handle_netcdf_error( 'netcdf', 213 ) 2260 2265 id_dim_time_yz(av) = id_dim_time_old(1) 2261 2266 2262 2267 nc_stat = NF90_INQUIRE_DIMENSION( id_set_yz(av), id_dim_time_yz(av), & 2263 2268 len = do2d_yz_time_count(av) ) 2264 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(214 )2269 CALL handle_netcdf_error( 'netcdf', 214 ) 2265 2270 2266 2271 nc_stat = NF90_GET_VAR( id_set_yz(av), id_var_time_yz(av), & … … 2268 2273 start = (/ do2d_yz_time_count(av) /), & 2269 2274 count = (/ 1 /) ) 2270 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(215 )2275 CALL handle_netcdf_error( 'netcdf', 215 ) 2271 2276 2272 2277 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 2294 2299 nc_stat = NF90_INQ_VARID( id_set_yz(av), netcdf_var_name, & 2295 2300 id_var_do2d(av,i) ) 2296 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(216 )2301 CALL handle_netcdf_error( 'netcdf', 216 ) 2297 2302 ENDIF 2298 2303 i = i + 1 … … 2303 2308 nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'title', & 2304 2309 TRIM( run_description_header ) ) 2305 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(217 )2310 CALL handle_netcdf_error( 'netcdf', 217 ) 2306 2311 message_string = 'NetCDF file for cross-sections ' // & 2307 2312 TRIM( var ) // ' from previous run found.' // & … … 2320 2325 TRIM( run_description_header ) // & 2321 2326 TRIM( time_average_text ) ) 2322 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(218 )2327 CALL handle_netcdf_error( 'netcdf', 218 ) 2323 2328 2324 2329 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval_pr … … 2329 2334 TRIM( run_description_header ) ) 2330 2335 ENDIF 2331 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(219 )2336 CALL handle_netcdf_error( 'netcdf', 219 ) 2332 2337 2333 2338 ! … … 2335 2340 nc_stat = NF90_DEF_DIM( id_set_pr, 'time', NF90_UNLIMITED, & 2336 2341 id_dim_time_pr ) 2337 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(220 )2342 CALL handle_netcdf_error( 'netcdf', 220 ) 2338 2343 2339 2344 nc_stat = NF90_DEF_VAR( id_set_pr, 'time', NF90_DOUBLE, & 2340 2345 id_dim_time_pr, id_var_time_pr ) 2341 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(221 )2346 CALL handle_netcdf_error( 'netcdf', 221 ) 2342 2347 2343 2348 nc_stat = NF90_PUT_ATT( id_set_pr, id_var_time_pr, 'units', 'seconds') 2344 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(222 )2349 CALL handle_netcdf_error( 'netcdf', 222 ) 2345 2350 2346 2351 ! … … 2359 2364 nc_stat = NF90_DEF_DIM( id_set_pr, 'z'//TRIM(netcdf_var_name), & 2360 2365 nzt+2-nzb, id_dim_z_pr(i,0) ) 2361 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(223 )2366 CALL handle_netcdf_error( 'netcdf', 223 ) 2362 2367 2363 2368 nc_stat = NF90_DEF_VAR( id_set_pr, 'z'//TRIM(netcdf_var_name), & 2364 2369 NF90_DOUBLE, id_dim_z_pr(i,0), & 2365 2370 id_var_z_pr(i,0) ) 2366 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(224 )2371 CALL handle_netcdf_error( 'netcdf', 224 ) 2367 2372 2368 2373 nc_stat = NF90_PUT_ATT( id_set_pr, id_var_z_pr(i,0), 'units', & 2369 2374 'meters' ) 2370 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 225 ) 2371 2375 CALL handle_netcdf_error( 'netcdf', 225 ) 2372 2376 ! 2373 2377 !-- Define the variable … … 2375 2379 nc_precision(5), (/ id_dim_z_pr(i,0), & 2376 2380 id_dim_time_pr /), id_var_dopr(i,0) ) 2377 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(226 )2381 CALL handle_netcdf_error( 'netcdf', 226 ) 2378 2382 2379 2383 nc_stat = NF90_PUT_ATT( id_set_pr, id_var_dopr(i,0), & 2380 2384 'long_name', TRIM( data_output_pr(i) ) ) 2381 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(227 )2385 CALL handle_netcdf_error( 'netcdf', 227 ) 2382 2386 2383 2387 nc_stat = NF90_PUT_ATT( id_set_pr, id_var_dopr(i,0), & 2384 2388 'units', TRIM( dopr_unit(i) ) ) 2385 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(228 )2389 CALL handle_netcdf_error( 'netcdf', 228 ) 2386 2390 2387 2391 var_list = TRIM(var_list) // TRIM(netcdf_var_name) // ';' … … 2399 2403 'z'//TRIM(netcdf_var_name)//suffix, & 2400 2404 nzt+2-nzb, id_dim_z_pr(i,j) ) 2401 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(229 )2405 CALL handle_netcdf_error( 'netcdf', 229 ) 2402 2406 2403 2407 nc_stat = NF90_DEF_VAR( id_set_pr, & … … 2405 2409 nc_precision(5), id_dim_z_pr(i,j), & 2406 2410 id_var_z_pr(i,j) ) 2407 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(230 )2411 CALL handle_netcdf_error( 'netcdf', 230 ) 2408 2412 2409 2413 nc_stat = NF90_PUT_ATT( id_set_pr, id_var_z_pr(i,j), & 2410 2414 'units', 'meters' ) 2411 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(231 )2415 CALL handle_netcdf_error( 'netcdf', 231 ) 2412 2416 2413 2417 ! … … 2418 2422 (/ id_dim_z_pr(i,j), & 2419 2423 id_dim_time_pr /), id_var_dopr(i,j) ) 2420 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(232 )2424 CALL handle_netcdf_error( 'netcdf', 232 ) 2421 2425 2422 2426 nc_stat = NF90_PUT_ATT( id_set_pr, id_var_dopr(i,j), & … … 2424 2428 TRIM( data_output_pr(i) ) // ' SR ' & 2425 2429 // suffix(2:2) ) 2426 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(233 )2430 CALL handle_netcdf_error( 'netcdf', 233 ) 2427 2431 2428 2432 nc_stat = NF90_PUT_ATT( id_set_pr, id_var_dopr(i,j), & 2429 2433 'units', TRIM( dopr_unit(i) ) ) 2430 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(234 )2434 CALL handle_netcdf_error( 'netcdf', 234 ) 2431 2435 2432 2436 var_list = TRIM(var_list) // TRIM(netcdf_var_name) // & … … 2443 2447 !-- restart runs) 2444 2448 nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'VAR_LIST', var_list ) 2445 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(235 )2449 CALL handle_netcdf_error( 'netcdf', 235 ) 2446 2450 2447 2451 ! … … 2453 2457 nc_precision(5), (/ id_dim_time_pr /), & 2454 2458 id_var_norm_dopr(i) ) 2455 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(236 )2459 CALL handle_netcdf_error( 'netcdf', 236 ) 2456 2460 2457 2461 nc_stat = NF90_PUT_ATT( id_set_pr, id_var_norm_dopr(i), & 2458 2462 'long_name', & 2459 2463 TRIM( dopr_norm_longnames(i) ) ) 2460 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(237 )2464 CALL handle_netcdf_error( 'netcdf', 237 ) 2461 2465 2462 2466 ENDDO … … 2465 2469 !-- Leave NetCDF define mode 2466 2470 nc_stat = NF90_ENDDEF( id_set_pr ) 2467 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(238 )2471 CALL handle_netcdf_error( 'netcdf', 238 ) 2468 2472 2469 2473 ! … … 2476 2480 start = (/ 1 /), & 2477 2481 count = (/ nzt-nzb+2 /) ) 2478 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(239 )2482 CALL handle_netcdf_error( 'netcdf', 239 ) 2479 2483 2480 2484 ENDDO … … 2491 2495 nc_stat = NF90_GET_ATT( id_set_pr, NF90_GLOBAL, 'VAR_LIST', & 2492 2496 var_list_old ) 2493 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(240 )2497 CALL handle_netcdf_error( 'netcdf', 240 ) 2494 2498 2495 2499 var_list = ';' … … 2528 2532 !-- on the file. 2529 2533 nc_stat = NF90_INQ_VARID( id_set_pr, 'time', id_var_time_pr ) 2530 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(241 )2534 CALL handle_netcdf_error( 'netcdf', 241 ) 2531 2535 2532 2536 nc_stat = NF90_INQUIRE_VARIABLE( id_set_pr, id_var_time_pr, & 2533 2537 dimids = id_dim_time_old ) 2534 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(242 )2538 CALL handle_netcdf_error( 'netcdf', 242 ) 2535 2539 id_dim_time_pr = id_dim_time_old(1) 2536 2540 2537 2541 nc_stat = NF90_INQUIRE_DIMENSION( id_set_pr, id_dim_time_pr, & 2538 2542 len = dopr_time_count ) 2539 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(243 )2543 CALL handle_netcdf_error( 'netcdf', 243 ) 2540 2544 2541 2545 nc_stat = NF90_GET_VAR( id_set_pr, id_var_time_pr, & … … 2543 2547 start = (/ dopr_time_count /), & 2544 2548 count = (/ 1 /) ) 2545 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(244 )2549 CALL handle_netcdf_error( 'netcdf', 244 ) 2546 2550 2547 2551 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 2571 2575 nc_stat = NF90_INQ_VARID( id_set_pr, netcdf_var_name_base, & 2572 2576 id_var_dopr(i,0) ) 2573 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(245 )2577 CALL handle_netcdf_error( 'netcdf', 245 ) 2574 2578 ELSE 2575 2579 DO j = 0, statistic_regions … … 2578 2582 nc_stat = NF90_INQ_VARID( id_set_pr, netcdf_var_name, & 2579 2583 id_var_dopr(i,j) ) 2580 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(246 )2584 CALL handle_netcdf_error( 'netcdf', 246 ) 2581 2585 ENDDO 2582 2586 ENDIF … … 2590 2594 'NORM_' // TRIM( dopr_norm_names(i) ), & 2591 2595 id_var_norm_dopr(i) ) 2592 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(247 )2596 CALL handle_netcdf_error( 'netcdf', 247 ) 2593 2597 ENDDO 2594 2598 … … 2597 2601 nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'title', & 2598 2602 TRIM( run_description_header ) ) 2599 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(248 )2603 CALL handle_netcdf_error( 'netcdf', 248 ) 2600 2604 message_string = 'NetCDF file for vertical profiles ' // & 2601 2605 'from previous run found.' // & … … 2610 2614 nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title', & 2611 2615 TRIM( run_description_header ) ) 2612 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(249 )2616 CALL handle_netcdf_error( 'netcdf', 249 ) 2613 2617 2614 2618 ! … … 2616 2620 nc_stat = NF90_DEF_DIM( id_set_ts, 'time', NF90_UNLIMITED, & 2617 2621 id_dim_time_ts ) 2618 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(250 )2622 CALL handle_netcdf_error( 'netcdf', 250 ) 2619 2623 2620 2624 nc_stat = NF90_DEF_VAR( id_set_ts, 'time', NF90_DOUBLE, & 2621 2625 id_dim_time_ts, id_var_time_ts ) 2622 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(251 )2626 CALL handle_netcdf_error( 'netcdf', 251 ) 2623 2627 2624 2628 nc_stat = NF90_PUT_ATT( id_set_ts, id_var_time_ts, 'units', 'seconds') 2625 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(252 )2629 CALL handle_netcdf_error( 'netcdf', 252 ) 2626 2630 2627 2631 ! … … 2639 2643 nc_precision(6), (/ id_dim_time_ts /), & 2640 2644 id_var_dots(i,0) ) 2641 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(253 )2645 CALL handle_netcdf_error( 'netcdf', 253 ) 2642 2646 2643 2647 nc_stat = NF90_PUT_ATT( id_set_ts, id_var_dots(i,0), & 2644 2648 'long_name', TRIM( dots_label(i) ) ) 2645 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(254 )2649 CALL handle_netcdf_error( 'netcdf', 254 ) 2646 2650 2647 2651 nc_stat = NF90_PUT_ATT( id_set_ts, id_var_dots(i,0), & 2648 2652 'units', TRIM( dots_unit(i) ) ) 2649 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(255 )2653 CALL handle_netcdf_error( 'netcdf', 255 ) 2650 2654 2651 2655 var_list = TRIM(var_list) // TRIM(netcdf_var_name) // ';' … … 2663 2667 (/ id_dim_time_ts /), & 2664 2668 id_var_dots(i,j) ) 2665 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(256 )2669 CALL handle_netcdf_error( 'netcdf', 256 ) 2666 2670 2667 2671 nc_stat = NF90_PUT_ATT( id_set_ts, id_var_dots(i,j), & … … 2669 2673 TRIM( dots_label(i) ) // ' SR ' // & 2670 2674 suffix(2:2) ) 2671 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(257 )2675 CALL handle_netcdf_error( 'netcdf', 257 ) 2672 2676 2673 2677 var_list = TRIM(var_list) // TRIM(netcdf_var_name) // & … … 2684 2688 !-- restart runs) 2685 2689 nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'VAR_LIST', var_list ) 2686 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(258 )2690 CALL handle_netcdf_error( 'netcdf', 258 ) 2687 2691 2688 2692 ! 2689 2693 !-- Leave NetCDF define mode 2690 2694 nc_stat = NF90_ENDDEF( id_set_ts ) 2691 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(259 )2695 CALL handle_netcdf_error( 'netcdf', 259 ) 2692 2696 2693 2697 … … 2701 2705 nc_stat = NF90_GET_ATT( id_set_ts, NF90_GLOBAL, 'VAR_LIST', & 2702 2706 var_list_old ) 2703 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(260 )2707 CALL handle_netcdf_error( 'netcdf', 260 ) 2704 2708 2705 2709 var_list = ';' … … 2739 2743 !-- on the file. 2740 2744 nc_stat = NF90_INQ_VARID( id_set_ts, 'time', id_var_time_ts ) 2741 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(261 )2745 CALL handle_netcdf_error( 'netcdf', 261 ) 2742 2746 2743 2747 nc_stat = NF90_INQUIRE_VARIABLE( id_set_ts, id_var_time_ts, & 2744 2748 dimids = id_dim_time_old ) 2745 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(262 )2749 CALL handle_netcdf_error( 'netcdf', 262 ) 2746 2750 id_dim_time_ts = id_dim_time_old(1) 2747 2751 2748 2752 nc_stat = NF90_INQUIRE_DIMENSION( id_set_ts, id_dim_time_ts, & 2749 2753 len = dots_time_count ) 2750 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(263 )2754 CALL handle_netcdf_error( 'netcdf', 263 ) 2751 2755 2752 2756 nc_stat = NF90_GET_VAR( id_set_ts, id_var_time_ts, & … … 2754 2758 start = (/ dots_time_count /), & 2755 2759 count = (/ 1 /) ) 2756 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(264 )2760 CALL handle_netcdf_error( 'netcdf', 264 ) 2757 2761 2758 2762 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 2782 2786 nc_stat = NF90_INQ_VARID( id_set_ts, netcdf_var_name_base, & 2783 2787 id_var_dots(i,0) ) 2784 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(265 )2788 CALL handle_netcdf_error( 'netcdf', 265 ) 2785 2789 ELSE 2786 2790 DO j = 0, statistic_regions … … 2789 2793 nc_stat = NF90_INQ_VARID( id_set_ts, netcdf_var_name, & 2790 2794 id_var_dots(i,j) ) 2791 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(266 )2795 CALL handle_netcdf_error( 'netcdf', 266 ) 2792 2796 ENDDO 2793 2797 ENDIF … … 2799 2803 nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title', & 2800 2804 TRIM( run_description_header ) ) 2801 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(267 )2805 CALL handle_netcdf_error( 'netcdf', 267 ) 2802 2806 message_string = 'NetCDF file for time series ' // & 2803 2807 'from previous run found.' // & … … 2816 2820 TRIM( run_description_header ) // & 2817 2821 TRIM( time_average_text ) ) 2818 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(268 )2822 CALL handle_netcdf_error( 'netcdf', 268 ) 2819 2823 2820 2824 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval_sp … … 2825 2829 TRIM( run_description_header ) ) 2826 2830 ENDIF 2827 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(269 )2831 CALL handle_netcdf_error( 'netcdf', 269 ) 2828 2832 2829 2833 ! … … 2831 2835 nc_stat = NF90_DEF_DIM( id_set_sp, 'time', NF90_UNLIMITED, & 2832 2836 id_dim_time_sp ) 2833 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(270 )2837 CALL handle_netcdf_error( 'netcdf', 270 ) 2834 2838 2835 2839 nc_stat = NF90_DEF_VAR( id_set_sp, 'time', NF90_DOUBLE, & 2836 2840 id_dim_time_sp, id_var_time_sp ) 2837 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(271 )2841 CALL handle_netcdf_error( 'netcdf', 271 ) 2838 2842 2839 2843 nc_stat = NF90_PUT_ATT( id_set_sp, id_var_time_sp, 'units', 'seconds') 2840 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(272 )2844 CALL handle_netcdf_error( 'netcdf', 272 ) 2841 2845 2842 2846 ! … … 2853 2857 !-- Define vertical coordinate grid (zu grid) 2854 2858 nc_stat = NF90_DEF_DIM( id_set_sp, 'zu_sp', ns, id_dim_zu_sp ) 2855 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(273 )2859 CALL handle_netcdf_error( 'netcdf', 273 ) 2856 2860 2857 2861 nc_stat = NF90_DEF_VAR( id_set_sp, 'zu_sp', NF90_DOUBLE, & 2858 2862 id_dim_zu_sp, id_var_zu_sp ) 2859 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(274 )2863 CALL handle_netcdf_error( 'netcdf', 274 ) 2860 2864 2861 2865 nc_stat = NF90_PUT_ATT( id_set_sp, id_var_zu_sp, 'units', 'meters' ) 2862 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(275 )2866 CALL handle_netcdf_error( 'netcdf', 275 ) 2863 2867 2864 2868 ! 2865 2869 !-- Define vertical coordinate grid (zw grid) 2866 2870 nc_stat = NF90_DEF_DIM( id_set_sp, 'zw_sp', ns, id_dim_zw_sp ) 2867 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(276 )2871 CALL handle_netcdf_error( 'netcdf', 276 ) 2868 2872 2869 2873 nc_stat = NF90_DEF_VAR( id_set_sp, 'zw_sp', NF90_DOUBLE, & 2870 2874 id_dim_zw_sp, id_var_zw_sp ) 2871 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(277 )2875 CALL handle_netcdf_error( 'netcdf', 277 ) 2872 2876 2873 2877 nc_stat = NF90_PUT_ATT( id_set_sp, id_var_zw_sp, 'units', 'meters' ) 2874 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(278 )2878 CALL handle_netcdf_error( 'netcdf', 278 ) 2875 2879 2876 2880 ! 2877 2881 !-- Define x-axis 2878 2882 nc_stat = NF90_DEF_DIM( id_set_sp, 'k_x', nx/2, id_dim_x_sp ) 2879 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(279 )2883 CALL handle_netcdf_error( 'netcdf', 279 ) 2880 2884 2881 2885 nc_stat = NF90_DEF_VAR( id_set_sp, 'k_x', NF90_DOUBLE, id_dim_x_sp, & 2882 2886 id_var_x_sp ) 2883 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(280 )2887 CALL handle_netcdf_error( 'netcdf', 280 ) 2884 2888 2885 2889 nc_stat = NF90_PUT_ATT( id_set_sp, id_var_x_sp, 'units', 'm-1' ) 2886 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(281 )2890 CALL handle_netcdf_error( 'netcdf', 281 ) 2887 2891 2888 2892 ! 2889 2893 !-- Define y-axis 2890 2894 nc_stat = NF90_DEF_DIM( id_set_sp, 'k_y', ny/2, id_dim_y_sp ) 2891 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(282 )2895 CALL handle_netcdf_error( 'netcdf', 282 ) 2892 2896 2893 2897 nc_stat = NF90_DEF_VAR( id_set_sp, 'k_y', NF90_DOUBLE, id_dim_y_sp, & 2894 2898 id_var_y_sp ) 2895 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(283 )2899 CALL handle_netcdf_error( 'netcdf', 283 ) 2896 2900 2897 2901 nc_stat = NF90_PUT_ATT( id_set_sp, id_var_y_sp, 'units', 'm-1' ) 2898 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(284 )2902 CALL handle_netcdf_error( 'netcdf', 284 ) 2899 2903 2900 2904 ! … … 2945 2949 id_var_dospx(i) ) 2946 2950 ENDIF 2947 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(285 )2951 CALL handle_netcdf_error( 'netcdf', 285 ) 2948 2952 2949 2953 nc_stat = NF90_PUT_ATT( id_set_sp, id_var_dospx(i), & 2950 2954 'long_name', netcdf_var_name ) 2951 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(286 )2955 CALL handle_netcdf_error( 'netcdf', 286 ) 2952 2956 2953 2957 nc_stat = NF90_PUT_ATT( id_set_sp, id_var_dospx(i), & 2954 2958 'units', 'unknown' ) 2955 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(287 )2959 CALL handle_netcdf_error( 'netcdf', 287 ) 2956 2960 2957 2961 var_list = TRIM( var_list ) // TRIM( netcdf_var_name ) // ';' … … 2976 2980 id_var_dospy(i) ) 2977 2981 ENDIF 2978 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(288 )2982 CALL handle_netcdf_error( 'netcdf', 288 ) 2979 2983 2980 2984 nc_stat = NF90_PUT_ATT( id_set_sp, id_var_dospy(i), & 2981 2985 'long_name', netcdf_var_name ) 2982 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(289 )2986 CALL handle_netcdf_error( 'netcdf', 289 ) 2983 2987 2984 2988 nc_stat = NF90_PUT_ATT( id_set_sp, id_var_dospy(i), & 2985 2989 'units', 'unknown' ) 2986 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(290 )2990 CALL handle_netcdf_error( 'netcdf', 290 ) 2987 2991 2988 2992 var_list = TRIM( var_list ) // TRIM( netcdf_var_name ) // ';' … … 2998 3002 !-- restart runs) 2999 3003 nc_stat = NF90_PUT_ATT( id_set_sp, NF90_GLOBAL, 'VAR_LIST', var_list ) 3000 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(291 )3004 CALL handle_netcdf_error( 'netcdf', 291 ) 3001 3005 3002 3006 ! 3003 3007 !-- Leave NetCDF define mode 3004 3008 nc_stat = NF90_ENDDEF( id_set_sp ) 3005 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(292 )3009 CALL handle_netcdf_error( 'netcdf', 292 ) 3006 3010 3007 3011 ! … … 3014 3018 nc_stat = NF90_PUT_VAR( id_set_sp, id_var_zu_sp, netcdf_data, & 3015 3019 start = (/ 1 /), count = (/ ns /) ) 3016 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(293 )3020 CALL handle_netcdf_error( 'netcdf', 293 ) 3017 3021 3018 3022 ! … … 3021 3025 nc_stat = NF90_PUT_VAR( id_set_sp, id_var_zw_sp, netcdf_data, & 3022 3026 start = (/ 1 /), count = (/ ns /) ) 3023 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(294 )3027 CALL handle_netcdf_error( 'netcdf', 294 ) 3024 3028 3025 3029 DEALLOCATE( netcdf_data ) … … 3034 3038 nc_stat = NF90_PUT_VAR( id_set_sp, id_var_x_sp, netcdf_data, & 3035 3039 start = (/ 1 /), count = (/ nx/2 /) ) 3036 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(295 )3040 CALL handle_netcdf_error( 'netcdf', 295 ) 3037 3041 3038 3042 DEALLOCATE( netcdf_data ) … … 3045 3049 nc_stat = NF90_PUT_VAR( id_set_sp, id_var_y_sp, netcdf_data, & 3046 3050 start = (/ 1 /), count = (/ ny/2 /) ) 3047 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(296 )3051 CALL handle_netcdf_error( 'netcdf', 296 ) 3048 3052 3049 3053 DEALLOCATE( netcdf_data ) … … 3059 3063 nc_stat = NF90_GET_ATT( id_set_sp, NF90_GLOBAL, 'VAR_LIST', & 3060 3064 var_list_old ) 3061 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 297 ) 3062 3065 CALL handle_netcdf_error( 'netcdf', 297 ) 3063 3066 var_list = ';' 3064 3067 i = 1 … … 3102 3105 !-- Get and compare the number of vertical levels 3103 3106 nc_stat = NF90_INQ_VARID( id_set_sp, 'zu_sp', id_var_zu_sp ) 3104 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(298 )3107 CALL handle_netcdf_error( 'netcdf', 298 ) 3105 3108 3106 3109 nc_stat = NF90_INQUIRE_VARIABLE( id_set_sp, id_var_zu_sp, & 3107 3110 dimids = id_dim_zu_sp_old ) 3108 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(299 )3111 CALL handle_netcdf_error( 'netcdf', 299 ) 3109 3112 id_dim_zu_sp = id_dim_zu_sp_old(1) 3110 3113 3111 3114 nc_stat = NF90_INQUIRE_DIMENSION( id_set_sp, id_dim_zu_sp, & 3112 3115 len = ns_old ) 3113 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(300 )3116 CALL handle_netcdf_error( 'netcdf', 300 ) 3114 3117 3115 3118 IF ( ns /= ns_old ) THEN … … 3130 3133 3131 3134 nc_stat = NF90_GET_VAR( id_set_sp, id_var_zu_sp, netcdf_data ) 3132 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(301 )3135 CALL handle_netcdf_error( 'netcdf', 301 ) 3133 3136 3134 3137 DO i = 1, ns … … 3154 3157 !-- on the file. 3155 3158 nc_stat = NF90_INQ_VARID( id_set_sp, 'time', id_var_time_sp ) 3156 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(302 )3159 CALL handle_netcdf_error( 'netcdf', 302 ) 3157 3160 3158 3161 nc_stat = NF90_INQUIRE_VARIABLE( id_set_sp, id_var_time_sp, & 3159 3162 dimids = id_dim_time_old ) 3160 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(303 )3163 CALL handle_netcdf_error( 'netcdf', 303 ) 3161 3164 id_dim_time_sp = id_dim_time_old(1) 3162 3165 3163 3166 nc_stat = NF90_INQUIRE_DIMENSION( id_set_sp, id_dim_time_sp, & 3164 3167 len = dosp_time_count ) 3165 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(304 )3168 CALL handle_netcdf_error( 'netcdf', 304 ) 3166 3169 3167 3170 nc_stat = NF90_GET_VAR( id_set_sp, id_var_time_sp, & … … 3169 3172 start = (/ dosp_time_count /), & 3170 3173 count = (/ 1 /) ) 3171 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(305 )3174 CALL handle_netcdf_error( 'netcdf', 305 ) 3172 3175 3173 3176 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 3195 3198 nc_stat = NF90_INQ_VARID( id_set_sp, netcdf_var_name, & 3196 3199 id_var_dospx(i) ) 3197 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(306 )3200 CALL handle_netcdf_error( 'netcdf', 306 ) 3198 3201 ENDIF 3199 3202 … … 3202 3205 nc_stat = NF90_INQ_VARID( id_set_sp, netcdf_var_name, & 3203 3206 id_var_dospy(i) ) 3204 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(307 )3207 CALL handle_netcdf_error( 'netcdf', 307 ) 3205 3208 ENDIF 3206 3209 … … 3217 3220 TRIM( run_description_header ) // & 3218 3221 TRIM( time_average_text ) ) 3219 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(308 )3222 CALL handle_netcdf_error( 'netcdf', 308 ) 3220 3223 3221 3224 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval_sp … … 3226 3229 TRIM( run_description_header ) ) 3227 3230 ENDIF 3228 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(309 )3231 CALL handle_netcdf_error( 'netcdf', 309 ) 3229 3232 message_string = 'NetCDF file for spectra ' // & 3230 3233 'from previous run found.' // & … … 3239 3242 nc_stat = NF90_PUT_ATT( id_set_prt, NF90_GLOBAL, 'title', & 3240 3243 TRIM( run_description_header ) ) 3241 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(310 )3244 CALL handle_netcdf_error( 'netcdf', 310 ) 3242 3245 3243 3246 ! … … 3245 3248 nc_stat = NF90_DEF_DIM( id_set_prt, 'time', NF90_UNLIMITED, & 3246 3249 id_dim_time_prt ) 3247 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(311 )3250 CALL handle_netcdf_error( 'netcdf', 311 ) 3248 3251 3249 3252 nc_stat = NF90_DEF_VAR( id_set_prt, 'time', NF90_DOUBLE, & 3250 3253 id_dim_time_prt, id_var_time_prt ) 3251 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(312 )3254 CALL handle_netcdf_error( 'netcdf', 312 ) 3252 3255 3253 3256 nc_stat = NF90_PUT_ATT( id_set_prt, id_var_time_prt, 'units', & 3254 3257 'seconds' ) 3255 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(313 )3258 CALL handle_netcdf_error( 'netcdf', 313 ) 3256 3259 3257 3260 ! … … 3259 3262 nc_stat = NF90_DEF_DIM( id_set_prt, 'particle_number', & 3260 3263 maximum_number_of_particles, id_dim_prtnum ) 3261 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(314 )3264 CALL handle_netcdf_error( 'netcdf', 314 ) 3262 3265 3263 3266 nc_stat = NF90_DEF_VAR( id_set_prt, 'particle_number', NF90_DOUBLE, & 3264 3267 id_dim_prtnum, id_var_prtnum ) 3265 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(315 )3268 CALL handle_netcdf_error( 'netcdf', 315 ) 3266 3269 3267 3270 nc_stat = NF90_PUT_ATT( id_set_prt, id_var_prtnum, 'units', & 3268 3271 'particle number' ) 3269 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(316 )3272 CALL handle_netcdf_error( 'netcdf', 316 ) 3270 3273 3271 3274 ! … … 3273 3276 nc_stat = NF90_DEF_VAR( id_set_prt, 'real_num_of_prt', NF90_INT, & 3274 3277 id_dim_time_prt, id_var_rnop_prt ) 3275 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(317 )3278 CALL handle_netcdf_error( 'netcdf', 317 ) 3276 3279 3277 3280 nc_stat = NF90_PUT_ATT( id_set_prt, id_var_rnop_prt, 'units', & 3278 3281 'particle number' ) 3279 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(318 )3282 CALL handle_netcdf_error( 'netcdf', 318 ) 3280 3283 3281 3284 ! … … 3287 3290 (/ id_dim_prtnum, id_dim_time_prt /), & 3288 3291 id_var_prt(i) ) 3289 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(319 )3292 CALL handle_netcdf_error( 'netcdf', 319 ) 3290 3293 3291 3294 nc_stat = NF90_PUT_ATT( id_set_prt, id_var_prt(i), & 3292 3295 'long_name', TRIM( prt_var_names(i) ) ) 3293 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(320 )3296 CALL handle_netcdf_error( 'netcdf', 320 ) 3294 3297 3295 3298 nc_stat = NF90_PUT_ATT( id_set_prt, id_var_prt(i), & 3296 3299 'units', TRIM( prt_var_units(i) ) ) 3297 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(321 )3300 CALL handle_netcdf_error( 'netcdf', 321 ) 3298 3301 3299 3302 ENDDO … … 3302 3305 !-- Leave NetCDF define mode 3303 3306 nc_stat = NF90_ENDDEF( id_set_prt ) 3304 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(322 )3307 CALL handle_netcdf_error( 'netcdf', 322 ) 3305 3308 3306 3309 … … 3313 3316 !-- on the file. 3314 3317 nc_stat = NF90_INQ_VARID( id_set_prt, 'time', id_var_time_prt ) 3315 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(323 )3318 CALL handle_netcdf_error( 'netcdf', 323 ) 3316 3319 3317 3320 nc_stat = NF90_INQUIRE_VARIABLE( id_set_prt, id_var_time_prt, & 3318 3321 dimids = id_dim_time_old ) 3319 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(324 )3322 CALL handle_netcdf_error( 'netcdf', 324 ) 3320 3323 id_dim_time_prt = id_dim_time_old(1) 3321 3324 3322 3325 nc_stat = NF90_INQUIRE_DIMENSION( id_set_prt, id_dim_time_prt, & 3323 3326 len = prt_time_count ) 3324 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(325 )3327 CALL handle_netcdf_error( 'netcdf', 325 ) 3325 3328 3326 3329 nc_stat = NF90_GET_VAR( id_set_prt, id_var_time_prt, & … … 3328 3331 start = (/ prt_time_count /), & 3329 3332 count = (/ 1 /) ) 3330 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(326 )3333 CALL handle_netcdf_error( 'netcdf', 326 ) 3331 3334 3332 3335 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 3349 3352 nc_stat = NF90_INQ_VARID( id_set_prt, 'real_num_of_prt', & 3350 3353 id_var_rnop_prt ) 3351 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(327 )3354 CALL handle_netcdf_error( 'netcdf', 327 ) 3352 3355 3353 3356 DO i = 1, 17 … … 3355 3358 nc_stat = NF90_INQ_VARID( id_set_prt, prt_var_names(i), & 3356 3359 id_var_prt(i) ) 3357 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(328 )3360 CALL handle_netcdf_error( 'netcdf', 328 ) 3358 3361 3359 3362 ENDDO … … 3372 3375 nc_stat = NF90_PUT_ATT( id_set_pts, NF90_GLOBAL, 'title', & 3373 3376 TRIM( run_description_header ) ) 3374 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(396 )3377 CALL handle_netcdf_error( 'netcdf', 396 ) 3375 3378 3376 3379 ! … … 3378 3381 nc_stat = NF90_DEF_DIM( id_set_pts, 'time', NF90_UNLIMITED, & 3379 3382 id_dim_time_pts ) 3380 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(397 )3383 CALL handle_netcdf_error( 'netcdf', 397 ) 3381 3384 3382 3385 nc_stat = NF90_DEF_VAR( id_set_pts, 'time', NF90_DOUBLE, & 3383 3386 id_dim_time_pts, id_var_time_pts ) 3384 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(398 )3387 CALL handle_netcdf_error( 'netcdf', 398 ) 3385 3388 3386 3389 nc_stat = NF90_PUT_ATT( id_set_pts, id_var_time_pts, 'units', & 3387 3390 'seconds') 3388 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(399 )3391 CALL handle_netcdf_error( 'netcdf', 399 ) 3389 3392 3390 3393 ! … … 3412 3415 (/ id_dim_time_pts /), & 3413 3416 id_var_dopts(i,j) ) 3414 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(400 )3417 CALL handle_netcdf_error( 'netcdf', 400 ) 3415 3418 3416 3419 IF ( j == 0 ) THEN … … 3424 3427 suffix1(2:3) ) 3425 3428 ENDIF 3426 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(401 )3429 CALL handle_netcdf_error( 'netcdf', 401 ) 3427 3430 3428 3431 nc_stat = NF90_PUT_ATT( id_set_pts, id_var_dopts(i,j), & 3429 3432 'units', TRIM( dopts_unit(i) ) ) 3430 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(402 )3433 CALL handle_netcdf_error( 'netcdf', 402 ) 3431 3434 3432 3435 var_list = TRIM(var_list) // TRIM(netcdf_var_name) // & … … 3444 3447 nc_stat = NF90_PUT_ATT( id_set_pts, NF90_GLOBAL, 'VAR_LIST', & 3445 3448 var_list ) 3446 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 403 ) 3449 CALL handle_netcdf_error( 'netcdf', 403 ) 3450 3447 3451 3448 3452 ! 3449 3453 !-- Leave NetCDF define mode 3450 3454 nc_stat = NF90_ENDDEF( id_set_pts ) 3451 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(404 )3455 CALL handle_netcdf_error( 'netcdf', 404 ) 3452 3456 3453 3457 … … 3461 3465 nc_stat = NF90_GET_ATT( id_set_pts, NF90_GLOBAL, 'VAR_LIST', & 3462 3466 var_list_old ) 3463 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(405 )3467 CALL handle_netcdf_error( 'netcdf', 405 ) 3464 3468 3465 3469 var_list = ';' … … 3504 3508 !-- on the file. 3505 3509 nc_stat = NF90_INQ_VARID( id_set_pts, 'time', id_var_time_pts ) 3506 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(406 )3510 CALL handle_netcdf_error( 'netcdf', 406 ) 3507 3511 3508 3512 nc_stat = NF90_INQUIRE_VARIABLE( id_set_pts, id_var_time_pts, & 3509 3513 dimids = id_dim_time_old ) 3510 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(407 )3514 CALL handle_netcdf_error( 'netcdf', 407 ) 3511 3515 id_dim_time_pts = id_dim_time_old(1) 3512 3516 3513 3517 nc_stat = NF90_INQUIRE_DIMENSION( id_set_pts, id_dim_time_pts, & 3514 3518 len = dopts_time_count ) 3515 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(408 )3519 CALL handle_netcdf_error( 'netcdf', 408 ) 3516 3520 3517 3521 nc_stat = NF90_GET_VAR( id_set_pts, id_var_time_pts, & … … 3519 3523 start = (/ dopts_time_count /), & 3520 3524 count = (/ 1 /) ) 3521 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(409 )3525 CALL handle_netcdf_error( 'netcdf', 409 ) 3522 3526 3523 3527 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 3556 3560 nc_stat = NF90_INQ_VARID( id_set_pts, netcdf_var_name, & 3557 3561 id_var_dopts(i,j) ) 3558 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(410 )3562 CALL handle_netcdf_error( 'netcdf', 410 ) 3559 3563 3560 3564 IF ( number_of_particle_groups == 1 ) EXIT … … 3568 3572 nc_stat = NF90_PUT_ATT( id_set_pts, NF90_GLOBAL, 'title', & 3569 3573 TRIM( run_description_header ) ) 3570 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error(411 )3574 CALL handle_netcdf_error( 'netcdf', 411 ) 3571 3575 message_string = 'NetCDF file for particle time series ' // & 3572 3576 'from previous run found.' // & … … 3586 3590 3587 3591 3588 3589 SUBROUTINE handle_netcdf_error( errno ) 3592 SUBROUTINE handle_netcdf_error( routine_name, errno ) 3590 3593 #if defined( __netcdf ) 3591 3594 … … 3597 3600 !------------------------------------------------------------------------------! 3598 3601 3602 USE control_parameters 3599 3603 USE netcdf 3600 3604 USE netcdf_control … … 3603 3607 IMPLICIT NONE 3604 3608 3609 CHARACTER(LEN=6) :: message_identifier 3610 CHARACTER(LEN=*) :: routine_name 3611 3605 3612 INTEGER :: errno 3606 3613 3607 3614 IF ( nc_stat /= NF90_NOERR ) THEN 3608 PRINT*, '+++ netcdf error ', errno,': ', TRIM( NF90_STRERROR( nc_stat ) ) 3609 #if defined( __parallel ) 3610 CALL MPI_ABORT( comm2d, 9999, ierr)3611 #else 3612 CALL local_stop3613 #endif 3615 3616 WRITE( message_identifier, '(''NC'',I4.4)' ) errno 3617 message_string = TRIM( NF90_STRERROR( nc_stat ) ) 3618 3619 CALL message( routine_name, message_identifier, 2, 2, 0, 6, 0 ) 3620 3614 3621 ENDIF 3615 3622
Note: See TracChangeset
for help on using the changeset viewer.