NorESMhub / BLOM

Bergen Layered Ocean Model
GNU Lesser General Public License v3.0
16 stars 25 forks source link

Changing rhsctp to .true. in namelist_definition_blom.xml causes model to crash #343

Closed mvertens closed 4 months ago

mvertens commented 4 months ago

I have added the ability to run both the 2 degree and 1/4 degree blom in a prototype branch noresm2_5_alpha2_v2 (in my fork). However, running a DEBUG test - SMS_D_Ld3.T62_tn025.NOINY.betzy_intel - with blom master caused an invalid operation and it was in the following line

     2270                   if (rhsctp) then
     2271 c
     2272 c --- ---- -------- Topographic Rhines scale.
==>  2273                     rhisct=egr(i,k)/max(1.e-22*iL_mks2cgs,betatp(i,j))
     2274 c
     2275 c --- ---- --- ---- Mask rhsctp if flow is not along bottom topography
     2276 c                   1) option 1 with cosine to power of 10 will be >10

     2270                   if (rhsctp) then
     2271 c
     2272 c --- ---- -------- Topographic Rhines scale.

It looks like for i=32, j=1, and k=39 betatp(i,j) = NaN. This will only get trapped when you compile with the DEBUG flag set to true. It looks like rhsctp became equal to .true. in the hash 5f475375 (you can see this by doing a git blame on namelist_definition_blom.xml). I have also run DEBUG tests with both 1 degree and 2 degree blom and this problem did not exist.

AleksiNummelin commented 4 months ago

Thanks for catching this @mvertens! There must be something wrong with the remapping to 0.25 deg grid. I will check and produce a new version of the topographic beta file.

AleksiNummelin commented 4 months ago

I looked into this now, all of the files have nan values over land but nowhere else (the point i=32, j=1 is also on land). What is a bit weird is that this was not caught in 1 deg and 2 deg versions which also have the land-nan values. I have now reproduced the files such that land points have 0's (I replaced the old files on Betzy since this is just a minor change to files, but I do have the copy of the old ones), @mvertens could you try to run this again (thanks!)?

It might also just be that the 0.25 deg configuration has been tested so little that it crashes due to something else, but this is the first point where nans are caught (and probably egr is nan as well).

mvertens commented 4 months ago

@AleksiNummelin - thanks for doing this. I have confirmed that with these new files I can successfully run the following test ERS_D_Ld3.T62_tn025.NOINY.betzy_intel - which tests restarts in debug mode for the tn025 grid!

AleksiNummelin commented 4 months ago

Thanks @mvertens, I am closing this then, let's reopen if further issues related to rhsctp arise!