²é¿´: 2127  |  »Ø¸´: 1

hznu2007

Ìú³æ (³õÈëÎÄ̳)

[ÇóÖú] FORTRAN³ÌÐòDO WHILE³öÏÖÓï¾ä´íÎó£¬ÇëÄÄλ¸ßÊÖÐÞ¸Äһϣ¨½ô¼±ÇóÖú£© ÒÑÓÐ1È˲ÎÓë

program main
  use IMSL
  implicit none
  external FCN
  
  real, parameter :: ERRREL=0.0001
  integer, parameter :: N=2
  integer, parameter :: ITMAX=100
  real :: XGUESS(N)=(/ 0.5, 0.5 /)
  real X(N) , FNORM

  CALL NEQNF(FCN, ERRREL, N, ITMAX, XGUESS, X, FNORM)
  write(*,*) X
  stop
end

subroutine FCN(XA, F, N)
   implicit none
   integer N
   external FK, FE
   double precision a, b, c, Romberg
   real, target :: XA(N)
   real F(N)
   real, pointer :: x, ita
   x=> XA(1)
   ita=> XA(2)
  
   c=Romberg(a, b, ita, FK)
   F(1)=2*c/3.14159265+0.5/sqrt(1-ita**2)-0.5
   c=Romberg(a, b, ita, FE)
   F(2)=2*c/3.14159265+0.5*sqrt(1-ita**2)-2.5+x*(ita**2)
   
   return
end subroutine

double precision function FE(g,ita)
  double precision g, ita
  FE=( 1-(ita*cos(g))*(ita*cos(g))) **0.5
end


double precision function FK(g,ita)
  double precision g, ita
  FK=( 1-(ita*cos(g))*(ita*cos(g))) **0.5
  FK=1/FK
end

double precision function Romberg(a, b, ita, f)
  double precision a, b, ita, f, eps
  integer m, i, k, point
  parameter(m=30, eps=1e-9)
  double precision t(m), er, h, tt, t2, l

  h=b-a
  k=1
  er=1
  point=1
  t(1)=h/2*(f(a,ita)+f(b,ita))

    do 10 while( (er.gt.eps).and.(k.lt.n))
       tt=t(1)

           t(1)=0
           do 20 i=1,point
           t(1)=t(1)+f(a+i*h-h/2,ita)
           continue
           t(1)=tt/2+t(1)*h/2

           l=1
           do 30 i=2,k
             t2=t(i)
                 l=l*4
                 t(i)=(t(i-1)*l-tt)/(l-1)
                 tt=t2
           continue

           point=point*2
           k=k+1
           h=h/2
           l=l*4
           t(k)=(t(k-1)*1-tt)/(l-1)
           er=abs(t(k)-tt)

         continue
         Romberg=t(k)
   end do
  
end
--------------------Configuration: 201401 - Win32 Debug--------------------
Compiling Fortran...
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90(70) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure.   [I]
    do 30 i=2,k
-----------------^
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90(86) : Error: This ENDDO statement requires a label.   [30]
   end do
^
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90(70) : Error: There is an extra DO construct label.   [30]
    do 30 i=2,k
--------------^
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90(64) : Error: An unterminated block exists.
    do 20 i=1,point
^
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90(60) : Error: An unterminated block exists.
    do 10 while( (er.gt.eps).and.(k.lt.n))
^
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90(60) : Error: This label is undefined.   [10]
    do 10 while( (er.gt.eps).and.(k.lt.n))
-------^
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90(64) : Error: This label is undefined.   [20]
    do 20 i=1,point
--------------^
Error executing df.exe.

01.obj - 7 error(s), 0 warning(s)
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

jpchou

ר¼Ò¹ËÎÊ (ÖøÃûдÊÖ)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
jjdg: ½ð±Ò+1, ¸Ðл²ÎÓë 2014-01-14 01:49:13
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90(70) : Error: This DO variable has already been used as an outer DO variable in the same nesting structure.   [I]
    do 30 i=2,k
-----------------^
D:\compaq visual fortran\MSDEV98\MyProjects\hello\01.f90(86) : Error: This ENDDO statement requires a label.   [30]
   end do
^

