takes care of argc and getargv in f90 code.
authorGengbin Zheng <gzheng@illinois.edu>
Mon, 24 Oct 2005 20:59:28 +0000 (20:59 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Mon, 24 Oct 2005 20:59:28 +0000 (20:59 +0000)
src/langs/f90charm/f90main.C
src/langs/f90charm/futil.f90

index 43e7a1f383a8a01167f3ba8f927082aa7c52f857..559c742fc28b071f2900f545bafcc8eb583c9e13 100644 (file)
@@ -7,12 +7,13 @@ extern void _initCharm(int argc, char **argv);
 
 CkChareID mainhandle;
 
+// called from futil.f90 program main
 extern "C" void FTN_NAME(CONVERSEMAIN, conversemain)(int *argc,char _argv[][80],int length[])
 {
   int i;
   char **argv = new char*[*argc+2];
 
-  for(i=0;i <= *argc;i++) {
+  for(i=0;i<=*argc;i++) {
     if (length[i] < 100) {
       _argv[i][length[i]]='\0';
       argv[i] = &(_argv[i][0]);
index 1fde4deb81d1c982fe80fe8f3b261e344d9eea02..9f68f76c688b1126aef94f6fff9b7fb76c5a88d7 100644 (file)
 !         call pxfgetarg(i,argv(i),length(i),ierr)
 !         if (ierr .ne. 0) print*,'Arg ',i,' error'
 !      end do
+
+      argc = IARGC()
+      do i = 0,argc
+         call GETARG(i,argv(i))
+         length(i) = LEN_TRIM(argv(i));
+      end do
+
       call conversemain(argc,argv,length)
 
       END