ClimateGlobalChange / tempestremap

TempestRemap: Remapping software for climate applications
Other
42 stars 29 forks source link

latest TR wont produce intbilin maps FE->FV #102

Closed mt5555 closed 2 years ago

mt5555 commented 2 years ago

TR used to produce nice integrated bilinear maps from FE -> FV, and would not produce intbilin maps FE->FE.

Latest code suggests these maps only work FE->FE.

could this be a mistake?

                } else if (it == "mono3") {
                        if (nMonotoneType != 0) {
                                _EXCEPTIONT("Multiple monotonicity specifications found (--mono) or (--method \"mono#\")");
                        }
                        if ((eSourceType == DiscretizationType_FV) || (eTargetType == DiscretizationType_FV)) {               
                                _EXCEPTIONT("--method \"mono3\" is only used when remapping to/from CGLL or DGLL grids");
                        }
                        nMonotoneType = 3;
jsbamboo commented 2 years ago

I encountered the same problem for the parameter "--in_type cgll --in_np 4 --out_type fv --mono3 --noconserve" in version 2.1.3

mt5555 commented 2 years ago

Just changing the code to:

                } else if (it == "mono3") {
                        if (nMonotoneType != 0) {
                                _EXCEPTIONT("Multiple monotonicity specifications found (--mono) or (--method \"mono#\")");
                        }
                        if ((eSourceType == DiscretizationType_FV) ) {               
                                _EXCEPTIONT("--method \"mono3\" is only used when remapping to/from CGLL or DGLL grids");
                        }
                        nMonotoneType = 3;

did allow me to produce an integrated bilinear map file ( --mono3 --noconserve, as @jsbamboo was using, but in the new code it looks like its --method mono3 --noconserve). The map file looked good - accurate and monotone.

paullric commented 2 years ago

Yes, interface was changed to remove “—mono2” and “—mono3” options, and replace those with “—method mono2” and “—method mono3”.

It does seem that there a bug when using these options, in that it throws an inappropriate error message. This should be fixed in commit ac2eda8c2aaddff25ebf6a27396f7304356922d9.

~ Paul

On Sep 12, 2022, at 1:15 PM, Mark Taylor @.***> wrote:

Just changing the code to: ''' } else if (it == "mono3") { if (nMonotoneType != 0) { _EXCEPTIONT("Multiple monotonicity specifications found (--mono) or (--method "mono#")"); } if ((eSourceType == DiscretizationType_FV) ) { _EXCEPTIONT("--method "mono3" is only used when remapping to/from CGLL or DGLL grids"); } nMonotoneType = 3; '''

did allow me to produce an integrated bilinear map file ( --mono3 --noconserve, as @jsbamboo https://github.com/jsbamboo was using, but in the new code it looks like its --method mono3 --noconserve). The map file looked good - accurate and monotone.

— Reply to this email directly, view it on GitHub https://github.com/ClimateGlobalChange/tempestremap/issues/102#issuecomment-1244360870, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIVPZCF2CBUHIX2Z7IBPILV56FOVANCNFSM6AAAAAAQJMZZV4. You are receiving this because you are subscribed to this thread.

jsbamboo commented 2 years ago

Yeah it works using --method mono3 --noconserve after removing eTargetType == DiscretizationType_FV in src @mt5555 .

Thanks! @mt5555 @paullric