KTH framework for Nek5000 toolboxes; testing version  0.0.1
chkptms.f
Go to the documentation of this file.
1 
5 !=======================================================================
8  subroutine chkpts_register()
9  implicit none
10 
11  include 'SIZE'
12  include 'FRAMELP'
13  include 'CHKPTD'
14  include 'CHKPTMSD'
15 
16  ! local variables
17  integer lpmid
18 !-----------------------------------------------------------------------
19  ! check if the current module was already registered
20  call mntr_mod_is_name_reg(lpmid,chkptms_name)
21  if (lpmid.gt.0) then
22  call mntr_warn(lpmid,
23  $ 'module ['//trim(chkptms_name)//'] already registered')
24  return
25  endif
26 
27  ! find parent module
28  call mntr_mod_is_name_reg(lpmid,chpt_name)
29  if (lpmid.le.0) then
30  lpmid = 1
31  call mntr_abort(lpmid,
32  $ 'Parent ['//trim(chpt_name)//'] module not registered')
33  endif
34 
35  ! register module
36  call mntr_mod_reg(chkptms_id,lpmid,chkptms_name,
37  $ 'Multi-file checkpointing')
38 
39  ! register timers
40  call mntr_tmr_is_name_reg(lpmid,'CHP_TOT')
41  call mntr_tmr_reg(chkptms_tread_id,lpmid,chkptms_id,
42  $ 'CHP_READ','Checkpointing reading time',.true.)
43 
44  call mntr_tmr_reg(chkptms_twrite_id,lpmid,chkptms_id,
45  $ 'CHP_WRITE','Checkpointing writing time',.true.)
46 
47  ! adjust step delay
48  call mntr_set_step_delay(chkptms_snmax)
49 
50  return
51  end subroutine
52 !=======================================================================
56  subroutine chkpts_init
57  implicit none
58 
59  include 'SIZE' ! NID, NPERT
60  include 'TSTEP' ! ISTEP, NSTEPS
61  include 'INPUT' ! IFPERT, PARAM
62  include 'FRAMELP'
63  include 'CHKPTD'
64  include 'CHKPTMSD'
65 !-----------------------------------------------------------------------
66  ! check if the module was already initialised
67  if (chkptms_ifinit) then
68  call mntr_warn(chkptms_id,
69  $ 'module ['//trim(chkptms_name)//'] already initiaised.')
70  return
71  endif
72 
73  ! get number of snapshots in a set
74  if (param(27).lt.0) then
75  chkptms_nsnap = nbdinp
76  else
77  chkptms_nsnap = chkptms_snmax
78  endif
79 
80  ! we support only one perturbation
81  if (ifpert) then
82  if (npert.gt.1) call mntr_abort(chkptms_id,
83  $ 'only single perturbation supported')
84  endif
85 
86  chkptms_ifinit = .true.
87 
88  return
89  end subroutine
90 !=======================================================================
94  logical function chkpts_is_initialised()
95  implicit none
96 
97  include 'SIZE'
98  include 'CHKPTMSD'
99 !-----------------------------------------------------------------------
100  chkpts_is_initialised = chkptms_ifinit
101 
102  return
103  end function
104 !=======================================================================
109  subroutine chkpts_write()
110  implicit none
111 
112  include 'SIZE' !
113  include 'TSTEP' ! ISTEP, NSTEPS
114  include 'INPUT' ! IFMVBD, IFREGUO
115  include 'FRAMELP'
116  include 'CHKPTD'
117  include 'CHKPTMSD'
118 
119  ! local variables
120  integer il, ifile, fnum
121  real ltim
122  character*132 fname(chkptms_fmax)
123  logical ifcoord
124  logical ifreguol
125 
126  character*2 str
127  character*200 lstring
128 
129  integer icalldl
130  save icalldl
131  data icalldl /0/
132 
133  ! functions
134  real dnekclock
135 !-----------------------------------------------------------------------
136  ! no regular mesh
137  ifreguol= ifreguo
138  ifreguo = .false.
139 
140  ! do we write a snapshot
141  ifile = 0
142  if (chpt_stepc.gt.0.and.chpt_stepc.le.chkptms_nsnap) then
143  ! timing
144  ltim = dnekclock()
145 
146  ! file number
147  ifile = chkptms_nsnap - chpt_stepc +1
148  if (ifile.eq.1) call mntr_log(chkptms_id,lp_inf,
149  $ 'Writing checkpoint snapshot')
150 
151  ! initialise I/O data
152  call io_init
153 
154  ! get set of file names in the snapshot
155  call chkptms_set_name(fname, fnum, chpt_set_o, ifile)
156 
157  ! do we wtrite coordinates; we save coordinates in DNS files only
158  if (ifmvbd) then ! moving boundaries save in every file
159  ifcoord = .true.
160  elseif (ifile.eq.1) then
161  ! perturbation mode with constant base flow - only 1 rsX written
162  if (ifpert.and.(.not.ifbase)) then
163  if (icalldl.eq.0.and.(.not.chpt_ifrst)) then
164  icalldl = 1
165  ifcoord = .true.
166  else
167  call chcopy (fname(1),fname(fnum),132)
168  fnum = 1
169  ifcoord = .false.
170  endif
171  ! DNS, MHD, perturbation with changing base flow - every first rsX file in snapshot
172  else
173  ifcoord = .true.
174  endif
175  else
176  if (ifpert.and.(.not.ifbase)) then
177  call chcopy (fname(1),fname(fnum),132)
178  fnum = 1
179  endif
180  ifcoord = .false.
181  endif
182 
183  ! write down files
184  call chkptms_restart_write(fname, fnum, ifcoord)
185 
186  ! update output set number
187  ! we do it after the last file in the set was sucsesfully written
188  if (ifile.eq.chkptms_nsnap) then
189  write(str,'(I2)') chpt_set_o+1
190  lstring = 'Written checkpoint snapshot number: '//trim(str)
191  call mntr_log(chkptms_id,lp_prd,lstring)
192  endif
193 
194  ! timing
195  ltim = dnekclock() - ltim
196  call mntr_tmr_add(chkptms_twrite_id,1,ltim)
197  endif
198 
199  ! put parameters back
200  ifreguo = ifreguol
201 
202  return
203  end subroutine
204 !=======================================================================
209  subroutine chkpts_read()
210  implicit none
211 
212  include 'SIZE' !
213  include 'TSTEP' ! ISTEP, IF_FULL_PRES
214  include 'INPUT' ! IFREGUO, INITC
215  include 'FRAMELP'
216  include 'CHKPTD'
217  include 'CHKPTMSD'
218 
219  ! local variables
220  integer ifile, fnum, fnuml, il
221  real dtratio, epsl, ltim
222  parameter(epsl = 0.0001)
223  logical ifreguol
224  character*132 fname(chkptms_fmax),fnamel(chkptms_fmax)
225  character*200 lstring
226  integer icalld
227  save icalld
228  data icalld /0/
229 
230  !functions
231  real dnekclock
232 !-----------------------------------------------------------------------
233  ! no regular mesh; important for file name generation
234  ifreguol= ifreguo
235  ifreguo = .false.
236 
237  ! this is multi step restart so check for timestep consistency is necessary
238  ! this routine gets the information of pressure mesh as well
239  if (chpt_ifrst.and.icalld.eq.0) then
240  call chkptms_dt_get
241  icalld = 1
242  endif
243 
244  if (chpt_ifrst.and.(istep.lt.chkptms_nsnap)) then
245 
246  ! timing
247  ltim = dnekclock()
248 
249  ifile = istep+1 ! snapshot number
250 
251  ! initialise I/O data
252  call io_init
253 
254  ! get set of file names in the snapshot
255  call chkptms_set_name(fname, fnum, chpt_set_i, ifile)
256 
257  ! perturbation mode with constant base flow - only 1 rsX written
258  if (ifpert.and.(.not.ifbase)) then
259  if (ifile.eq.1) then
260  il = 0
261  call chkptms_set_name(fnamel, fnuml, il, ifile)
262  call chcopy (fname(1),fnamel(1),132)
263  fnum = 2
264  else
265  call chcopy (fname(1),fname(fnum),132)
266  fnum = 1
267  endif
268  endif
269 
270  call chkptms_restart_read(fname, fnum)
271 
272  ! check time step consistency
273  if(ifile.gt.1.and.chkptms_dtstep(ifile).gt.0.0) then
274  dtratio = abs(dt-chkptms_dtstep(ifile))
275  $ /chkptms_dtstep(ifile)
276  if (dtratio.gt.epsl) then
277  write(lstring,*) 'Time step inconsistent, new=',
278  $ dt,', old=',chkptms_dtstep(ifile)
279  call mntr_warn(chkptms_id,lstring)
280  ! possible place to exit if this should be trerated as error
281  endif
282  endif
283 
284  ! timing
285  ltim = dnekclock() - ltim
286  call mntr_tmr_add(chkptms_tread_id,1,ltim)
287  endif
288 
289  ! put parameters back
290  ifreguo = ifreguol
291  if_full_pres=.false.
292 
293  return
294  end subroutine
295 !=======================================================================
300  subroutine chkptms_dt_get
301  implicit none
302 
303  include 'SIZE'
304  include 'INPUT'
305  include 'RESTART'
306  include 'TSTEP'
307  include 'FRAMELP'
308  include 'CHKPTD'
309  include 'CHKPTMSD'
310 
311  ! local variables
312  integer ifile, ierr
313  real timerl(chkptms_snmax), p0thr
314  character*132 fname, header
315  character*3 prefix
316  character*4 dummy
317 !-----------------------------------------------------------------------
318  ! which set of files should be used
319  if (ifpert.and.(.not.ifbase)) then
320  prefix(1:2)='rp'
321  else
322  prefix(1:2)='rs'
323  endif
324 
325  ! initialise I/O data
326  call io_init
327 
328  ! collect simulation time from file headers
329  do ifile=1,chkptms_nsnap
330  call chkpt_fname(fname, prefix, chpt_set_i, ifile, ierr)
331  call mntr_check_abort(chkptms_id,ierr,
332  $ 'dt get; file name error')
333 
334  ierr = 0
335  if (nid.eq.pid00) then
336  ! open file
337  call addfid(fname,fid0)
338  ! add ending character; required by C
339  fname = trim(fname)//char(0)
340  call byte_open(fname,ierr)
341  ! read header
342  if (ierr.eq.0) then
343  call blank (header,iheadersize)
344  call byte_read (header,iheadersize/4,ierr)
345  endif
346  ! close the file
347  if (ierr.eq.0) call byte_close(ierr)
348  endif
349  call mntr_check_abort(chkptms_id,ierr,
350  $ 'dt get; error reading header')
351 
352  call bcast(header,iheadersize)
353  ierr = 0
354  if (index(header,'#std').eq.1) then
355  read(header,*,iostat=ierr) dummy
356  $ , wdsizr,nxr,nyr,nzr,nelr,nelgr,timer,istpr
357  $ , ifiler,nfiler
358  $ , rdcode ! 74+20=94
359  $ , p0thr, chkptms_if_pmesh
360  else
361  ierr = 1
362  endif
363  call mntr_check_abort(chkptms_id,ierr,
364  $ 'dt get; error extracting timer')
365 
366  timerl(ifile) = timer
367  enddo
368 
369  ! get dt
370  do ifile=2,chkptms_nsnap
371  chkptms_dtstep(ifile) = timerl(ifile) - timerl(ifile-1)
372  enddo
373 
374  return
375  end subroutine
376 !=======================================================================
383  subroutine chkptms_set_name(fname, fnum, nset, ifile)
384  implicit none
385 
386  include 'SIZE' ! NIO
387  include 'INPUT' ! IFMHD, IFPERT, IFBASE
388  include 'FRAMELP'
389  include 'CHKPTMSD'
390 
391  ! argument list
392  character*132 fname(chkptms_fmax)
393  integer fnum, nset, ifile
394 
395  ! local variables
396  integer ifilel, ierr
397 
398  character*132 bname
399  character*3 prefix
400 !-----------------------------------------------------------------------
401  ! fill fname array with 'rsX' (DNS), 'rpX' (pert.) and 'rbX' (MHD) file names
402  if (ifmhd) then
403  ! file number
404  fnum = 2
405 
406  ! prefix and name for fluid (DNS)
407  prefix(1:2)='rs'
408  call chkpt_fname(fname(1), prefix, nset, ifile, ierr)
409  call mntr_check_abort(chkptms_id,ierr,
410  $ 'chkptms_set_name; DNS file name error')
411 
412  ! prefix and name for magnetic field (MHD)
413  prefix(1:2)='rb'
414  call chkpt_fname(fname(2), prefix, nset, ifile, ierr)
415  call mntr_check_abort(chkptms_id,ierr,
416  $ 'chkptms_set_name; MHD file name error')
417 
418  elseif (ifpert) then
419  ! file number
420  ! I assume only single perturbation
421  fnum = 2
422 
423  ! prefix and name for base flow (DNS)
424  prefix(1:2)='rs'
425  if (ifbase) then
426  ifilel = ifile
427  else
428  ifilel =1
429  endif
430  call chkpt_fname(fname(1), prefix, nset, ifilel, ierr)
431  call mntr_check_abort(chkptms_id,ierr,
432  $ 'chkptms_set_name; base flow file name error')
433 
434  ! prefix and name for perturbation
435  prefix(1:2)='rp'
436  call chkpt_fname(fname(2), prefix, nset, ifile, ierr)
437  call mntr_check_abort(chkptms_id,ierr,
438  $ 'chkptms_set_name; perturbation file name error')
439 
440  else ! DNS
441  fnum = 1
442 
443  ! create prefix and name for DNS
444  prefix(1:2)='rs'
445  call chkpt_fname(fname(1), prefix, nset, ifile, ierr)
446  call mntr_check_abort(chkptms_id,ierr,
447  $ 'chkptms_set_name; DNS file name error')
448 
449  endif
450 
451  return
452  end subroutine
453 !=======================================================================
461  subroutine chkpt_fname(fname, prefix, nset, ifile, ierr)
462  implicit none
463 
464  include 'SIZE' ! NIO
465  include 'INPUT' ! SESSION
466  include 'CHKPTD'
467  include 'CHKPTMSD'
468 
469  ! argument list
470  character*132 fname
471  character*3 prefix
472  integer nset, ifile, ierr
473 
474  ! local variables
475  character*132 bname ! base name
476  character*132 fnamel ! local file name
477  character*3 prefixl ! local prefix
478  integer itmp
479 
480  character*6 str
481 
482  character*(*) kst
483  parameter(kst='0123456789abcdefx')
484 !-----------------------------------------------------------------------
485  ! create prefix and name for DNS
486  ierr = 0
487  prefixl(1:2) = prefix(1:2)
488  itmp=min(17,chpt_nset*chkptms_nsnap) + 1
489  prefixl(3:3)=kst(itmp:itmp)
490 
491  ! get base name (SESSION)
492  bname = trim(adjustl(session))
493 
494  call io_mfo_fname(fnamel,bname,prefixl,ierr)
495  if (ierr.ne.0) then
496  call mntr_error(chkptms_id,'chkpt_fname; file name error')
497  return
498  endif
499 
500  write(str,'(i5.5)') chkptms_nsnap*nset+ifile
501  fname = trim(fnamel)//trim(str)
502 
503  return
504  end subroutine
505 !=======================================================================
511  subroutine chkptms_restart_write(fname, fnum, ifcoord)
512  implicit none
513 
514  include 'SIZE'
515  include 'RESTART'
516  include 'TSTEP'
517  include 'INPUT'
518  include 'CHKPTMSD'
519 
520  ! argument list
521  character*132 fname(chkptms_fmax)
522  integer fnum
523  logical ifcoord
524 
525  ! local variables
526  integer lwdsizo
527  integer ipert, il
528  ! which set of variables do we write: DNS (1), MHD (2) or perturbation (3)
529  integer chktype
530 
531  logical lif_full_pres, lifxyo, lifpo, lifvo, lifto,
532  $ lifpsco(LDIMT1)
533 !-----------------------------------------------------------------------
534  ! adjust I/O parameters
535  lwdsizo = wdsizo
536  wdsizo = 8
537  lif_full_pres = if_full_pres
538  if_full_pres = .true.
539  lifxyo = ifxyo
540  lifpo= ifpo
541  ifpo = .true.
542  lifvo= ifvo
543  ifvo = .true.
544  lifto= ifto
545  ifto = ifheat
546  do il=1,npscal
547  lifpsco(il)= ifpsco(il)
548  ifpsco(il) = .true.
549  enddo
550 
551  if (ifmhd) then
552  ! DNS first
553  ifxyo = ifcoord
554  chktype = 1
555  call chkptms_mfo(fname(1),chktype,ipert)
556 
557  ! MHD
558  ifxyo = .false.
559  chktype = 2
560  call chkptms_mfo(fname(2),chktype,ipert)
561 
562  elseif (ifpert) then
563  ! DNS first
564  if (fnum.eq.2) then
565  ifxyo = ifcoord
566  chktype = 1
567  call chkptms_mfo(fname(1),chktype,ipert)
568  endif
569 
570  ! perturbation
571  ifxyo = .false.
572  chktype = 3
573  ipert = 1
574  call chkptms_mfo(fname(fnum),chktype,ipert)
575  else ! DNS
576  ! write only one set of files
577  if (fnum.ne.1) call mntr_abort(chkptms_id,
578  $ 'chkptms_restart_write; too meny files for DNS')
579 
580  ifxyo = ifcoord
581  chktype = 1
582  call chkptms_mfo(fname(1),chktype,ipert)
583  endif
584 
585  ! restore I/O parameters
586  wdsizo = lwdsizo
587  if_full_pres = lif_full_pres
588  ifxyo = lifxyo
589  ifpo = lifpo
590  ifvo = lifvo
591  ifto = lifto
592  do il=1,npscal
593  ifpsco(il) = lifpsco(il)
594  enddo
595 
596  return
597  end subroutine
598 !=======================================================================
603  subroutine chkptms_restart_read(fname, fnum)
604  implicit none
605 
606  include 'SIZE'
607  include 'RESTART'
608  include 'TSTEP'
609  include 'INPUT'
610  include 'CHKPTMSD'
611 
612  ! argument list
613  character*132 fname(chkptms_fmax)
614  integer fnum
615 
616  ! local variables
617  integer ndumps, ipert, il
618  ! which set of variables do we write: DNS (1), MHD (2) or perturbation (3)
619  integer chktype
620  character*132 fnamel
621 !-----------------------------------------------------------------------
622  if (ifmhd) then
623  ! DNS first
624  chktype = 1
625  call sioflag(ndumps,fnamel,fname(1))
626  call chkptms_mfi(fnamel,chktype,ipert)
627 
628  ! MHD
629  chktype = 2
630  call sioflag(ndumps,fnamel,fname(2))
631  call chkptms_mfi(fnamel,chktype,ipert)
632 
633  elseif (ifpert) then
634  ! DNS first
635  if (fnum.eq.2) then
636  chktype = 1
637  call sioflag(ndumps,fnamel,fname(1))
638  call chkptms_mfi(fnamel,chktype,ipert)
639  endif
640 
641  ! perturbation
642  chktype = 3
643  ipert = 1
644  call sioflag(ndumps,fnamel,fname(fnum))
645  call chkptms_mfi(fnamel,chktype,ipert)
646  else ! DNS
647  ! read only one set of files
648  if (fnum.ne.1) call mntr_abort(chkptms_id,
649  $ 'chkptms_restart_read; too meny files for DNS')
650 
651  chktype = 1
652  call sioflag(ndumps,fnamel,fname(1))
653  call chkptms_mfi(fnamel,chktype,ipert)
654  endif
655 
656  return
657  end subroutine
658 !=======================================================================
669  subroutine chkptms_mfo(fname,chktype,ipert)
670  implicit none
671 
672  include 'SIZE'
673  include 'INPUT'
674  include 'PARALLEL'
675  include 'RESTART'
676  include 'TSTEP'
677  include 'GEOM'
678  include 'SOLN'
679  include 'FRAMELP'
680  include 'CHKPTMSD'
681 
682  ! argumnt list
683  character*132 fname
684  integer chktype, ipert
685 
686  ! local variables
687  integer ierr, il, itmp
688  integer ioflds
689  integer*8 offs,nbyte
690  real dnbyte, tiostart, tio
691 
692  ! functions
693  real dnekclock_sync, glsum
694 
695  real pm1(lx1,ly1,lz1,lelv)
696  common /scrcg/ pm1
697 !-----------------------------------------------------------------------
698  ! simple timing
699  tiostart=dnekclock_sync()
700 
701  ! set elelemnt size
702  nxo = nx1
703  nyo = ny1
704  nzo = nz1
705 
706  ! open file
707  call io_mbyte_open(fname,ierr)
708  call mntr_check_abort(chkptms_id,ierr,
709  $ 'chkptms_mfo; file not opened')
710 
711  ! write a header and create element mapping
712  call mfo_write_hdr
713 
714  ! set header offset
715  offs = iheadersize + 4 + isize*nelgt
716  ioflds = 0
717 
718  ! write fields
719  ! coordinates
720  if (ifxyo) then
721  call io_mfov(offs,xm1,ym1,zm1,nx1,ny1,nz1,nelt,nelgt,ndim)
722  ioflds = ioflds + ndim
723  endif
724 
725  ! velocity, magnetic field, perturbation velocity
726  if (ifvo) then
727  if (chktype.eq.1) then
728  call io_mfov(offs,vx,vy,vz,nx1,ny1,nz1,nelt,nelgt,ndim)
729  elseif(chktype.eq.2) then
730  call io_mfov(offs,bx,by,bz,nx1,ny1,nz1,nelt,nelgt,ndim)
731  elseif(chktype.eq.3) then
732  call io_mfov(offs,vxp(1,ipert),vyp(1,ipert),
733  $ vzp(1,ipert),nx1,ny1,nz1,nelt,nelgt,ndim)
734  endif
735  ioflds = ioflds + ndim
736  endif
737 
738  ! pressure
739  if (ifpo) then
740  if (chktype.eq.1) then
741  ! copy array if necessary
742  if (ifsplit) then
743  itmp = nx1*ny1*nz1*lelv
744  call io_mfos(offs,pr,nx2,ny2,nz2,nelt,nelgt,ndim)
745  else
746  itmp = nx1*ny1*nz1*lelv
747  call rzero(pm1,itmp)
748  itmp = nx2*ny2*nz2
749  do il=1,nelv
750  call copy(pm1(1,1,1,il),pr(1,1,1,il),itmp)
751  enddo
752  call io_mfos(offs,pm1,nx1,ny1,nz1,nelt,nelgt,ndim)
753  endif
754  elseif(chktype.eq.2) then
755  ! copy array
756  itmp = nx1*ny1*nz1*lelv
757  call rzero(pm1,itmp)
758  itmp = nx2*ny2*nz2
759  do il=1,nelv
760  call copy(pm1(1,1,1,il),pm(1,1,1,il),itmp)
761  enddo
762  call io_mfos(offs,pm1,nx1,ny1,nz1,nelt,nelgt,ndim)
763  elseif(chktype.eq.3) then
764  ! copy array
765  itmp = nx1*ny1*nz1*lelv
766  call rzero(pm1,itmp)
767  itmp = nx2*ny2*nz2
768  do il=1,nelv
769  call copy(pm1(1,1,1,il),prp(1+itmp*(il-1),ipert),itmp)
770  enddo
771  call io_mfos(offs,pm1,nx1,ny1,nz1,nelt,nelgt,ndim)
772  endif
773  ioflds = ioflds + 1
774  endif
775 
776  if (chktype.ne.2) then
777  if (ifto) then
778  if (chktype.eq.1) then
779  call io_mfos(offs,t,nx1,ny1,nz1,nelt,nelgt,ndim)
780  elseif(chktype.eq.3) then
781  call io_mfos(offs,tp(1,1,ipert),
782  $ nx1,ny1,nz1,nelt,nelgt,ndim)
783  endif
784  ioflds = ioflds + 1
785  endif
786 
787  do il=1,ldimt-1
788  if (ifpsco(il)) then
789  if (chktype.eq.1) then
790  call io_mfos(offs,t(1,1,1,1,il+1),
791  $ nx1,ny1,nz1,nelt,nelgt,ndim)
792  elseif(chktype.eq.3) then
793  call io_mfos(offs,tp(1,il+1,ipert),
794  $ nx1,ny1,nz1,nelt,nelgt,ndim)
795  endif
796  ioflds = ioflds + 1
797  endif
798  enddo
799  endif
800  dnbyte = 1.*ioflds*nelt*wdsizo*nx1*ny1*nz1
801 
802  ! possible place for metadata
803 
804  ! close file
805  call io_mbyte_close(ierr)
806  call mntr_check_abort(chkptms_id,ierr,
807  $ 'chkptms_mfo; file not closed')
808 
809  ! stamp the log
810  tio = dnekclock_sync()-tiostart
811  if (tio.le.0) tio=1.
812 
813  dnbyte = glsum(dnbyte,1)
814  dnbyte = dnbyte + iheadersize + 4. + isize*nelgt
815  dnbyte = dnbyte/1024/1024
816 
817  call mntr_log(chkptms_id,lp_prd,'Checkpoint written:')
818  call mntr_logr(chkptms_id,lp_vrb,'file size (MB) = ',dnbyte)
819  call mntr_logr(chkptms_id,lp_vrb,'avg data-throughput (MB/s) = ',
820  $ dnbyte/tio)
821  call mntr_logi(chkptms_id,lp_vrb,'io-nodes = ',nfileo)
822 
823  return
824  end subroutine
825 !=======================================================================
834  subroutine chkptms_mfi(fname,chktype,ipert)
835  implicit none
836 
837  include 'SIZE'
838  include 'INPUT'
839  include 'PARALLEL'
840  include 'RESTART'
841  include 'TSTEP'
842  include 'GEOM'
843  include 'SOLN'
844  include 'FRAMELP'
845  include 'CHKPTMSD'
846 
847  ! argumnt list
848  character*132 fname
849  integer chktype, ipert
850 
851  ! local variables
852  integer ierr, il, jl, kl
853  integer itmp1, itmp2, itmp3
854  integer ioflds
855  integer*8 offs0,offs,nbyte
856  real dnbyte, tiostart, tio
857  logical ifskip
858 
859  ! scratch arrays
860  integer lwkv
861  parameter(lwkv = lx1*ly1*lz1*lelt)
862  real wkv1(lwkv),wkv2(lwkv),wkv3(lwkv)
863  common /scruz/ wkv1,wkv2,wkv3
864 
865  ! functions
866  real dnekclock_sync, glsum
867 !-----------------------------------------------------------------------
868  ! simple timing
869  tiostart=dnekclock_sync()
870 
871  ! open file and read header; some operations related to header are
872  ! performed in chkpts_read; it is not the optimal way, but I don't want
873  ! to modify mfi_prepare
874  call mfi_prepare(fname)
875 
876  ! set header offset
877  offs = iheadersize + 4 + isize*nelgr
878  ioflds = 0
879 
880  ! read fields
881  ! coordinates
882  if (ifgetxr) then
883  ifskip = .not.ifgetx
884  ! skip coordinates if you need to interpolate them;
885  ! I assume current coordinates are more exact than the interpolated one
886  if ((nxr.eq.lx1).and.(nyr.eq.ly1).and.(nzr.eq.lz1)) then
887  call io_mfiv(offs,xm1,ym1,zm1,lx1,ly1,lz1,lelt,ifskip)
888  else
889  ifskip=.true.
890  call io_mfiv(offs,wkv1,wkv2,wkv3,nxr,nyr,nzr,lelt,ifskip)
891  endif
892  ioflds = ioflds + ldim
893  endif
894 
895  ! velocity, magnetic field, perturbation velocity
896  if (ifgetur) then
897  ifskip = .not.ifgetu
898  if ((nxr.eq.lx1).and.(nyr.eq.ly1).and.(nzr.eq.lz1)) then
899  ! unchanged resolution
900  ! read field directly to the variables
901  if (chktype.eq.1) then
902  call io_mfiv(offs,vx,vy,vz,lx1,ly1,lz1,lelv,ifskip)
903  elseif(chktype.eq.2) then
904  call io_mfiv(offs,bx,by,bz,lx1,ly1,lz1,lelv,ifskip)
905  elseif(chktype.eq.3) then
906  call io_mfiv(offs,vxp(1,ipert),vyp(1,ipert),vzp(1,ipert)
907  $ ,lx1,ly1,lz1,lelv,ifskip)
908  endif
909  else
910  ! modified resolution
911  ! read field to tmp array
912  call io_mfiv(offs,wkv1,wkv2,wkv3,nxr,nyr,nzr,lelt,ifskip)
913 
914  ! interpolate
915  if (ifgetu) then
916  if (chktype.eq.1) then
917  call chkptms_map_gll(vx,wkv1,nxr,nzr,nelv)
918  call chkptms_map_gll(vy,wkv2,nxr,nzr,nelv)
919  if (if3d) call chkptms_map_gll(vz,wkv3,nxr,nzr,nelv)
920  elseif(chktype.eq.2) then
921  call chkptms_map_gll(bx,wkv1,nxr,nzr,nelv)
922  call chkptms_map_gll(by,wkv2,nxr,nzr,nelv)
923  if (if3d) call chkptms_map_gll(bz,wkv3,nxr,nzr,nelv)
924  elseif(chktype.eq.3) then
925  call chkptms_map_gll(vxp(1,ipert),wkv1,nxr,nzr,nelv)
926  call chkptms_map_gll(vyp(1,ipert),wkv2,nxr,nzr,nelv)
927  if (if3d) call chkptms_map_gll(vzp(1,ipert),wkv3,
928  $ nxr,nzr,nelv)
929  endif
930  endif
931  endif
932  ioflds = ioflds + ndim
933  endif
934 
935  ! pressure
936  if (ifgetpr) then
937  ifskip = .not.ifgetp
938 
939  if (chkptms_if_pmesh) then
940  ! file contains pressure on nxr-2 (GL) mesh
941  ! read field to tmp array
942  call io_mfis(offs,wkv1,nxr,nyr,nzr,lelt,ifskip)
943 
944  if (ifgetp) then
945  if ((nxr.eq.lx1).and.(nyr.eq.ly1).and.(nzr.eq.lz1)) then
946  ! unchanged resolution
947  if (ifsplit) then
948  if (chktype.eq.1) then
949  !interpolate GL to GLL
950  itmp1 = nx1*ny1*nz1
951  jl = 1
952  do il=1,nelv
953  call map21t (pr(1,1,1,il),wkv1(jl),il)
954  jl = jl +itmp1
955  enddo
956  endif
957  else
958  ! remove zeros
959  itmp1 = nx1*ny1*nz1
960  itmp2 = nx2*ny2*nz2
961  jl = 1
962  if(chktype.eq.1) then
963  do il=1,nelv
964  call copy(pr(1,1,1,il),wkv1(jl),itmp2)
965  jl = jl + itmp1
966  enddo
967  elseif(chktype.eq.2) then
968  do il=1,nelv
969  call copy(pm(1,1,1,il),wkv1(jl),itmp2)
970  jl = jl + itmp1
971  enddo
972  elseif(chktype.eq.3) then
973  kl = 1
974  do il=1,nelv
975  call copy(prp(kl,ipert),wkv1(jl),itmp2)
976  jl = jl + itmp1
977  kl = kl + itmp2
978  enddo
979  endif
980  endif
981  else
982  ! modified resolution
983  ! remove zeros
984  itmp1 = nxr*nyr*nzr
985  itmp3 = max(nzr-2,1)
986  itmp2 = (nxr-2)*(nyr-2)*itmp3
987  jl = 1
988  kl = 1
989  do il=1,nelv
990  call copy(wkv2(kl),wkv1(jl),itmp2)
991  jl = jl + itmp1
992  kl = kl + itmp2
993  enddo
994 
995  if (ifsplit) then
996  if (chktype.eq.1) then
997  ! interpolate on GL mesh
998  call chkptms_map_gl(wkv1,wkv2,nxr-2,itmp3,nelv)
999 
1000  !interpolate GL to GLL
1001  itmp2 = nx2*ny2*nz2
1002  jl = 1
1003  do il=1,nelv
1004  call map21t (pr(1,1,1,il),wkv1(jl),il)
1005  jl = jl +itmp2
1006  enddo
1007  endif
1008  else
1009  ! interpolate on GL mesh
1010  if (chktype.eq.1) then
1011  call chkptms_map_gl(pr,wkv2,nxr-2,itmp3,nelv)
1012  elseif(chktype.eq.2) then
1013  call chkptms_map_gl(pm,wkv2,nxr-2,itmp3,nelv)
1014  elseif(chktype.eq.3) then
1015  call chkptms_map_gl(prp(1,ipert),wkv2,nxr-2,
1016  $ itmp3,nelv)
1017  endif
1018  endif
1019  endif
1020  endif
1021 
1022  else
1023  ! file contains pressure on nxr (GLL) mesh
1024  if ((nxr.eq.lx1).and.(nyr.eq.ly1).and.(nzr.eq.lz1)) then
1025  ! unchanged resolution
1026  if (ifsplit) then
1027  ! read field directly to the variables
1028  if (chktype.eq.1) then
1029  call io_mfis(offs,pr,lx1,ly1,lz1,lelv,ifskip)
1030  endif
1031  else
1032  ! read field to tmp array
1033  call io_mfis(offs,wkv1,nxr,nyr,nzr,lelt,ifskip)
1034 
1035  ! interpolate GLL to GL
1036  if (ifgetp) then
1037  itmp2 = nx1*ny1*nz1
1038  itmp2 = nx2*ny2*nz2
1039  jl = 1
1040  if (chktype.eq.1) then
1041  do il=1,nelv
1042  call map12 (pr(1,1,1,il),wkv1(jl),il)
1043  jl = jl +itmp1
1044  enddo
1045  elseif(chktype.eq.2) then
1046  do il=1,nelv
1047  call map12 (pm(1,1,1,il),wkv1(jl),il)
1048  jl = jl +itmp1
1049  enddo
1050  elseif(chktype.eq.3) then
1051  kl = 1
1052  do il=1,nelv
1053  call map12 (prp(kl,ipert),wkv1(jl),il)
1054  jl = jl +itmp1
1055  kl = kl +itmp2
1056  enddo
1057  endif
1058  endif
1059  endif
1060 
1061  else
1062  ! modified resolution
1063  ! read field to tmp array
1064  call io_mfis(offs,wkv1,nxr,nyr,nzr,lelt,ifskip)
1065 
1066  if (ifgetp) then
1067  if (ifsplit) then
1068  ! interpolate on GLL
1069  call chkptms_map_gll(pr,wkv1,nxr,nzr,nelv)
1070  else
1071  ! interpolate on GLL
1072  call chkptms_map_gll(wkv2,wkv1,nxr,nzr,nelv)
1073 
1074  ! interpolate GLL to GL
1075  itmp2 = nx1*ny1*nz1
1076  itmp2 = nx2*ny2*nz2
1077  jl = 1
1078  if (chktype.eq.1) then
1079  do il=1,nelv
1080  call map12 (pr(1,1,1,il),wkv2(jl),il)
1081  jl = jl +itmp1
1082  enddo
1083  elseif(chktype.eq.2) then
1084  do il=1,nelv
1085  call map12 (pm(1,1,1,il),wkv2(jl),il)
1086  jl = jl +itmp1
1087  enddo
1088  elseif(chktype.eq.3) then
1089  kl = 1
1090  do il=1,nelv
1091  call map12 (prp(kl,ipert),wkv2(jl),il)
1092  jl = jl +itmp1
1093  kl = kl +itmp2
1094  enddo
1095  endif
1096  endif
1097  endif
1098  endif
1099  endif
1100 
1101  ioflds = ioflds + 1
1102  endif
1103 
1104  if (chktype.ne.2) then
1105  if (ifgettr) then
1106  ifskip = .not.ifgett
1107  if ((nxr.eq.lx1).and.(nyr.eq.ly1).and.(nzr.eq.lz1)) then
1108  ! unchanged resolution
1109  ! read field directly to the variables
1110  if (chktype.eq.1) then
1111  call io_mfis(offs,t,lx1,ly1,lz1,lelt,ifskip)
1112  elseif(chktype.eq.3) then
1113  call io_mfis(offs,tp(1,1,ipert),lx1,ly1,lz1,lelt,
1114  $ ifskip)
1115  endif
1116  else
1117  ! modified resolution
1118  ! read field to tmp array
1119  call io_mfis(offs,wkv1,nxr,nyr,nzr,lelt,ifskip)
1120 
1121  ! interpolate
1122  if (ifgett) then
1123  if (chktype.eq.1) then
1124  call chkptms_map_gll(t,wkv1,nxr,nzr,nelt)
1125  elseif(chktype.eq.3) then
1126  call chkptms_map_gll(tp(1,1,ipert),wkv1,nxr,nzr,
1127  $ nelt)
1128  endif
1129  endif
1130  endif
1131  ioflds = ioflds + 1
1132  endif
1133 
1134  do il=1,ldimt-1
1135  if (ifgtpsr(il)) then
1136  ifskip = .not.ifgtps(il)
1137  if ((nxr.eq.lx1).and.(nyr.eq.ly1).and.(nzr.eq.lz1)) then
1138  ! unchanged resolution
1139  ! read field directly to the variables
1140  if (chktype.eq.1) then
1141  call io_mfis(offs,t(1,1,1,1,il+1),lx1,ly1,lz1,
1142  $ lelt,ifskip)
1143  elseif(chktype.eq.3) then
1144  call io_mfis(offs,tp(1,il+1,ipert),lx1,ly1,lz1,
1145  $ lelt,ifskip)
1146  endif
1147  else
1148  ! modified resolution
1149  ! read field to tmp array
1150  call io_mfis(offs,wkv1,nxr,nyr,nzr,lelt,ifskip)
1151 
1152  ! interpolate
1153  if (ifgtps(il)) then
1154  if (chktype.eq.1) then
1155  call chkptms_map_gll(t(1,1,1,1,il+1),wkv1,
1156  $ nxr,nzr,nelt)
1157  elseif(chktype.eq.3) then
1158  call chkptms_map_gll(tp(1,il+1,ipert),wkv1,
1159  $ nxr,nzr,nelt)
1160  endif
1161  endif
1162  endif
1163  ioflds = ioflds + 1
1164  endif
1165  enddo
1166  endif
1167 
1168  if (ifgtim) time = timer
1169 
1170  ! close file
1171  call io_mbyte_close(ierr)
1172  call mntr_check_abort(chkptms_id,ierr,
1173  $ 'chkptms_mfi; file not closed')
1174 
1175  ! stamp the log
1176  tio = dnekclock_sync()-tiostart
1177  if (tio.le.0) tio=1.
1178 
1179  if(nid.eq.pid0r) then
1180  dnbyte = 1.*ioflds*nelr*wdsizr*nxr*nyr*nzr
1181  else
1182  dnbyte = 0.0
1183  endif
1184 
1185  dnbyte = glsum(dnbyte,1)
1186  dnbyte = dnbyte + iheadersize + 4. + isize*nelgt
1187  dnbyte = dnbyte/1024/1024
1188 
1189  call mntr_log(chkptms_id,lp_prd,'Checkpoint read:')
1190  call mntr_logr(chkptms_id,lp_vrb,'avg data-throughput (MB/s) = ',
1191  $ dnbyte/tio)
1192  call mntr_logi(chkptms_id,lp_vrb,'io-nodes = ',nfileo)
1193 
1194  if (ifaxis) call chkptms_axis_interp_ic()
1195 
1196  return
1197  end subroutine
1198 !=======================================================================
1209  subroutine chkptms_map_gll(xf,yf,nxr,nzr,nel)
1210  implicit none
1211 
1212  include 'SIZE'
1213  include 'INPUT'
1214  include 'IXYZ'
1215  include 'WZ'
1216 
1217  ! argument lists
1218  integer nxr, nzr, nel
1219  real xf(lx1,ly1,lz1,nel), yf(nxr,nxr,nzr,nel)
1220 
1221  ! local variables
1222  integer nyzr, nxy2
1223  integer ie, iz, izoff
1224 
1225  ! moddificaion flag
1226  integer nold
1227  save nold
1228  data nold /0/
1229 
1230  ! work arrays
1231  integer lxr, lyr, lzr, lxyzr
1232  parameter(lxr=lx1+6)
1233  parameter(lyr=ly1+6)
1234  parameter(lzr=lz1+6)
1235  parameter(lxyzr=lxr*lyr*lzr)
1236  real txa(lxyzr),txb(lx1,ly1,lzr),zgmr(lxr),wgtr(lxr)
1237  common /ctmp0/ txa, txb, zgmr, wgtr
1238 
1239  ! interpolation arrays
1240  real ires(lxr*lxr) ,itres(lxr*lxr)
1241  common /ctmpabm1/ ires, itres
1242 !-----------------------------------------------------------------------
1243  nyzr = nxr*nzr
1244  nxy2 = lx1*ly1
1245 
1246  if (nxr.ne.nold) then
1247  nold=nxr
1248  call zwgll(zgmr,wgtr,nxr)
1249  call igllm(ires,itres,zgmr,zgm1,nxr,lx1,nxr,lx1)
1250  endif
1251 
1252  do ie=1,nel
1253  call mxm (ires,lx1,yf(1,1,1,ie),nxr,txa,nyzr)
1254  do iz=1,nzr
1255  izoff = 1 + (iz-1)*lx1*nxr
1256  call mxm (txa(izoff),lx1,itres,nxr,txb(1,1,iz),ly1)
1257  enddo
1258  if (if3d) then
1259  call mxm (txb,nxy2,itres,nzr,xf(1,1,1,ie),lz1)
1260  else
1261  call copy(xf(1,1,1,ie),txb,nxy2)
1262  endif
1263  enddo
1264 
1265  return
1266  end subroutine
1267 !=======================================================================
1278  subroutine chkptms_map_gl(xf,yf,nxr,nzr,nel)
1279  implicit none
1280 
1281  include 'SIZE'
1282  include 'INPUT'
1283  include 'IXYZ'
1284  include 'WZ'
1285 
1286  ! argument lists
1287  integer nxr, nzr, nel
1288  real xf(lx2,ly2,lz2,nel), yf(nxr,nxr,nzr,nel)
1289 
1290  ! local variables
1291  integer nyzr, nxy2
1292  integer ie, iz, izoff
1293 
1294  ! moddificaion flag
1295  integer nold
1296  save nold
1297  data nold /0/
1298 
1299  ! work arrays
1300  integer lxr, lyr, lzr, lxyzr
1301  parameter(lxr=lx2+6)
1302  parameter(lyr=ly2+6)
1303  parameter(lzr=lz2+6)
1304  parameter(lxyzr=lxr*lyr*lzr)
1305  real txa(lxyzr),txb(lx2,ly2,lzr),zgmr(lxr),wgtr(lxr)
1306  common /ctmp0/ txa, txb, zgmr, wgtr
1307 
1308  ! interpolation arrays
1309  real ires(lxr,lxr) ,itres(lxr,lxr)
1310  common /ctmpabm2/ ires, itres
1311 !-----------------------------------------------------------------------
1312  nyzr = nxr*nzr
1313  nxy2 = lx2*ly2
1314 
1315  if (nxr.ne.nold) then
1316  nold=nxr
1317  call zwgl (zgmr,wgtr,nxr)
1318  call iglm (ires,itres,zgmr,zgm2,nxr,lx2,nxr,lx2)
1319  endif
1320 
1321  do ie=1,nel
1322  call mxm (ires,lx2,yf(1,1,1,ie),nxr,txa,nyzr)
1323  do iz=1,nzr
1324  izoff = 1 + (iz-1)*lx2*nxr
1325  call mxm (txa(izoff),lx2,itres,nxr,txb(1,1,iz),ly2)
1326  enddo
1327  if (if3d) then
1328  call mxm (txb,nxy2,itres,nzr,xf(1,1,1,ie),lz2)
1329  else
1330  call copy(xf(1,1,1,ie),txb,nxy2)
1331  endif
1332  enddo
1333 
1334  return
1335  end subroutine
1336 !=======================================================================
1343  implicit none
1344 
1345  include 'SIZE'
1346  include 'INPUT'
1347  include 'TSTEP'
1348  include 'RESTART'
1349  include 'SOLN'
1350  include 'GEOM'
1351  include 'IXYZ'
1352 
1353  ! scratch space
1354  real axism1 (lx1,ly1), axism2 (lx2,ly2), ialj2 (ly2,ly2),
1355  $ iatlj2(ly2,ly2), tmp(ly2,ly2)
1356  common /ctmp0/ axism1, axism2, ialj2, iatlj2, tmp
1357 
1358  ! local variables
1359  integer el, ips, is1
1360 !-----------------------------------------------------------------------
1361  if (.not.ifaxis) return
1362 
1363  ! get interpolation operators between Gauss-Lobatto Jacobi
1364  ! and and Gauss Legendre poits (this is missing in genwz)
1365  !call invmt(iajl2 ,ialj2 ,tmp ,ly2)
1366  call invmt(iatjl2,iatlj2,tmp,ly2)
1367 
1368  do el=1,nelv
1369  if (ifrzer(el)) then
1370  if (ifgetx) then
1371  call mxm(xm1(1,1,1,el),nx1,iatlj1,ny1,axism1,ny1)
1372  call copy(xm1(1,1,1,el),axism1,nx1*ny1)
1373  call mxm(ym1(1,1,1,el),nx1,iatlj1,ny1,axism1,ny1)
1374  call copy(ym1(1,1,1,el),axism1,nx1*ny1)
1375  endif
1376  if (ifgetu) then
1377  call mxm(vx(1,1,1,el),nx1,iatlj1,ny1,axism1,ny1)
1378  call copy(vx(1,1,1,el),axism1,nx1*ny1)
1379  call mxm(vy(1,1,1,el),nx1,iatlj1,ny1,axism1,ny1)
1380  call copy(vy(1,1,1,el),axism1,nx1*ny1)
1381  endif
1382  if (ifgetw) then
1383  call mxm(vz(1,1,1,el),nx1,iatlj1,ny1,axism1,ny1)
1384  call copy(vz(1,1,1,el),axism1,nx1*ny1)
1385  endif
1386  if (ifgetp) then
1387  if (ifsplit) then
1388  call mxm(pr(1,1,1,el),nx1,iatlj1,ny1,axism1,ny1)
1389  call copy(pr(1,1,1,el),axism1,nx1*ny1)
1390  else
1391  call mxm(pr(1,1,1,el),nx2,iatlj2,ny2,axism2,ny2)
1392  call copy(pr(1,1,1,el),axism2,nx2*ny2)
1393  endif
1394  endif
1395  if (ifgett) then
1396  call mxm(t(1,1,1,el,1),nx1,iatlj1,ny1,axism1,ny1)
1397  call copy(t(1,1,1,el,1),axism1,nx1*ny1)
1398  endif
1399  do ips=1,npscal
1400  is1 = ips + 1
1401  if (ifgtps(ips)) then
1402  call mxm(t(1,1,1,el,is1),nx1,iatlj1,ny1,axism1,ny1)
1403  call copy(t(1,1,1,el,is1),axism1,nx1*ny1)
1404  endif
1405  enddo
1406  endif
1407  enddo
1408 
1409  return
1410  end subroutine
1411 !=======================================================================
#define byte_open
Definition: byte.c:35
#define byte_close
Definition: byte.c:36
#define byte_read
Definition: byte.c:38
subroutine invmt(A, B, AA, N)
Definition: coef.f:1696
subroutine map21t(y, x, iel)
Definition: coef.f:1568
subroutine map12(y, x, iel)
Definition: coef.f:1530
subroutine bcast(buf, len)
Definition: comm_mpi.f:431
subroutine chkpts_init
Dummy replacement for checkpoint initialisation.
Definition: chkptdm.f:18
subroutine chkpts_read
Dummy replacement for checkpoint reader.
Definition: chkptdm.f:37
logical function chkpts_is_initialised()
Dummy replacement for check of module initialisation.
Definition: chkptdm.f:27
subroutine chkpts_register
Dummy replacement for checkpoint registration.
Definition: chkptdm.f:10
subroutine chkpts_write
Dummy replacement for checkpoint writer.
Definition: chkptdm.f:45
subroutine chkptms_map_gll(xf, yf, nxr, nzr, nel)
Interpolate input on velocity mesh.
Definition: chkptms.f:1210
subroutine chkptms_mfi(fname, chktype, ipert)
Read field to the file.
Definition: chkptms.f:835
subroutine chkptms_restart_read(fname, fnum)
Read checkpoint snapshot.
Definition: chkptms.f:604
subroutine chkptms_mfo(fname, chktype, ipert)
Write field to the file.
Definition: chkptms.f:670
subroutine chkptms_restart_write(fname, fnum, ifcoord)
Write checkpoint snapshot.
Definition: chkptms.f:512
subroutine chkptms_axis_interp_ic()
Map loaded variables from velocity to axisymmetric mesh.
Definition: chkptms.f:1343
subroutine chkptms_map_gl(xf, yf, nxr, nzr, nel)
Interpolate pressure input.
Definition: chkptms.f:1279
subroutine chkptms_dt_get
Get old simulation time steps and pressure mesh marker.
Definition: chkptms.f:301
subroutine chkptms_set_name(fname, fnum, nset, ifile)
Generate set of restart file names in snapshot.
Definition: chkptms.f:384
subroutine chkpt_fname(fname, prefix, nset, ifile, ierr)
Generate single restart file name.
Definition: chkptms.f:462
subroutine io_mfos(offs, lvs, lnx, lny, lnz, lnel, lnelg, lndim)
Write single scalar to the file.
Definition: io_tools.f:375
subroutine io_mfov(offs, lvx, lvy, lvz, lnx, lny, lnz, lnel, lnelg, lndim)
Write single vector to the file.
Definition: io_tools.f:273
subroutine io_mbyte_open(hname, ierr)
Open field file.
Definition: io_tools.f:182
subroutine io_mfo_fname(fname, bname, prefix, ierr)
Generate file name according to nek rulles without opening the file.
Definition: io_tools.f:109
subroutine io_mbyte_close(ierr)
Close field file.
Definition: io_tools.f:232
subroutine io_mfis(offs, uf, lnx, lny, lnz, lnel, ifskip)
Read scalar filed from the file.
Definition: io_tools.f:667
subroutine io_mfiv(offs, uf, vf, wf, lnx, lny, lnz, lnel, ifskip)
Read vector filed from the file.
Definition: io_tools.f:458
subroutine mntr_logi(mid, priority, logs, ivar)
Write log message adding single integer.
Definition: mntrlog.f:709
subroutine mntr_tmr_is_name_reg(mid, mname)
Check if timer name is registered and return its id.
Definition: mntrtmr.f:146
subroutine mntr_logr(mid, priority, logs, rvar)
Write log message adding single real.
Definition: mntrlog.f:731
subroutine mntr_warn(mid, logs)
Write warning message.
Definition: mntrlog.f:803
subroutine mntr_tmr_add(mid, icount, time)
Check if timer id is registered. This operation is performed locally.
Definition: mntrtmr.f:237
subroutine mntr_mod_is_name_reg(mid, mname)
Check if module name is registered and return its id.
Definition: mntrlog.f:459
subroutine mntr_abort(mid, logs)
Abort simulation.
Definition: mntrlog.f:837
subroutine mntr_log(mid, priority, logs)
Write log message.
Definition: mntrlog.f:600
subroutine mntr_error(mid, logs)
Write error message.
Definition: mntrlog.f:820
subroutine mntr_mod_reg(mid, pmid, mname, mdscr)
Register new module.
Definition: mntrlog.f:346
subroutine mntr_tmr_reg(mid, pmid, modid, mname, mdscr, ifsum)
Register new timer.
Definition: mntrtmr.f:16
subroutine mntr_check_abort(mid, ierr, logs)
Abort simulation.
Definition: mntrlog.f:856
subroutine mntr_set_step_delay(dstep)
Set number of steps necessary to write proper checkpointing.
Definition: mntrlog.f:254
subroutine addfid(fname, fid)
Definition: ic.f:2512
subroutine sioflag(ndumps, fname, rsopts)
Definition: ic.f:954
subroutine mfi_prepare(hname)
Definition: ic.f:2543
subroutine copy(a, b, n)
Definition: math.f:260
subroutine blank(A, N)
Definition: math.f:19
subroutine chcopy(a, b, n)
Definition: math.f:281
subroutine rzero(a, n)
Definition: math.f:208
subroutine mxm(a, n1, b, n2, c, n3)
Definition: mxm_wrapper.f:2
subroutine io_init
Definition: prepost.f:1024
subroutine mfo_write_hdr
Definition: prepost.f:1857
subroutine zwgl(Z, W, NP)
Definition: speclib.f:91
subroutine zwgll(Z, W, NP)
Definition: speclib.f:108
subroutine iglm(I12, IT12, Z1, Z2, lz1, lz2, ND1, ND2)
Definition: speclib.f:1077
subroutine igllm(I12, IT12, Z1, Z2, lz1, lz2, ND1, ND2)
Definition: speclib.f:1102