SCALE-RM
Data Types | Functions/Subroutines
gtool_history Module Reference

module Gtool_History More...

Functions/Subroutines

subroutine, public historyinit (title, source, institution, array_size, master, myrank, rankidx, time_start, time_interval, time_units, time_since, default_basename, default_tinterval, default_tunit, default_taverage, default_zinterp, default_datatype, namelist_filename, namelist_fid)
 
subroutine, public historyaddvariable (varname, dims, desc, units, now_step, id, zinterp, existed, options)
 
subroutine historyputaxissp (name, desc, units, dim, var, dtype, down)
 
subroutine historyputaxisdp (name, desc, units, dim, var, dtype, down)
 
subroutine historyput1dassociatedcoordinatessp (name, desc, units, dims, var, dtype)
 
subroutine historyput1dassociatedcoordinatesdp (name, desc, units, dims, var, dtype)
 
subroutine historyput2dassociatedcoordinatessp (name, desc, units, dims, var, dtype)
 
subroutine historyput2dassociatedcoordinatesdp (name, desc, units, dims, var, dtype)
 
subroutine historyput3dassociatedcoordinatessp (name, desc, units, dims, var, dtype)
 
subroutine historyput3dassociatedcoordinatesdp (name, desc, units, dims, var, dtype)
 
subroutine historyput4dassociatedcoordinatessp (name, desc, units, dims, var, dtype)
 
subroutine historyput4dassociatedcoordinatesdp (name, desc, units, dims, var, dtype)
 
subroutine, public historysettattr (varname, key, val)
 
subroutine, public historyquery (itemid, step_next, answer)
 
subroutine, public historywrite (itemid, step_now)
 
subroutine, public historywriteall (step_now)
 
subroutine historyget1dsp (var, basename, varname, step, allow_missing, single)
 
subroutine historyget2ddp (var, basename, varname, step, allow_missing, single)
 
subroutine historyget2dsp (var, basename, varname, step, allow_missing, single)
 
subroutine historyget3ddp (var, basename, varname, step, allow_missing, single)
 
subroutine historyget3dsp (var, basename, varname, step, allow_missing, single)
 
subroutine, public historyoutputlist
 
subroutine, public historyfinalize
 

Detailed Description

module Gtool_History

Description
module library for history output
Author
Team SCALE
History
  • 2012-06-11 (S.Nishizawa) [new] imported from SCALE-LES

Function/Subroutine Documentation

◆ historyinit()

subroutine, public gtool_history::historyinit ( character(len=*), intent(in)  title,
character(len=*), intent(in)  source,
character(len=*), intent(in)  institution,
integer, intent(in)  array_size,
integer, intent(in)  master,
integer, intent(in)  myrank,
integer, dimension(:), intent(in)  rankidx,
real(dp), intent(in)  time_start,
real(dp), intent(in)  time_interval,
character(len=*), intent(in), optional  time_units,
character(len=*), intent(in), optional  time_since,
character(len=*), intent(in), optional  default_basename,
real(dp), intent(in), optional  default_tinterval,
character(len=*), intent(in), optional  default_tunit,
logical, intent(in), optional  default_taverage,
logical, intent(in), optional  default_zinterp,
character(len=*), intent(in), optional  default_datatype,
character(len=*), intent(in), optional  namelist_filename,
integer, intent(in), optional  namelist_fid 
)

Definition at line 201 of file gtool_history.f90.

References gtool_file_h::file_preclist, gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

Referenced by scale_history::hist_setup().

