²é¿´: 2126  |  »Ø¸´: 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 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 085600µ÷¼Á +5 ÑúÑú123sun 2026-03-12 6/300 2026-03-16 15:58 by ÑúÑú123sun
[¿¼ÑÐ] 309Çóµ÷¼Á +5 »¨ÓëÒ¶@ 2026-03-10 5/250 2026-03-16 14:13 by ŶŶ123
[¿¼ÑÐ] 304Çóµ÷¼Á +6 СÐÜjoy 2026-03-14 6/300 2026-03-16 12:59 by Iveryant
[¿¼ÑÐ] 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
[»ù½ðÉêÇë] NSFCÉ걨ÊéÀïÉêÇëÈ˼òÀúÖдú±íÐÔÂÛÖø»¹ÐèÒªÔÚÉ걨Êé×îºóµÄ¸½¼þÀïÃæÔÙÉÏ´«Ò»±éÂð 20+5 NSFC2026ÎÒÀ´ÁË 2026-03-10 14/700 2026-03-15 23:53 by ²»¸ºÉØ»ªµÄ»¢
[¿¼ÑÐ] »úеר˶µ÷¼Á +3 ±¿±¿ÍÃ×Ó 2026-03-12 3/150 2026-03-15 20:02 by Àõ×ÓÖà?
[¿¼ÑÐ] 330Çóµ÷¼Á +3 ?½´¸øµ÷¼Á¹òÁË 2026-03-13 3/150 2026-03-14 10:13 by JourneyLucky
[¿¼ÑÐ] 321Çóµ÷¼Á +3 CUcat 2026-03-10 3/150 2026-03-14 00:25 by JourneyLucky
[¿¼ÑÐ] 341Çóµ÷¼Á +4 ·¬ÇÑÍ·--- 2026-03-10 4/200 2026-03-13 23:12 by JourneyLucky
[¿¼ÑÐ] 304Çóµ÷¼Á +6 Mochaaaa 2026-03-12 7/350 2026-03-13 22:18 by ÐÇ¿ÕÐÇÔÂ
[¿¼ÑÐ] 333Çóµ÷¼Á +3 ÇòÇò¹ÅÁ¦ 2026-03-11 3/150 2026-03-13 21:27 by JourneyLucky
[¿¼ÑÐ] ²ÄÁÏÓ뻯¹¤085600µ÷¼ÁÇóÀÏʦÊÕÁô +9 jiaanl 2026-03-11 9/450 2026-03-13 20:22 by JourneyLucky
[¿¼ÑÐ] 310Çóµ÷¼Á +3 ¡¾ÉÏÉÏÇ©¡¿ 2026-03-11 3/150 2026-03-13 16:16 by JourneyLucky
[¿¼ÑÐ] 302Çóµ÷¼Á +6 ¸ºÐÄÕßµ±Öï 2026-03-11 6/300 2026-03-13 16:11 by JourneyLucky
[¿¼ÑÐ] һ־Ըɽ´ó07»¯Ñ§ 332·Ö ËÄÁù¼¶Òѹý ±¾¿ÆÉ½¶«Ë«·Ç Çóµ÷¼Á£¡ +3 ²»ÏëÀíÄã 2026-03-12 3/150 2026-03-13 14:18 by JourneyLucky
[¿¼ÑÐ] 070303Ò»Ö¾Ô¸Î÷±±´óѧѧ˶310ÕÒµ÷¼Á +3 dÈçÔ¸Éϰ¶ 2026-03-13 3/150 2026-03-13 10:43 by houyaoxu
[¿¼²©] ¸£ÖÝ´óѧÑî»ÆºÆ¿ÎÌâ×éÕÐÊÕ2026Äêרҵѧλ²©Ê¿Ñо¿Éú£¬2026.03.20½ØÖ¹ +3 Xiangyu_ou 2026-03-12 3/150 2026-03-13 09:36 by duanwu655
[¿¼ÑÐ] 341Çóµ÷¼Á +4 µ·µ°ÖíÖí 2026-03-11 4/200 2026-03-12 14:47 by ruiyingmiao
[¿¼²©] 26É격ÇóÖú +3 ÌøÔ¾±ý¸É 2026-03-10 4/200 2026-03-10 21:15 by Tntcnn
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û