Author Topic: History data in restart files  (Read 7129 times)

aza

  • Jr. Member
  • **
  • Posts: 11
History data in restart files
« on: June 15, 2016, 01:35:04 AM »
Having realized that saving and reading restart files with history variables does not work properly in FEAPpv 3.1 I observed the following in restrt.f:

nh1 and nh2 match for write and read but they don't point to the right place. This means that history data is not written to the restart file (hr(point), point=nh1,nh2 is zero) and thus either can be read. The problem could be solved by replacing the existing write and read commands by

        write(ios) rnmax,nh1,nh2,(hr(point),point=np(50),np(50)+2*nh1-1)
        read(ios) rnmax,nh1,nh2,(hr(point),point=np(50),np(50)+2*nh1-1)
       
where nh1 is the number of history variables at t_n.
       
   
After having found this solution, I read in another topic that a passage in pgetd.f has to be replaced by

c       Assign pointer, length, and precision

        if( pcomp(dname, dict(i), 5) ) then
          point =  np(dlist(i))
          lengt =  ipoint(i)
          prec  =  iprec(i)
          flag  = .true.
          return
        endif
       
So I tried again if restart would work with this correction and therefore canceled my adaptations in restrt.f.  Now, nh1 and nh2 still match for write and read. Saving the history data is working and nh1 is now the pointer to the first history entry (np(50)=nh1).
But when reading the restart file I get a segmentation fault and np(50) is not equal to nh1. I tried to add the line
        setvar = palloc( 50,'H    ',nh2-nh1,2)
but this does not help.


Of course, I could go back to the original pgetd.f and use my first solution which is sufficient for my actual demand. Nevertheless I am interested in a solution that works with the revised version of pgetd and would appreciate if anyone had a suggestion.

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: History data in restart files
« Reply #1 on: June 16, 2016, 05:28:33 AM »
I suspect the location where the history variables will be stored differs in the two runs.  Thus, I have modified the restrt.f file as attached.  Please try and let us know if this fixes your problem.

aza

  • Jr. Member
  • **
  • Posts: 11
Re: History data in restart files
« Reply #2 on: June 16, 2016, 06:32:11 AM »
Dear Prof. Taylor,
 
yes, with your attached routine, everything works. Thank you for your assistance!
The only thing is that I still had to replace np(49) by np(50) -  I suppose that you had the corresponding pointer of FEAP instead of FEAPpv in mind here.
 
With best thanks,
aza

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: History data in restart files
« Reply #3 on: June 16, 2016, 07:24:54 AM »
Yes, what I was using was a next release of feappv (v4.1) which has pointers more in line with feap.


blackbird

  • Full Member
  • ***
  • Posts: 100
Re: History data in restart files
« Reply #4 on: March 12, 2018, 10:26:07 AM »
Hello!

I am currently using parFEAP 8.4 and I have a similar issue with the values I have stored in a user specified array (ualloc) - they are not correct after restart. However, I am not sure about entering a code snippet supposed for version 3.1 into my 8.4 code. Are you aware of a problem for ualloc at restart? Do you have a solution for this?

Best
Christian

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: History data in restart files
« Reply #5 on: March 12, 2018, 11:00:26 AM »
FEAP uses a slightly different scheme for reading/writing the restart file see the file program/restrt.f.
Notwithstanding, FEAP should be writing and reading the history variables, which is what this thread was
about.

If you want to ask about saving user arrays, then please start a new thread on the appropriate board.