Author Topic: Wrong usage of mprint? Output of arrays while debugging  (Read 5564 times)

crepes

  • Full Member
  • ***
  • Posts: 54
Wrong usage of mprint? Output of arrays while debugging
« on: September 15, 2016, 10:36:22 AM »
Dear all,

I am creating a user element and I want to print some information while executing an input file in feap. In several postings there is the hint to use 'mprint', but either I am using it totaly wrong, or it does not work in my installed feap.

What I did:

I included the debugs.h in my user element fortran code.
I declared a real*8 named testoutput(3,3).

I placed

Code: [Select]
        testoutput(1,1)=1.0;
        testoutput(2,1)=2.0;
        testoutput(3,1)=3.0;
        testoutput(1,2)=4.0;
        testoutput(2,2)=5.0;
        testoutput(3,2)=6.0;
        testoutput(1,3)=7.0;
        testoutput(2,3)=8.0;
        testoutput(3,3)=9.0;
        if(debug) then
            call mprint(testoutput,3,3,3,'S_element')
            print *, 'testoutputaaaaaaaaaaaaaaaaaaa'
            write(*,*) 'tessssssssssssssst'
        endif

in several places in my code. For example at the end of the isw=3 option and additional right after declaring all the variables. (I also tested the example of Prof Taylor in another thread with 'real*8  c(6,7)' and 'call mprint(c,6,7,6,'C")' )

I used 'make' to re-implement my user element in the correct directory withour any errors.

My input file ends with:
Code: [Select]

(...)

END !end of data input

order
1



BATCh
   debug
DT,,0.05
tran,back
LOOP,,6
LOOP,,5
TIME
TANG,,1
NEXT
PLOT,RANG,0.1,0.9
PLOT,WIPE
PLOT,CONT,1 ! Temperature contours
NEXT
END


inte
stop


After running my feap input file in a unix shell there is additional information, but the things that i want to output are missing. I also took a look at the logfile and the outputfile in the directory of the input file to look for some outputs that i thought to create.

I am using feap 8.4 with gcc on ubuntu 14.04

What do I do wrong?

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1165
Re: Wrong usage of mprint? Output of arrays while debugging
« Reply #1 on: September 15, 2016, 11:07:37 AM »
Looks ok.

maybe you are not getting to the code block at all

(0) Print out the value of debug before the if check
(1) Try removing the if check around the call to mprint

crepes

  • Full Member
  • ***
  • Posts: 54
Re: Wrong usage of mprint? Output of arrays while debugging
« Reply #2 on: September 15, 2016, 11:34:45 AM »
Thanks for your reply.

I tried (1) and there is still no output of my array or the test strings.


Maybe the following Informations help to figure out what is wrong:

After adding an 'inter' above the 'batch' in the input file to activate the interactive mode I typed in 'debug' and got the output:
Code: [Select]
Input a solution command: Enter "help" for list of commands.
 Enter "exit" to end with restart save, "quit" to end without restart save.
   List  1  Command  1> debug
 *Command   1 * debu                v:   0.00       0.00       0.00   
                                                           t=     0.01     0.00

   Debug flag is set to .true. - Printing is on
   Debug level =   0
 Input a solution command: Enter "help" for list of commands.
 Enter "exit" to end with restart save, "quit" to end without restart save.
   List  2  Command  1>

Typing in 'tang,,1' as another command does not give the expected output as well. (I guess as I placed the call of mprint also in isw=3 at this point there should have been the expected output.)

When I run the input file without the additional 'inter' the output is

Code: [Select]
*Command   2 * dt                  v:  0.500E-01   0.00       0.00   
                                                           t=     0.01     0.00
 *Command   3 * tran back           v:   0.00       0.00       0.00   
                                                           t=     0.01     0.00
 *Command   4 * loop                v:   2.00       13.0       0.00   
                                                           t=     0.01     0.00
 *Command   5 * loop                v:   5.00       9.00       0.00   
                                                           t=     0.01     0.00
 *Command   6 * time                v:   0.00       0.00       0.00   
                                                           t=     0.01     0.00
 *Command   7 * tang                v:   1.00       0.00       0.00   
                                                           t=     0.01     0.00
 *Command   8 * next                v:   5.00       6.00       1.00   
                                                           t=     0.01     0.00
 *Command   9 * plot RANG           v:  0.100      0.900       0.00   
                                                           t=     0.01     0.00
  X Length in cm.       20.24348
  Y Length in cm.       15.80651
  X Pixels in cm.       37.83934
  Y Pixels in cm.       37.83251
  No. Forground colors  17.00000

 *Command  10 * plot WIPE           v:   0.00       0.00       0.00   
                                                           t=     0.01     0.01
 *Command  11 * plot CONT           v:   1.00       0.00       0.00   
                                                           t=     0.01     0.01
 *Command  12 * next                v:   1.00       5.00       1.00   
                                                           t=     0.01     0.01
 *Command   5 * loop                v:   5.00       9.00       0.00   
                                                           t=     0.01     0.02
 *Command   6 * time                v:   0.00       0.00       0.00   
                                                           t=     0.01     0.02
 *Command   7 * tang                v:   1.00       0.00       0.00   
                                                           t=     0.01     0.02
 *Command   8 * next                v:   5.00       6.00       1.00   
                                                           t=     0.01     0.02
 *Command   9 * plot RANG           v:  0.100      0.900       0.00   
                                                           t=     0.01     0.02
 *Command  10 * plot WIPE           v:   0.00       0.00       0.00   
                                                           t=     0.01     0.02
 *Command  11 * plot CONT           v:   1.00       0.00       0.00   
                                                           t=     0.01     0.02
 *Command  12 * next                v:   2.00       5.00       2.00   
                                                           t=     0.02     0.02
 Input a solution command: Enter "help" for list of commands.
 Enter "exit" to end with restart save, "quit" to end without restart save.
   List 13  Command  1>

(I changed the number for the loop in the input file to 2. (In the input file that I had shown before there was a 6)

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Wrong usage of mprint? Output of arrays while debugging
« Reply #3 on: September 15, 2016, 02:19:33 PM »
Are you looking in the output file or on the screen?  If you give commands in interactive mode it should go to both output file and screen.  In batch mode only to output file

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: Wrong usage of mprint? Output of arrays while debugging
« Reply #4 on: September 15, 2016, 10:33:05 PM »
If you have removed the if check and it is still not printing then the program is not going through that part of the code!
Make sure your input file is setting the correct material type.

crepes

  • Full Member
  • ***
  • Posts: 54
Re: Wrong usage of mprint? Output of arrays while debugging
« Reply #5 on: September 16, 2016, 12:46:34 AM »
Ah okay. I guess I got mixed up while changing some input file or user element. Sorry, my qestion was unnecessary. The output works.

Thank you for your kind help