Äã do 30 i=2,k ½oÁË‚€ label "30"
¿ÉÊÇ end do ÍüÁ˽o
°Ñ end do ¸Ä³É 30 end do
¾Í¿ÉÒÔ
ÆäËûµØ·½Ò²Òª×öͬ˜ÓµÄÐÞ¸Ä
2Â¥2014-01-13 20:23:47
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ hznu2007 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[»ù½ðÉêÇë] ½ñÄêµÄ¹ú»ù½ðÊÇ´ò·ÖÖÆÂ𣿠50+3 zhanghaozhu 2026-03-14 3/150 2026-03-16 17:07 by ±±¾©À³ÒðÈóÉ«
[¿¼ÑÐ] 321Çóµ÷¼Á +5 ´óÃ×·¹£¡ 2026-03-15 5/250 2026-03-16 16:33 by houyaoxu
[¿¼ÑÐ] 085600²ÄÁÏÓ뻯¹¤ Çóµ÷¼Á +13 enenenhui 2026-03-13 14/700 2026-03-16 15:19 by ÁËÁËÁËÁË¡£¡£
[¿¼ÑÐ] 0703 ÎïÀí»¯Ñ§µ÷¼Á +3 ÎÒ¿ÉÒÔÉϰ¶µÄ¶Ô 2026-03-13 5/250 2026-03-16 10:50 by ÎÒ¿ÉÒÔÉϰ¶µÄ¶ÔÂ
[¿¼ÑÐ] 0703»¯Ñ§µ÷¼Á 290·ÖÓпÆÑо­Àú£¬ÂÛÎÄÔÚͶ +7 ÄåÄågk 2026-03-14 7/350 2026-03-16 10:12 by houyaoxu
[¿¼ÑÐ] 311Çóµ÷¼Á +6 ¶¬Ê®Èý 2026-03-15 6/300 2026-03-16 08:00 by wang_dand
[¿¼ÑÐ] »úеר˶µ÷¼Á +3 ±¿±¿ÍÃ×Ó 2026-03-12 3/150 2026-03-15 20:02 by Àõ×ÓÖà?
[¿¼ÑÐ] ²ÄÁϹ¤³Ì327Çóµ÷¼Á +3 xiaohe12w 2026-03-11 3/150 2026-03-14 20:20 by ms629
[¿¼ÑÐ] Ò»Ö¾Ô¸¹þ¹¤´ó²ÄÁÏ324·ÖÇóµ÷¼Á +5 ãÆÐñ¶« 2026-03-14 5/250 2026-03-14 14:53 by ľ¹Ï¸à
[¿¼ÑÐ] 0856²ÄÁÏÓ뻯¹¤309·ÖÇóµ÷¼Á +6 ZyZy¡­¡­ 2026-03-10 6/300 2026-03-14 00:38 by JourneyLucky
[¿¼ÑÐ] Çóµ÷¼Á£¬Ò»Ö¾Ô¸½­ÄÏ´óѧ»·¾³¹¤³Ì085701 +3 Djdjj12 2026-03-10 4/200 2026-03-14 00:31 by JourneyLucky
[¿¼ÑÐ] Ò»Ö¾Ô¸ºþʦ´ó»¯Ñ§289Çóµ÷¼Á +6 XMCMM3.14159 2026-03-10 6/300 2026-03-14 00:28 by JourneyLucky
[¿¼ÑÐ] 26¿¼Ñе÷¼Á +3 ying123. 2026-03-10 3/150 2026-03-14 00:18 by JourneyLucky
[¿¼ÑÐ] 279Çóµ÷¼Á +3 Dizzy123@ 2026-03-10 3/150 2026-03-13 23:02 by JourneyLucky
[¿¼ÑÐ] ²ÄÁÏר˶288·ÖÇóµ÷¼Á Ò»Ö¾Ô¸211 +4 ÔÚ¼ÒÏëÄã 2026-03-11 4/200 2026-03-13 22:49 by JourneyLucky
[¿¼ÑÐ] 332Çóµ÷¼Á +3 Zz°æ 2026-03-13 3/150 2026-03-13 20:36 by 18595523086
[¿¼ÑÐ] 26¿¼ÑÐÇóµ÷¼Á +5 ؼºêSir 2026-03-13 5/250 2026-03-13 13:05 by JourneyLucky
[¿¼²©] ¸£ÖÝ´óѧÑî»ÆºÆ¿ÎÌâ×éÕÐÊÕ2026Äêרҵѧλ²©Ê¿Ñо¿Éú£¬2026.03.20½ØÖ¹ +3 Xiangyu_ou 2026-03-12 3/150 2026-03-13 09:36 by duanwu655
[¿¼ÑÐ] 290Çóµ÷¼Á +3 ¿Â»´È» 2026-03-10 8/400 2026-03-11 13:48 by ¿Â»´È»
[¿¼ÑÐ] 298Çóµ÷¼Á +3 Vvѽ£¡ 2026-03-10 3/150 2026-03-10 22:40 by ½£Ê«¶Å¿µ
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û