201  use dc_calendar, only: &
202  calendarymdhms2sec
203  use gtool_file_h, only: &
204  file_real4, &
205  file_real8, &
207  implicit none
208 
209  character(len=*), intent(in) :: title
210  character(len=*), intent(in) :: source
211  character(len=*), intent(in) :: institution
212  integer, intent(in) :: array_size
213  integer, intent(in) :: master
214  integer, intent(in) :: myrank
215  integer, intent(in) :: rankidx(:)
216  real(DP), intent(in) :: time_start
217  real(DP), intent(in) :: time_interval
218  character(len=*), intent(in), optional :: time_units
219  character(len=*), intent(in), optional :: time_since
220  character(len=*), intent(in), optional :: default_basename
221  real(DP), intent(in), optional :: default_tinterval
222  character(len=*), intent(in), optional :: default_tunit
223  logical, intent(in), optional :: default_taverage
224  logical, intent(in), optional :: default_zinterp
225  character(len=*), intent(in), optional :: default_datatype
226  character(len=*), intent(in), optional :: namelist_filename
227  integer , intent(in), optional :: namelist_fid
228 
229  character(len=File_HLONG) :: history_default_basename = ''
230  real(DP) :: history_default_tinterval = 1.0_dp
231  character(len=File_HSHORT) :: history_default_tunit = 'sec'
232  logical :: history_default_taverage = .false.
233  logical :: history_default_zinterp = .false.
234  character(len=File_HSHORT) :: history_default_datatype = 'REAL4'
235 
236  namelist / param_history / &
237  history_title, &
238  history_source, &
239  history_institution, &
240  history_time_units, &
241  history_default_basename, &
242  history_default_tinterval, &
243  history_default_tunit, &
244  history_default_taverage, &
245  history_default_zinterp, &
246  history_default_datatype, &
247  history_output_step0, &
248  history_output_start, &
249  history_error_putmiss
250 
251  character(len=File_HLONG) :: basename
252  character(len=File_HSHORT) :: item
253  real(DP) :: tinterval
254  character(len=File_HSHORT) :: tunit
255  logical :: taverage
256  logical :: zinterp
257  character(len=File_HSHORT) :: datatype
258 
259  namelist / histitem / &
260  basename, &
261  item, &
262  tinterval, &
263  tunit, &
264  taverage, &
265  zinterp, &
266  datatype
267 
268  integer :: fid_conf
269 
270  integer :: ierr
271  integer :: n, ni
272  integer :: memsize
273  intrinsic size
274  !---------------------------------------------------------------------------
275 
276  call log('I', '')
277  call log('I', '+++ Module[HISTORY]/Categ[IO]')
278 
279  !--- read namelist
280  history_title = title
281  history_source = source
282  history_institution = institution
283  history_startdaysec = time_start
284  history_dtsec = time_interval
285  if ( present(time_units) ) then
286  history_time_units = time_units
287  else
288  history_time_units = 'seconds'
289  endif
290  if ( present(time_since) ) then
291  history_time_since = time_since
292  else
293  history_time_since = ''
294  endif
295  if ( present(default_basename) ) then
296  history_default_basename = default_basename
297  endif
298  if ( present(default_tinterval) ) then
299  history_default_tinterval = default_tinterval
300  if ( present(default_tunit) ) then
301  history_default_tunit = default_tunit
302  endif
303  endif
304  if ( present(default_taverage) ) then
305  history_default_taverage = default_taverage
306  endif
307  if ( present(default_zinterp) ) then
308  history_default_zinterp = default_zinterp
309  endif
310  if ( present(default_datatype) ) then
311  history_default_datatype = default_datatype
312  endif
313 
314  if ( present(namelist_fid) ) then
315  fid_conf = namelist_fid
316  rewind(fid_conf)
317  else if ( present(namelist_filename) ) then
318  if ( namelist_filename /= '' ) then
319  open( fid_conf, file = trim(namelist_filename), &
320  form = 'formatted', status = 'old', iostat = ierr)
321  else
322  call log('I', '*** Brank namelist file was specified. Default used. ***')
323  fid_conf = -1
324  endif
325  else
326  call log('I', '*** No namelist was specified. Default used. ***')
327  fid_conf = -1
328  endif
329 
330  if ( fid_conf > 0 ) then
331  read(fid_conf, nml=param_history, iostat=ierr)
332 
333  if( ierr < 0 ) then !--- missing
334  call log('I', '*** Not found namelist. Default used.')
335  elseif( ierr > 0 ) then !--- fatal error
336  call log('E', 'xxx Not appropriate names in namelist PARAM_HISTORY. Check!')
337  endif
338 #if defined(__PGI) || defined(__ES2)
339  write(log_fid,nml=param_history)
340 #else
341  write(message,nml=param_history)
342  call log('I', message)
343 #endif
344  endif
345 
346  ! listup history request
347  history_req_nmax = 0
348  if ( fid_conf > 0 ) then
349  rewind( fid_conf )
350  do n = 1, history_req_limit
351  basename = history_default_basename
352  read(fid_conf, nml=histitem, iostat=ierr)
353  if( ierr /= 0 ) exit
354  if ( basename /= "" ) history_req_nmax = history_req_nmax + 1
355  enddo
356  endif
357 
358  if ( history_req_nmax > history_req_limit ) then
359  write(message,*) '*** request of history file is exceed! n >', history_req_limit
360  call log('I', message)
361  elseif( history_req_nmax == 0 ) then
362  call log('I', '*** No history file specified.')
363  return
364  endif
365 
366  allocate( history_item(history_req_nmax) ); history_item(:) = ''
367  allocate( history_fid(history_req_nmax) )
368  allocate( history_vid(history_req_nmax) )
369  allocate( history_tintsec(history_req_nmax) )
370  allocate( history_tintstep(history_req_nmax) )
371  allocate( history_tavg(history_req_nmax) )
372  allocate( history_zinterp(history_req_nmax) )
373 
374  allocate( history_varsum(array_size,history_req_nmax) )
375  allocate( history_size(history_req_nmax) )
376  allocate( history_tstart(history_req_nmax) )
377  allocate( history_tstrstep(history_req_nmax) )
378  allocate( history_tlststep(history_req_nmax) )
379  allocate( history_tsumsec(history_req_nmax) )
380 
381  if ( fid_conf > 0 ) rewind(fid_conf)
382  memsize = 0
383  ni = 0
384  do n = 1, history_req_limit
385  ! set default
386  basename = history_default_basename
387  item = 'unknown'
388  tinterval = history_default_tinterval
389  tunit = history_default_tunit
390  taverage = history_default_taverage
391  zinterp = history_default_zinterp
392  datatype = history_default_datatype
393 
394  if ( fid_conf > 0 ) then
395  read(fid_conf, nml=histitem,iostat=ierr)
396  if( ierr /= 0 ) exit
397  endif
398 
399  if ( basename == "" ) cycle
400  ni = ni + 1
401 
402  history_req_item(ni) = item
403  history_req_basename(ni) = basename
404  call calendarymdhms2sec( history_req_tintsec(ni), tinterval, tunit )
405  history_req_tintstep(ni) = int( history_req_tintsec(ni) / history_dtsec )
406 
407  history_req_tavg(ni) = taverage
408  history_req_zinterp(ni) = zinterp
409 
410  if ( history_req_tintsec(ni) <= 0.d0 ) then
411  write(message,*) 'xxx Not appropriate time interval. Check!', item, tinterval
412  call log('E', message)
413  endif
414 
415  if ( abs(history_req_tintsec(ni)-real(History_req_tintstep(ni),kind=dp)*history_dtsec) > eps ) then
416  write(message,*) 'xxx time interval must be a multiple of delta t ', &
417  history_req_tintsec(ni), real(History_req_tintstep(ni),kind=dp)*history_dtsec
418  call log('E', message)
419  endif
420 
421  if ( datatype == 'REAL4' ) then
422  history_req_dtype(n) = file_real4
423  elseif( datatype == 'REAL8' ) then
424  history_req_dtype(n) = file_real8
425  else
426  write(message,*) 'xxx Not appropriate DATATYPE. Check!', datatype
427  call log('E', message)
428  endif
429 
430  memsize = memsize + array_size * file_preclist(history_req_dtype(ni))
431  enddo
432 
433  write(message,*) '*** Number of requested history item : ', history_req_nmax
434  call log('I', message)
435  write(message,*) '*** Output default data type : ', history_default_datatype
436  call log('I', message)
437  write(message,*) '*** Memory usage for history data buffer [Mbyte] : ', memsize/1024/1024
438  call log('I', message)
439 
440  if ( (.not. present(namelist_fid)) ) then
441  if ( fid_conf > 0 ) close(fid_conf)
442  endif
443 
444  history_master = master
445  history_myrank = myrank
446  allocate( history_rankidx(size(rankidx)) )
447  history_rankidx(:) = rankidx(:)
448 
449  return
module TIME
Definition: dc_calendar.f90:17
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, dimension(0:3), parameter, public file_preclist
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public dp
integer, parameter, public file_real8
Here is the call graph for this function:
Here is the caller graph for this function:

◆ historyaddvariable()

subroutine, public gtool_history::historyaddvariable ( character(len=*), intent(in)  varname,
character(len=*), dimension(:), intent(in)  dims,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
integer, intent(in)  now_step,
integer, intent(out)  id,
logical, intent(out)  zinterp,
logical, intent(out)  existed,
character(len=*), intent(in), optional  options 
)

Definition at line 463 of file gtool_history.f90.

