Two bugs after building the solver

Hi everyone,

I am simulating fluidized beds with three edited code files: calc_force_dem, calc_collision_wall_mod and check_solids_dem. The first two files are used to define forces between particles and walls, and the third files is used to specify the time step. However, there are two bugs now.

(1) The solver reports the following errors. It shows that two symbol (variables) are found in module ‘calc_force_dem_mod’ and ‘calc_collision_wall’, but I have decleared these variables in ‘calc_force_dem_mod’ and ‘calc_collision_wall’.

D:\7_Simulation_cases\Cylinder\test\check_solids_dem.f:22:32:

USE CALC_FORCE_DEM_MOD, only: LIQUID_BRIDGE, TCOLL_WET_TMP
                            1

Error: Symbol ‘liquid_bridge’ referenced at (1) not found in module ‘calc_force_dem_mod’
D:\7_Simulation_cases\Cylinder\test\check_solids_dem.f:22:47:

USE CALC_FORCE_DEM_MOD, only: LIQUID_BRIDGE, TCOLL_WET_TMP
                                           1

Error: Symbol ‘tcoll_wet_tmp’ referenced at (1) not found in module ‘calc_force_dem_mod’
D:\7_Simulation_cases\Cylinder\test\check_solids_dem.f:23:33:

USE CALC_COLLISION_WALL, only: LIQUID_BRIDGE_W, TCOLL_WET_TMP_W
                             1

Error: Symbol ‘liquid_bridge_w’ referenced at (1) not found in module ‘calc_collision_wall’
D:\7_Simulation_cases\Cylinder\test\check_solids_dem.f:23:50:

USE CALC_COLLISION_WALL, only: LIQUID_BRIDGE_W, TCOLL_WET_TMP_W
                                              1

Error: Symbol ‘tcoll_wet_tmp_w’ referenced at (1) not found in module ‘calc_collision_wall’
D:\7_Simulation_cases\Cylinder\test\check_solids_dem.f:652:29:

         IF (Liquid_Bridge) THEN
                         1

Error: Symbol ‘liquid_bridge’ at (1) has no IMPLICIT type
D:\7_Simulation_cases\Cylinder\test\check_solids_dem.f:692:28:

      IF (Liquid_Bridge_W) THEN
                        1

Error: Symbol ‘liquid_bridge_w’ at (1) has no IMPLICIT type
D:\7_Simulation_cases\Cylinder\test\check_solids_dem.f:653:40:

            TCOLL_TMP = TCOLL_WET_TMP
                                    1

Error: Symbol ‘tcoll_wet_tmp’ at (1) has no IMPLICIT type
D:\7_Simulation_cases\Cylinder\test\check_solids_dem.f:693:39:

         TCOLL_TMP = TCOLL_WET_TMP_W
                                   1

Error: Symbol ‘tcoll_wet_tmp_w’ at (1) has no IMPLICIT type
CMakeFiles\udfs.dir\build.make:102: recipe for target ‘CMakeFiles/udfs.dir/D_/7_Simulation_cases/Cylinder/test/check_solids_dem.f.obj’ failed
mingw32-make.exe[2]: *** [CMakeFiles/udfs.dir/D_/7_Simulation_cases/Cylinder/test/check_solids_dem.f.obj] Error 1
CMakeFiles\Makefile2:101: recipe for target ‘CMakeFiles/udfs.dir/all’ failed
mingw32-make.exe[1]: *** [CMakeFiles/udfs.dir/all] Error 2
Makefile:134: recipe for target ‘all’ failed
mingw32-make.exe: *** [all] Error 2

(2) As a result of the above bugs may coming from the check_solids_dem file, the first two files calc_force_dem and calc_collision_wall_mod are considered, in order to check these two code files. The solver can be built successfully; however, it stops running just at the begining, within one time step.

I am not sure which parts of the code are wrong. Much thanks.

Fei - the messages from the compiler are important and tell you what’s wrong with your code, if you understand how to read them.

Let’s look at the first error:

USE CALC_FORCE_DEM_MOD, only: LIQUID_BRIDGE, TCOLL_WET_TMP
                              1
    Error: Symbol ‘liquid_bridge’ referenced at (1) not found in module ‘calc_force_dem_mod’

That digit 1 is pointing at the error location. LIQUID_BRIDGE is not defined. You are requesting this symbol to be imported from the CALC_FORCE_DEM module. That symbol is not part of MFiX but I see that you added it to your copy of calc_force_dem.f

! FEI YANG EDITING---BEGINING-----------------------------------------
      ! Local variables (for liquid bridge force)
      LOGICAL  :: LIQUID_BRIDGE 

You have added LIQUID_BRIDGE as a local variable (as the comment indicates), so it does not get turned into a module export.

Any module variables must be declared and initialized above the CONTAINS line at the top of the module.

Consulting a good FORTRAN reference might help. I recommend the book “Modern Fortran”.

– Charles