knaughten / mitgcm_python

Python scripts designed for my Weddell Sea and Amundsen Sea configurations of MITgcm.
26 stars 17 forks source link

Proposal to have the 'discard_and_fill' output more diagnostic information when crashing #7

Closed DaniJonesOcean closed 3 years ago

DaniJonesOcean commented 3 years ago

Hi @knaughten,

I think it could be helpful to have the discard_and_fill function in interpolation.py output a bit more information before crashing. The current function appears to iteratively try to fill values throughout the domain. Ultimately, if it can't fill all the cells, then it gives up and crashes.

I'd like to add some code to output the attempted initial conditions; the unfilled values would be set to missing_val, which would make it easier to see where in the domain the problems are coming from. We could set the filename to be something with the word "error" or "problem" in it, to make it clear that there is a problem.

If you like this idea, I'm happy to give coding it up a try. You can assign it to me if you like. (Let me know if there are existing helper functions that you'd like me to use to output the data.)

knaughten commented 3 years ago

Sure, that sounds good to me. Have a go at coding whatever output you find to be helpful. You will probably find the class NCfile in file_io.py helpful if you want to output in NetCDF, otherwise you can use the function write_binary (also in file_io.py).

Dr Kaitlin Naughten | Ocean-Ice Modeller | British Antarctic Survey

High Cross, Madingley Road, Cambridge CB3 0ET

Email: @.**@.>


From: Dan Jones @.> Sent: 29 March 2021 11:55 To: knaughten/mitgcm_python @.> Cc: Kaitlin Naughten - UKRI BAS @.>; Mention @.> Subject: [knaughten/mitgcm_python] Proposal to have the 'discard_and_fill' output more diagnostic information when crashing (#7)

Hi @knaughtenhttps://github.com/knaughten,

I think it could be helpful to have the discard_and_fill function in interpolation.py output a bit more information before crashing. The current function appears to iteratively try to fill values throughout the domain. Ultimately, if it can't fill all the cells, then it gives up and crashes.

I'd like to add some code to output the attempted initial conditions; the unfilled values would be set to missing_val, which would make it easier to see where in the domain the problems are coming from. We could set the filename to be something with the word "error" or "problem" in it, to make it clear that there is a problem.

If you like this idea, I'm happy to give coding it up a try. You can assign it to me if you like. (Let me know if there are existing helper functions that you'd like me to use to output the data.)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/knaughten/mitgcm_python/issues/7, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC45IKC4VUNRLTM4SJG6ABTTGBTBXANCNFSM4Z7LJCTA.

This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses. Opinions, conclusions or other information in this message and attachments that are not related directly to UKRI business are solely those of the author and do not represent the views of UKRI.

DaniJonesOcean commented 3 years ago

Addressed with pull request #11