References gtool_file::filecreate(), gtool_file::filesetoption(), gtool_file::filesettattr(), and dc_log::log().

Referenced by scale_history::hist_reg().

463  use gtool_file, only: &
464  filecreate, &
465  filesetoption, &
466  fileaddvariable, &
467  filesettattr, &
468  fileputaxis, &
469  fileputassociatedcoordinates
470  implicit none
471 
472  character(len=*), intent(in) :: varname
473  character(len=*), intent(in) :: dims(:)
474  character(len=*), intent(in) :: desc
475  character(len=*), intent(in) :: units
476  integer, intent(in) :: now_step
477  integer, intent(out) :: id
478  logical, intent(out) :: zinterp
479  logical, intent(out) :: existed
480  character(len=*), intent(in), optional :: options ! 'filetype1:key1=val1&filetype2:key2=val2&...'
481 
482  character(len=File_HMID) :: tunits
483 
484  logical :: fileexisted
485  integer :: nmax, reqid
486  integer :: n, m
487  integer :: ic, ie, is, lo
488 
489  intrinsic size
490  !---------------------------------------------------------------------------
491 
492  existed = .false.
493 
494  !--- search existing item
495  id = -1
496  nmax = min( history_id_count, history_req_nmax )
497  do n = 1, nmax
498  if ( varname == history_item(n) ) then ! match existing item
499  id = n
500  zinterp = history_zinterp(n)
501  existed = .true.
502  return
503  endif
504  enddo
505 
506  if ( id < 0 ) then ! request-register matching check
507 
508  ! new file registration
509  if ( history_time_since == '' ) then
510  tunits = history_time_units
511  else
512  tunits = trim(history_time_units)//' since '//trim(history_time_since)
513  endif
514 
515  do n = 1, history_req_nmax
516  if ( varname == history_req_item(n) ) then
517  reqid = n
518  if( history_req_basename(reqid) == '' ) exit
519  history_id_count = history_id_count + 1
520  id = history_id_count
521 
522  call filecreate( history_fid(id), & ! (out)
523  fileexisted, & ! (out)
524  trim(history_req_basename(reqid)), & ! (in)
525  history_title, & ! (in)
526  history_source, & ! (in)
527  history_institution, & ! (in)
528  history_master, & ! (in)
529  history_myrank, & ! (in)
530  history_rankidx, & ! (in)
531  time_units = tunits ) ! (in)
532 
533  if ( .not. fileexisted ) then
534 
535  if ( present(options) ) then
536  ic = -1 ! index of ':'
537  ie = -1 ! index of '='
538  is = 1 ! start index
539  lo = len_trim(options)
540  do m = 1, lo+1
541  if ( m == lo+1 .or. options(m:m) == '&' ) then
542  if ( ic == -1 .or. ie == -1 ) then
543  call log('E', 'xxx option is invalid: ' // trim(options))
544  endif
545  call filesetoption(history_fid(id), & ! (in)
546  options(is:ic-1), & ! (in)
547  options(ic+1:ie-1), options(ie+1:m-1) ) ! (in)
548  ic = -1
549  ie = -1
550  is = m + 1
551  else if ( options(m:m) == ':' ) then
552  ic = m
553  else if ( options(m:m) == '=' ) then
554  ie = m
555  endif
556  enddo
557  endif
558 
559  do m = 1, history_axis_count
560  call fileputaxis( history_fid(id), & ! (in)
561  history_axis(m)%name, history_axis(m)%desc, & ! (in)
562  history_axis(m)%units, history_axis(m)%dim, & ! (in)
563  history_axis(m)%type, history_axis(m)%var ) ! (in)
564  enddo
565 
566  do m = 1, history_assoc_count
567  call fileputassociatedcoordinates( history_fid(id), & ! (in)
568  history_assoc(m)%name, history_assoc(m)%desc, & ! (in)
569  history_assoc(m)%units, & ! (in)
570  history_assoc(m)%dims(1:history_assoc(m)%ndims), & ! (in)
571  history_assoc(m)%type, history_assoc(m)%var ) ! (in)
572  enddo
573 
574  endif
575 
576  history_item(id) = varname
577  history_tintsec(id) = history_req_tintsec(reqid)
578  history_tintstep(id) = history_req_tintstep(reqid)
579  history_tavg(id) = history_req_tavg(reqid)
580  history_zinterp(id) = history_req_zinterp(reqid)
581 
582  history_varsum(:,id) = 0.d0
583 
584  if ( history_output_step0 .and. now_step==1 ) then
585  history_tstrstep(id) = 1 - history_tintstep(id)
586  else
587  history_tstrstep(id) = 1
588  endif
589  if ( history_output_start > 0.0_dp ) then
590  history_tstart(id) = history_startdaysec + history_output_start
591  else
592  history_tstart(id) = history_startdaysec
593  end if
594  history_tlststep(id) = history_tstrstep(id)
595  history_tsumsec(id) = 0.d0
596 
597  call fileaddvariable( history_vid(id), & ! (out)
598  history_fid(id), & ! (in)
599  varname, desc, units, dims, & ! (in)
600  history_req_dtype(reqid), & ! (in)
601  history_tintsec(id), & ! (in)
602  history_tavg(id) ) ! (in)
603 
604  if ( .not. fileexisted ) then
605  do m = 1, history_axis_count
606  if ( history_axis(m)%down ) then
607  call filesettattr( history_fid(id), history_axis(m)%name, "positive", "down" )
608  endif
609  enddo
610  endif
611 
612  write(message,*) '*** [HIST] Item registration No.= ', id
613  call log('I', message)
614  write(message,*) '] Name : ', trim(history_item(id))
615  call log('I', message)
616  write(message,*) '] Description : ', trim(desc)
617  call log('I', message)
618  write(message,*) '] Unit : ', trim(units)
619  call log('I', message)
620  write(message,*) '] Interval [sec] : ', history_tintsec(id)
621  call log('I', message)
622  write(message,*) '] Interval [step] : ', history_tintstep(id)
623  call log('I', message)
624  write(message,*) '] Time Average? : ', history_tavg(id)
625  call log('I', message)
626  write(message,*) '] z* -> z conversion? : ', history_zinterp(id)
627  call log('I', message)
628  call log('I', '')
629 
630  zinterp = history_zinterp(id)
631 
632  exit
633  endif
634  enddo
635 
636  endif
637 
638  return
integer, public is
start point of inner domain: x, local
subroutine, public filecreate(fid, existed, basename, title, source, institution, master, myrank, rankidx, single, time_units, append)
Definition: gtool_file.f90:150
module GTOOL_FILE
Definition: gtool_file.f90:17
subroutine, public filesettattr(fid, vname, key, val)
Definition: gtool_file.f90:942
subroutine, public filesetoption(fid, filetype, key, val)
Definition: gtool_file.f90:422
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, public ie
end point of inner domain: x, local
Here is the call graph for this function:
Here is the caller graph for this function:

◆ historyputaxissp()

subroutine gtool_history::historyputaxissp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), intent(in)  dim,
real(sp), dimension(:), intent(in)  var,
character(len=*), intent(in), optional  dtype,
logical, intent(in), optional  down 
)

