Hi,
I use the ISML function DQDAGS to calculate integral. The function F1, F2 need to return arrays. I don't know how to deal with it. The following is part of the code.
thanks for every help.
lur
****************************
..............
DO 55 I=1, N_ZONE
A(I) = 0.078D0 + 0.02D0 * (I-1)
B(I) = 0.078D0 + 0.02D0 * (I)
55 ENDDO
DO 60 N = 1, N_TEXP
INTEGR1(N)=0.0D0
INTEGR2(N)=0.0D0
INTEGR3(N)=0.0D0
DO 70 I =1, N_ZONE
CALL DQDAGS (F1, A(I), B(I), ERRABS,ERRREL,ANS1(I, N),ERR1(I, N))
CALL DQDAGS (F2, A(I), B(I), ERRABS,ERRREL,ANS2(I, N),ERR2(I, N))
CALL DQDAGS (F3, A(I), B(I), ERRABS,ERRREL,ANS3(I, N),ERR3(I, N))
70 ENDDO
INTEGR1(N)= INTEGR1(N) + ANS1(I, N)
INTEGR2(N)= INTEGR2(N) + ANS2(I, N)
INTEGR3(N)= INTEGR3(N) + ANS3(I, N)
60 ENDDO
..............
C ****************************************************************
DOUBLE PRECISION FUNCTION F1(R, SPAREA, N_TEXP, N_ZONE)
DOUBLE PRECISION I, N, II, NN
DOUBLE PRECISION N_TEXP, N_ZONE
DOUBLE PRECISION R !integration variable
DOUBLE PRECISION SPAREA(N_ZONE, N_TEXP)
DO 80 N = 1, N_TEXP
DO 81 I = 1, N_ZONE
F1(I, N) = SPAREA(I, N) * R
81 ENDDO
80 ENDDO
RETURN
END FUNCTION
C ****************************************************************
C ****************************************************************
DOUBLE PRECISION FUNCTION F2(R, N_TEXP,N_ZONE, HOLLIQ, THFILM, SPAREA, DIADRO)
DOUBLE PRECISION I, N, II, NN
DOUBLE PRECISION N_TEXP, N_ZONE
DOUBLE PRECISION R !integration variable
DOUBLE PRECISION HOLLIQ(N_TEXP)
DOUBLE PRECISION THFILM(N_TEXP)
DOUBLE PRECISION DIADRO(N_ZONE, N_TEXP)
DO 90 N = 1, N_TEXP
DO 100 I =1, N_ZONE
F2(I, N) = 6.D0 * (HOLLIQ(N)- THFILM(N)) * R / DIADRO(I, N)
100 ENDDO
90 ENDDO
RETURN
END FUNCTION
C ****************************************************************
C ****************************************************************
DOUBLE PRECISION FUNCTION F3(R)
DOUBLE PRECISION R !integration variable
F3= R
RETURN
END FUNCTION
C ****************************************************************
I use the ISML function DQDAGS to calculate integral. The function F1, F2 need to return arrays. I don't know how to deal with it. The following is part of the code.
thanks for every help.
lur
****************************
..............
DO 55 I=1, N_ZONE
A(I) = 0.078D0 + 0.02D0 * (I-1)
B(I) = 0.078D0 + 0.02D0 * (I)
55 ENDDO
DO 60 N = 1, N_TEXP
INTEGR1(N)=0.0D0
INTEGR2(N)=0.0D0
INTEGR3(N)=0.0D0
DO 70 I =1, N_ZONE
CALL DQDAGS (F1, A(I), B(I), ERRABS,ERRREL,ANS1(I, N),ERR1(I, N))
CALL DQDAGS (F2, A(I), B(I), ERRABS,ERRREL,ANS2(I, N),ERR2(I, N))
CALL DQDAGS (F3, A(I), B(I), ERRABS,ERRREL,ANS3(I, N),ERR3(I, N))
70 ENDDO
INTEGR1(N)= INTEGR1(N) + ANS1(I, N)
INTEGR2(N)= INTEGR2(N) + ANS2(I, N)
INTEGR3(N)= INTEGR3(N) + ANS3(I, N)
60 ENDDO
..............
C ****************************************************************
DOUBLE PRECISION FUNCTION F1(R, SPAREA, N_TEXP, N_ZONE)
DOUBLE PRECISION I, N, II, NN
DOUBLE PRECISION N_TEXP, N_ZONE
DOUBLE PRECISION R !integration variable
DOUBLE PRECISION SPAREA(N_ZONE, N_TEXP)
DO 80 N = 1, N_TEXP
DO 81 I = 1, N_ZONE
F1(I, N) = SPAREA(I, N) * R
81 ENDDO
80 ENDDO
RETURN
END FUNCTION
C ****************************************************************
C ****************************************************************
DOUBLE PRECISION FUNCTION F2(R, N_TEXP,N_ZONE, HOLLIQ, THFILM, SPAREA, DIADRO)
DOUBLE PRECISION I, N, II, NN
DOUBLE PRECISION N_TEXP, N_ZONE
DOUBLE PRECISION R !integration variable
DOUBLE PRECISION HOLLIQ(N_TEXP)
DOUBLE PRECISION THFILM(N_TEXP)
DOUBLE PRECISION DIADRO(N_ZONE, N_TEXP)
DO 90 N = 1, N_TEXP
DO 100 I =1, N_ZONE
F2(I, N) = 6.D0 * (HOLLIQ(N)- THFILM(N)) * R / DIADRO(I, N)
100 ENDDO
90 ENDDO
RETURN
END FUNCTION
C ****************************************************************
C ****************************************************************
DOUBLE PRECISION FUNCTION F3(R)
DOUBLE PRECISION R !integration variable
F3= R
RETURN
END FUNCTION
C ****************************************************************