nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

Rheology parameters not set #720

Open einola opened 1 month ago

einola commented 1 month ago

The rheology parameters in param all have the value 0 (or 0.) now.

I check this by putting an assert(params.P0 > 0.) somewhere in BBMStressUpdateStep.hpp (e.g. line 90).

Doing a git bisect reveals that

d5d88649d0f55438fb4f6299c2874ae2a1cb1f28 is the first bad commit
commit d5d88649d0f55438fb4f6299c2874ae2a1cb1f28
Author: Tim Spain <timothy.spain@nersc.no>
Date:   Mon Aug 26 12:04:36 2024 +0200

    Move calculation of the ice ocean stress to a common routine.

 dynamics/src/CGDynamicsKernel.cpp                | 25 ++++++++++++++--
 dynamics/src/include/BrittleCGDynamicsKernel.hpp | 37 +++---------------------
 dynamics/src/include/CGDynamicsKernel.hpp        | 24 +++++++++++++--
 dynamics/src/include/DynamicsKernel.hpp          | 32 ++++++++++++++++----
 dynamics/src/include/FreeDriftDynamicsKernel.hpp | 34 +++-------------------
 dynamics/src/include/VPCGDynamicsKernel.hpp      | 32 +++-----------------
 6 files changed, 82 insertions(+), 102 deletions(-)

I haven't investigated this further.

einola commented 1 month ago

Link to the commit is here.

einola commented 4 weeks ago

BBM still doesn't work, despite the hotfix.

einola commented 4 weeks ago

There was a compile warning in develop before the hotfix; maybe this can help:

====================[ Build | nextsim | Debug ]=================================
/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake --build /Users/einola/CLionProjects/nextsimdg/cmake-build-debug --target nextsim -j 6
[3/7] Building CXX object CMakeFiles/nextsimlib.dir/core/src/modules/DynamicsModule/module.cpp.o
In file included from /Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/module.cpp:12:
In file included from /Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp:11:
/Users/einola/CLionProjects/nextsimdg/dynamics/src/include/FreeDriftDynamicsKernel.hpp:39:70: warning: base class 'Nextsim::CGDynamicsKernel<6>' is uninitialized when used here to access 'Nextsim::CGDynamicsKernel<6>::u' [-Wuninitialized]
   39 |               sin(radians * paramsIn.ocean_turning_angle), paramsIn, u, v)
      |                                                                      ^
/Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp:30:11: note: in instantiation of member function 'Nextsim::FreeDriftDynamicsKernel<6>::FreeDriftDynamicsKernel' requested here
   30 |         , kernel(params)
      |           ^
In file included from /Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/module.cpp:12:
In file included from /Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/include/FreeDriftDynamics.hpp:11:
/Users/einola/CLionProjects/nextsimdg/dynamics/src/include/FreeDriftDynamicsKernel.hpp:39:73: warning: base class 'Nextsim::CGDynamicsKernel<6>' is uninitialized when used here to access 'Nextsim::CGDynamicsKernel<6>::v' [-Wuninitialized]
   39 |               sin(radians * paramsIn.ocean_turning_angle), paramsIn, u, v)
      |                                                                         ^
2 warnings generated.
[4/7] Building CXX object CMakeFiles/nextsimlib.dir/core/src/modules/DynamicsModule/MEVPDynamics.cpp.o
In file included from /Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/MEVPDynamics.cpp:10:
In file included from /Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp:15:
In file included from /Users/einola/CLionProjects/nextsimdg/dynamics/src/include/MEVPDynamicsKernel.hpp:12:
/Users/einola/CLionProjects/nextsimdg/dynamics/src/include/VPCGDynamicsKernel.hpp:58:59: warning: base class 'Nextsim::CGDynamicsKernel<6>' is uninitialized when used here to access 'Nextsim::CGDynamicsKernel<6>::u' [-Wuninitialized]
   58 |         : CGDynamicsKernel<DGadvection>(1., 0., paramsIn, u, v)
      |                                                           ^
/Users/einola/CLionProjects/nextsimdg/dynamics/src/include/MEVPDynamicsKernel.hpp:23:11: note: in instantiation of member function 'Nextsim::VPCGDynamicsKernel<6>::VPCGDynamicsKernel' requested here
   23 |         : VPCGDynamicsKernel<DGadvection>(MEVPStressStep, paramsIn)
      |           ^
/Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/MEVPDynamics.cpp:31:7: note: in instantiation of member function 'Nextsim::MEVPDynamicsKernel<6>::MEVPDynamicsKernel' requested here
   31 |     , kernel(params)
      |       ^
In file included from /Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/MEVPDynamics.cpp:10:
In file included from /Users/einola/CLionProjects/nextsimdg/core/src/modules/DynamicsModule/include/MEVPDynamics.hpp:15:
In file included from /Users/einola/CLionProjects/nextsimdg/dynamics/src/include/MEVPDynamicsKernel.hpp:12:
/Users/einola/CLionProjects/nextsimdg/dynamics/src/include/VPCGDynamicsKernel.hpp:58:62: warning: base class 'Nextsim::CGDynamicsKernel<6>' is uninitialized when used here to access 'Nextsim::CGDynamicsKernel<6>::v' [-Wuninitialized]
   58 |         : CGDynamicsKernel<DGadvection>(1., 0., paramsIn, u, v)
      |                                                              ^
2 warnings generated.
[7/7] Linking CXX executable nextsim

Build finished
timspainNERSC commented 4 weeks ago

I get the same warning in my branch where BBM definitely does work.

Add yes, we need to clean up those warnings.

einola commented 4 weeks ago

I've been trying to figure this out, but without any luck. It does not destroy all the ice if I turn off the advection, but that's as far as I've gotten.

timspainNERSC commented 4 weeks ago

Oh! Yes, I still need to debug the advection. That's why PR #668 is still a draft.