ncap2: ERROR where_assign(): the "where statement" cannot handle a variable with limits on the Left-Hand-Side of an assign statement. Please remove the limts and try again
Unfortunately I don't know how to solve. It looks like the where statement doesn't like to manage a 2D variable (mask_t) and a 3D variable (sst_diff) even at a specific fixed time.
Do you have any suggestion?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just realized that I missed the diemnsion order in the script(:,:,t) instead of the correct (t,:,:). But unfortunately, this doesn't change the result.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Finally I managed to make it working.
I degraded from 3D to 2D arrays to work with the where condition, like this: ncap2 -h -s '
for(*t=0;t<time.size();t++)
{
if(data_occ(t)>5000) {maskt=sst_mask(t,:,:); sst_difft=votemper(t,:,:); where(maskt == 1)sst_difft=votemper(t,:,:)-adjusted_sea_surface_temperature(t,:,:)-273.15;elsewhere sst_difft=votemper.get_miss();sst_diff(t,:,:)=sst_difft;}
else{sst_diff(t,:,:)=votemper.get_miss();};
}'
It works but it seems to me a workaroud.
Any suggestion?
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear all,
I am not able to run a ncap2 command.
First I calculate a 1D variable from an L3 mask like this:
I want to make some calculation along the time axis, based on a threshold value of the occurrence of observed data, like this:
The error messagge is quite straighforward:
Unfortunately I don't know how to solve. It looks like the where statement doesn't like to manage a 2D variable (mask_t) and a 3D variable (sst_diff) even at a specific fixed time.
Do you have any suggestion?
I just realized that I missed the diemnsion order in the script
(:,:,t)instead of the correct(t,:,:). But unfortunately, this doesn't change the result.Finally I managed to make it working.
I degraded from 3D to 2D arrays to work with the where condition, like this:
ncap2 -h -s ' for(*t=0;t<time.size();t++) { if(data_occ(t)>5000) {maskt=sst_mask(t,:,:); sst_difft=votemper(t,:,:); where(maskt == 1)sst_difft=votemper(t,:,:)-adjusted_sea_surface_temperature(t,:,:)-273.15;elsewhere sst_difft=votemper.get_miss();sst_diff(t,:,:)=sst_difft;} else{sst_diff(t,:,:)=votemper.get_miss();}; }'It works but it seems to me a workaroud.
Any suggestion?
Thank you