- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I am having a problem while I am trying to run my program as debug.
I am facing the following error: error #8127: A null argument is not permitted when calling a Fortran routine which has an explicit interface defined.
I am not sure what is happening because in the release mode every thing work properly.
Thank you all in advance!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without seeing source, it's hard to know exactly what is going on. But I can reproduce this error with the following source:
call sub (1,,2) end subroutine sub (a,b,c) integer a,b,c end subroutine sub
and compiling with /warn:interface, which is enabled in a Debug configuration. Are you using the ,, syntax in a call? Is that deliberate?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve the /warn:interface option works well. And I am using the null option as the last dummy argument, but now almost everything is ok.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Instead of the null option, use %VAL(0) - it will do the same thing and won't trigger the error. Ideally you'd be using explicit interfaces and OPTIONAL instead of that non-standard feature.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve I will try to do this on my code!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, could you help me to understand this error:
error #6633: The type of the actual argument differs from the type of the dummy argument. [DFIT_OPT]
SUBROUTINE PROBABILITY_DISTRIBUTION_BEST_FIT(IRV,SELECTED_CRV,DFIT_OPT)
!-----------------------------------------------------------------------
! EXTERNAL VARIABLES
!
! FIT_OPTION Integer that indicates fit option:
! 1 = Minimum squares differ. fit (minimizes CHI-SQUARES goodness_of_fit test)
! 2 = Minimum CDF difference fit (minimizes KOLMOGOROV goodness_of_fit test)
! IRV Interpolated random variable to be fitted
! CRV Continuous random variable resulting from the fit
! DFIT_OPT Options for analytical distribution fit
!-----------------------------------------------------------------------
IMPLICIT NONE
! INTEGER FIT_OPTION
TYPE(INTERPOLATED_RANDOM_VARIABLE),INTENT(IN) :: IRV
TYPE( CONT_RANDOM_VARIABLE),INTENT(INOUT) :: SELECTED_CRV
TYPE(RESP_DIST_FIT_OPTIONS), INTENT(IN) :: DFIT_OPT
!-----------------------------------------------------------------------
! INTERNAL VARIABLES
!
! CRV Vector of continuous random variables containing trial fitting results
! GOF_TEST Goodness of fit of trial results, the trial with best GOF result gets selected
!-----------------------------------------------------------------------
INTEGER :: I = 1, N_TRIALS = 1
TYPE(CONT_RANDOM_VARIABLE) :: CRV(DFIT_OPT%N_TRIALS)
REAL*8 GOF_TEST(DFIT_OPT%N_TRIALS)
GOF_TEST = 0.D0
N_TRIALS = DFIT_OPT%N_TRIALS
DO I=1, N_TRIALS
CALL PROBABILITY_DISTRIBUTION_SINGLE_FIT(DFIT_OPT%TRIAL_DISTRIBUTION(I),DFIT_OPT,IRV,CRV(I)) !THE ERROR IS HERE
....
END MODULE CLASS_PROBABILITY_DISTRIBUTION_FIT
Then the subroutine is:
SUBROUTINE PROBABILITY_DISTRIBUTION_SINGLE_FIT(FIT_CODE,DFIT_OPT,IRV,RESULT_CRV)
USE STRAND_GLOBAL_VARIABLES
USE CLASS_PROBABILITY_PAPER
USE CLASS_PROBABILITY_DISTRIBUTION_FIT
USE LINEAR_DISTRIBUTION_FIT
USE NONLINEAR_DISTRIBUTION_FIT
!-----------------------------------------------------------------------
! EXTERNAL VARIABLES
!
! FIT_OPTION Integer that indicates fit option:
! 1 = Minimum squares differ. fit (minimizes CHI-SQUARES goodness_of_fit test)
! 2 = Minimum CDF difference fit (minimizes KOLMOGOROV goodness_of_fit test)
! FIT_CODE Code of probability distribution to fit
! DFIT_OPT Options for analytical distribution fit
! IRV Interpolated random variable to be fitted
! RESULT_CRV Continuous random variable resulting from the fit
! GOF_TEST Goodness of fit of result
!-----------------------------------------------------------------------
IMPLICIT NONE
INTEGER, INTENT(IN) :: FIT_CODE
TYPE(RESP_DIST_FIT_OPTIONS), INTENT(IN) :: DFIT_OPT
TYPE(INTERPOLATED_RANDOM_VARIABLE),INTENT(IN) :: IRV
TYPE( CONT_RANDOM_VARIABLE),INTENT(INOUT) :: RESULT_CRV
...
END SUBROUTINE PROBABILITY_DISTRIBUTION_SINGLE_FIT
Thank you all!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see anything wrong with that code. Try this - do a Build > Rebuild Solution and see if the error goes away.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I still have problem with null arguments and optional. Could you take a look?
This is the call procedure:
CALL TIME_VARIANT_RELIABILITY_OLD(NRV,RP_SET,RP_TIME,RP_RESULT,XMDX(1:NRV), )
This is the subroutine:
SUBROUTINE TIME_VARIANT_RELIABILITY_OLD(NRV,RP_SET,RP_TIME,RP_RESULT,R_OUTCOME,RV_SET)
!-----------------------------------------------------------------------
! EXTERNAL VARIABLES:
!
! NRV Number of continuous random process
! RP_SET
! R_OUTCOME Outcome of resistance variables, generated by MCS or by FPI
! RP_TIME Vector of time variant reliability information
! RP_RESULT Results of time variant reliability analysis
! RV_SET Random variable set, optional, only needed for ENSEMBLE CROSSING RATE
! failure probability evaluation
!-----------------------------------------------------------------------
IMPLICIT NONE
INTEGER, INTENT(IN) :: NRV
TYPE(RANDOM_PROCESS_SET), INTENT(IN) :: RP_SET
TYPE(RP_RELIABILITY_TIME), INTENT(IN) :: RP_TIME
TYPE(RP_RELIABILITY_RESULT),INTENT(INOUT) :: RP_RESULT
REAL(8),INTENT(IN) :: R_OUTCOME(NRV)
TYPE(RANDOM_VARIABLE_SET),INTENT(IN), OPTIONAL :: RV_SET
...
END SUBROUTINE TIME_VARIANT_RELIABILITY_OLD
This is the error:
error #8127: A null argument is not permitted when calling a Fortran routine which has an explicit interface defined. [TIME_VARIANT_RELIABILITY_OLD]
I cannot see where is the error. An interesting fact is that the release mode works properly, unlike the Debug mode. This error appear when I am in the Debug mode.
Thank you again.
Ketson Roberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you want to use OPTIONAL, just leave off the last argument, don't use a comma with nothing after it. An explicit interface is required to be visible to the caller. Make sure that you test for presence of the optional argument with PRESENT() before using it.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page