Definition at line 653 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

653  use gtool_file_h, only: &
654  file_real4, &
655  file_real8
656  implicit none
657 
658  character(len=*), intent(in) :: name
659  character(len=*), intent(in) :: desc
660  character(len=*), intent(in) :: units
661  character(len=*), intent(in) :: dim
662  real(SP), intent(in) :: var(:)
663  character(len=*), intent(in), optional :: dtype
664  logical, intent(in), optional :: down
665 
666  integer :: type
667  !---------------------------------------------------------------------------
668 
669  if ( present(dtype) ) then
670  if ( dtype == 'REAL4' ) then
671  type = file_real4
672  else if ( dtype == 'REAL8' ) then
673  type = file_real8
674  else
675  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
676  call log('E', message)
677  endif
678  else
679  type = file_real4
680  endif
681 
682  if ( history_axis_count < history_axis_limit ) then
683  history_axis_count = history_axis_count + 1
684  history_axis(history_axis_count)%name = name
685  history_axis(history_axis_count)%desc = desc
686  history_axis(history_axis_count)%units = units
687  history_axis(history_axis_count)%dim = dim
688  history_axis(history_axis_count)%type = type
689  allocate(history_axis(history_axis_count)%var(size(var)))
690  history_axis(history_axis_count)%var = var
691  if ( present(down) ) then
692  history_axis(history_axis_count)%down = down
693  else
694  history_axis(history_axis_count)%down = .false.
695  endif
696  else
697  write(message,*) 'xxx Number of axis exceeds the limit.'
698  call log('E', message)
699  endif
700 
701  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historyputaxisdp()

subroutine gtool_history::historyputaxisdp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), intent(in)  dim,
real(dp), dimension(:), intent(in)  var,
character(len=*), intent(in), optional  dtype,
logical, intent(in), optional  down 
)

Definition at line 712 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

712  use gtool_file_h, only: &
713  file_real4, &
714  file_real8
715  implicit none
716 
717  character(len=*), intent(in) :: name
718  character(len=*), intent(in) :: desc
719  character(len=*), intent(in) :: units
720  character(len=*), intent(in) :: dim
721  real(DP), intent(in) :: var(:)
722  character(len=*), intent(in), optional :: dtype
723  logical, intent(in), optional :: down
724 
725  integer :: type
726  !---------------------------------------------------------------------------
727 
728  if ( present(dtype) ) then
729  if ( dtype == 'REAL4' ) then
730  type = file_real4
731  else if ( dtype == 'REAL8' ) then
732  type = file_real8
733  else
734  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
735  call log('E', message)
736  endif
737  else
738  type = file_real8
739  endif
740 
741  if ( history_axis_count < history_axis_limit ) then
742  history_axis_count = history_axis_count + 1
743  history_axis(history_axis_count)%name = name
744  history_axis(history_axis_count)%desc = desc
745  history_axis(history_axis_count)%units = units
746  history_axis(history_axis_count)%dim = dim
747  history_axis(history_axis_count)%type = type
748  allocate(history_axis(history_axis_count)%var(size(var)))
749  history_axis(history_axis_count)%var = var
750  if ( present(down) ) then
751  history_axis(history_axis_count)%down = down
752  else
753  history_axis(history_axis_count)%down = .false.
754  endif
755  else
756  write(message,*) 'xxx Number of axis exceeds the limit.'
757  call log('E', message)
758  endif
759 
760  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historyput1dassociatedcoordinatessp()

subroutine gtool_history::historyput1dassociatedcoordinatessp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), dimension(:), intent(in)  dims,
real(sp), dimension(:), intent(in)  var,
character(len=*), intent(in), optional  dtype 
)

Definition at line 774 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

774  use gtool_file_h, only: &
775  file_real4, &
776  file_real8
777  implicit none
778 
779  character(len=*), intent(in) :: name
780  character(len=*), intent(in) :: desc
781  character(len=*), intent(in) :: units
782  character(len=*), intent(in) :: dims(:)
783  real(SP), intent(in) :: var(:)
784  character(len=*), intent(in), optional :: dtype
785 
786  integer :: type
787  !---------------------------------------------------------------------------
788 
789  if ( present(dtype) ) then
790  if ( dtype == 'REAL4' ) then
791  type = file_real4
792  else if ( dtype == 'REAL8' ) then
793  type = file_real8
794  else
795  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
796  call log('E', message)
797  endif
798  else
799  type = file_real4
800  endif
801 
802  if ( history_assoc_count < history_assoc_limit ) then
803  history_assoc_count = history_assoc_count + 1
804  history_assoc(history_assoc_count)%name = name
805  history_assoc(history_assoc_count)%desc = desc
806  history_assoc(history_assoc_count)%units = units
807  history_assoc(history_assoc_count)%dims(1:1) = dims
808  history_assoc(history_assoc_count)%ndims = 1
809  history_assoc(history_assoc_count)%type = type
810  allocate(history_assoc(history_assoc_count)%var(size(var)))
811  history_assoc(history_assoc_count)%var = reshape(var, (/size(var)/))
812  else
813  write(message,*) 'xxx Number of associate coordinates exceeds the limit.'
814  call log('E', message)
815  endif
816 
817  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historyput1dassociatedcoordinatesdp()

subroutine gtool_history::historyput1dassociatedcoordinatesdp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), dimension(:), intent(in)  dims,
real(dp), dimension(:), intent(in)  var,
character(len=*), intent(in), optional  dtype 
)

Definition at line 827 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

