-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ATM grid for ATMxLND if ATM and LND grids are the same #58
Use ATM grid for ATMxLND if ATM and LND grids are the same #58
Conversation
- This update avoids clipping/calculating ATMxLND exchange grid if the ATM and LND grids are the same. It simply reuses ATM grid as ATMxLND. - The above logic is in the GCA algorithm but was missing from the non-GCA causing unnecessary inaccuracies in exchange grids. - This update also adds comments and verbosity to the tool that are useful for debugging
@ceblanton please assign this for reviews. Suggested reviewers are Jeff and yourself :) |
//min_atm_lat = 9999; /* dummy large value */ | ||
//for(na=0; na<ntile_atm; na++) { | ||
// min_lat = minval_double((nxa[na]+1)*(nya[na]+1), yatm[na]); | ||
// if(min_atm_lat > min_lat) min_atm_lat = min_lat; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikizadehgfdl Is there a reason you are leaving these as comments vs removing them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you agree it's not needed I'll remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think its needed, but we have these various version forever in github.
If it could be an option in the foreseeable future, I think then a comment is appropriate
|
||
if(lnd_same_as_atm) { | ||
if(na==nl && ja==jl && ia==il) { | ||
if(na_in != nl_in) printf("Error: na_in,nl_in,n_out,%d,%d,%d",na_in, nl_in, n_out); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikizadehgfdl Dont you want to call function mpp_error() here, or do you want to continue processing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I should error out here. I'll fix it. Thanks.
@@ -1571,7 +1643,10 @@ int main (int argc, char *argv[]) | |||
else | |||
xarea = poly_area(x_out, y_out, n_out )*ocn_frac; | |||
|
|||
if(xarea<0) printf("error: xarea<0, %f",xarea); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikizadehgfdl Dont you want to call mpp_error here and stop processing?
mpp_close(fid); | ||
free(mask); | ||
} | ||
if(nbad>0) { | ||
printf("make_coupler_mosaic: number of points with omask != ofrac is %d\n", nbad); | ||
mpp_error("make_coupler_mosaic: omask is not equal ocn_frac"); | ||
//mpp_error("make_coupler_mosaic: omask is not equal ocn_frac"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikizadehgfdl If processing should stop, mpp_error should be called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a tough one. If we error out here we won't be able to see how bad the constructed xgrid is. On the other hand if we don't error out the user might think all is all right. Perhaps we need a --debug switch that continues and if(! debug) mpp_error . Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikizadehgfdl You can make and set a fatal error status flag (just true or false if you like, or a counter) , print the immediate message(s), continue processing, and latter (possibly at the end) call mpp_error with another message.
NOAA-GFDL#58 updated all sites to 18s intel compilers See merge request fre/fre-nctools!114
the ATM and LND grids are the same. It simply reuses ATM grid as ATMxLND.
causing unnecessary inaccuracies in exchange grids.
useful for debugging