giacrossi / WenOOF

WENO interpolation Object Oriented Fortran library
3 stars 0 forks source link

Compiling error after commit #13

Closed giacrossi closed 7 years ago

giacrossi commented 7 years ago

After the commit ded4f4fc3032f34b60519f695a295c4ad18e032f I obtain the following error with intel compiler:

Compiling src/lib/type_weno_interpolator_js.f90 serially src/lib/type_weno_interpolator_js.f90(159): error #6460: This is not a field name that is defined in the encompassing structure. [ALPHA_BASE] call self%alpha%alpha_base%create(S = self%S) ----------------------^ src/lib/type_weno_interpolator_js.f90(159): error #6460: This is not a field name that is defined in the encompassing structure. [CREATE] call self%alpha%alpha_base%create(S = self%S) ---------------------------------^ src/lib/type_weno_interpolator_js.f90(126): remark #7712: This variable has not been used. [ALPHA_BASE_TYPE] subroutine create(self, constructor, IS_type, alpha_type, alpha_base_type, weights_opt_type, polynomial_type) ------------------------------------------------------------^ compilation aborted for src/lib/type_weno_interpolator_js.f90 (code 1)

With gfortran compiler the error is:

`Compiling src/lib/type_weno_interpolator_js.f90 serially src/lib/type_weno_interpolator_js.f90:159:32:

   call self%alpha%alpha_base%create(S = self%S)
                            1

Error: ‘alpha_base’ at (1) is not a member of the ‘weno_alpha_coefficient’ structure`

szaghi commented 7 years ago

I pulled the latest master.

Building the tests I obtained:

stefano@zaghi(05:44 PM Mon Oct 24) on master
~/downloads/WenOOF 7 files, 84Kb
→ FoBiS.py build -mode tests-intel-debug
...
Compiling src/tests/sin_reconstruction.f90 serially
src/tests/sin_reconstruction.f90(43): error #6631: A non-optional actual argument must be present when invoking a procedure with an explicit interface.   [IS_TYPE]
call factory%create(constructor=weno_constructor_upwind(S=S, eps=10._R_P**(-40)), interpolator=interpolator)
-----^

that is the first error. That is, in this calling you have API mismatch, namely IS_TYPE is not passed. This is not an OOP problem, it a simple sintax error. Fix all of such errors, please.

giacrossi commented 7 years ago

Develop, the problem is on the branch DEVELOP.

Giacomo Rossi, Ph.D., Space Engineer

Il 24 ott 2016 5:55 PM, "Stefano Zaghi" notifications@github.com ha scritto:

I pulled the latest master.

Building the tests I obtained:

stefano@zaghi(05:44 PM Mon Oct 24) on master~/downloads/WenOOF 7 files, 84Kb → FoBiS.py build -mode tests-intel-debug ... Compiling src/tests/sin_reconstruction.f90 serially src/tests/sin_reconstruction.f90(43): error #6631: A non-optional actual argument must be present when invoking a procedure with an explicit interface. [IS_TYPE] call factory%create(constructor=weno_constructor_upwind(S=S, eps=10._R_P**(-40)), interpolator=interpolator) -----^

that is the first error. That is, in this calling https://github.com/giacombum/WenOOF/blob/master/src/tests/sin_reconstruction.f90#L43 you have API mismatch, namely IS_TYPE is not passed. This is not an OOP problem, it a simple sintax error. Fix all of such errors, please.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/giacombum/WenOOF/issues/13#issuecomment-255782044, or mute the thread https://github.com/notifications/unsubscribe-auth/AGpxIdXkZV51GxIIxzYhQcJCKsOhrmr9ks5q3NTZgaJpZM4KdJJT .

szaghi commented 7 years ago

In my current Ifort 17.0.1, the error is different (syntax error, again), and yes, I am now using develop branch. See my log

stefano@zaghi(02:50 PM Tue Nov 15) on develop
~/downloads/WenOOF 8 files, 88Kb
→ git pull
Already up-to-date.

Compiling error(s)

