Skip to content
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

Merged
merged 3 commits into from
Mar 11, 2021

Conversation

nikizadehgfdl
Copy link
Contributor

  • This update closes issue make_coupler_mosaic tool does not reuse ATM grid for LND when they are the same #57
  • 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

- 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
@nikizadehgfdl
Copy link
Contributor Author

@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;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor Author

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);
Copy link
Contributor

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");
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@ngs333 ngs333 merged commit ad93abb into NOAA-GFDL:master Mar 11, 2021
uramirez8707 pushed a commit to uramirez8707/FRE-NCtools that referenced this pull request Mar 25, 2024
uramirez8707 pushed a commit to uramirez8707/FRE-NCtools that referenced this pull request Mar 25, 2024
uramirez8707 pushed a commit to uramirez8707/FRE-NCtools that referenced this pull request Mar 25, 2024
NOAA-GFDL#58 updated all sites to 18s intel compilers

See merge request fre/fre-nctools!114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make_coupler_mosaic tool does not reuse ATM grid for LND when they are the same
4 participants