827  use gtool_file_h, only: &
828  file_real4, &
829  file_real8
830  implicit none
831 
832  character(len=*), intent(in) :: name
833  character(len=*), intent(in) :: desc
834  character(len=*), intent(in) :: units
835  character(len=*), intent(in) :: dims(:)
836  real(DP), intent(in) :: var(:)
837  character(len=*), intent(in), optional :: dtype
838 
839  integer :: type
840  !---------------------------------------------------------------------------
841 
842  if ( present(dtype) ) then
843  if ( dtype == 'REAL4' ) then
844  type = file_real4
845  else if ( dtype == 'REAL8' ) then
846  type = file_real8
847  else
848  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
849  call log('E', message)
850  endif
851  else
852  type = file_real8
853  endif
854 
855  if ( history_assoc_count < history_assoc_limit ) then
856  history_assoc_count = history_assoc_count + 1
857  history_assoc(history_assoc_count)%name = name
858  history_assoc(history_assoc_count)%desc = desc
859  history_assoc(history_assoc_count)%units = units
860  history_assoc(history_assoc_count)%dims(1:1) = dims
861  history_assoc(history_assoc_count)%ndims = 1
862  history_assoc(history_assoc_count)%type = type
863  allocate(history_assoc(history_assoc_count)%var(size(var)))
864  history_assoc(history_assoc_count)%var = reshape(var, (/size(var)/))
865  else
866  write(message,*) 'xxx Number of associate coordinates exceeds the limit.'
867  call log('E', message)
868  endif
869 
870  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historyput2dassociatedcoordinatessp()

subroutine gtool_history::historyput2dassociatedcoordinatessp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), dimension(:), intent(in)  dims,
real(sp), dimension(:,:), intent(in)  var,
character(len=*), intent(in), optional  dtype 
)

Definition at line 880 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

880  use gtool_file_h, only: &
881  file_real4, &
882  file_real8
883  implicit none
884 
885  character(len=*), intent(in) :: name
886  character(len=*), intent(in) :: desc
887  character(len=*), intent(in) :: units
888  character(len=*), intent(in) :: dims(:)
889  real(SP), intent(in) :: var(:,:)
890  character(len=*), intent(in), optional :: dtype
891 
892  integer :: type
893  !---------------------------------------------------------------------------
894 
895  if ( present(dtype) ) then
896  if ( dtype == 'REAL4' ) then
897  type = file_real4
898  else if ( dtype == 'REAL8' ) then
899  type = file_real8
900  else
901  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
902  call log('E', message)
903  endif
904  else
905  type = file_real4
906  endif
907 
908  if ( history_assoc_count < history_assoc_limit ) then
909  history_assoc_count = history_assoc_count + 1
910  history_assoc(history_assoc_count)%name = name
911  history_assoc(history_assoc_count)%desc = desc
912  history_assoc(history_assoc_count)%units = units
913  history_assoc(history_assoc_count)%dims(1:2) = dims
914  history_assoc(history_assoc_count)%ndims = 2
915  history_assoc(history_assoc_count)%type = type
916  allocate(history_assoc(history_assoc_count)%var(size(var)))
917  history_assoc(history_assoc_count)%var = reshape(var, (/size(var)/))
918  else
919  write(message,*) 'xxx Number of associate coordinates exceeds the limit.'
920  call log('E', message)
921  endif
922 
923  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historyput2dassociatedcoordinatesdp()

subroutine gtool_history::historyput2dassociatedcoordinatesdp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), dimension(:), intent(in)  dims,
real(dp), dimension(:,:), intent(in)  var,
character(len=*), intent(in), optional  dtype 
)

Definition at line 933 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

933  use gtool_file_h, only: &
934  file_real4, &
935  file_real8
936  implicit none
937 
938  character(len=*), intent(in) :: name
939  character(len=*), intent(in) :: desc
940  character(len=*), intent(in) :: units
941  character(len=*), intent(in) :: dims(:)
942  real(DP), intent(in) :: var(:,:)
943  character(len=*), intent(in), optional :: dtype
944 
945  integer :: type
946  !---------------------------------------------------------------------------
947 
948  if ( present(dtype) ) then
949  if ( dtype == 'REAL4' ) then
950  type = file_real4
951  else if ( dtype == 'REAL8' ) then
952  type = file_real8
953  else
954  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
955  call log('E', message)
956  endif
957  else
958  type = file_real8
959  endif
960 
961  if ( history_assoc_count < history_assoc_limit ) then
962  history_assoc_count = history_assoc_count + 1
963  history_assoc(history_assoc_count)%name = name
964  history_assoc(history_assoc_count)%desc = desc
965  history_assoc(history_assoc_count)%units = units
966  history_assoc(history_assoc_count)%dims(1:2) = dims
967  history_assoc(history_assoc_count)%ndims = 2
968  history_assoc(history_assoc_count)%type = type
969  allocate(history_assoc(history_assoc_count)%var(size(var)))
970  history_assoc(history_assoc_count)%var = reshape(var, (/size(var)/))
971  else
972  write(message,*) 'xxx Number of associate coordinates exceeds the limit.'
973  call log('E', message)
974  endif
975 
976  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historyput3dassociatedcoordinatessp()

subroutine gtool_history::historyput3dassociatedcoordinatessp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), dimension(:), intent(in)  dims,
real(sp), dimension(:,:,:), intent(in)  var,
character(len=*), intent(in), optional  dtype 
)

Definition at line 986 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

986  use gtool_file_h, only: &
987  file_real4, &
988  file_real8
989  implicit none
990 
991  character(len=*), intent(in) :: name
992  character(len=*), intent(in) :: desc
993  character(len=*), intent(in) :: units
994  character(len=*), intent(in) :: dims(:)
995  real(SP), intent(in) :: var(:,:,:)
996  character(len=*), intent(in), optional :: dtype
997 
998  integer :: type
999  !---------------------------------------------------------------------------
1000 
1001  if ( present(dtype) ) then
1002  if ( dtype == 'REAL4' ) then
1003  type = file_real4
1004  else if ( dtype == 'REAL8' ) then
1005  type = file_real8
1006  else
1007  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
1008  call log('E', message)
1009  endif
1010  else
1011  type = file_real4
1012  endif
1013 
1014  if ( history_assoc_count < history_assoc_limit ) then
1015  history_assoc_count = history_assoc_count + 1
1016  history_assoc(history_assoc_count)%name = name
1017  history_assoc(history_assoc_count)%desc = desc
1018  history_assoc(history_assoc_count)%units = units
1019  history_assoc(history_assoc_count)%dims(1:3) = dims
1020  history_assoc(history_assoc_count)%ndims = 3
1021  history_assoc(history_assoc_count)%type = type
1022  allocate(history_assoc(history_assoc_count)%var(size(var)))
1023  history_assoc(history_assoc_count)%var = reshape(var, (/size(var)/))
1024  else
1025  write(message,*) 'xxx Number of associate coordinates exceeds the limit.'
1026  call log('E', message)
1027  endif
1028 
1029  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historyput3dassociatedcoordinatesdp()