stefano@zaghi(02:49 PM Tue Nov 15) on develop
~/downloads/WenOOF 7 files, 84Kb
→ FoBiS.py build -mode tests-intel-debug
Builder options
  Directories
    Building directory: "tests"
    Compiled-objects .o   directory: "tests/obj"
    Compiled-objects .mod directory: "tests/mod"
  Compiler options
    Vendor: "intel"
    Compiler command: "ifort"
    Module directory switch: "-module"
    Compiling flags: "-cpp -c -assume realloc_lhs -O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces#-fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std03"
    Linking flags: "-O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces#-fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std03"
    Preprocessing flags: ""
    Coverage: False
    Profile: False
  PreForM.py used: False
  PreForM.py output directory: None
  PreForM.py extensions processed: []

Building src/third_party/pyplot-fortran/src/tests/test.f90
Compiling src/third_party/pyplot-fortran/src/pyplot_module.f90 serially
src/third_party/pyplot-fortran/src/pyplot_module.f90(126): warning #5268: Extension to standard: The text exceeds right hand column allowed on the line.
    character(len=*),      intent(in), optional :: real_fmt        !! format string for real numbers (examples: '(E30.16)' [default], '*')
------------------------------------------------------------------------------------------------------------------------------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(298): warning #6477: Fortran 2003 does not allow this statement or directive.
        error stop 'Error in add_plot: pyplot class not properly initialized.'
-------------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(383): warning #6477: Fortran 2003 does not allow this statement or directive.
        error stop 'Error in add_plot: pyplot class not properly initialized.'
-------------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(445): warning #6477: Fortran 2003 does not allow this statement or directive.
        error stop 'Error in add_3d_plot: pyplot class not properly initialized.'
-------------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(532): warning #6477: Fortran 2003 does not allow this statement or directive.
        error stop 'Error in add_bar: pyplot class not properly initialized.'
-------------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(572): warning #6477: Fortran 2003 does not allow this statement or directive.
        error stop 'Error converting integer to string'
-------------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(603): warning #6477: Fortran 2003 does not allow this statement or directive.
        if (istat/=0) error stop 'Error in vec_to_string'
----------------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(675): warning #7410: Fortran 2003 does not allow this keyword.   [NEWUNIT]
        open(newunit=iunit, file=file, status='REPLACE', iostat=istat)
-------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(676): warning #6477: Fortran 2003 does not allow this statement or directive.
        if (istat/=0) error stop 'Error opening file.'
