32 use,
intrinsic :: iso_fortran_env, only : stderr=>error_unit,stdout=>output_unit
34 integer,
parameter :: emp_e=stderr
35 integer,
parameter :: emp_o=stdout
36 integer,
parameter :: unit_nml=10
37 integer,
parameter :: unit_obs=11
39 integer,
parameter :: unit_truth=12
41 integer,
parameter :: unit_weight=13
43 integer,
parameter :: unit_mean=14
45 integer,
parameter :: unit_state=15
47 integer,
parameter :: unit_ens_rmse=16
49 integer,
parameter :: unit_mat_tri=17
51 integer,
parameter :: unit_spatial_rmse=18
53 integer,
parameter :: unit_variance=19
55 integer,
parameter :: unit_hist_read=20
57 integer,
parameter :: unit_hist_write=21
59 integer,
parameter :: unit_hist_readt=22
61 integer,
parameter :: unit_hist_readp=23
63 integer,
parameter :: unit_traj_read=24
65 integer,
parameter :: unit_traj_write=24
67 integer,
parameter :: unit_vardata=25
89 integer,
intent(in) :: id_num
90 character(14) :: filename
91 character(10) :: basename
93 character(3),
parameter :: msnul=
'nul'
94 character(9),
parameter :: unixnul=
'/dev/null'
95 character(10),
parameter :: emp_out_name=
'empire.nml'
96 logical :: file_exists
99 namelist/empire_output/basename
101 inquire(file=emp_out_name,exist=file_exists)
103 open(unit_nml,file=emp_out_name,iostat=ios,action=
'read'&
104 &,status=
'old',form=
'formatted')
106 print*,
'Cannot open ',emp_out_name
107 stop
'open_emp_o ERROR'
109 read(unit_nml,nml=empire_output,iostat=ios)
111 if(ios .ne. 0) basename =
'emp.out'
116 select case(basename)
123 write(filename,
'(A,A,i0)') trim(basename),
'.',id_num
126 print*,
"this process' output will henceforth be directed to ",filename
128 inquire(unit=emp_o,opened=opend)
133 open(emp_o,file=filename,action=
'write',status=
'replace'&
136 inquire(unit=emp_e,opened=opend)
140 write(filename,
'(A,i0)')
'emp.err.',id_num
141 open(emp_e,file=filename,action=
'write',status=
'replace'&
subroutine close_emp_o()
subroutine to close the output file
Module that stores the information about the outputting from empire.
subroutine open_emp_o(id_num)
subroutine to open the file for outputting