subroutine gtool_history::historyput3dassociatedcoordinatesdp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), dimension(:), intent(in)  dims,
real(dp), dimension(:,:,:), intent(in)  var,
character(len=*), intent(in), optional  dtype 
)

Definition at line 1039 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

1039  use gtool_file_h, only: &
1040  file_real4, &
1041  file_real8
1042  implicit none
1043 
1044  character(len=*), intent(in) :: name
1045  character(len=*), intent(in) :: desc
1046  character(len=*), intent(in) :: units
1047  character(len=*), intent(in) :: dims(:)
1048  real(DP), intent(in) :: var(:,:,:)
1049  character(len=*), intent(in), optional :: dtype
1050 
1051  integer :: type
1052  !---------------------------------------------------------------------------
1053 
1054  if ( present(dtype) ) then
1055  if ( dtype == 'REAL4' ) then
1056  type = file_real4
1057  else if ( dtype == 'REAL8' ) then
1058  type = file_real8
1059  else
1060  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
1061  call log('E', message)
1062  endif
1063  else
1064  type = file_real8
1065  endif
1066 
1067  if ( history_assoc_count < history_assoc_limit ) then
1068  history_assoc_count = history_assoc_count + 1
1069  history_assoc(history_assoc_count)%name = name
1070  history_assoc(history_assoc_count)%desc = desc
1071  history_assoc(history_assoc_count)%units = units
1072  history_assoc(history_assoc_count)%dims(1:3) = dims
1073  history_assoc(history_assoc_count)%ndims = 3
1074  history_assoc(history_assoc_count)%type = type
1075  allocate(history_assoc(history_assoc_count)%var(size(var)))
1076  history_assoc(history_assoc_count)%var = reshape(var, (/size(var)/))
1077  else
1078  write(message,*) 'xxx Number of associate coordinates exceeds the limit.'
1079  call log('E', message)
1080  endif
1081 
1082  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historyput4dassociatedcoordinatessp()

subroutine gtool_history::historyput4dassociatedcoordinatessp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), dimension(:), intent(in)  dims,
real(sp), dimension(:,:,:,:), intent(in)  var,
character(len=*), intent(in), optional  dtype 
)

Definition at line 1092 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

1092  use gtool_file_h, only: &
1093  file_real4, &
1094  file_real8
1095  implicit none
1096 
1097  character(len=*), intent(in) :: name
1098  character(len=*), intent(in) :: desc
1099  character(len=*), intent(in) :: units
1100  character(len=*), intent(in) :: dims(:)
1101  real(SP), intent(in) :: var(:,:,:,:)
1102  character(len=*), intent(in), optional :: dtype
1103 
1104  integer :: type
1105  !---------------------------------------------------------------------------
1106 
1107  if ( present(dtype) ) then
1108  if ( dtype == 'REAL4' ) then
1109  type = file_real4
1110  else if ( dtype == 'REAL8' ) then
1111  type = file_real8
1112  else
1113  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
1114  call log('E', message)
1115  endif
1116  else
1117  type = file_real4
1118  endif
1119 
1120  if ( history_assoc_count < history_assoc_limit ) then
1121  history_assoc_count = history_assoc_count + 1
1122  history_assoc(history_assoc_count)%name = name
1123  history_assoc(history_assoc_count)%desc = desc
1124  history_assoc(history_assoc_count)%units = units
1125  history_assoc(history_assoc_count)%dims(1:4) = dims
1126  history_assoc(history_assoc_count)%ndims = 4
1127  history_assoc(history_assoc_count)%type = type
1128  allocate(history_assoc(history_assoc_count)%var(size(var)))
1129  history_assoc(history_assoc_count)%var = reshape(var, (/size(var)/))
1130  else
1131  write(message,*) 'xxx Number of associate coordinates exceeds the limit.'
1132  call log('E', message)
1133  endif
1134 
1135  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historyput4dassociatedcoordinatesdp()

subroutine gtool_history::historyput4dassociatedcoordinatesdp ( character(len=*), intent(in)  name,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), dimension(:), intent(in)  dims,
real(dp), dimension(:,:,:,:), intent(in)  var,
character(len=*), intent(in), optional  dtype 
)

Definition at line 1145 of file gtool_history.f90.

References gtool_file_h::file_real4, gtool_file_h::file_real8, and dc_log::log().

1145  use gtool_file_h, only: &
1146  file_real4, &
1147  file_real8
1148  implicit none
1149 
1150  character(len=*), intent(in) :: name
1151  character(len=*), intent(in) :: desc
1152  character(len=*), intent(in) :: units
1153  character(len=*), intent(in) :: dims(:)
1154  real(DP), intent(in) :: var(:,:,:,:)
1155  character(len=*), intent(in), optional :: dtype
1156 
1157  integer :: type
1158  !---------------------------------------------------------------------------
1159 
1160  if ( present(dtype) ) then
1161  if ( dtype == 'REAL4' ) then
1162  type = file_real4
1163  else if ( dtype == 'REAL8' ) then
1164  type = file_real8
1165  else
1166  write(message,*) 'xxx Not appropriate dtype. Check!', dtype
1167  call log('E', message)
1168  endif
1169  else
1170  type = file_real8
1171  endif
1172 
1173  if ( history_assoc_count < history_assoc_limit ) then
1174  history_assoc_count = history_assoc_count + 1
1175  history_assoc(history_assoc_count)%name = name
1176  history_assoc(history_assoc_count)%desc = desc
1177  history_assoc(history_assoc_count)%units = units
1178  history_assoc(history_assoc_count)%dims(1:4) = dims
1179  history_assoc(history_assoc_count)%ndims = 4
1180  history_assoc(history_assoc_count)%type = type
1181  allocate(history_assoc(history_assoc_count)%var(size(var)))
1182  history_assoc(history_assoc_count)%var = reshape(var, (/size(var)/))
1183  else
1184  write(message,*) 'xxx Number of associate coordinates exceeds the limit.'
1185  call log('E', message)
1186  endif
1187 
1188  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
integer, parameter, public file_real4
module FILE I/O HEADER
integer, parameter, public file_real8
Here is the call graph for this function:

◆ historysettattr()

subroutine, public gtool_history::historysettattr ( character(len=*), intent(in)  varname,
character(len=*), intent(in)  key,
character(len=*), intent(in)  val 
)

