@@ -61,6 +61,9 @@ function FUN_nc_OpenDAP_with_limit( filename0, filename1, dim_limit_name, dim_li
61
61
%
62
62
% % Another example for 2D lon/lat cases is attached to the end.
63
63
64
+ % By L. Chi, V1.62 2022-07-27: fix a bug: Some old codes will create a large nan matrix before downloading a large dataset no matter whether
65
+ % "divided_dim_str" is set or not. The nan matrix is may lead to an out-of-memory error and it is useless.
66
+ % Related codes have been commented and will be removed in a later version.
64
67
% By L. Chi, V1.61 2021-08-16: correct a typo ("compressiion_level" -> "compression_level")
65
68
% By L. Chi, V1.60 2021-07-28: Put all operations to source files in try-catch blocks to survive from internet/server errors.
66
69
%
@@ -421,22 +424,22 @@ function FUN_nc_OpenDAP_with_limit( filename0, filename1, dim_limit_name, dim_li
421
424
% The data will be donwloaded peice by piece by piece according to the last dim.
422
425
423
426
disp([datestr(now ) ' downloading ' info0 .Variables(iv ).Name ])
424
- if all( size(count ) == 1 ) % in case of count = 5 instead of [5 6 7 8]
425
- var_value = nan(count ,1 );
426
- else
427
- var_value = nan(count );
428
- end
427
+ % if all( size(count) == 1 ) % in case of count = 5 instead of [5 6 7 8]
428
+ % var_value = nan(count,1);
429
+ % else
430
+ % var_value = nan(count);
431
+ % end
429
432
divided_dim = FUN_struct_find_field_ind( VarDim_now , ' Name' , divided_dim_str ) ;
430
433
431
434
% make the divided_dim as the last dim.
432
- [var_value , tem_ind_reverse ] = FUN_dim_move_to_end(var_value , divided_dim ) ;
433
- tem_size = size( var_value );
434
- % check
435
- if count(divided_dim ) == tem_size(end )
436
- else
437
- error(' dimension error' )
438
- end
439
- var_value = reshape( var_value , [], count(divided_dim ) );
435
+ % [var_value, tem_ind_reverse] = FUN_dim_move_to_end(var_value, divided_dim );
436
+ % tem_size = size( var_value );
437
+ % % check
438
+ % if count(divided_dim) == tem_size(end)
439
+ % else
440
+ % error('dimension error')
441
+ % end
442
+ % var_value = reshape( var_value, [], count(divided_dim) );
440
443
441
444
442
445
% prepare for loading the index by groups
0 commit comments