30 integer,
allocatable,
dimension(:) :: trajvar
31 character(28),
parameter :: traj_list=
'traj_list.dat'
48 use sizes, only : state_dim_g
49 logical :: dir_e,file_e
51 integer :: counter,lowerbound,upperbound
52 integer,
allocatable,
dimension(:) :: tempvar
55 inquire( file=
"./traj/.", exist=dir_e )
56 if ( .not. dir_e )
then
57 write(emp_e,*)
'EMPIRE ERROR -559: ./traj/ directory does not exi&
59 write(emp_e,*)
'Please create the directory traj/ in the folder t&
65 inquire( file=traj_list, exist=file_e )
66 if ( .not. file_e )
then
67 write(emp_e,*)
'EMPIRE ERROR -560: file ',traj_list,
' does not exi&
69 write(emp_e,*)
'This file should contain a list of state variable&
71 write(emp_e,*)
'for which you want to output trajectories'
75 open(unit_traj_read,file=traj_list,action=
'read')
76 read(unit_traj_read,*) trajn
78 allocate(trajvar(trajn))
81 read(unit_traj_read,*) trajvar(i)
82 if(trajvar(i) .le. 0)
then
83 write(emp_e,*)
'EMPIRE ERROR -561: trajectory variable ',i,
' less &
85 write(emp_e,*)
' : variable read as',trajvar(i),
' &
88 elseif(trajvar(i) .gt. state_dim_g)
then
89 write(emp_e,*)
'EMPIRE ERROR -562: trajectory variable ',i,
' larger &
90 &than the state dimension ',state_dim_g
91 write(emp_e,*)
' : variable read as',trajvar(i),
' &
100 if(comm_version .eq. 3)
then
102 lowerbound = state_displacements(pf_member_rank+1)
103 if(pf_member_rank .eq. pf_member_size-1)
then
104 upperbound = state_dim_g
106 upperbound = state_displacements(pf_member_rank+2)
111 if(trajvar(i) .gt. lowerbound .and. trajvar(i) .le.&
113 counter = counter + 1
117 allocate(tempvar(trajn))
120 allocate(trajvar(counter))
124 if(tempvar(i) .gt. lowerbound .and. tempvar(i) .le.&
126 counter = counter + 1
127 trajvar(counter) = tempvar(i)
131 trajvar = trajvar - lowerbound
138 if(
allocated(trajvar))
deallocate(trajvar)
151 integer,
parameter :: rk = kind(1.0d0)
152 integer :: particle,i,j
153 character(28) :: filename
158 particle = pf%particles(i)
162 write(filename,
'(A,i7.7)')
'traj/truth_var',trajvar(j)
164 write(filename,
'(A,i7.7,A,i5.5)')
'traj/var',trajvar(j),
'particle',particle
166 if(pf%timestep .eq. 0)
then
167 open(unit_traj_write,file=filename,action=
'write',status=
'replace')
169 open(unit_traj_write,file=filename,action=
'write',status=
'old',position=
'append')
171 write(unit_traj_write,
'(es22.15)') pf%psi(trajvar(j),i)
172 close(unit_traj_write)
Module containing EMPIRE coupling data.
Module that stores the information about the outputting from empire.
subroutine setup_traj
subroutine to read in which trajectories are required
Module that stores the dimension of observation and state spaces.
subroutine trajectories
subroutine to output trajectories
module pf_control holds all the information to control the the main program
module to hold data for trajectories
subroutine deallocate_traj