Definition at line 1197 of file gtool_history.f90.

References gtool_file::filesettattr().

1197  use gtool_file, only: &
1198  filesettattr
1199  implicit none
1200 
1201  character(len=*), intent(in) :: varname
1202  character(len=*), intent(in) :: key
1203  character(len=*), intent(in) :: val
1204 
1205  integer :: n
1206  !---------------------------------------------------------------------------
1207 
1208  do n = 1, history_id_count
1209  call filesettattr( history_fid(n), & ! (in)
1210  varname, & ! (in)
1211  key, & ! (in)
1212  val ) ! (in)
1213  enddo
1214 
module GTOOL_FILE
Definition: gtool_file.f90:17
subroutine, public filesettattr(fid, vname, key, val)
Definition: gtool_file.f90:942
Here is the call graph for this function:

◆ historyquery()

subroutine, public gtool_history::historyquery ( integer, intent(in)  itemid,
integer, intent(in)  step_next,
logical, intent(out)  answer 
)

Definition at line 1223 of file gtool_history.f90.

References dc_log::log().

Referenced by scale_history::hist_query().

1223  implicit none
1224 
1225  integer, intent(in) :: itemid
1226  integer, intent(in) :: step_next
1227  logical, intent(out) :: answer
1228  !---------------------------------------------------------------------------
1229 
1230  answer = .false.
1231 
1232  if ( history_tavg(itemid) ) then
1233  answer = .true.
1234  elseif( step_next == history_tstrstep(itemid) + history_tintstep(itemid) ) then
1235  answer = .true.
1236  endif
1237 
1238  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ historywrite()

subroutine, public gtool_history::historywrite ( integer, intent(in)  itemid,
integer, intent(in)  step_now 
)

Definition at line 1867 of file gtool_history.f90.

References historyoutputlist(), and dc_log::log().

Referenced by historywriteall().

1867  use dc_calendar, only: &
1868  calendarsec2ymdhms
1869  use gtool_file, only: &
1870  filewrite
1871  implicit none
1872 
1873  integer, intent(in) :: itemid
1874  integer, intent(in) :: step_now
1875 
1876  integer :: isize
1877  real(DP) :: time_str, time_end
1878  real(DP) :: sec_str, sec_end
1879 
1880  real(DP), save :: sec_end_last = -1.0_dp
1881  logical, save :: firsttime = .true.
1882  !---------------------------------------------------------------------------
1883 
1884  if( history_id_count == 0 ) return
1885 
1886  if ( step_now < history_tstrstep(itemid) + history_tintstep(itemid) ) then
1887  return
1888  endif
1889 
1890  if ( history_tlststep(itemid) == history_tstrstep(itemid) ) then
1891  write(message,*) 'xxx History variable was never put after the last output!: ', &
1892  trim(history_item(itemid))
1893  if ( history_error_putmiss ) then
1894  call log('E', message)
1895  else
1896  call log('I', message)
1897  endif
1898  endif
1899 
1900  isize = history_size(itemid)
1901 
1902  if ( history_tavg(itemid) ) then
1903  history_varsum(1:isize,itemid) = history_varsum(1:isize,itemid) / history_tsumsec(itemid)
1904  endif
1905 
1906  if ( firsttime ) then
1907  firsttime = .false.
1908  call historyoutputlist
1909  endif
1910 
1911  sec_str = history_startdaysec + real(History_tstrstep(itemid)-1,kind=DP) * history_dtsec
1912  sec_end = history_startdaysec + real(step_now-1 ,kind=DP) * history_dtsec
1913 
1914  ! convert time units
1915  call calendarsec2ymdhms( time_str, sec_str, history_time_units )
1916  call calendarsec2ymdhms( time_end, sec_end, history_time_units )
1917 
1918  if ( sec_end .ge. history_tstart(itemid) ) then
1919  if ( sec_end_last < sec_end ) then
1920  write(message,'(A)') '*** Output History'
1921  call log('I', message)
1922  endif
1923 
1924  call filewrite( history_fid(itemid), & ! file id
1925  history_vid(itemid), & ! variable id
1926  history_varsum(1:isize,itemid), & ! data
1927  time_str, & ! start time
1928  time_end ) ! end time
1929  else
1930  if ( sec_end_last < sec_end ) then
1931  write(message,'(A,2F15.3)') '*** Output History: Suppressed ', sec_end, history_tstart(itemid)
1932  call log('I', message)
1933  endif
1934  endif
1935 
1936  history_varsum(:,itemid) = 0.0_dp
1937  history_tstrstep(itemid) = step_now
1938  history_tlststep(itemid) = step_now
1939  history_tsumsec(itemid) = 0.0_dp
1940 
1941  sec_end_last = sec_end
1942 
1943  return
module GTOOL_FILE
Definition: gtool_file.f90:17
module TIME
Definition: dc_calendar.f90:17
subroutine, public log(type, message)
Definition: dc_log.f90:133
Here is the call graph for this function:
Here is the caller graph for this function:

◆ historywriteall()

subroutine, public gtool_history::historywriteall ( integer, intent(in)  step_now)

Definition at line 1950 of file gtool_history.f90.

References historywrite().

Referenced by scale_history::hist_write().

1950  implicit none
1951 
1952  integer, intent(in) :: step_now
1953 
1954  integer :: n
1955  !---------------------------------------------------------------------------
1956 
1957  do n = 1, history_id_count
1958  call historywrite( n, step_now )
1959  enddo
1960 
1961  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ historyget1dsp()

subroutine gtool_history::historyget1dsp ( real(sp), dimension(:), intent(out)  var,
character(len=*), intent(in)  basename,
character(len=*), intent(in)  varname,
integer, intent(in)  step,
logical, intent(in), optional  allow_missing,
logical, intent(in), optional  single 
)

Definition at line 2002 of file gtool_history.f90.

2002  use gtool_file, only: &
2003  fileread
2004  implicit none
2005 
2006  real(SP), intent(out) :: var(:)
2007  character(len=*), intent(in) :: basename
2008  character(len=*), intent(in) :: varname
2009  integer, intent(in) :: step
2010  logical, intent(in), optional :: allow_missing
2011  logical, intent(in), optional :: single
2012  !---------------------------------------------------------------------------
2013 
2014  call fileread( var, & ! [OUT]
2015  basename, & ! [IN]
2016  varname, & ! [IN]
2017  step, & ! [IN]
2018  history_myrank, & ! [IN]
2019  allow_missing, & ! [IN]
2020  single ) ! [IN]
2021 
2022  return
module GTOOL_FILE
Definition: gtool_file.f90:17

