45 public :: historyputaxis
46 public :: historyputassociatedcoordinates
57 interface historyputaxis
60 end interface historyputaxis
62 interface historyputassociatedcoordinates
71 end interface historyputassociatedcoordinates
74 module procedure historyput0didsp
75 module procedure historyput0diddp
76 module procedure historyput1didsp
77 module procedure historyput1diddp
78 module procedure historyput2didsp
79 module procedure historyput2diddp
80 module procedure historyput3didsp
81 module procedure historyput3diddp
82 end interface historyput
91 end interface historyget
94 character(len=File_HSHORT) :: item
95 character(len=File_HMID) :: zcoord
96 character(len=File_HSHORT) :: outname
97 character(len=File_HLONG) :: basename
104 character(len=File_HSHORT) :: item
105 character(len=File_HMID) :: zcoord
106 character(len=File_HSHORT) :: outname
113 integer :: laststep_write
114 integer :: laststep_put
117 real(DP),
pointer :: varsum(:)
124 character(len=File_HSHORT) :: name
125 character(len=File_HLONG) :: desc
126 character(len=File_HSHORT) :: units
127 character(len=File_HSHORT) :: dim
130 real(DP),
pointer :: var(:)
137 character(len=File_HSHORT) :: name
138 character(len=File_HLONG) :: desc
139 character(len=File_HSHORT) :: units
141 character(len=File_HSHORT) :: dims(4)
143 real(DP),
pointer :: var(:)
166 integer,
private :: History_master
167 integer,
private :: History_myrank
168 integer,
private,
allocatable :: History_rankidx(:)
170 real(DP),
private :: History_STARTDAYSEC
171 real(DP),
private :: History_DTSEC
172 character(len=File_HMID),
private :: History_TIME_SINCE
175 character(len=File_HMID),
private :: History_TITLE
176 character(len=File_HMID),
private :: History_SOURCE
177 character(len=File_HMID),
private :: History_INSTITUTION
178 character(len=File_HMID),
private :: History_TIME_UNITS
180 logical,
private :: History_OUTPUT_STEP0 = .false.
181 real(DP),
private :: History_OUTPUT_WAIT = 0.0_dp
183 logical,
private :: History_ERROR_PUTMISS = .true.
186 integer,
private,
parameter :: History_req_limit = 1000
187 integer,
private :: History_req_count = 0
188 type(request),
private,
allocatable :: History_req(:)
190 integer,
private :: History_id_count = 0
191 type(vars),
private,
allocatable :: History_vars(:)
192 logical,
private,
allocatable :: History_axis_written(:)
194 integer,
private,
parameter :: History_axis_limit = 100
195 integer,
private :: History_axis_count = 0
196 type(axis),
private :: History_axis(History_axis_limit)
198 integer,
private,
parameter :: History_assoc_limit = 20
199 integer,
private :: History_assoc_count = 0
200 type(assoc),
private :: History_assoc(History_assoc_limit)
202 real(DP),
private,
parameter :: eps = 1.d-10
204 integer,
private :: laststep_write = -1
205 logical,
private :: firsttime = .true.
206 character(len=LOG_LMSG),
private :: message =
'' 207 logical,
private :: debug = .false.
209 integer,
private :: io_buffer_size
237 #if defined(PGI) || defined(SX) 249 integer,
intent(out) :: item_count
250 integer,
intent(out) :: variant_count
251 integer,
intent(in) :: isize
252 integer,
intent(in) :: jsize
253 integer,
intent(in) :: ksize
254 integer,
intent(in) :: master
255 integer,
intent(in) :: myrank
256 integer,
intent(in) :: rankidx(:)
257 character(len=*),
intent(in) :: title
258 character(len=*),
intent(in) :: source
259 character(len=*),
intent(in) :: institution
260 real(DP),
intent(in) :: time_start
261 real(DP),
intent(in) :: time_interval
262 character(len=*),
intent(in),
optional :: time_units
263 character(len=*),
intent(in),
optional :: time_since
264 character(len=*),
intent(in),
optional :: default_basename
265 character(len=*),
intent(in),
optional :: default_zcoord
266 real(DP),
intent(in),
optional :: default_tinterval
267 character(len=*),
intent(in),
optional :: default_tunit
268 logical,
intent(in),
optional :: default_taverage
269 character(len=*),
intent(in),
optional :: default_datatype
270 character(len=*),
intent(in),
optional :: namelist_filename
271 integer ,
intent(in),
optional :: namelist_fid
273 character(len=File_HLONG) :: history_default_basename
274 real(DP) :: history_default_tinterval
275 character(len=File_HSHORT) :: history_default_tunit
276 logical :: history_default_taverage
277 character(len=File_HSHORT) :: history_default_zcoord
278 character(len=File_HSHORT) :: history_default_datatype
282 namelist / param_history / &
285 history_institution, &
286 history_time_units, &
287 history_default_basename, &
288 history_default_tinterval, &
289 history_default_tunit, &
290 history_default_taverage, &
291 history_default_zcoord, &
292 history_default_datatype, &
293 history_output_step0, &
294 history_output_wait, &
295 history_error_putmiss, &
298 character(len=File_HSHORT) :: item
299 character(len=File_HSHORT) :: outname
301 character(len=File_HLONG) :: basename
302 real(DP) :: tinterval
303 character(len=File_HSHORT) :: tunit
305 character(len=File_HSHORT) :: zcoord
306 character(len=File_HSHORT) :: datatype
308 namelist / histitem / &
318 integer :: array_size
321 real(DP) :: item_dtsec
322 integer :: item_dstep
324 integer :: id1, id2, count
325 character(len=File_HSHORT) :: item1, item2
334 call log(
'I',
'###### Module[HISTORY] / Origin[gtoollib]')
337 allocate( history_rankidx(
size(rankidx)) )
338 history_master = master
339 history_myrank = myrank
340 history_rankidx(:) = rankidx(:)
342 history_startdaysec = time_start
343 history_dtsec = time_interval
344 if(
present(time_since) )
then 345 history_time_since = time_since
347 history_time_since =
'' 350 history_time_units =
'seconds' 351 history_default_basename =
'' 352 history_default_tinterval = -1.0_dp
353 history_default_tunit =
'sec' 354 history_default_taverage = .false.
355 history_default_zcoord =
'' 356 history_default_datatype =
'REAL4' 359 history_title = title
360 history_source = source
361 history_institution = institution
362 if(
present(time_units) ) history_time_units = time_units
363 if(
present(default_basename) ) history_default_basename = default_basename
364 if(
present(default_tinterval) ) history_default_tinterval = default_tinterval
365 if(
present(default_tunit) ) history_default_tunit = default_tunit
366 if(
present(default_taverage) ) history_default_taverage = default_taverage
367 if(
present(default_zcoord) ) history_default_zcoord = default_zcoord
368 if(
present(default_datatype) ) history_default_datatype = default_datatype
371 if (
present(namelist_fid) )
then 373 elseif(
present(namelist_filename) )
then 374 if ( namelist_filename /=
'' )
then 376 file = trim(namelist_filename), &
377 form =
'formatted', &
383 call log(
'E',
'xxx No namelist file is specified. Check!')
387 read(fid,nml=param_history,iostat=ierr)
389 call log(
'I',
'*** Not found namelist. Default used.')
390 elseif( ierr > 0 )
then 391 call log(
'E',
'xxx Not appropriate names in namelist PARAM_HISTORY. Check!')
394 #if defined(PGI) || defined(SX) 395 if ( log_master_nml )
write(log_fid_nml,nml=param_history)
397 write(message,nml=param_history)
398 call log_nml(
'I',message)
401 if ( history_output_wait < 0.0_dp )
then 402 write(message,*)
'xxx History_OUTPUT_WAIT must be positive. STOP' 403 call log(
'E',message)
406 array_size = isize * jsize * ksize
409 history_req_count = 0
411 do n = 1, history_req_limit
413 outname =
'undefined' 414 basename = history_default_basename
416 read(fid,nml=histitem,iostat=ierr)
418 if( basename ==
'' .OR. item ==
'' .OR. outname ==
'' ) cycle
420 history_req_count = history_req_count + 1
423 item_count = history_req_count
426 if ( history_req_count > history_req_limit )
then 427 write(message,*)
'xxx request of history file is exceed! n >', history_req_limit
428 call log(
'E',message)
429 elseif( history_req_count == 0 )
then 430 call log(
'I',
'*** No history file specified.')
435 allocate( history_req(history_req_count) )
438 io_buffer_size = array_size * history_req_count * 8
445 if ( fid > 0 ) rewind(fid)
446 do n = 1, history_req_limit
449 outname =
'undefined' 450 basename = history_default_basename
451 tinterval = history_default_tinterval
452 tunit = history_default_tunit
453 taverage = history_default_taverage
454 zcoord = history_default_zcoord
455 datatype = history_default_datatype
457 read(fid,nml=histitem,iostat=ierr)
459 if( basename ==
'' .OR. item ==
'' .OR. outname ==
'' ) cycle
461 if ( log_fid_nml /= log_fid )
then 462 #if defined(PGI) || defined(SX) 463 if ( log_master_nml )
write(log_fid_nml,nml=histitem)
465 write(message,nml=histitem)
466 call log_nml(
'I',message)
471 if ( outname ==
'undefined' ) outname = item
473 if ( history_req(id)%outname == outname )
then 475 'xxx Same name of history output is already registered. Check!', trim(outname)
476 call log(
'E',message)
482 history_req(reqid)%item = item
483 history_req(reqid)%outname = outname
484 history_req(reqid)%basename = basename
485 history_req(reqid)%taverage = taverage
487 call calendarymdhms2sec( item_dtsec, tinterval, tunit )
488 item_dstep = int( item_dtsec / history_dtsec )
490 if ( item_dtsec <= 0.d0 )
then 492 'xxx Not appropriate time interval. Check!', trim(item), tinterval, trim(tunit)
493 call log(
'E',message)
496 if ( abs(item_dtsec-
real(item_dstep,kind=
dp)*history_dtsec ) > eps )
then 498 'xxx time interval must be a multiple of delta t. (interval,dt)=', item_dtsec, history_dtsec
499 call log(
'E',message)
502 history_req(reqid)%dstep = item_dstep
503 history_req(reqid)%zcoord = zcoord
505 if ( datatype ==
'REAL4' )
then 508 elseif( datatype ==
'REAL8' )
then 512 write(message,*)
'xxx Not appropriate DATATYPE. Check!', datatype
513 call log(
'E',message)
518 write(message,
'(A,I4)')
'*** Number of requested history item : ', history_req_count
519 call log(
'I',message)
520 write(message,
'(A,A)')
'*** Output default data type : ', history_default_datatype
521 call log(
'I',message)
522 write(message,
'(A,I8)')
'*** Memory usage for history data buffer [Mbyte] : ', memsize / 1024 / 1024
523 call log(
'I',message)
524 write(message,
'(A,L4)')
'*** Output value at the initial step? : ', history_output_step0
525 call log(
'I',message)
526 write(message,
'(A,L4)')
'*** Check if requested item is not registered? : ', history_error_putmiss
527 call log(
'I',message)
528 if ( history_output_wait > 0.0_dp )
then 529 write(message,
'(A,F10.3)')
'*** Time to suppress output [sec] : ', history_output_wait
530 call log(
'I',message)
533 if ( .NOT.
present(namelist_fid) )
then 534 if( fid > 0 )
close(fid)
538 allocate( history_vars( history_req_count) )
539 allocate( history_axis_written(0:history_req_count) )
541 do n = 1, history_req_count
542 allocate( history_vars(n)%varsum(array_size) )
546 do id1 = 1, item_count
547 item1 = history_req(id1)%item
549 do id2 = id1, item_count
550 item2 = history_req(id2)%item
551 if( item1 == item2 ) count = count + 1
553 variant_count = max( variant_count, count)
566 logical,
intent(out) :: existed
567 character(len=*),
intent(in) :: item
568 character(len=*),
intent(in),
optional :: zcoord
578 max_count = min( history_id_count, history_req_count )
583 if ( item == history_vars(n)%item )
then 585 if (
present(zcoord) )
then 586 if ( history_vars(n)%zcoord == zcoord )
then 627 integer,
intent(out) :: nregist
628 character(len=*),
intent(in) :: item
629 character(len=*),
intent(in) :: dims(:)
630 character(len=*),
intent(in) :: desc
631 character(len=*),
intent(in) :: units
632 integer,
intent(in) :: now_step
633 character(len=*),
intent(in),
optional :: zcoord
634 character(len=*),
intent(in),
optional :: options
635 integer,
intent(in),
optional :: start(:)
636 integer,
intent(in),
optional :: count(:)
637 integer,
intent(in),
optional :: comm
639 character(len=File_HMID) :: tunits
640 logical :: fileexisted
641 integer :: ic, ie, is, lo
646 logical :: shared_file_io
649 integer :: m, dim_size
657 shared_file_io = .false.
658 if (
present(comm) .AND. comm .NE. mpi_comm_null ) shared_file_io = .true.
664 if ( .NOT. existed )
then 667 if ( history_time_since ==
'' )
then 668 tunits = trim(history_time_units)
670 tunits = trim(history_time_units)//
' since '//trim(history_time_since)
675 do reqid = 1, history_req_count
678 if ( item == history_req(reqid)%item )
then 680 if (
present(zcoord) )
then 681 if ( history_req(reqid)%zcoord /= zcoord ) cycle
685 nregist = nregist + 1
687 history_id_count = history_id_count + 1
688 id = history_id_count
690 history_vars(id)%item = history_req(reqid)%item
691 history_vars(id)%outname = history_req(reqid)%outname
695 history_req(reqid)%basename, &
698 history_institution, &
701 history_rankidx(:), &
702 time_units = tunits, &
705 history_vars(id)%fid = fid
706 history_vars(id)%dstep = history_req(reqid)%dstep
707 history_vars(id)%taverage = history_req(reqid)%taverage
708 history_vars(id)%zcoord = history_req(reqid)%zcoord
710 if ( .NOT. fileexisted )
then 713 if (
present(options) )
then 717 lo = len_trim(options)
719 if ( m == lo+1 .OR. options(m:m) ==
'&' )
then 720 if ( ic == -1 .OR. ie == -1 )
then 721 call log(
'E',
'xxx option is invalid: '//trim(options))
726 options(ic+1:ie-1), &
732 elseif( options(m:m) ==
':' )
then 734 elseif( options(m:m) ==
'=' )
then 742 do m = 1, history_axis_count
743 if ( shared_file_io )
then 744 dim_size = history_axis(m)%gdim_size
746 dim_size = history_axis(m)%dim_size
750 history_axis(m)%name, &
751 history_axis(m)%desc, &
752 history_axis(m)%units, &
753 history_axis(m)%dim, &
754 history_axis(m)%dtype, &
760 do m = 1, history_assoc_count
762 if ( shared_file_io )
then 763 dim_size = history_axis(m)%gdim_size
765 dim_size = history_axis(m)%dim_size
769 history_assoc(m)%name, &
770 history_assoc(m)%desc, &
771 history_assoc(m)%units, &
772 history_assoc(m)%dims(1:history_assoc(m)%ndims), &
773 history_assoc(m)%dtype )
780 history_axis_written(fid) = .false.
785 dtsec =
real(History_vars(id)%dstep,kind=DP) * history_dtsec
790 history_vars(id)%ndims =
size(dims)
792 history_vars(id)%start(:) = 1
793 history_vars(id)%count(:) = 1
794 if (
present(start) ) history_vars(id)%start(:) = start(:)
795 if (
present(count) ) history_vars(id)%count(:) = count(:)
797 call fileaddvariable( history_vars(id)%vid, &
799 history_vars(id)%outname, &
803 history_req(reqid)%dtype, &
805 history_vars(id)%taverage )
807 if ( .not. fileexisted )
then 808 do m = 1, history_axis_count
809 if ( history_axis(m)%down )
then 810 call filesettattr( fid, history_axis(m)%name,
'positive',
'down' )
816 history_vars(id)%size = 0
817 history_vars(id)%waitsec = history_output_wait
818 if ( history_output_step0 .AND. now_step == 1 )
then 819 history_vars(id)%laststep_write = 1 - history_vars(id)%dstep
821 history_vars(id)%laststep_write = 1
823 history_vars(id)%laststep_put = history_vars(id)%laststep_write
824 history_vars(id)%timesum = 0.0_dp
825 history_vars(id)%varsum(:) = 0.0_dp
828 write(message,*)
'*** [HIST] Item registration No.= ', id
829 call log(
'I',message)
830 write(message,*)
'] Item name : ', trim(history_vars(id)%item)
831 call log(
'I',message)
832 write(message,*)
'] Output name : ', trim(history_vars(id)%outname)
833 call log(
'I',message)
834 write(message,*)
'] Description : ', trim(desc)
835 call log(
'I',message)
836 write(message,*)
'] Unit : ', trim(units)
837 call log(
'I',message)
838 write(message,*)
'] Z-coordinate : ', trim(history_vars(id)%zcoord)
839 call log(
'I',message)
840 write(message,*)
'] Interval [sec,step] : ', dtsec, history_vars(id)%dstep
841 call log(
'I',message)
842 write(message,*)
'] Time Average? : ', history_vars(id)%taverage
843 call log(
'I',message)
844 write(message,*)
'] axis name : ', dims(1:ndim)
845 call log(
'I',message)
876 character(len=*),
intent(in) :: name
877 character(len=*),
intent(in) :: desc
878 character(len=*),
intent(in) :: units
879 character(len=*),
intent(in) :: dim
880 real(SP),
intent(in) :: var(:)
881 character(len=*),
intent(in),
optional :: datatype
882 logical,
intent(in),
optional :: down
883 integer,
intent(in),
optional :: gsize
884 integer,
intent(in),
optional :: start
893 if (
present(datatype) )
then 894 if ( datatype ==
'REAL4' )
then 896 elseif( datatype ==
'REAL8' )
then 899 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
900 call log(
'E',message)
908 if ( history_axis_count < history_axis_limit )
then 909 history_axis_count = history_axis_count + 1
910 id = history_axis_count
912 allocate( history_axis(id)%var(dim_size) )
914 history_axis(id)%name = name
915 history_axis(id)%desc = desc
916 history_axis(id)%units = units
917 history_axis(id)%dim = dim
918 history_axis(id)%dtype = dtype
919 history_axis(id)%dim_size = dim_size
920 history_axis(id)%var(:) = var(:)
922 if (
present(down) )
then 923 history_axis(history_axis_count)%down = down
925 history_axis(history_axis_count)%down = .false.
927 if (
present(gsize) ) &
928 history_axis(history_axis_count)%gdim_size = gsize
929 if (
present(start) )
then 930 history_axis(history_axis_count)%start(1) = start
932 history_axis(history_axis_count)%start(1) = 1
935 write(message,*)
'xxx Number of axis exceeds the limit.' 936 call log(
'E',message)
958 character(len=*),
intent(in) :: name
959 character(len=*),
intent(in) :: desc
960 character(len=*),
intent(in) :: units
961 character(len=*),
intent(in) :: dim
962 real(DP),
intent(in) :: var(:)
963 character(len=*),
intent(in),
optional :: datatype
964 logical,
intent(in),
optional :: down
965 integer,
intent(in),
optional :: gsize
966 integer,
intent(in),
optional :: start
975 if (
present(datatype) )
then 976 if ( datatype ==
'REAL4' )
then 978 elseif( datatype ==
'REAL8' )
then 981 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
982 call log(
'E',message)
990 if ( history_axis_count < history_axis_limit )
then 991 history_axis_count = history_axis_count + 1
992 id = history_axis_count
994 allocate( history_axis(id)%var(dim_size) )
996 history_axis(id)%name = name
997 history_axis(id)%desc = desc
998 history_axis(id)%units = units
999 history_axis(id)%dim = dim
1000 history_axis(id)%dtype = dtype
1001 history_axis(id)%dim_size = dim_size
1002 history_axis(id)%var(:) = var(:)
1004 if (
present(down) )
then 1005 history_axis(history_axis_count)%down = down
1007 history_axis(history_axis_count)%down = .false.
1009 if (
present(gsize) ) &
1010 history_axis(history_axis_count)%gdim_size = gsize
1011 if (
present(start) )
then 1012 history_axis(history_axis_count)%start(1) = start
1014 history_axis(history_axis_count)%start(1) = 1
1017 write(message,*)
'xxx Number of axis exceeds the limit.' 1018 call log(
'E',message)
1038 character(len=*),
intent(in) :: name
1039 character(len=*),
intent(in) :: desc
1040 character(len=*),
intent(in) :: units
1041 character(len=*),
intent(in) :: dims(:)
1042 real(SP),
intent(in) :: var(:)
1043 character(len=*),
intent(in),
optional :: datatype
1044 integer,
intent(in),
optional :: start(:)
1050 intrinsic size, shape, reshape
1053 if (
present(datatype) )
then 1054 if ( datatype ==
'REAL4' )
then 1056 elseif( datatype ==
'REAL8' )
then 1059 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
1060 call log(
'E',message)
1066 dim_size =
size(var)
1068 if ( history_assoc_count < history_assoc_limit )
then 1069 history_assoc_count = history_assoc_count + 1
1070 id = history_assoc_count
1072 allocate( history_assoc(id)%var(dim_size) )
1074 history_assoc(id)%name = name
1075 history_assoc(id)%desc = desc
1076 history_assoc(id)%units = units
1077 history_assoc(id)%ndims = 1
1078 history_assoc(id)%dims(:) =
'' 1079 history_assoc(id)%dims(1:1) = dims(1:1)
1080 history_assoc(id)%dtype = dtype
1081 history_assoc(id)%var(:) = reshape( var, (/ dim_size /) )
1085 history_assoc(id)%count(1:1) = shape(var)
1086 if (
present(start) )
then 1087 history_assoc(id)%start(1:1) = start(1:1)
1089 history_assoc(id)%start = (/ 1, 1, 1, 1 /)
1092 write(message,*)
'xxx Number of associate coordinates exceeds the limit.' 1093 call log(
'E',message)
1113 character(len=*),
intent(in) :: name
1114 character(len=*),
intent(in) :: desc
1115 character(len=*),
intent(in) :: units
1116 character(len=*),
intent(in) :: dims(:)
1117 real(DP),
intent(in) :: var(:)
1118 character(len=*),
intent(in),
optional :: datatype
1119 integer,
intent(in),
optional :: start(:)
1125 intrinsic size, shape, reshape
1128 if (
present(datatype) )
then 1129 if ( datatype ==
'REAL4' )
then 1131 elseif( datatype ==
'REAL8' )
then 1134 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
1135 call log(
'E',message)
1141 dim_size =
size(var)
1143 if ( history_assoc_count < history_assoc_limit )
then 1144 history_assoc_count = history_assoc_count + 1
1145 id = history_assoc_count
1147 allocate( history_assoc(id)%var(dim_size) )
1149 history_assoc(id)%name = name
1150 history_assoc(id)%desc = desc
1151 history_assoc(id)%units = units
1152 history_assoc(id)%ndims = 1
1153 history_assoc(id)%dims(:) =
'' 1154 history_assoc(id)%dims(1:1) = dims(1:1)
1155 history_assoc(id)%dtype = dtype
1156 history_assoc(id)%var(:) = reshape( var, (/ dim_size /) )
1160 history_assoc(id)%count(1:1) = shape(var)
1161 if (
present(start) )
then 1162 history_assoc(id)%start(1:1) = start(1:1)
1164 history_assoc(id)%start = (/ 1, 1, 1, 1 /)
1167 write(message,*)
'xxx Number of associate coordinates exceeds the limit.' 1168 call log(
'E',message)
1188 character(len=*),
intent(in) :: name
1189 character(len=*),
intent(in) :: desc
1190 character(len=*),
intent(in) :: units
1191 character(len=*),
intent(in) :: dims(:)
1192 real(SP),
intent(in) :: var(:,:)
1193 character(len=*),
intent(in),
optional :: datatype
1194 integer,
intent(in),
optional :: start(:)
1200 intrinsic size, shape, reshape
1203 if (
present(datatype) )
then 1204 if ( datatype ==
'REAL4' )
then 1206 elseif( datatype ==
'REAL8' )
then 1209 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
1210 call log(
'E',message)
1216 dim_size =
size(var)
1218 if ( history_assoc_count < history_assoc_limit )
then 1219 history_assoc_count = history_assoc_count + 1
1220 id = history_assoc_count
1222 allocate( history_assoc(id)%var(dim_size) )
1224 history_assoc(id)%name = name
1225 history_assoc(id)%desc = desc
1226 history_assoc(id)%units = units
1227 history_assoc(id)%ndims = 2
1228 history_assoc(id)%dims(:) =
'' 1229 history_assoc(id)%dims(1:2) = dims(1:2)
1230 history_assoc(id)%dtype = dtype
1231 history_assoc(id)%var(:) = reshape( var, (/ dim_size /) )
1235 history_assoc(id)%count(1:2) = shape(var)
1236 if (
present(start) )
then 1237 history_assoc(id)%start(1:2) = start(1:2)
1239 history_assoc(id)%start = (/ 1, 1, 1, 1 /)
1242 write(message,*)
'xxx Number of associate coordinates exceeds the limit.' 1243 call log(
'E',message)
1263 character(len=*),
intent(in) :: name
1264 character(len=*),
intent(in) :: desc
1265 character(len=*),
intent(in) :: units
1266 character(len=*),
intent(in) :: dims(:)
1267 real(DP),
intent(in) :: var(:,:)
1268 character(len=*),
intent(in),
optional :: datatype
1269 integer,
intent(in),
optional :: start(:)
1275 intrinsic size, shape, reshape
1278 if (
present(datatype) )
then 1279 if ( datatype ==
'REAL4' )
then 1281 elseif( datatype ==
'REAL8' )
then 1284 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
1285 call log(
'E',message)
1291 dim_size =
size(var)
1293 if ( history_assoc_count < history_assoc_limit )
then 1294 history_assoc_count = history_assoc_count + 1
1295 id = history_assoc_count
1297 allocate( history_assoc(id)%var(dim_size) )
1299 history_assoc(id)%name = name
1300 history_assoc(id)%desc = desc
1301 history_assoc(id)%units = units
1302 history_assoc(id)%ndims = 2
1303 history_assoc(id)%dims(:) =
'' 1304 history_assoc(id)%dims(1:2) = dims(1:2)
1305 history_assoc(id)%dtype = dtype
1306 history_assoc(id)%var(:) = reshape( var, (/ dim_size /) )
1310 history_assoc(id)%count(1:2) = shape(var)
1311 if (
present(start) )
then 1312 history_assoc(id)%start(1:2) = start(1:2)
1314 history_assoc(id)%start = (/ 1, 1, 1, 1 /)
1317 write(message,*)
'xxx Number of associate coordinates exceeds the limit.' 1318 call log(
'E',message)
1338 character(len=*),
intent(in) :: name
1339 character(len=*),
intent(in) :: desc
1340 character(len=*),
intent(in) :: units
1341 character(len=*),
intent(in) :: dims(:)
1342 real(SP),
intent(in) :: var(:,:,:)
1343 character(len=*),
intent(in),
optional :: datatype
1344 integer,
intent(in),
optional :: start(:)
1350 intrinsic size, shape, reshape
1353 if (
present(datatype) )
then 1354 if ( datatype ==
'REAL4' )
then 1356 elseif( datatype ==
'REAL8' )
then 1359 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
1360 call log(
'E',message)
1366 dim_size =
size(var)
1368 if ( history_assoc_count < history_assoc_limit )
then 1369 history_assoc_count = history_assoc_count + 1
1370 id = history_assoc_count
1372 allocate( history_assoc(id)%var(dim_size) )
1374 history_assoc(id)%name = name
1375 history_assoc(id)%desc = desc
1376 history_assoc(id)%units = units
1377 history_assoc(id)%ndims = 3
1378 history_assoc(id)%dims(:) =
'' 1379 history_assoc(id)%dims(1:3) = dims(1:3)
1380 history_assoc(id)%dtype = dtype
1381 history_assoc(id)%var(:) = reshape( var, (/ dim_size /) )
1385 history_assoc(id)%count(1:3) = shape(var)
1386 if (
present(start) )
then 1387 history_assoc(id)%start(1:3) = start(1:3)
1389 history_assoc(id)%start = (/ 1, 1, 1, 1 /)
1392 write(message,*)
'xxx Number of associate coordinates exceeds the limit.' 1393 call log(
'E',message)
1413 character(len=*),
intent(in) :: name
1414 character(len=*),
intent(in) :: desc
1415 character(len=*),
intent(in) :: units
1416 character(len=*),
intent(in) :: dims(:)
1417 real(DP),
intent(in) :: var(:,:,:)
1418 character(len=*),
intent(in),
optional :: datatype
1419 integer,
intent(in),
optional :: start(:)
1425 intrinsic size, shape, reshape
1428 if (
present(datatype) )
then 1429 if ( datatype ==
'REAL4' )
then 1431 elseif( datatype ==
'REAL8' )
then 1434 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
1435 call log(
'E',message)
1441 dim_size =
size(var)
1443 if ( history_assoc_count < history_assoc_limit )
then 1444 history_assoc_count = history_assoc_count + 1
1445 id = history_assoc_count
1447 allocate( history_assoc(id)%var(dim_size) )
1449 history_assoc(id)%name = name
1450 history_assoc(id)%desc = desc
1451 history_assoc(id)%units = units
1452 history_assoc(id)%ndims = 3
1453 history_assoc(id)%dims(:) =
'' 1454 history_assoc(id)%dims(1:3) = dims(1:3)
1455 history_assoc(id)%dtype = dtype
1456 history_assoc(id)%var(:) = reshape( var, (/ dim_size /) )
1460 history_assoc(id)%count(1:3) = shape(var)
1461 if (
present(start) )
then 1462 history_assoc(id)%start(1:3) = start(1:3)
1464 history_assoc(id)%start = (/ 1, 1, 1, 1 /)
1467 write(message,*)
'xxx Number of associate coordinates exceeds the limit.' 1468 call log(
'E',message)
1488 character(len=*),
intent(in) :: name
1489 character(len=*),
intent(in) :: desc
1490 character(len=*),
intent(in) :: units
1491 character(len=*),
intent(in) :: dims(:)
1492 real(SP),
intent(in) :: var(:,:,:,:)
1493 character(len=*),
intent(in),
optional :: datatype
1494 integer,
intent(in),
optional :: start(:)
1500 intrinsic size, shape, reshape
1503 if (
present(datatype) )
then 1504 if ( datatype ==
'REAL4' )
then 1506 elseif( datatype ==
'REAL8' )
then 1509 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
1510 call log(
'E',message)
1516 dim_size =
size(var)
1518 if ( history_assoc_count < history_assoc_limit )
then 1519 history_assoc_count = history_assoc_count + 1
1520 id = history_assoc_count
1522 allocate( history_assoc(id)%var(dim_size) )
1524 history_assoc(id)%name = name
1525 history_assoc(id)%desc = desc
1526 history_assoc(id)%units = units
1527 history_assoc(id)%ndims = 4
1528 history_assoc(id)%dims(:) =
'' 1529 history_assoc(id)%dims(1:4) = dims(1:4)
1530 history_assoc(id)%dtype = dtype
1531 history_assoc(id)%var(:) = reshape( var, (/ dim_size /) )
1535 history_assoc(id)%count(1:4) = shape(var)
1536 if (
present(start) )
then 1537 history_assoc(id)%start(1:4) = start(1:4)
1539 history_assoc(id)%start = (/ 1, 1, 1, 1 /)
1542 write(message,*)
'xxx Number of associate coordinates exceeds the limit.' 1543 call log(
'E',message)
1563 character(len=*),
intent(in) :: name
1564 character(len=*),
intent(in) :: desc
1565 character(len=*),
intent(in) :: units
1566 character(len=*),
intent(in) :: dims(:)
1567 real(DP),
intent(in) :: var(:,:,:,:)
1568 character(len=*),
intent(in),
optional :: datatype
1569 integer,
intent(in),
optional :: start(:)
1575 intrinsic size, shape, reshape
1578 if (
present(datatype) )
then 1579 if ( datatype ==
'REAL4' )
then 1581 elseif( datatype ==
'REAL8' )
then 1584 write(message,*)
'xxx Not appropriate datatype. Check!', datatype
1585 call log(
'E',message)
1591 dim_size =
size(var)
1593 if ( history_assoc_count < history_assoc_limit )
then 1594 history_assoc_count = history_assoc_count + 1
1595 id = history_assoc_count
1597 allocate( history_assoc(id)%var(dim_size) )
1599 history_assoc(id)%name = name
1600 history_assoc(id)%desc = desc
1601 history_assoc(id)%units = units
1602 history_assoc(id)%ndims = 4
1603 history_assoc(id)%dims(:) =
'' 1604 history_assoc(id)%dims(1:4) = dims(1:4)
1605 history_assoc(id)%dtype = dtype
1606 history_assoc(id)%var(:) = reshape( var, (/ dim_size /) )
1610 history_assoc(id)%count(1:4) = shape(var)
1611 if (
present(start) )
then 1612 history_assoc(id)%start(1:4) = start(1:4)
1614 history_assoc(id)%start = (/ 1, 1, 1, 1 /)
1617 write(message,*)
'xxx Number of associate coordinates exceeds the limit.' 1618 call log(
'E',message)
1633 character(len=*),
intent(in) :: varname
1634 character(len=*),
intent(in) :: key
1635 character(len=*),
intent(in) :: val
1640 do id = 1, history_id_count
1656 character(len=*),
intent(in) :: item
1657 integer,
intent(in) :: step_now
1658 logical,
intent(out) :: answer
1666 do id = 1, history_id_count
1667 if ( item == history_vars(id)%item )
then 1668 if ( history_vars(id)%taverage )
then 1670 elseif( step_now == history_vars(id)%laststep_write + history_vars(id)%dstep )
then 1680 subroutine historyput0didsp( &
1686 integer,
intent(in) :: id
1687 integer,
intent(in) :: step_now
1688 real(SP),
intent(in) :: var
1696 if ( id < 0 )
return 1698 dt = ( step_now - history_vars(id)%laststep_put ) * history_dtsec
1700 if ( dt < eps .AND. ( .NOT. history_vars(id)%taverage ) )
then 1701 write(message,*)
'xxx History variable was put two times before output!: ', &
1702 trim(history_vars(id)%item), step_now, history_vars(id)%laststep_put
1703 call log(
'E',message)
1706 if ( history_vars(id)%taverage )
then 1708 history_vars(id)%varsum(idx) = history_vars(id)%varsum(idx) + var * dt
1710 history_vars(id)%timesum = history_vars(id)%timesum + dt
1713 history_vars(id)%varsum(idx) = var
1715 history_vars(id)%timesum = 0.0_dp
1718 history_vars(id)%size = idx
1719 history_vars(id)%laststep_put = step_now
1722 end subroutine historyput0didsp
1725 subroutine historyput0diddp( &
1731 integer,
intent(in) :: id
1732 integer,
intent(in) :: step_now
1733 real(DP),
intent(in) :: var
1741 if ( id < 0 )
return 1743 dt = ( step_now - history_vars(id)%laststep_put ) * history_dtsec
1745 if ( dt < eps .AND. ( .NOT. history_vars(id)%taverage ) )
then 1746 write(message,*)
'xxx History variable was put two times before output!: ', &
1747 trim(history_vars(id)%item), step_now, history_vars(id)%laststep_put
1748 call log(
'E',message)
1751 if ( history_vars(id)%taverage )
then 1753 history_vars(id)%varsum(idx) = history_vars(id)%varsum(idx) + var * dt
1755 history_vars(id)%timesum = history_vars(id)%timesum + dt
1758 history_vars(id)%varsum(idx) = var
1760 history_vars(id)%timesum = 0.0_dp
1763 history_vars(id)%size = idx
1764 history_vars(id)%laststep_put = step_now
1767 end subroutine historyput0diddp
1770 subroutine historyput1didsp( &
1776 integer,
intent(in) :: id
1777 integer,
intent(in) :: step_now
1778 real(SP),
intent(in) :: var(:)
1788 if ( id < 0 )
return 1791 dt = ( step_now - history_vars(id)%laststep_put ) * history_dtsec
1793 if ( dt < eps .AND. ( .NOT. history_vars(id)%taverage ) )
then 1794 write(message,*)
'xxx History variable was put two times before output!: ', &
1795 trim(history_vars(id)%item), step_now, history_vars(id)%laststep_put
1796 call log(
'E',message)
1799 if ( history_vars(id)%taverage )
then 1802 history_vars(id)%varsum(idx) = history_vars(id)%varsum(idx) + var(i) * dt
1805 history_vars(id)%timesum = history_vars(id)%timesum + dt
1809 history_vars(id)%varsum(idx) = var(i)
1812 history_vars(id)%timesum = 0.0_dp
1815 history_vars(id)%size = idx
1816 history_vars(id)%laststep_put = step_now
1819 end subroutine historyput1didsp
1822 subroutine historyput1diddp( &
1828 integer,
intent(in) :: id
1829 integer,
intent(in) :: step_now
1830 real(DP),
intent(in) :: var(:)
1840 if ( id < 0 )
return 1843 dt = ( step_now - history_vars(id)%laststep_put ) * history_dtsec
1845 if ( dt < eps .AND. ( .NOT. history_vars(id)%taverage ) )
then 1846 write(message,*)
'xxx History variable was put two times before output!: ', &
1847 trim(history_vars(id)%item), step_now, history_vars(id)%laststep_put
1848 call log(
'E',message)
1851 if ( history_vars(id)%taverage )
then 1854 history_vars(id)%varsum(idx) = history_vars(id)%varsum(idx) + var(i) * dt
1857 history_vars(id)%timesum = history_vars(id)%timesum + dt
1861 history_vars(id)%varsum(idx) = var(i)
1864 history_vars(id)%timesum = 0.0_dp
1867 history_vars(id)%size = idx
1868 history_vars(id)%laststep_put = step_now
1871 end subroutine historyput1diddp
1874 subroutine historyput2didsp( &
1880 integer,
intent(in) :: id
1881 integer,
intent(in) :: step_now
1882 real(SP),
intent(in) :: var(:,:)
1892 if ( id < 0 )
return 1895 dt = ( step_now - history_vars(id)%laststep_put ) * history_dtsec
1897 if ( dt < eps .AND. ( .NOT. history_vars(id)%taverage ) )
then 1898 write(message,*)
'xxx History variable was put two times before output!: ', &
1899 trim(history_vars(id)%item), step_now, history_vars(id)%laststep_put
1900 call log(
'E',message)
1903 if ( history_vars(id)%taverage )
then 1906 idx = (j-1)*vsize(1)+i
1907 history_vars(id)%varsum(idx) = history_vars(id)%varsum(idx) + var(i,j) * dt
1911 history_vars(id)%timesum = history_vars(id)%timesum + dt
1915 idx = (j-1)*vsize(1)+i
1916 history_vars(id)%varsum(idx) = var(i,j)
1920 history_vars(id)%timesum = 0.0_dp
1923 history_vars(id)%size = idx
1924 history_vars(id)%laststep_put = step_now
1927 end subroutine historyput2didsp
1930 subroutine historyput2diddp( &
1936 integer,
intent(in) :: id
1937 integer,
intent(in) :: step_now
1938 real(DP),
intent(in) :: var(:,:)
1948 if ( id < 0 )
return 1951 dt = ( step_now - history_vars(id)%laststep_put ) * history_dtsec
1953 if ( dt < eps .AND. ( .NOT. history_vars(id)%taverage ) )
then 1954 write(message,*)
'xxx History variable was put two times before output!: ', &
1955 trim(history_vars(id)%item), step_now, history_vars(id)%laststep_put
1956 call log(
'E',message)
1959 if ( history_vars(id)%taverage )
then 1962 idx = (j-1)*vsize(1)+i
1963 history_vars(id)%varsum(idx) = history_vars(id)%varsum(idx) + var(i,j) * dt
1967 history_vars(id)%timesum = history_vars(id)%timesum + dt
1971 idx = (j-1)*vsize(1)+i
1972 history_vars(id)%varsum(idx) = var(i,j)
1976 history_vars(id)%timesum = 0.0_dp
1979 history_vars(id)%size = idx
1980 history_vars(id)%laststep_put = step_now
1983 end subroutine historyput2diddp
1986 subroutine historyput3didsp( &
1992 integer,
intent(in) :: id
1993 integer,
intent(in) :: step_now
1994 real(SP),
intent(in) :: var(:,:,:)
2004 if ( id < 0 )
return 2007 dt = ( step_now - history_vars(id)%laststep_put ) * history_dtsec
2009 if ( dt < eps .AND. ( .NOT. history_vars(id)%taverage ) )
then 2010 write(message,*)
'xxx History variable was put two times before output!: ', &
2011 trim(history_vars(id)%item), step_now, history_vars(id)%laststep_put
2012 call log(
'E',message)
2015 if ( history_vars(id)%taverage )
then 2019 idx = ((k-1)*vsize(2)+(j-1))*vsize(1)+i
2020 history_vars(id)%varsum(idx) = history_vars(id)%varsum(idx) + var(i,j,k) * dt
2025 history_vars(id)%timesum = history_vars(id)%timesum + dt
2030 idx = ((k-1)*vsize(2)+(j-1))*vsize(1)+i
2031 history_vars(id)%varsum(idx) = var(i,j,k)
2036 history_vars(id)%timesum = 0.0_dp
2039 history_vars(id)%size = idx
2040 history_vars(id)%laststep_put = step_now
2043 end subroutine historyput3didsp
2046 subroutine historyput3diddp( &
2052 integer,
intent(in) :: id
2053 integer,
intent(in) :: step_now
2054 real(DP),
intent(in) :: var(:,:,:)
2064 if ( id < 0 )
return 2067 dt = ( step_now - history_vars(id)%laststep_put ) * history_dtsec
2069 if ( dt < eps .AND. ( .NOT. history_vars(id)%taverage ) )
then 2070 write(message,*)
'xxx History variable was put two times before output!: ', &
2071 trim(history_vars(id)%item), step_now, history_vars(id)%laststep_put
2072 call log(
'E',message)
2075 if ( history_vars(id)%taverage )
then 2079 idx = ((k-1)*vsize(2)+(j-1))*vsize(1)+i
2080 history_vars(id)%varsum(idx) = history_vars(id)%varsum(idx) + var(i,j,k) * dt
2085 history_vars(id)%timesum = history_vars(id)%timesum + dt
2090 idx = ((k-1)*vsize(2)+(j-1))*vsize(1)+i
2091 history_vars(id)%varsum(idx) = var(i,j,k)
2096 history_vars(id)%timesum = 0.0_dp
2099 history_vars(id)%size = idx
2100 history_vars(id)%laststep_put = step_now
2103 end subroutine historyput3diddp
2111 integer,
intent(in) :: step_now
2114 integer :: fid, prev_fid
2122 do id = 1, history_id_count
2128 do id = 1, history_id_count
2129 fid = history_vars(id)%fid
2130 if ( fid .NE. prev_fid )
then 2147 filewriteassociatedcoordinates
2150 integer :: m, id, fid
2154 if( history_req_count == 0 )
return 2155 if( history_axis_count == 0 )
return 2157 do id = 1, history_id_count
2159 fid = history_vars(id)%fid
2161 if ( history_axis_written(fid) ) cycle
2166 do m = 1, history_axis_count
2167 if ( history_axis(m)%start(1) > 0 )
then 2168 start(1) = history_axis(m)%start(1)
2169 call filewriteaxis( fid, &
2170 history_axis(m)%name, &
2171 history_axis(m)%var, &
2176 do m = 1, history_assoc_count
2177 call filewriteassociatedcoordinates( fid, &
2178 history_assoc(m)%name, &
2179 history_assoc(m)%var, &
2180 history_assoc(m)%start, &
2181 history_assoc(m)%count, &
2182 history_assoc(m)%ndims )
2189 history_axis_written( fid ) = .true.
2206 integer,
intent(in) :: id
2207 integer,
intent(in) :: step_now
2210 real(DP) :: time_str, time_end
2211 real(DP) :: sec_str, sec_end
2214 if( history_req_count == 0 )
return 2216 if ( step_now < history_vars(id)%laststep_write + history_vars(id)%dstep )
then 2220 if ( history_vars(id)%laststep_put == history_vars(id)%laststep_write )
then 2221 write(message,*)
'xxx History variable was never put after the last output!: ', &
2222 trim(history_vars(id)%item)
2223 if ( history_error_putmiss )
then 2224 call log(
'E',message)
2226 call log(
'I',message)
2230 isize = history_vars(id)%size
2232 if ( history_vars(id)%taverage )
then 2233 history_vars(id)%varsum(1:isize) = history_vars(id)%varsum(1:isize) / history_vars(id)%timesum
2236 if ( firsttime )
then 2241 sec_str = history_startdaysec +
real(History_vars(id)%laststep_write-1,kind=DP) * history_dtsec
2242 sec_end = history_startdaysec +
real(step_now -1,kind=DP) * history_dtsec
2244 if ( sec_end >= history_startdaysec + history_vars(id)%waitsec )
then 2245 if ( laststep_write < step_now )
then 2246 write(message,
'(A)')
'*** Output History' 2247 call log(
'I',message)
2251 call calendarsec2ymdhms( time_str, sec_str, history_time_units )
2252 call calendarsec2ymdhms( time_end, sec_end, history_time_units )
2254 if ( history_vars(id)%count(1) .GT. 0 )
then 2260 call filewrite( history_vars(id)%fid, &
2261 history_vars(id)%vid, &
2262 history_vars(id)%varsum(1:isize), &
2265 history_vars(id)%start, &
2266 history_vars(id)%count, &
2267 history_vars(id)%ndims )
2270 if ( laststep_write < step_now )
then 2271 write(message,
'(A)')
'*** Output History: Suppressed.' 2272 call log(
'I',message)
2276 history_vars(id)%laststep_write = step_now
2277 history_vars(id)%laststep_put = step_now
2278 history_vars(id)%timesum = 0.0_dp
2279 history_vars(id)%varsum(:) = 0.0_dp
2281 laststep_write = step_now
2299 real(DP),
intent(out) :: var(:)
2300 character(len=*),
intent(in) :: basename
2301 character(len=*),
intent(in) :: varname
2302 integer,
intent(in) :: step
2303 logical,
intent(in),
optional :: allow_missing
2304 logical,
intent(in),
optional :: single
2306 logical :: allow_missing_
2310 allow_missing_ = .false.
2313 if (
present(allow_missing) )
then 2314 allow_missing_ = allow_missing
2317 if (
present(single) )
then 2321 call fileread( var, &
2344 real(SP),
intent(out) :: var(:)
2345 character(len=*),
intent(in) :: basename
2346 character(len=*),
intent(in) :: varname
2347 integer,
intent(in) :: step
2348 logical,
intent(in),
optional :: allow_missing
2349 logical,
intent(in),
optional :: single
2351 logical :: allow_missing_
2355 allow_missing_ = .false.
2358 if (
present(allow_missing) )
then 2359 allow_missing_ = allow_missing
2362 if (
present(single) )
then 2366 call fileread( var, &
2389 real(DP),
intent(out) :: var(:,:)
2390 character(len=*),
intent(in) :: basename
2391 character(len=*),
intent(in) :: varname
2392 integer,
intent(in) :: step
2393 logical,
intent(in),
optional :: allow_missing
2394 logical,
intent(in),
optional :: single
2396 logical :: allow_missing_
2400 allow_missing_ = .false.
2403 if (
present(allow_missing) )
then 2404 allow_missing_ = allow_missing
2407 if (
present(single) )
then 2411 call fileread( var, &
2434 real(SP),
intent(out) :: var(:,:)
2435 character(len=*),
intent(in) :: basename
2436 character(len=*),
intent(in) :: varname
2437 integer,
intent(in) :: step
2438 logical,
intent(in),
optional :: allow_missing
2439 logical,
intent(in),
optional :: single
2441 logical :: allow_missing_
2445 allow_missing_ = .false.
2448 if (
present(allow_missing) )
then 2449 allow_missing_ = allow_missing
2452 if (
present(single) )
then 2456 call fileread( var, &
2479 real(DP),
intent(out) :: var(:,:,:)
2480 character(len=*),
intent(in) :: basename
2481 character(len=*),
intent(in) :: varname
2482 integer,
intent(in) :: step
2483 logical,
intent(in),
optional :: allow_missing
2484 logical,
intent(in),
optional :: single
2486 logical :: allow_missing_
2490 allow_missing_ = .false.
2493 if (
present(allow_missing) )
then 2494 allow_missing_ = allow_missing
2497 if (
present(single) )
then 2501 call fileread( var, &
2524 real(SP),
intent(out) :: var(:,:,:)
2525 character(len=*),
intent(in) :: basename
2526 character(len=*),
intent(in) :: varname
2527 integer,
intent(in) :: step
2528 logical,
intent(in),
optional :: allow_missing
2529 logical,
intent(in),
optional :: single
2531 logical :: allow_missing_
2535 allow_missing_ = .false.
2538 if (
present(allow_missing) )
then 2539 allow_missing_ = allow_missing
2542 if (
present(single) )
then 2546 call fileread( var, &
2566 write(message,
'(A)')
'*** [HIST] Output item list ' 2567 call log(
'I',message)
2568 write(message,
'(A,I4)')
'*** Number of history item :', history_req_count
2569 call log(
'I',message)
2570 write(message,
'(2A)')
'ITEM :OUTNAME ', &
2571 ': size:interval[sec]: step:timeavg?:zcoord' 2572 call log(
'I',message)
2573 write(message,
'(2A)')
'=================================================', &
2574 '================================================' 2575 call log(
'I',message)
2577 do id = 1, history_id_count
2578 dtsec =
real(History_vars(id)%dstep,kind=DP) * history_dtsec
2580 write(message,
'(A24,1x,A24,1x,I8,1x,F13.3,1x,I8,1x,L8,1x,A6)') history_vars(id)%item, &
2581 history_vars(id)%outname, &
2582 history_vars(id)%size, &
2584 history_vars(id)%dstep, &
2585 history_vars(id)%taverage, &
2586 history_vars(id)%zcoord
2587 call log(
'I',message)
2590 write(message,
'(2A)')
'=================================================', &
2591 '================================================' 2592 call log(
'I',message)
2606 integer :: fid, prev_fid
2610 do id = 1, history_id_count
2611 fid = history_vars(id)%fid
2612 if ( fid .NE. prev_fid )
then
subroutine historyput2dassociatedcoordinatessp(name, desc, units, dims, var, datatype, start)
subroutine historyget3ddp(var, basename, varname, step, allow_missing, single)
subroutine historyput3dassociatedcoordinatesdp(name, desc, units, dims, var, datatype, start)
subroutine, public historyaddvariable(nregist, item, dims, desc, units, now_step, zcoord, options, start, count, comm)
subroutine, public historycheck(existed, item, zcoord)
integer, parameter, public log_lmsg
subroutine, public log_nml(type, message)
subroutine historyget3dsp(var, basename, varname, step, allow_missing, single)
subroutine, public historywriteaxes
subroutine historyput3dassociatedcoordinatessp(name, desc, units, dims, var, datatype, start)
subroutine historyget1dsp(var, basename, varname, step, allow_missing, single)
subroutine historyget1ddp(var, basename, varname, step, allow_missing, single)
integer, public log_fid_nml
integer, parameter, public dp
subroutine, public historyfinalize
subroutine historyputaxisdp(name, desc, units, dim, var, datatype, down, gsize, start)
subroutine, public log(type, message)
subroutine historyget2ddp(var, basename, varname, step, allow_missing, single)
subroutine historyput2dassociatedcoordinatesdp(name, desc, units, dims, var, datatype, start)
subroutine historyput4dassociatedcoordinatesdp(name, desc, units, dims, var, datatype, start)
subroutine historyput1dassociatedcoordinatessp(name, desc, units, dims, var, datatype, start)
subroutine, public historyoutputlist
subroutine, public historywrite(id, step_now)
integer, parameter, public sp
subroutine historyputaxissp(name, desc, units, dim, var, datatype, down, gsize, start)
subroutine historyput1dassociatedcoordinatesdp(name, desc, units, dims, var, datatype, start)
subroutine historyput4dassociatedcoordinatessp(name, desc, units, dims, var, datatype, start)
subroutine, public historywriteall(step_now)
subroutine, public historyquery(item, step_now, answer)
subroutine, public historyinit(item_count, variant_count, isize, jsize, ksize, master, myrank, rankidx, title, source, institution, time_start, time_interval, time_units, time_since, default_basename, default_zcoord, default_tinterval, default_tunit, default_taverage, default_datatype, namelist_filename, namelist_fid)
subroutine historyget2dsp(var, basename, varname, step, allow_missing, single)
subroutine, public historysettattr(varname, key, val)