- Timestamp:
- Mar 19, 2010 5:30:02 AM (15 years ago)
- Location:
- palm/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/DOC/app/appendix_a.html
r493 r519 1 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 2 <html><head> 3 3 4 4 5 … … 1876 1877 <td style="vertical-align: top;"> 1877 1878 maximum_number_of_particles needs to be increased 1878 but this is not allowed with NetCDF output switched on 1879 </td><td style="vertical-align: top;"><br> 1879 but this is not allowed with netcdf_data_format < 3 1880 </td><td style="vertical-align: top;">NetCDF output is switched on (<a href="chapter_4.2.html#data_output_format">data_output_format</a> = <span style="font-style: italic;">'netcdf'</span>) and a NetCDF3 format is used (<a href="chapter_4.2.html#netcdf_data_format">netcdf_data_format </a>< <span style="font-style: italic;">3</span>).<br> 1881 <br> 1882 If output of particle data is switched on (see <a href="chapter_4.2.html#dt_write_particle_data">dt_write_particle_data</a>), the size of the particle array, given on each processor by <a href="chapter_4.2.html#maximum_number_of_particles">maximum_number_of_particles</a>, 1883 is not allowed to increase during the run, when the NetCDF3 data format 1884 is used, because NetCDF3 allows only one unlimited dimension, which is 1885 the time dimension. Anyhow, PALM tries to increase the size of the 1886 particle array, if the number of particles in a subdomain becomes 1887 larger than the size of this array. This may happen because of a flow 1888 convergence or because new sets of particles are released (see <a href="chapter_4.2.html#dt_prel">dt_prel</a>).<br> 1889 <br> 1890 This problem can be avoided by using the NetCDF4 data format (<a href="chapter_4.2.html#netcdf_data_format">netcdf_data_format</a> > <span style="font-style: italic;">2</span>), which allows more than one unlimited dimension.<br> 1891 <br> 1892 Alternatively, <a href="chapter_4.2.html#maximum_number_of_particles">maximum_number_of_particles</a> can be given a sufficiently large value.<br> 1880 1893 </td> 1881 1894 … … 1889 1902 <td style="vertical-align: top;"> 1890 1903 maximum_number_of_tails needs to be increased 1891 but this is not allowed with NetCDF output switched on 1892 </td><td style="vertical-align: top;"><br> 1904 but this is not allowed with netcdf_data_format < 3 1905 </td><td style="vertical-align: top;">NetCDF output is switched on (<a href="chapter_4.2.html#data_output_format">data_output_format</a> = <span style="font-style: italic;">'netcdf'</span>) and a NetCDF3 format is used (<a href="chapter_4.2.html#netcdf_data_format">netcdf_data_format</a> < <span style="font-style: italic;">3</span>).<br> 1906 1907 <br> 1908 1909 If output of particle data is switched on (see <a href="chapter_4.2.html#dt_write_particle_data">dt_write_particle_data</a>), the size of the particle tail array, given on each processor by <a href="chapter_4.2.html#maximum_number_of_tails">maximum_number_of_tails</a>, 1910 is not allowed to increase during the run, when the NetCDF3 data format 1911 is used, because NetCDF3 allows only one unlimited dimension, which is 1912 the time dimension. Anyhow, PALM tries to increase the size of the 1913 particle tail array, if the number of particle tails in a subdomain becomes 1914 larger than the size of this array. This may happen because of a flow 1915 convergence or because new sets of particles are released (see <a href="chapter_4.2.html#dt_prel">dt_prel</a>).<br> 1916 1917 <br> 1918 1919 This problem can be avoided by using the NetCDF4 data format (<a href="chapter_4.2.html#netcdf_data_format">netcdf_data_format</a> > <span style="font-style: italic;">2</span>), which allows more than one unlimited dimension.<br> 1920 1921 <br> 1922 1923 Alternatively, <a href="chapter_4.2.html#maximum_number_of_tails">maximum_number_of_tails</a> can be given a sufficiently large value. 1893 1924 </td> 1894 1925 -
palm/trunk/SOURCE/advec_particles.f90
r482 r519 5 5 ! ----------------- 6 6 ! TEST: PRINT statements on unit 9 (commented out) 7 ! NetCDF4 output format allows size of particle array to be extended 7 8 ! 8 9 ! Former revisions: … … 1978 1979 IF ( number_of_particles + number_of_initial_particles > & 1979 1980 maximum_number_of_particles ) THEN 1980 IF ( netcdf_output ) THEN1981 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 1981 1982 message_string = 'maximum_number_of_particles ' // & 1982 1983 'needs to be increased ' // & 1983 1984 '&but this is not allowed with ' // & 1984 ' NetCDF output switched on'1985 'netcdf_data_format < 3' 1985 1986 CALL message( 'advec_particles', 'PA0146', 2, 2, -1, 6, 1 ) 1986 1987 ELSE … … 1998 1999 IF ( number_of_tails + number_of_initial_tails > & 1999 2000 maximum_number_of_tails ) THEN 2000 IF ( netcdf_output ) THEN2001 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 2001 2002 message_string = 'maximum_number_of_tails ' // & 2002 2003 'needs to be increased ' // & 2003 2004 '&but this is not allowed wi' // & 2004 'th NetCDF output switched on'2005 'th netcdf_data_format < 3' 2005 2006 CALL message( 'advec_particles', 'PA0147', 2, 2, -1, 6, 1 ) 2006 2007 ELSE … … 2389 2390 maximum_number_of_particles ) & 2390 2391 THEN 2391 IF ( netcdf_output ) THEN2392 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 2392 2393 message_string = 'maximum_number_of_particles ' // & 2393 2394 'needs to be increased ' // & 2394 2395 '&but this is not allowed with ' // & 2395 ' NetCDF output switched on'2396 'netcdf-data_format < 3' 2396 2397 CALL message( 'advec_particles', 'PA0146', 2, 2, -1, 6, 1 ) 2397 2398 ELSE … … 2417 2418 IF ( number_of_tails+trrpt_count_recv > maximum_number_of_tails ) & 2418 2419 THEN 2419 IF ( netcdf_output ) THEN2420 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 2420 2421 message_string = 'maximum_number_of_tails ' // & 2421 2422 'needs to be increased ' // & 2422 2423 '&but this is not allowed wi'// & 2423 'th NetCDF output switched on'2424 'th netcdf_data_format < 3' 2424 2425 CALL message( 'advec_particles', 'PA0147', 2, 2, -1, 6, 1 ) 2425 2426 ELSE … … 2466 2467 maximum_number_of_particles ) & 2467 2468 THEN 2468 IF ( netcdf_output ) THEN2469 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 2469 2470 message_string = 'maximum_number_of_particles ' // & 2470 2471 'needs to be increased ' // & 2471 2472 '&but this is not allowed with '// & 2472 ' NetCDF output switched on'2473 'netcdf_data_format < 3' 2473 2474 CALL message( 'advec_particles', 'PA0146', 2, 2, -1, 6, 1 ) 2474 2475 ELSE … … 2494 2495 IF ( number_of_tails+trlpt_count_recv > maximum_number_of_tails ) & 2495 2496 THEN 2496 IF ( netcdf_output ) THEN2497 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 2497 2498 message_string = 'maximum_number_of_tails ' // & 2498 2499 'needs to be increased ' // & 2499 2500 '&but this is not allowed wi'// & 2500 'th NetCDF output switched on'2501 'th netcdf_data_format < 3' 2501 2502 CALL message( 'advec_particles', 'PA0147', 2, 2, -1, 6, 1 ) 2502 2503 ELSE … … 2836 2837 maximum_number_of_particles ) & 2837 2838 THEN 2838 IF ( netcdf_output ) THEN2839 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 2839 2840 message_string = 'maximum_number_of_particles ' // & 2840 2841 'needs to be increased ' // & 2841 2842 '&but this is not allowed with '// & 2842 ' NetCDF output switched on'2843 'netcdf_data_format < 3' 2843 2844 CALL message( 'advec_particles', 'PA0146', 2, 2, -1, 6, 1 ) 2844 2845 ELSE … … 2864 2865 IF ( number_of_tails+trnpt_count_recv > maximum_number_of_tails ) & 2865 2866 THEN 2866 IF ( netcdf_output ) THEN2867 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 2867 2868 message_string = 'maximum_number_of_tails ' // & 2868 2869 'needs to be increased ' // & 2869 2870 '&but this is not allowed wi' // & 2870 'th NetCDF output switched on'2871 'th netcdf_data_format < 3' 2871 2872 CALL message( 'advec_particles', 'PA0147', 2, 2, -1, 6, 1 ) 2872 2873 ELSE … … 2914 2915 maximum_number_of_particles ) & 2915 2916 THEN 2916 IF ( netcdf_output ) THEN2917 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 2917 2918 message_string = 'maximum_number_of_particles ' // & 2918 2919 'needs to be increased ' // & 2919 2920 '&but this is not allowed with ' // & 2920 ' NetCDF output switched on'2921 'netcdf_data_format < 3' 2921 2922 CALL message( 'advec_particles', 'PA0146', 2, 2, -1, 6, 1 ) 2922 2923 ELSE … … 2942 2943 IF ( number_of_tails+trspt_count_recv > maximum_number_of_tails ) & 2943 2944 THEN 2944 IF ( netcdf_output ) THEN2945 IF ( netcdf_output .AND. netcdf_data_format < 3 ) THEN 2945 2946 message_string = 'maximum_number_of_tails ' // & 2946 2947 'needs to be increased ' // & -
palm/trunk/SOURCE/check_open.f90
r494 r519 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! NetCDF4 support for particle data 7 7 ! 8 8 ! Former revisions: … … 1275 1275 1276 1276 ! 1277 !-- Create a new NetCDF output file 1278 IF ( netcdf_data_format > 1 ) THEN 1277 !-- Create a new NetCDF output file with requested NetCDF format 1278 IF ( netcdf_data_format == 1 ) THEN 1279 ! 1280 !-- Classic NetCDF format 1281 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_prt ) 1282 1283 ELSEIF ( netcdf_data_format == 2 ) THEN 1284 ! 1285 !-- 64bit-offset format 1279 1286 nc_stat = NF90_CREATE( filename, & 1280 1287 OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),& 1281 1288 id_set_prt ) 1282 ELSE 1283 nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_prt ) 1284 ENDIF 1289 1290 #if defined( __netcdf4 ) 1291 ELSEIF ( netcdf_data_format == 3 ) THEN 1292 ! 1293 !-- NetCDF4/HDF5 format, but no parallel output into a single file! 1294 nc_stat = NF90_CREATE( filename, & 1295 OR( NF90_NOCLOBBER, NF90_NETCDF4 ), & 1296 id_set_prt ) 1297 1298 ELSEIF ( netcdf_data_format == 4 ) THEN 1299 ! 1300 !-- NetCDF4/HDF5 format with classic model flag, but no parallel 1301 !-- output into a single file! 1302 nc_stat = NF90_CREATE( filename, & 1303 OR( NF90_NOCLOBBER, & 1304 OR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), & 1305 id_set_prt ) 1306 #endif 1307 ENDIF 1308 1285 1309 CALL handle_netcdf_error( 'check_open', 43 ) 1286 1310 -
palm/trunk/SOURCE/modules.f90
r494 r519 5 5 ! Current revisions: 6 6 ! ----------------- 7 ! 7 ! -replace_char, replace_by 8 8 ! 9 9 ! Former revisions: … … 976 976 #endif 977 977 978 INTEGER, PARAMETER :: dopr_norm_num = 7, dopts_num = 26, dots_max = 100, & 979 replace_num = 6 978 INTEGER, PARAMETER :: dopr_norm_num = 7, dopts_num = 26, dots_max = 100 980 979 981 980 INTEGER :: dots_num = 23 982 983 CHARACTER, DIMENSION( replace_num ) :: &984 replace_char = (/ '''', '"', '*', '/', '(', ')' /), &985 replace_by = (/ 'p' , 'p', 's', 'o', '_', '_' /)986 981 987 982 CHARACTER (LEN=6), DIMENSION(dopr_norm_num) :: dopr_norm_names = & -
palm/trunk/SOURCE/netcdf.f90
r494 r519 7 7 ! Current revisions: 8 8 ! ------------------ 9 ! 9 ! Particle number defined as unlimited dimension in case of NetCDF4 output, 10 ! special characters like * and " are now allowed for NetCDF variable names, 11 ! replacement of these characters removed, routine clean_netcdf_varname 12 ! removed 10 13 ! 11 14 ! Former revisions: … … 95 98 CHARACTER (LEN=4) :: grid_x, grid_y, grid_z 96 99 CHARACTER (LEN=6) :: mode 97 CHARACTER (LEN=10) :: netcdf_var_name, netcdf_var_name_base, & 98 precision, var 100 CHARACTER (LEN=10) :: netcdf_var_name, precision, var 99 101 CHARACTER (LEN=80) :: time_average_text 100 102 CHARACTER (LEN=2000) :: var_list, var_list_old … … 1556 1558 !-- surface variable. Define it with id_dim_zu1_xy. 1557 1559 IF ( INDEX( do2d(av,i), '*' ) /= 0 ) THEN 1558 ! 1559 !-- First, remove those characters not allowed by NetCDF 1560 netcdf_var_name = do2d(av,i) 1561 CALL clean_netcdf_varname( netcdf_var_name ) 1562 1563 nc_stat = NF90_DEF_VAR( id_set_xy(av), netcdf_var_name, & 1560 1561 nc_stat = NF90_DEF_VAR( id_set_xy(av), do2d(av,i), & 1564 1562 nc_precision(1), & 1565 1563 (/ id_dim_x_xy(av), id_dim_y_xy(av),& … … 1568 1566 id_var_do2d(av,i) ) 1569 1567 1570 var_list = TRIM(var_list) // TRIM( netcdf_var_name) // ';'1568 var_list = TRIM(var_list) // TRIM( do2d(av,i) ) // ';' 1571 1569 1572 1570 ELSE … … 1827 1825 DO WHILE ( do2d(av,i)(1:1) /= ' ' ) 1828 1826 IF ( INDEX( do2d(av,i), 'xy' ) /= 0 ) THEN 1829 netcdf_var_name = do2d(av,i) 1830 CALL clean_netcdf_varname( netcdf_var_name ) 1831 var_list = TRIM(var_list) // TRIM(netcdf_var_name) // ';' 1827 var_list = TRIM( var_list ) // TRIM( do2d(av,i) ) // ';' 1832 1828 ENDIF 1833 1829 i = i + 1 … … 1967 1963 DO WHILE ( do2d(av,i)(1:1) /= ' ' ) 1968 1964 IF ( INDEX( do2d(av,i), 'xy' ) /= 0 ) THEN 1969 netcdf_var_name = do2d(av,i) 1970 CALL clean_netcdf_varname( netcdf_var_name ) 1971 nc_stat = NF90_INQ_VARID( id_set_xy(av), netcdf_var_name, & 1965 nc_stat = NF90_INQ_VARID( id_set_xy(av), do2d(av,i), & 1972 1966 id_var_do2d(av,i) ) 1973 1967 CALL handle_netcdf_error( 'netcdf', 138 ) … … 2401 2395 DO WHILE ( do2d(av,i)(1:1) /= ' ' ) 2402 2396 IF ( INDEX( do2d(av,i), 'xz' ) /= 0 ) THEN 2403 netcdf_var_name = do2d(av,i) 2404 CALL clean_netcdf_varname( netcdf_var_name ) 2405 var_list = TRIM(var_list) // TRIM(netcdf_var_name) // ';' 2397 var_list = TRIM( var_list ) // TRIM( do2d(av,i) ) // ';' 2406 2398 ENDIF 2407 2399 i = i + 1 … … 2541 2533 DO WHILE ( do2d(av,i)(1:1) /= ' ' ) 2542 2534 IF ( INDEX( do2d(av,i), 'xz' ) /= 0 ) THEN 2543 netcdf_var_name = do2d(av,i) 2544 CALL clean_netcdf_varname( netcdf_var_name ) 2545 nc_stat = NF90_INQ_VARID( id_set_xz(av), netcdf_var_name, & 2535 nc_stat = NF90_INQ_VARID( id_set_xz(av), do2d(av,i), & 2546 2536 id_var_do2d(av,i) ) 2547 2537 CALL handle_netcdf_error( 'netcdf', 177 ) … … 2989 2979 DO WHILE ( do2d(av,i)(1:1) /= ' ' ) 2990 2980 IF ( INDEX( do2d(av,i), 'yz' ) /= 0 ) THEN 2991 netcdf_var_name = do2d(av,i) 2992 CALL clean_netcdf_varname( netcdf_var_name ) 2993 var_list = TRIM(var_list) // TRIM(netcdf_var_name) // ';' 2981 var_list = TRIM( var_list ) // TRIM( do2d(av,i) ) // ';' 2994 2982 ENDIF 2995 2983 i = i + 1 … … 3129 3117 DO WHILE ( do2d(av,i)(1:1) /= ' ' ) 3130 3118 IF ( INDEX( do2d(av,i), 'yz' ) /= 0 ) THEN 3131 netcdf_var_name = do2d(av,i) 3132 CALL clean_netcdf_varname( netcdf_var_name ) 3133 nc_stat = NF90_INQ_VARID( id_set_yz(av), netcdf_var_name, & 3119 nc_stat = NF90_INQ_VARID( id_set_yz(av), do2d(av,i), & 3134 3120 id_var_do2d(av,i) ) 3135 3121 CALL handle_netcdf_error( 'netcdf', 216 ) … … 3229 3215 var_list = ';' 3230 3216 DO i = 1, dopr_n 3231 !3232 !-- First, remove those characters not allowed by NetCDF3233 netcdf_var_name = data_output_pr(i)3234 CALL clean_netcdf_varname( netcdf_var_name )3235 3217 3236 3218 IF ( statistic_regions == 0 ) THEN … … 3238 3220 ! 3239 3221 !-- Define the z-axes (each variable gets its own z-axis) 3240 nc_stat = NF90_DEF_DIM( id_set_pr, 'z'//TRIM(netcdf_var_name), & 3222 nc_stat = NF90_DEF_DIM( id_set_pr, & 3223 'z' // TRIM( data_output_pr(i) ), & 3241 3224 nzt+2-nzb, id_dim_z_pr(i,0) ) 3242 3225 CALL handle_netcdf_error( 'netcdf', 223 ) 3243 3226 3244 nc_stat = NF90_DEF_VAR( id_set_pr, 'z'//TRIM(netcdf_var_name), & 3245 NF90_DOUBLE, id_dim_z_pr(i,0), & 3227 nc_stat = NF90_DEF_VAR( id_set_pr, & 3228 'z' // TRIM( data_output_pr(i) ), & 3229 NF90_DOUBLE, id_dim_z_pr(i,0), & 3246 3230 id_var_z_pr(i,0) ) 3247 3231 CALL handle_netcdf_error( 'netcdf', 224 ) … … 3252 3236 ! 3253 3237 !-- Define the variable 3254 nc_stat = NF90_DEF_VAR( id_set_pr, netcdf_var_name,&3238 nc_stat = NF90_DEF_VAR( id_set_pr, data_output_pr(i), & 3255 3239 nc_precision(5), (/ id_dim_z_pr(i,0), & 3256 3240 id_dim_time_pr /), id_var_dopr(i,0) ) … … 3265 3249 CALL handle_netcdf_error( 'netcdf', 228 ) 3266 3250 3267 var_list = TRIM( var_list) // TRIM(netcdf_var_name) //';'3251 var_list = TRIM( var_list ) // TRIM( data_output_pr(i) ) // ';' 3268 3252 3269 3253 ELSE … … 3277 3261 !-- Define the z-axes (each variable gets it own z-axis) 3278 3262 nc_stat = NF90_DEF_DIM( id_set_pr, & 3279 'z'//TRIM(netcdf_var_name)//suffix, &3263 'z'//TRIM(data_output_pr(i))//suffix, & 3280 3264 nzt+2-nzb, id_dim_z_pr(i,j) ) 3281 3265 CALL handle_netcdf_error( 'netcdf', 229 ) 3282 3266 3283 3267 nc_stat = NF90_DEF_VAR( id_set_pr, & 3284 'z'//TRIM(netcdf_var_name)//suffix, &3268 'z'//TRIM(data_output_pr(i))//suffix, & 3285 3269 nc_precision(5), id_dim_z_pr(i,j), & 3286 3270 id_var_z_pr(i,j) ) … … 3294 3278 !-- Define the variable 3295 3279 nc_stat = NF90_DEF_VAR( id_set_pr, & 3296 TRIM( netcdf_var_name) // suffix, &3280 TRIM(data_output_pr(i)) // suffix, & 3297 3281 nc_precision(5), & 3298 3282 (/ id_dim_z_pr(i,j), & … … 3310 3294 CALL handle_netcdf_error( 'netcdf', 234 ) 3311 3295 3312 var_list = TRIM( var_list) // TRIM(netcdf_var_name) // &3296 var_list = TRIM( var_list ) // TRIM( data_output_pr(i) ) // & 3313 3297 suffix // ';' 3314 3298 … … 3376 3360 DO i = 1, dopr_n 3377 3361 3378 netcdf_var_name = data_output_pr(i)3379 CALL clean_netcdf_varname( netcdf_var_name )3380 3381 3362 IF ( statistic_regions == 0 ) THEN 3382 var_list = TRIM( var_list) // TRIM(netcdf_var_name) // ';'3363 var_list = TRIM( var_list ) // TRIM( data_output_pr(i) ) // ';' 3383 3364 ELSE 3384 3365 DO j = 0, statistic_regions 3385 3366 WRITE ( suffix, '(''_'',I1)' ) j 3386 var_list = TRIM( var_list) // TRIM(netcdf_var_name) // &3367 var_list = TRIM( var_list ) // TRIM( data_output_pr(i) ) // & 3387 3368 suffix // ';' 3388 3369 ENDDO … … 3445 3426 DO i = 1, dopr_n 3446 3427 3447 netcdf_var_name_base = data_output_pr(i)3448 CALL clean_netcdf_varname( netcdf_var_name_base )3449 3450 3428 IF ( statistic_regions == 0 ) THEN 3451 nc_stat = NF90_INQ_VARID( id_set_pr, netcdf_var_name_base, &3429 nc_stat = NF90_INQ_VARID( id_set_pr, data_output_pr(i), & 3452 3430 id_var_dopr(i,0) ) 3453 3431 CALL handle_netcdf_error( 'netcdf', 245 ) … … 3455 3433 DO j = 0, statistic_regions 3456 3434 WRITE ( suffix, '(''_'',I1)' ) j 3457 netcdf_var_name = TRIM( netcdf_var_name_base) // suffix3435 netcdf_var_name = TRIM( data_output_pr(i) ) // suffix 3458 3436 nc_stat = NF90_INQ_VARID( id_set_pr, netcdf_var_name, & 3459 3437 id_var_dopr(i,j) ) … … 3525 3503 var_list = ';' 3526 3504 DO i = 1, dots_num 3527 !3528 !-- First, remove those characters not allowed by NetCDF3529 netcdf_var_name = dots_label(i)3530 CALL clean_netcdf_varname( netcdf_var_name )3531 3505 3532 3506 IF ( statistic_regions == 0 ) THEN 3533 3507 3534 nc_stat = NF90_DEF_VAR( id_set_ts, netcdf_var_name,&3508 nc_stat = NF90_DEF_VAR( id_set_ts, dots_label(i), & 3535 3509 nc_precision(6), (/ id_dim_time_ts /), & 3536 3510 id_var_dots(i,0) ) … … 3545 3519 CALL handle_netcdf_error( 'netcdf', 255 ) 3546 3520 3547 var_list = TRIM( var_list) // TRIM(netcdf_var_name) // ';'3521 var_list = TRIM( var_list ) // TRIM( dots_label(i) ) // ';' 3548 3522 3549 3523 ELSE … … 3555 3529 3556 3530 nc_stat = NF90_DEF_VAR( id_set_ts, & 3557 TRIM( netcdf_var_name ) // suffix,&3531 TRIM( dots_label(i) ) // suffix, & 3558 3532 nc_precision(6), & 3559 3533 (/ id_dim_time_ts /), & … … 3571 3545 CALL handle_netcdf_error( 'netcdf', 347 ) 3572 3546 3573 var_list = TRIM( var_list) // TRIM(netcdf_var_name) // &3547 var_list = TRIM( var_list ) // TRIM( dots_label(i) ) // & 3574 3548 suffix // ';' 3575 3549 … … 3607 3581 DO i = 1, dots_num 3608 3582 3609 netcdf_var_name = dots_label(i)3610 CALL clean_netcdf_varname( netcdf_var_name )3611 3612 3583 IF ( statistic_regions == 0 ) THEN 3613 var_list = TRIM( var_list) // TRIM(netcdf_var_name) // ';'3584 var_list = TRIM( var_list ) // TRIM( dots_label(i) ) // ';' 3614 3585 ELSE 3615 3586 DO j = 0, statistic_regions 3616 3587 WRITE ( suffix, '(''_'',I1)' ) j 3617 var_list = TRIM( var_list) // TRIM(netcdf_var_name) // &3588 var_list = TRIM( var_list ) // TRIM( dots_label(i) ) // & 3618 3589 suffix // ';' 3619 3590 ENDDO … … 3676 3647 DO i = 1, dots_num 3677 3648 3678 netcdf_var_name_base = dots_label(i)3679 CALL clean_netcdf_varname( netcdf_var_name_base )3680 3681 3649 IF ( statistic_regions == 0 ) THEN 3682 nc_stat = NF90_INQ_VARID( id_set_ts, netcdf_var_name_base, &3650 nc_stat = NF90_INQ_VARID( id_set_ts, dots_label(i), & 3683 3651 id_var_dots(i,0) ) 3684 3652 CALL handle_netcdf_error( 'netcdf', 265 ) … … 3686 3654 DO j = 0, statistic_regions 3687 3655 WRITE ( suffix, '(''_'',I1)' ) j 3688 netcdf_var_name = TRIM( netcdf_var_name_base) // suffix3656 netcdf_var_name = TRIM( dots_label(i) ) // suffix 3689 3657 nc_stat = NF90_INQ_VARID( id_set_ts, netcdf_var_name, & 3690 3658 id_var_dots(i,j) ) … … 3842 3810 !-- Define the variable 3843 3811 netcdf_var_name = TRIM( data_output_sp(i) ) // '_x' 3844 CALL clean_netcdf_varname( netcdf_var_name )3845 3812 IF ( TRIM( grid_z ) == 'zw' ) THEN 3846 3813 nc_stat = NF90_DEF_VAR( id_set_sp, netcdf_var_name, & … … 3873 3840 !-- Define the variable 3874 3841 netcdf_var_name = TRIM( data_output_sp(i) ) // '_y' 3875 CALL clean_netcdf_varname( netcdf_var_name )3876 3842 IF ( TRIM( grid_z ) == 'zw' ) THEN 3877 3843 nc_stat = NF90_DEF_VAR( id_set_sp, netcdf_var_name, & … … 4174 4140 ! 4175 4141 !-- Define particle coordinate (maximum particle number) 4176 nc_stat = NF90_DEF_DIM( id_set_prt, 'particle_number', & 4177 maximum_number_of_particles, id_dim_prtnum ) 4142 IF ( netcdf_data_format < 3 ) THEN 4143 nc_stat = NF90_DEF_DIM( id_set_prt, 'particle_number', & 4144 maximum_number_of_particles, id_dim_prtnum) 4145 ELSE 4146 ! 4147 !-- NetCDF4 allows more than one unlimited dimension 4148 nc_stat = NF90_DEF_DIM( id_set_prt, 'particle_number', & 4149 NF90_UNLIMITED, id_dim_prtnum) 4150 ENDIF 4178 4151 CALL handle_netcdf_error( 'netcdf', 314 ) 4179 4152 … … 4311 4284 DO i = 1, dopts_num 4312 4285 4313 !4314 !-- First, remove those characters not allowed by NetCDF4315 netcdf_var_name = dopts_label(i)4316 CALL clean_netcdf_varname( netcdf_var_name )4317 4318 4286 DO j = 0, number_of_particle_groups 4319 4287 … … 4325 4293 4326 4294 nc_stat = NF90_DEF_VAR( id_set_pts, & 4327 TRIM( netcdf_var_name ) // suffix1,&4295 TRIM( dopts_label(i) ) // suffix1, & 4328 4296 nc_precision(6), & 4329 4297 (/ id_dim_time_pts /), & … … 4347 4315 CALL handle_netcdf_error( 'netcdf', 402 ) 4348 4316 4349 var_list = TRIM( var_list) // TRIM(netcdf_var_name) // &4317 var_list = TRIM( var_list ) // TRIM( dopts_label(i) ) // & 4350 4318 suffix1 // ';' 4351 4319 … … 4385 4353 DO i = 1, dopts_num 4386 4354 4387 netcdf_var_name = dopts_label(i)4388 CALL clean_netcdf_varname( netcdf_var_name )4389 4390 4355 DO j = 0, number_of_particle_groups 4391 4356 … … 4396 4361 ENDIF 4397 4362 4398 var_list = TRIM( var_list) // TRIM(netcdf_var_name) // &4363 var_list = TRIM( var_list ) // TRIM( dopts_label(i) ) // & 4399 4364 suffix1 // ';' 4400 4365 … … 4459 4424 DO i = 1, dopts_num 4460 4425 4461 netcdf_var_name_base = dopts_label(i)4462 CALL clean_netcdf_varname( netcdf_var_name_base )4463 4464 4426 DO j = 0, number_of_particle_groups 4465 4427 … … 4470 4432 ENDIF 4471 4433 4472 netcdf_var_name = TRIM( netcdf_var_name_base) // suffix14434 netcdf_var_name = TRIM( dopts_label(i) ) // suffix1 4473 4435 4474 4436 nc_stat = NF90_INQ_VARID( id_set_pts, netcdf_var_name, & … … 4546 4508 #endif 4547 4509 END SUBROUTINE handle_netcdf_error 4548 4549 4550 4551 SUBROUTINE clean_netcdf_varname( string )4552 #if defined( __netcdf )4553 4554 !------------------------------------------------------------------------------!4555 !4556 ! Description:4557 ! ------------4558 ! Replace those characters in string which are not allowed by NetCDF.4559 !------------------------------------------------------------------------------!4560 4561 USE netcdf_control4562 4563 IMPLICIT NONE4564 4565 CHARACTER (LEN=10), INTENT(INOUT) :: string4566 4567 INTEGER :: i, ic4568 4569 DO i = 1, replace_num4570 DO4571 ic = INDEX( string, replace_char(i) )4572 IF ( ic /= 0 ) THEN4573 string(ic:ic) = replace_by(i)4574 ELSE4575 EXIT4576 ENDIF4577 ENDDO4578 ENDDO4579 4580 #endif4581 END SUBROUTINE clean_netcdf_varname
Note: See TracChangeset
for help on using the changeset viewer.