◆ historyget2ddp()

subroutine gtool_history::historyget2ddp ( real(dp), dimension(:,:), intent(out)  var,
character(len=*), intent(in)  basename,
character(len=*), intent(in)  varname,
integer, intent(in)  step,
logical, intent(in), optional  allow_missing,
logical, intent(in), optional  single 
)

Definition at line 2031 of file gtool_history.f90.

2031  use gtool_file, only: &
2032  fileread
2033  implicit none
2034 
2035  real(DP), intent(out) :: var(:,:)
2036  character(len=*), intent(in) :: basename
2037  character(len=*), intent(in) :: varname
2038  integer, intent(in) :: step
2039  logical, intent(in), optional :: allow_missing
2040  logical, intent(in), optional :: single
2041  !---------------------------------------------------------------------------
2042 
2043  call fileread( var, & ! [OUT]
2044  basename, & ! [IN]
2045  varname, & ! [IN]
2046  step, & ! [IN]
2047  history_myrank, & ! [IN]
2048  allow_missing, & ! [IN]
2049  single ) ! [IN]
2050 
2051  return
module GTOOL_FILE
Definition: gtool_file.f90:17

◆ historyget2dsp()

subroutine gtool_history::historyget2dsp ( real(sp), dimension(:,:), intent(out)  var,
character(len=*), intent(in)  basename,
character(len=*), intent(in)  varname,
integer, intent(in)  step,
logical, intent(in), optional  allow_missing,
logical, intent(in), optional  single 
)

Definition at line 2060 of file gtool_history.f90.

2060  use gtool_file, only: &
2061  fileread
2062  implicit none
2063 
2064  real(SP), intent(out) :: var(:,:)
2065  character(len=*), intent(in) :: basename
2066  character(len=*), intent(in) :: varname
2067  integer, intent(in) :: step
2068  logical, intent(in), optional :: allow_missing
2069  logical, intent(in), optional :: single
2070  !---------------------------------------------------------------------------
2071 
2072  call fileread( var, & ! [OUT]
2073  basename, & ! [IN]
2074  varname, & ! [IN]
2075  step, & ! [IN]
2076  history_myrank, & ! [IN]
2077  allow_missing, & ! [IN]
2078  single ) ! [IN]
2079 
2080  return
module GTOOL_FILE
Definition: gtool_file.f90:17

◆ historyget3ddp()

subroutine gtool_history::historyget3ddp ( real(dp), dimension(:,:,:), intent(out)  var,
character(len=*), intent(in)  basename,
character(len=*), intent(in)  varname,
integer, intent(in)  step,
logical, intent(in), optional  allow_missing,
logical, intent(in), optional  single 
)

Definition at line 2089 of file gtool_history.f90.

2089  use gtool_file, only: &
2090  fileread
2091  implicit none
2092 
2093  real(DP), intent(out) :: var(:,:,:)
2094  character(len=*), intent(in) :: basename
2095  character(len=*), intent(in) :: varname
2096  integer, intent(in) :: step
2097  logical, intent(in), optional :: allow_missing
2098  logical, intent(in), optional :: single
2099  !---------------------------------------------------------------------------
2100 
2101  call fileread( var, & ! [OUT]
2102  basename, & ! [IN]
2103  varname, & ! [IN]
2104  step, & ! [IN]
2105  history_myrank, & ! [IN]
2106  allow_missing, & ! [IN]
2107  single ) ! [IN]
2108 
2109  return
module GTOOL_FILE
Definition: gtool_file.f90:17

◆ historyget3dsp()

subroutine gtool_history::historyget3dsp ( real(sp), dimension(:,:,:), intent(out)  var,
character(len=*), intent(in)  basename,
character(len=*), intent(in)  varname,
integer, intent(in)  step,
logical, intent(in), optional  allow_missing,
logical, intent(in), optional  single 
)

Definition at line 2118 of file gtool_history.f90.

2118  use gtool_file, only: &
2119  fileread
2120  implicit none
2121 
2122  real(SP), intent(out) :: var(:,:,:)
2123  character(len=*), intent(in) :: basename
2124  character(len=*), intent(in) :: varname
2125  integer, intent(in) :: step
2126  logical, intent(in), optional :: allow_missing
2127  logical, intent(in), optional :: single
2128  !---------------------------------------------------------------------------
2129 
2130  call fileread( var, & ! [OUT]
2131  basename, & ! [IN]
2132  varname, & ! [IN]
2133  step, & ! [IN]
2134  history_myrank, & ! [IN]
2135  allow_missing, & ! [IN]
2136  single ) ! [IN]
2137 
2138  return
module GTOOL_FILE
Definition: gtool_file.f90:17

◆ historyoutputlist()

subroutine, public gtool_history::historyoutputlist ( )

Definition at line 2143 of file gtool_history.f90.

References dc_log::log().

Referenced by historywrite().

2143  implicit none
2144 
2145  integer :: n
2146  !---------------------------------------------------------------------------
2147 
2148  call log('I', '')
2149  write(message,*) '*** [HIST] Output item list '
2150  call log('I', message)
2151  write(message,*) '*** Number of history item :', history_req_nmax
2152  call log('I', message)
2153  write(message,*) 'NAME :size :interval[sec]: [step]:timeavg?:zinterp?'
2154  call log('I', message)
2155  write(message,*) '============================================================================'
2156  call log('I', message)
2157 
2158  do n = 1, history_id_count
2159  write(message,'(1x,A,1x,I8,1x,f13.3,1x,I8,1x,L8,1x,L8)') &
2160  history_item(n), history_size(n), history_tintsec(n), history_tintstep(n), history_tavg(n), history_zinterp(n)
2161  call log('I', message)
2162  enddo
2163 
2164  write(message,*) '============================================================================'
2165  call log('I', message)
2166  call log('I', '')
2167 
2168  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
Here is the call graph for this function:
Here is the caller graph for this function:

◆ historyfinalize()

subroutine, public gtool_history::historyfinalize ( )

Definition at line 2173 of file gtool_history.f90.

References gtool_file::fileclose().

2173  use gtool_file, only: &
2174  fileclose
2175  implicit none
2176 
2177  integer :: n
2178  !---------------------------------------------------------------------------
2179 
2180  do n = 1, history_id_count
2181  call fileclose( history_fid(n) )
2182  enddo
2183 
2184  return
module GTOOL_FILE
Definition: gtool_file.f90:17
subroutine, public fileclose(fid)
Here is the call graph for this function: