*Set Var StepIndex=0
*Set Var meshflag=1
*set var krokVIntervalu=1
*Set Var krokVIntervaluActivity=1
*loop intervals
*#
*If(IntvData(Number_of_LOAD_STEPs,Int)>0 && (IntvData(Generate_Multiple_Steps,Int)>0 || IntvData(Define_Loading_History,Int)>0) && IntvData(Interval_Is_Active,real)==1)
*#
*For(StepNumberI=1;StepNumberI<=IntvData(Number_of_LOAD_STEPs,Int);StepNumberI=StepNumberI+1)
*Set Var StepIndex=Operation(StepIndex+1)
*Set Var j=1
*#
*# --------------------------------------------------------------
*#
*# Begin not without saving
*If( strcmp(IntvData(Store_Data_for_this_Interval_Steps),"WITHOUT_SAVING")!=0)
*EndIf
*# End not without saving
*#
*# --------------------------------------------------------------
*#
*# Begin Save all
*If( strcmp(IntvData(Store_Data_for_this_Interval_Steps),"SAVE_ALL")==0)
RESTORE from
*include ..\include.src.bas\StoreStepID.bas
*#
*If(meshflag==1)
OUTPUT FILE_OPEN "AtenaResults.msh" 
OUTPUT STANDARD Record Length 9000 ;
OUTPUT LOCATION NODES DATA LIST "REFERENCE_NODAL_COORDINATES" END ;
OUTPUT LOCATION ELEMENTS DATA LIST "ELEMENT_INCIDENCES" END ;
*Set Var meshflag=0
OUTPUT FILE_OPEN "AtenaResults.out" 
*EndIf
*#
OUTPUT STANDARD Record Length 9000 ;
// OUTPUT LOCATION NODES DATA ALL ;
*include ..\include.src.bas\WritePostOutput.bas
*EndIf
*# End Save all
*#
*# --------------------------------------------------------------
*#
*# Begin Save each n plus last one
*If(strcmp(IntvData(Store_Data_for_this_Interval_Steps),"SAVE_EACH_Nth_PLUS_LAST_ONE")==0)
*#
*If(krokVIntervalu==IntvData(Nth_Step_to_Store,Int) || StepNumberI==IntvData(Number_of_LOAD_STEPs,Int) || StepNumberI==1)
*#
*If( (StepNumberI!=1 && IntvData(Nth_Step_to_Store,Int)!=1) || (IntvData(Nth_Step_to_Store,Int)==1))
*set var krokVIntervalu=0
*EndIf
*#
OUTPUT LOCATION ELEMENTS RECOVERY *GenData(Nodal_data_recovery) ;
*#
RESTORE from
*include ..\include.src.bas\StoreStepID.bas
*#
*If(meshflag==1)
OUTPUT FILE_OPEN "AtenaResults.msh" 
OUTPUT STANDARD Record Length 9000 ;
OUTPUT LOCATION NODES DATA LIST "REFERENCE_NODAL_COORDINATES" END ;
OUTPUT LOCATION ELEMENTS DATA LIST "ELEMENT_INCIDENCES" END ;
*Set Var meshflag=0
OUTPUT FILE_OPEN "AtenaResults.out" 
*EndIf
*#
OUTPUT STANDARD Record Length 9000 ;
// OUTPUT LOCATION NODES DATA ALL ;
*include ..\include.src.bas\WritePostOutput.bas
*#
*#
*EndIf
*#
*Set Var krokVIntervalu=Operation(krokVIntervalu+1)
*Set Var krokVIntervaluActivity=Operation(krokVIntervaluActivity+1)
*#
*EndIf
*# End Save each n plus last one
*#
*#
*# --------------------------------------------------------------
*#
*# Begin Save last one
*If( strcmp(IntvData(Store_Data_for_this_Interval_Steps),"SAVE_LAST_ONE")==0)
*If(StepNumberI==IntvData(Number_of_LOAD_STEPs,Int))
RESTORE from
*include ..\include.src.bas\StoreStepID.bas
*#
*If(meshflag==1)
OUTPUT FILE_OPEN "AtenaResults.msh" 
OUTPUT STANDARD Record Length 9000 ;
OUTPUT LOCATION NODES DATA LIST "REFERENCE_NODAL_COORDINATES" END ;
OUTPUT LOCATION ELEMENTS DATA LIST "ELEMENT_INCIDENCES" END ;
*Set Var meshflag=0
OUTPUT FILE_OPEN "AtenaResults.out" 
*EndIf
*#
OUTPUT STANDARD Record Length 9000 ;
// OUTPUT LOCATION NODES DATA ALL ;
*include ..\include.src.bas\WritePostOutput.bas
*#
*EndIf
*EndIf
*# End Save last one
*#

*# include ..\include.src.bas\delete_transport_temperature.bas
*#konec for
*End
*EndIf
*# Delete Load CASE *IntervalIndex ;
*End intervals