----------------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(685): warning #7416: Fortran 2003 does not allow this intrinsic procedure.   [EXECUTE_COMMAND_LINE]
        call execute_command_line(python_exe//' '//file)
-------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(693): warning #6477: Fortran 2003 does not allow this statement or directive.
        if (istat/=0) error stop 'Error closing file.'
----------------------^
src/third_party/pyplot-fortran/src/pyplot_module.f90(731): warning #6477: Fortran 2003 does not allow this statement or directive.
        error stop 'error in savefig: pyplot class not properly initialized.'
-------------------^

Compiling src/third_party/pyplot-fortran/src/tests/test.f90 serially
Linking tests/test
Target src/third_party/pyplot-fortran/src/tests/test.f90 has been successfully built
Builder options
  Directories
    Building directory: "tests"
    Compiled-objects .o   directory: "tests/obj"
    Compiled-objects .mod directory: "tests/mod"
  Compiler options
    Vendor: "intel"
    Compiler command: "ifort"
    Module directory switch: "-module"
    Compiling flags: "-cpp -c -assume realloc_lhs -O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces#-fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std03"
    Linking flags: "-O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces#-fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std03"
    Preprocessing flags: ""
    Coverage: False
    Profile: False
  PreForM.py used: False
  PreForM.py output directory: None
  PreForM.py extensions processed: []

Building src/third_party/PENF/src/tests/test_all.F90
Compiling src/third_party/PENF/src/lib/penf_global_parameters_variables.F90 serially
Compiling src/third_party/PENF/src/lib/penf_b_size.F90 serially
Compiling src/third_party/PENF/src/lib/penf_stringify.F90 serially
Compiling src/third_party/PENF/src/lib/penf.F90 serially
Compiling src/third_party/PENF/src/tests/test_all.F90 serially
Linking tests/test_all
Target src/third_party/PENF/src/tests/test_all.F90 has been successfully built
Builder options
  Directories
    Building directory: "tests"
    Compiled-objects .o   directory: "tests/obj"
    Compiled-objects .mod directory: "tests/mod"
  Compiler options
    Vendor: "intel"
    Compiler command: "ifort"
    Module directory switch: "-module"
    Compiling flags: "-cpp -c -assume realloc_lhs -O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces#-fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std03"
    Linking flags: "-O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces#-fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std03"
    Preprocessing flags: ""
    Coverage: False
    Profile: False
  PreForM.py used: False
  PreForM.py output directory: None
  PreForM.py extensions processed: []

Building src/third_party/PENF/src/tests/compact_real.f90
Compiling src/third_party/PENF/src/tests/compact_real.f90 serially
Linking tests/compact_real
Target src/third_party/PENF/src/tests/compact_real.f90 has been successfully built
Builder options
  Directories
    Building directory: "tests"
    Compiled-objects .o   directory: "tests/obj"
    Compiled-objects .mod directory: "tests/mod"
  Compiler options
    Vendor: "intel"
    Compiler command: "ifort"
    Module directory switch: "-module"
    Compiling flags: "-cpp -c -assume realloc_lhs -O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces#-fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std03"
    Linking flags: "-O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces#-fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std03"
    Preprocessing flags: ""
    Coverage: False
    Profile: False
  PreForM.py used: False
  PreForM.py output directory: None
  PreForM.py extensions processed: []

Building src/tests/sin_reconstruction.f90
Compiling src/lib/type_weno_alpha_coefficient.f90 serially
Compiling src/lib/type_weno_optimal_weights.f90 src/lib/type_weno_smoothness_indicators.f90 src/lib/type_weno_polynomials.f90 src/lib/type_weno_alpha_coefficient_js.f90 using 2 concurrent processes
Compiling src/lib/type_weno_alpha_coefficient_z.f90 serially
Compiling src/lib/type_weno_interpolator.f90 src/lib/type_weno_alpha_coefficient_m.f90 src/lib/type_weno_optimal_weights_js.f90 src/lib/type_weno_smoothness_indicators_js.f90 src/lib/type_weno_polynomials_js.f90 using 2 concurrent processes
Compiling src/lib/type_weno_interpolator_js.f90 serially
src/lib/type_weno_interpolator_js.f90(163): error #6460: This is not a field name that is defined in the encompassing structure.   [ALPHA_BASE]
      call self%alpha%alpha_base%create(S = self%S)
----------------------^
src/lib/type_weno_interpolator_js.f90(163): error #6460: This is not a field name that is defined in the encompassing structure.   [CREATE]
      call self%alpha%alpha_base%create(S = self%S)
---------------------------------^
src/lib/type_weno_interpolator_js.f90(130): remark #7712: This variable has not been used.   [ALPHA_BASE_TYPE]
  subroutine create(self, constructor, IS_type, alpha_type, alpha_base_type, weights_opt_type, polynomial_type)
------------------------------------------------------------^
compilation aborted for src/lib/type_weno_interpolator_js.f90 (code 1)

Errors meaning

At this line the invoked alpha_base member does not exist. Probably you have some quirks into the associate function.

giacrossi commented 7 years ago

This is the error I've searching for!!!!! Yes, the error is the same that I obtain after some changes in the alpha coefficient API.

The problem is the following: the abstract alpha type is defined here, the first concrete type (alpha_js) extends this type here, the second concrete type (alpha_z) extends the first concrete type here and the last concrete type (alpha_m) extends the second concrete type here. But this last concrete type, as you can see, contains this allocatable object that is initialized by means of this procedure.

Now the error that you (and I) obtain, I think that derives from the problem that the alpha abstract type hasn't the allocatable object that the concrete type alpha_m has, so when here the alpha_base object is used, the object isn't recognized, because the 'alpha' defined here is a simple abstract type and not a concrete type... but... how can I use the alpha_base when alpha_type=weno_alpha_coefficient_m? Because in that case, the concrete alpha type own the allocatable object alpha_base...

giacrossi commented 7 years ago

@szaghi maybe I've solved with the last commit (9fb38db4ff183fc009cb9d269c1e8a1127b5c56e). Obviously feel free to say what you think about, and to reopen the issue if you think is necessary.