All Classes Files Functions Variables Pages
module_init_memory.f90
Go to the documentation of this file.
1 !=====================================================================================================================================
2 ! EFISPEC3D !
3 ! (Elements FInis SPECtraux 3D) !
4 ! !
5 ! http://efispec.free.fr !
6 ! !
7 ! !
8 ! This file is part of EFISPEC3D !
9 ! Please refer to http://efispec.free.fr if you use it or part of it !
10 ! !
11 ! !
12 !1 ---> French License: CeCILL V2 !
13 ! !
14 ! Copyright BRGM 2009 contributeurs : Florent DE MARTIN !
15 ! David MICHEA !
16 ! Philippe THIERRY !
17 ! !
18 ! Contact: f.demartin at brgm.fr !
19 ! !
20 ! Ce logiciel est un programme informatique servant a resoudre l'equation du !
21 ! mouvement en trois dimensions via une methode des elements finis spectraux. !
22 ! !
23 ! Ce logiciel est regi par la licence CeCILL soumise au droit francais et !
24 ! respectant les principes de diffusion des logiciels libres. Vous pouvez !
25 ! utiliser, modifier et/ou redistribuer ce programme sous les conditions de la !
26 ! licence CeCILL telle que diffusee par le CEA, le CNRS et l'INRIA sur le site !
27 ! "http://www.cecill.info". !
28 ! !
29 ! En contrepartie de l'accessibilite au code source et des droits de copie, de !
30 ! modification et de redistribution accordes par cette licence, il n'est offert !
31 ! aux utilisateurs qu'une garantie limitee. Pour les memes raisons, seule une !
32 ! responsabilite restreinte pese sur l'auteur du programme, le titulaire des !
33 ! droits patrimoniaux et les concedants successifs. !
34 ! !
35 ! A cet egard l'attention de l'utilisateur est attiree sur les risques associes !
36 ! au chargement, a l'utilisation, a la modification et/ou au developpement et a !
37 ! la reproduction du logiciel par l'utilisateur etant donne sa specificite de !
38 ! logiciel libre, qui peut le rendre complexe a manipuler et qui le reserve donc !
39 ! a des developpeurs et des professionnels avertis possedant des connaissances !
40 ! informatiques approfondies. Les utilisateurs sont donc invites a charger et !
41 ! tester l'adequation du logiciel a leurs besoins dans des conditions permettant !
42 ! d'assurer la securite de leurs systemes et ou de leurs donnees et, plus !
43 ! generalement, a l'utiliser et l'exploiter dans les memes conditions de !
44 ! securite. !
45 ! !
46 ! Le fait que vous puissiez acceder a cet en-tete signifie que vous avez pris !
47 ! connaissance de la licence CeCILL et que vous en avez accepte les termes. !
48 ! !
49 ! !
50 !2 ---> International license: GNU GPL V3 !
51 ! !
52 ! EFISPEC3D is a computer program that solves the three-dimensional equations of !
53 ! motion using a finite spectral-element method. !
54 ! !
55 ! Copyright (C) 2009 Florent DE MARTIN !
56 ! !
57 ! Contact: f.demartin at brgm.fr !
58 ! !
59 ! This program is free software: you can redistribute it and/or modify it under !
60 ! the terms of the GNU General Public License as published by the Free Software !
61 ! Foundation, either version 3 of the License, or (at your option) any later !
62 ! version. !
63 ! !
64 ! This program is distributed in the hope that it will be useful, but WITHOUT ANY !
65 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A !
66 ! PARTICULAR PURPOSE. See the GNU General Public License for more details. !
67 ! !
68 ! You should have received a copy of the GNU General Public License along with !
69 ! this program. If not, see http://www.gnu.org/licenses/. !
70 ! !
71 ! !
72 !3 ---> Third party libraries !
73 ! !
74 ! EFISPEC3D uses the following of third party libraries: !
75 ! !
76 ! --> METIS 5.1.0 !
77 ! see http://glaros.dtc.umn.edu/gkhome/metis/metis/overview !
78 ! !
79 ! --> Lib_VTK_IO !
80 ! see S. Zaghi's website: https://github.com/szaghi/Lib_VTK_IO !
81 ! !
82 ! --> INTERP_LINEAR !
83 ! see J. Burkardt website: http://people.sc.fsu.edu/~jburkardt/ !
84 ! !
85 ! --> SAC !
86 ! http://ds.iris.edu/files/sac-manual/ !
87 ! !
88 ! --> EXODUS II !
89 ! http://sourceforge.net/projects/exodusii/ !
90 ! !
91 ! --> NETCDF !
92 ! http://www.unidata.ucar.edu/software/netcdf/ !
93 ! !
94 ! --> HDF5 !
95 ! http://www.hdfgroup.org/HDF5/ !
96 ! !
97 ! Some of these libraries are located in directory lib and pre-compiled !
98 ! with intel compiler for x86_64 platform. !
99 ! !
100 ! !
101 !4 ---> Related Articles !
102 ! !
103 ! De Martin, F., Matsushima, M., Kawase, H. (BSSA, 2013) !
104 ! Impact of geometric effects on near-surface Green's functions !
105 ! doi:10.1785/0120130039 !
106 ! !
107 ! Aochi, H., Ducellier, A., Dupros, F., Delatre, M., Ulrich, T., De Martin, F., !
108 ! Yoshimi, M., (Pure Appl. Geophys. 2013) !
109 ! Finite Difference Simulations of Seismic Wave Propagation for the 2007 Mw 6.6 !
110 ! Niigata-ken Chuetsu-Oki Earthquake: Validity of Models and Reliable !
111 ! Input Ground Motion in the Near-Field !
112 ! doi:10.1007/s00024-011-0429-5 !
113 ! !
114 ! De Martin, F. (BSSA, 2011) !
115 ! Verification of a Spectral-Element Method Code for the Southern California !
116 ! Earthquake Center LOH.3 Viscoelastic Case !
117 ! doi:10.1785/0120100305 !
118 ! !
119 !=====================================================================================================================================
120 
123 
127 
128  implicit none
129 
130  private
131 
132  public :: init_array_real_dp
133  public :: init_array_real
134  public :: init_array_int
135  public :: memory_consumption
136 
140 
141  module procedure init_array_rank1_real_dp
142  module procedure init_array_rank2_real_dp
143 
144  end interface init_array_real_dp
145 
148  interface init_array_real
149 
150  module procedure init_array_rank1_real
151  module procedure init_array_rank2_real
152  module procedure init_array_rank3_real
153  module procedure init_array_rank4_real
154  module procedure init_array_rank5_real
155 
156  end interface init_array_real
157 
160  interface init_array_int
161 
162  module procedure init_array_rank1_int
163  module procedure init_array_rank2_int
164  module procedure init_array_rank3_int
165  module procedure init_array_rank4_int
166 
167  end interface init_array_int
168 
169  contains
170 
171 !
172 !
177 !***********************************************************************************************************************************************************************************
178  function init_array_rank1_real_dp(t,n1,tname) result(err)
179 !***********************************************************************************************************************************************************************************
180 
181  use mod_global_variables, only : error_stop
182 
183  implicit none
184 
185  integer , intent( in) :: n1
186  double precision, intent(out), allocatable, dimension(:) :: t
187  character(len=*), intent( in) :: tname
188 
189  integer :: err
190  integer :: i
191 
192  allocate(t(n1),stat=err)
193 
194  if (err /= 0) then
195 
196  call error_stop("error while allocating array "//trim(adjustl(tname)))
197 
198  else
199 
200  do i = 1,n1
201  t(i) = 0.0d0
202  enddo
203 
204  endif
205 
206  return
207 !***********************************************************************************************************************************************************************************
208  end function init_array_rank1_real_dp
209 !***********************************************************************************************************************************************************************************
210 
211 
212 !
213 !
219 !***********************************************************************************************************************************************************************************
220  function init_array_rank2_real_dp(t,n1,n2,tname) result(err)
221 !***********************************************************************************************************************************************************************************
222 
223  use mod_global_variables, only : error_stop
224 
225  implicit none
226 
227  integer , intent( in) :: n1
228  integer , intent( in) :: n2
229  double precision, intent(out), allocatable, dimension(:,:) :: t
230  character(len=*), intent( in) :: tname
231 
232  integer :: err
233  integer :: i
234  integer :: j
235 
236  allocate(t(n2,n1),stat=err)
237 
238  if (err /= 0) then
239 
240  call error_stop("error while allocating array "//trim(adjustl(tname)))
241 
242  else
243 
244  do i = 1,n1
245  do j = 1,n2
246  t(j,i) = 0.0d0
247  enddo
248  enddo
249 
250  endif
251 
252  return
253 !***********************************************************************************************************************************************************************************
254  end function init_array_rank2_real_dp
255 !***********************************************************************************************************************************************************************************
256 
257 
258 !
259 !
264 !***********************************************************************************************************************************************************************************
265  function init_array_rank1_real(t,n1,tname) result(err)
266 !***********************************************************************************************************************************************************************************
267 
268  use mod_global_variables, only : error_stop
269 
270  implicit none
271 
272  integer , intent( in) :: n1
273  real , intent(out), allocatable, dimension(:) :: t
274  character(len=*), intent( in) :: tname
275 
276  integer :: err
277  integer :: i
278 
279  allocate(t(n1),stat=err)
280 
281  if (err /= 0) then
282 
283  call error_stop("error while allocating array "//trim(adjustl(tname)))
284 
285  else
286 
287  do i = 1,n1
288  t(i) = 0.0
289  enddo
290 
291  endif
292 
293  return
294 !***********************************************************************************************************************************************************************************
295  end function init_array_rank1_real
296 !***********************************************************************************************************************************************************************************
297 
298 !
299 !
305 !***********************************************************************************************************************************************************************************
306  function init_array_rank2_real(t,n1,n2,tname) result(err)
307 !***********************************************************************************************************************************************************************************
308 
309  use mod_global_variables, only : error_stop
310 
311  implicit none
312 
313  integer , intent( in) :: n1
314  integer , intent( in) :: n2
315  real , intent(out), allocatable, dimension(:,:) :: t
316  character(len=*), intent( in) :: tname
317 
318  integer :: err
319  integer :: i
320  integer :: j
321 
322  allocate(t(n2,n1),stat=err)
323 
324  if (err /= 0) then
325 
326  call error_stop("error while allocating array "//trim(adjustl(tname)))
327 
328  else
329 
330  do i = 1,n1
331  do j = 1,n2
332  t(j,i) = 0.0
333  enddo
334  enddo
335 
336  endif
337 
338  return
339 !***********************************************************************************************************************************************************************************
340  end function init_array_rank2_real
341 !***********************************************************************************************************************************************************************************
342 
343 !
344 !
351 !***********************************************************************************************************************************************************************************
352  function init_array_rank3_real(t,n1,n2,n3,tname) result(err)
353 !***********************************************************************************************************************************************************************************
354 
355  use mod_global_variables, only : error_stop
356 
357  implicit none
358 
359  integer , intent( in) :: n1
360  integer , intent( in) :: n2
361  integer , intent( in) :: n3
362  real , intent(out), allocatable, dimension(:,:,:) :: t
363  character(len=*), intent( in) :: tname
364 
365  integer :: err
366  integer :: i
367  integer :: j
368  integer :: k
369 
370  allocate(t(n3,n2,n1),stat=err)
371 
372  if (err /= 0) then
373 
374  call error_stop("error while allocating array "//trim(adjustl(tname)))
375 
376  else
377 
378  do i = 1,n1
379  do j = 1,n2
380  do k = 1,n3
381  t(k,j,i) = 0.0
382  enddo
383  enddo
384  enddo
385 
386  endif
387 
388  return
389 !***********************************************************************************************************************************************************************************
390  end function init_array_rank3_real
391 !***********************************************************************************************************************************************************************************
392 
393 !
394 !
402 !***********************************************************************************************************************************************************************************
403  function init_array_rank4_real(t,n1,n2,n3,n4,tname) result(err)
404 !***********************************************************************************************************************************************************************************
405 
406  use mod_global_variables, only : error_stop
407 
408  implicit none
409 
410  integer , intent( in) :: n1
411  integer , intent( in) :: n2
412  integer , intent( in) :: n3
413  integer , intent( in) :: n4
414  real , intent(out), allocatable, dimension(:,:,:,:) :: t
415  character(len=*), intent(in) :: tname
416 
417  integer :: err
418  integer :: i
419  integer :: j
420  integer :: k
421  integer :: l
422 
423  allocate(t(n4,n3,n2,n1),stat=err)
424 
425  if (err /= 0) then
426 
427  call error_stop("error while allocating array "//trim(adjustl(tname)))
428 
429  else
430 
431  do i = 1,n1
432  do j = 1,n2
433  do k = 1,n3
434  do l = 1,n4
435  t(l,k,j,i) = 0.0
436  enddo
437  enddo
438  enddo
439  enddo
440 
441  endif
442 
443  return
444 !***********************************************************************************************************************************************************************************
445  end function init_array_rank4_real
446 !***********************************************************************************************************************************************************************************
447 
448 !
449 !
458 !***********************************************************************************************************************************************************************************
459  function init_array_rank5_real(t,n1,n2,n3,n4,n5,tname) result(err)
460 !***********************************************************************************************************************************************************************************
461 
462  use mod_global_variables, only : error_stop
463 
464  implicit none
465 
466  integer , intent( in) :: n1
467  integer , intent( in) :: n2
468  integer , intent( in) :: n3
469  integer , intent( in) :: n4
470  integer , intent( in) :: n5
471  real , intent(out), allocatable, dimension(:,:,:,:,:) :: t
472  character(len=*), intent(in) :: tname
473 
474  integer :: err
475  integer :: i
476  integer :: j
477  integer :: k
478  integer :: l
479  integer :: m
480 
481  allocate(t(n5,n4,n3,n2,n1),stat=err)
482 
483  if (err /= 0) then
484 
485  call error_stop("error while allocating array "//trim(adjustl(tname)))
486 
487  else
488 
489  do i = 1,n1
490  do j = 1,n2
491  do k = 1,n3
492  do l = 1,n4
493  do m = 1,n5
494  t(m,l,k,j,i) = 0.0
495  enddo
496  enddo
497  enddo
498  enddo
499  enddo
500 
501  endif
502 
503  return
504 !***********************************************************************************************************************************************************************************
505  end function init_array_rank5_real
506 !***********************************************************************************************************************************************************************************
507 
508 !
509 !
514 !***********************************************************************************************************************************************************************************
515  function init_array_rank1_int(t,n1,tname) result(err)
516 !***********************************************************************************************************************************************************************************
517 
518  use mod_global_variables, only : error_stop
519 
520  implicit none
521 
522  integer , intent( in) :: n1
523  integer , intent(out), allocatable, dimension(:) :: t
524  character(len=*), intent( in) :: tname
525 
526  integer :: err
527  integer :: i
528 
529  allocate(t(n1),stat=err)
530 
531  if (err /= 0) then
532 
533  call error_stop("error while allocating array "//trim(adjustl(tname)))
534 
535  else
536 
537  do i = 1,n1
538  t(i) = 0
539  enddo
540 
541  endif
542 
543  return
544 !***********************************************************************************************************************************************************************************
545  end function init_array_rank1_int
546 !***********************************************************************************************************************************************************************************
547 
548 !
549 !
555 !***********************************************************************************************************************************************************************************
556  function init_array_rank2_int(t,n1,n2,tname) result(err)
557 !***********************************************************************************************************************************************************************************
558 
559  use mod_global_variables, only : error_stop
560 
561  implicit none
562 
563  integer , intent( in) :: n1
564  integer , intent( in) :: n2
565  integer , intent(out), allocatable, dimension(:,:) :: t
566  character(len=*), intent( in) :: tname
567 
568  integer :: err
569  integer :: i
570  integer :: j
571 
572  allocate(t(n2,n1),stat=err)
573 
574  if (err /= 0) then
575 
576  call error_stop("error while allocating array "//trim(adjustl(tname)))
577 
578  else
579 
580  do i = 1,n1
581  do j = 1,n2
582  t(j,i) = 0
583  enddo
584  enddo
585 
586  endif
587 
588  return
589 !***********************************************************************************************************************************************************************************
590  end function init_array_rank2_int
591 !***********************************************************************************************************************************************************************************
592 
593 !
594 !
601 !***********************************************************************************************************************************************************************************
602  function init_array_rank3_int(t,n1,n2,n3,tname) result(err)
603 !***********************************************************************************************************************************************************************************
604 
605  use mod_global_variables, only : error_stop
606 
607  implicit none
608 
609  integer , intent( in) :: n1
610  integer , intent( in) :: n2
611  integer , intent( in) :: n3
612  integer , intent(out), allocatable, dimension(:,:,:) :: t
613  character(len=*), intent( in) :: tname
614 
615  integer :: err
616  integer :: i
617  integer :: j
618  integer :: k
619 
620  allocate(t(n3,n2,n1),stat=err)
621 
622  if (err /= 0) then
623 
624  call error_stop("error while allocating array "//trim(adjustl(tname)))
625 
626  else
627 
628  do i = 1,n1
629  do j = 1,n2
630  do k = 1,n3
631  t(k,j,i) = 0
632  enddo
633  enddo
634  enddo
635 
636  endif
637 
638  return
639 !***********************************************************************************************************************************************************************************
640  end function init_array_rank3_int
641 !***********************************************************************************************************************************************************************************
642 
643 !
644 !
652 !***********************************************************************************************************************************************************************************
653  function init_array_rank4_int(t,n1,n2,n3,n4,tname) result(err)
654 !***********************************************************************************************************************************************************************************
655 
656  use mod_global_variables, only : error_stop
657 
658  implicit none
659 
660  integer , intent( in) :: n1
661  integer , intent( in) :: n2
662  integer , intent( in) :: n3
663  integer , intent( in) :: n4
664  integer , intent(out), allocatable, dimension(:,:,:,:) :: t
665  character(len=*), intent(in) :: tname
666 
667  integer :: err
668  integer :: i
669  integer :: j
670  integer :: k
671  integer :: l
672 
673  allocate(t(n4,n3,n2,n1),stat=err)
674 
675  if (err /= 0) then
676 
677  call error_stop("error while allocating array "//trim(adjustl(tname)))
678 
679  else
680 
681  do i = 1,n1
682  do j = 1,n2
683  do k = 1,n3
684  do l = 1,n4
685  t(l,k,j,i) = 0
686  enddo
687  enddo
688  enddo
689  enddo
690 
691  endif
692 
693  return
694 !***********************************************************************************************************************************************************************************
695  end function init_array_rank4_int
696 !***********************************************************************************************************************************************************************************
697 
698 !
699 !
703 !***********************************************************************************************************************************************************************************
704  subroutine memory_consumption()
705 !***********************************************************************************************************************************************************************************
706 
707  use mpi
708 
710 
711  implicit none
712 
713  real, parameter :: mo = (1024.0)**2
714  real :: total_memory
715  real :: total_memory_all_cpu
716  real :: size_cpu_world(ig_ncpu)
717  integer :: ios
718  integer :: i
719 
720  total_memory = 0.0
721  total_memory_all_cpu = 0.0
722 
723  total_memory = total_memory + real(sizeof(lg_visco))/mo
724  total_memory = total_memory + real(sizeof(lg_snapshot_vtk))/mo
725  total_memory = total_memory + real(sizeof(lg_snapshot_gmt))/mo
726  total_memory = total_memory + real(sizeof(lg_output_medium_vtk))/mo
727  total_memory = total_memory + real(sizeof(ig_lagrange_order))/mo
728  total_memory = total_memory + real(sizeof(ig_ngll))/mo
729  total_memory = total_memory + real(sizeof(ig_lst_unit))/mo
730  total_memory = total_memory + real(sizeof(ig_ndof))/mo
731  total_memory = total_memory + real(sizeof(ig_nrelax))/mo
732  total_memory = total_memory + real(sizeof(rg_newmark_gamma))/mo
733  total_memory = total_memory + real(sizeof(rg_pi))/mo
734  total_memory = total_memory + real(sizeof(epsilon_machine))/mo
735  total_memory = total_memory + real(sizeof(tiny_real))/mo
736  total_memory = total_memory + real(sizeof(lg_async_mpi_comm))/mo
737  total_memory = total_memory + real(sizeof(lg_output_cputime))/mo
738  total_memory = total_memory + real(sizeof(lg_output_debug_file))/mo
739 
740  total_memory = total_memory + real(sizeof(rg_dcsource_gll_force))/mo
741  total_memory = total_memory + real(sizeof(rg_hexa_gll_jacobian_det))/mo
742  total_memory = total_memory + real(sizeof(rg_hexa_gll_dxidx))/mo
743  total_memory = total_memory + real(sizeof(rg_hexa_gll_dxidy))/mo
744  total_memory = total_memory + real(sizeof(rg_hexa_gll_dxidz))/mo
745  total_memory = total_memory + real(sizeof(rg_hexa_gll_detdx))/mo
746  total_memory = total_memory + real(sizeof(rg_hexa_gll_detdy))/mo
747  total_memory = total_memory + real(sizeof(rg_hexa_gll_detdz))/mo
748  total_memory = total_memory + real(sizeof(rg_hexa_gll_dzedx))/mo
749  total_memory = total_memory + real(sizeof(rg_hexa_gll_dzedy))/mo
750  total_memory = total_memory + real(sizeof(rg_hexa_gll_dzedz))/mo
751  total_memory = total_memory + real(sizeof(rg_hexa_gll_rho))/mo
752  total_memory = total_memory + real(sizeof(rg_hexa_gll_rhovs2))/mo
753  total_memory = total_memory + real(sizeof(rg_hexa_gll_rhovp2))/mo
754  total_memory = total_memory + real(sizeof(rg_quadp_gll_rhovs))/mo
755  total_memory = total_memory + real(sizeof(rg_quadp_gll_rhovp))/mo
756  total_memory = total_memory + real(sizeof(rg_quadp_gll_jaco_det))/mo
757  total_memory = total_memory + real(sizeof(rg_quadp_gll_normal))/mo
758  total_memory = total_memory + real(sizeof(rg_hexa_gll_wkqs))/mo
759  total_memory = total_memory + real(sizeof(rg_hexa_gll_wkqp))/mo
760  total_memory = total_memory + real(sizeof(rg_hexa_gll_ksixx))/mo
761  total_memory = total_memory + real(sizeof(rg_hexa_gll_ksiyy))/mo
762  total_memory = total_memory + real(sizeof(rg_hexa_gll_ksizz))/mo
763  total_memory = total_memory + real(sizeof(rg_hexa_gll_ksixy))/mo
764  total_memory = total_memory + real(sizeof(rg_hexa_gll_ksixz))/mo
765  total_memory = total_memory + real(sizeof(rg_hexa_gll_ksiyz))/mo
766  total_memory = total_memory + real(sizeof(rg_relax_coeff))/mo
767  total_memory = total_memory + real(sizeof(rg_mem_var_exp))/mo
768  total_memory = total_memory + real(sizeof(rg_gll_displacement))/mo
769  total_memory = total_memory + real(sizeof(rg_gll_velocity))/mo
770  total_memory = total_memory + real(sizeof(rg_gll_acceleration))/mo
771  total_memory = total_memory + real(sizeof(rg_gnode_abscissa))/mo
772  total_memory = total_memory + real(sizeof(rg_gnode_abscissa_dist))/mo
773  total_memory = total_memory + real(sizeof(rg_gll_mass_matrix))/mo
774  total_memory = total_memory + real(sizeof(rg_gnode_x))/mo
775  total_memory = total_memory + real(sizeof(rg_gnode_y))/mo
776  total_memory = total_memory + real(sizeof(rg_gnode_z))/mo
777  total_memory = total_memory + real(sizeof(rg_receiver_snapshot_z))/mo
778  total_memory = total_memory + real(sizeof(ig_receiver_snapshot_locnum))/mo
779  total_memory = total_memory + real(sizeof(rg_dcsource_user_func))/mo
780  total_memory = total_memory + real(sizeof(rg_sfsource_user_func))/mo
781  total_memory = total_memory + real(sizeof(rg_mpi_buffer_send))/mo
782  total_memory = total_memory + real(sizeof(rg_mpi_buffer_recv))/mo
783  total_memory = total_memory + real(sizeof(rg_dt))/mo
784  total_memory = total_memory + real(sizeof(rg_dt2))/mo
785  total_memory = total_memory + real(sizeof(rg_simu_current_time))/mo
786  total_memory = total_memory + real(sizeof(rg_simu_total_time))/mo
787  total_memory = total_memory + real(sizeof(rg_mesh_xmax))/mo
788  total_memory = total_memory + real(sizeof(rg_mesh_xmin))/mo
789  total_memory = total_memory + real(sizeof(rg_mesh_ymax))/mo
790  total_memory = total_memory + real(sizeof(rg_mesh_ymin))/mo
791  total_memory = total_memory + real(sizeof(rg_mesh_zmax))/mo
792  total_memory = total_memory + real(sizeof(rg_mesh_zmin))/mo
793  total_memory = total_memory + real(sizeof(rg_receiver_snapshot_dxdy))/mo
794  total_memory = total_memory + real(sizeof(rg_receiver_snapshot_dx))/mo
795  total_memory = total_memory + real(sizeof(rg_receiver_snapshot_dy))/mo
796  total_memory = total_memory + real(sizeof(ig_receiver_snapshot_nx))/mo
797  total_memory = total_memory + real(sizeof(ig_receiver_snapshot_ny))/mo
798  total_memory = total_memory + real(sizeof(ig_hexa_gll_glonum))/mo
799  total_memory = total_memory + real(sizeof(ig_quadp_gll_glonum))/mo
800  total_memory = total_memory + real(sizeof(ig_quadf_gll_glonum))/mo
801  total_memory = total_memory + real(sizeof(ig_hexa_gnode_glonum))/mo
802  total_memory = total_memory + real(sizeof(ig_quadp_gnode_glonum))/mo
803  total_memory = total_memory + real(sizeof(ig_quadf_gnode_glonum))/mo
804  total_memory = total_memory + real(sizeof(ig_hexa_gnode_xiloc))/mo
805  total_memory = total_memory + real(sizeof(ig_hexa_gnode_etloc))/mo
806  total_memory = total_memory + real(sizeof(ig_hexa_gnode_zeloc))/mo
807  total_memory = total_memory + real(sizeof(ig_quad_gnode_xiloc))/mo
808  total_memory = total_memory + real(sizeof(ig_quad_gnode_etloc))/mo
809  total_memory = total_memory + real(sizeof(ig_hexa_receiver_unit))/mo
810  total_memory = total_memory + real(sizeof(ig_quad_receiver_unit))/mo
811  total_memory = total_memory + real(sizeof(ig_mpi_buffer_sizemax))/mo
812  total_memory = total_memory + real(sizeof(ig_mpi_request_send))/mo
813  total_memory = total_memory + real(sizeof(ig_mpi_request_recv))/mo
814  total_memory = total_memory + real(sizeof(ig_mpi_buffer_offset))/mo
815  total_memory = total_memory + real(sizeof(ig_hexa_material_number))/mo
816  total_memory = total_memory + real(sizeof(ig_material_type))/mo
817  total_memory = total_memory + real(sizeof(ig_receiver_snapshot_glonum))/mo
818  total_memory = total_memory + real(sizeof(ig_receiver_snapshot_mpi_shift))/mo
819  total_memory = total_memory + real(sizeof(ig_receiver_snapshot_total_number))/mo
820  total_memory = total_memory + real(sizeof(ig_ncpu))/mo
821  total_memory = total_memory + real(sizeof(ig_myrank))/mo
822  total_memory = total_memory + real(sizeof(ig_ncpu_neighbor))/mo
823  total_memory = total_memory + real(sizeof(ig_cpu_neighbor_info))/mo
824  total_memory = total_memory + real(sizeof(ig_nhexa))/mo
825  total_memory = total_memory + real(sizeof(ig_nhexa_outer))/mo
826  total_memory = total_memory + real(sizeof(ig_nhexa_inner))/mo
827  total_memory = total_memory + real(sizeof(ig_nquad_parax))/mo
828  total_memory = total_memory + real(sizeof(ig_nquad_fsurf))/mo
829  total_memory = total_memory + real(sizeof(ig_mesh_nnode))/mo
830  total_memory = total_memory + real(sizeof(ig_hexa_nnode))/mo
831  total_memory = total_memory + real(sizeof(ig_quad_nnode))/mo
832  total_memory = total_memory + real(sizeof(ig_line_nnode))/mo
833  total_memory = total_memory + real(sizeof(ig_hexa_node2gll))/mo
834  total_memory = total_memory + real(sizeof(ig_ndt))/mo
835  total_memory = total_memory + real(sizeof(ig_idt))/mo
836  total_memory = total_memory + real(sizeof(ig_receiver_saving_incr))/mo
837  total_memory = total_memory + real(sizeof(ig_snapshot_saving_incr))/mo
838  total_memory = total_memory + real(sizeof(ig_snapshot_volume_saving_incr))/mo
839  total_memory = total_memory + real(sizeof(lg_boundary_absorption))/mo
840  total_memory = total_memory + real(sizeof(ig_ndcsource))/mo
841  total_memory = total_memory + real(sizeof(ig_nsfsource))/mo
842  total_memory = total_memory + real(sizeof(ig_nreceiver_hexa))/mo
843  total_memory = total_memory + real(sizeof(ig_nreceiver_quad))/mo
844  total_memory = total_memory + real(sizeof(ig_nreceiver_snapshot))/mo
845  total_memory = total_memory + real(sizeof(ig_medium_type))/mo
846  total_memory = total_memory + real(sizeof(ig_nmaterial))/mo
847  total_memory = total_memory + real(sizeof(ig_quadp_neighbor_hexa))/mo
848  total_memory = total_memory + real(sizeof(ig_quadp_neighbor_hexaface))/mo
849  total_memory = total_memory + real(sizeof(ig_nneighbor_all_kind))/mo
850  total_memory = total_memory + real(sizeof(ig_cpu_name_len))/mo
851  total_memory = total_memory + real(sizeof(cg_cpu_name))/mo
852  total_memory = total_memory + real(sizeof(cg_prefix))/mo
853  total_memory = total_memory + real(sizeof(cg_myrank))/mo
854  total_memory = total_memory + real(sizeof(cg_ncpu))/mo
855  total_memory = total_memory + real(sizeof(lg_snapshot))/mo
856  total_memory = total_memory + real(sizeof(lg_snapshot_displacement))/mo
857  total_memory = total_memory + real(sizeof(lg_snapshot_velocity))/mo
858  total_memory = total_memory + real(sizeof(lg_snapshot_acceleration))/mo
859  total_memory = total_memory + real(sizeof(lg_snapshot_volume))/mo
860  total_memory = total_memory + real(sizeof(lg_snapshot_volume_displacement))/mo
861  total_memory = total_memory + real(sizeof(lg_snapshot_volume_velocity))/mo
862  total_memory = total_memory + real(sizeof(lg_snapshot_volume_acceleration))/mo
863 
864  total_memory = total_memory + real(sizeof(rg_gll_coordinate))/mo
865  total_memory = total_memory + real(sizeof(rg_gll_weight))/mo
866  total_memory = total_memory + real(sizeof(rg_gll_abscissa))/mo
867  total_memory = total_memory + real(sizeof(rg_gll_lagrange_deriv))/mo
868  total_memory = total_memory + real(sizeof(rg_gll_abscissa_dist))/mo
869  total_memory = total_memory + real(sizeof(ig_ngll_total))/mo
870 
871  total_memory = total_memory + real(sizeof(ig_hexa_snapshot))/mo
872  total_memory = total_memory + real(sizeof(ig_vtk_hexa_conn_snapshot))/mo
873  total_memory = total_memory + real(sizeof(ig_vtk_node_gll_glonum_snapshot))/mo
874  total_memory = total_memory + real(sizeof(rg_vtk_node_x_snapshot))/mo
875  total_memory = total_memory + real(sizeof(rg_vtk_node_y_snapshot))/mo
876  total_memory = total_memory + real(sizeof(rg_vtk_node_z_snapshot))/mo
877  total_memory = total_memory + real(sizeof(ig_vtk_cell_type_snapshot))/mo
878  total_memory = total_memory + real(sizeof(ig_vtk_offset_snapshot))/mo
879  total_memory = total_memory + real(sizeof(ig_vtk_nhexa_snapshot))/mo
880  total_memory = total_memory + real(sizeof(ig_vtk_nnode_snapshot))/mo
881  total_memory = total_memory + real(sizeof(rg_snapshot_volume_xmin))/mo
882  total_memory = total_memory + real(sizeof(rg_snapshot_volume_xmax))/mo
883  total_memory = total_memory + real(sizeof(rg_snapshot_volume_ymin))/mo
884  total_memory = total_memory + real(sizeof(rg_snapshot_volume_ymax))/mo
885  total_memory = total_memory + real(sizeof(rg_snapshot_volume_zmin))/mo
886  total_memory = total_memory + real(sizeof(rg_snapshot_volume_zmax))/mo
887 
888  total_memory = total_memory + real(sizeof(tg_sfsource))/mo
889  total_memory = total_memory + real(sizeof(tg_dcsource))/mo
890  total_memory = total_memory + real(sizeof(tg_receiver_hexa))/mo
891  total_memory = total_memory + real(sizeof(tg_receiver_snapshot_quad))/mo
892  total_memory = total_memory + real(sizeof(tg_cpu_neighbor))/mo
893  total_memory = total_memory + real(sizeof(tg_elastic_material))/mo
894  total_memory = total_memory + real(sizeof(tg_viscoelastic_material))/mo
895 
896  !
897  !cpu 0 gather all info
898  call mpi_gather(total_memory,1,mpi_real,size_cpu_world,1,mpi_real,0,mpi_comm_world,ios)
899 
900  !
901  !cpu 0 write info in *.lst
902  if (ig_myrank == 0) then
903 
904  write(ig_lst_unit,'(" ",/,a)') "memory consumption approximation"
905 
906  do i = 1,ig_ncpu
907  write(ig_lst_unit,'(a,i8,a,f15.3,a)') "cpu ",i-1," : ",size_cpu_world(i)," Mo"
908  total_memory_all_cpu = total_memory_all_cpu + size_cpu_world(i)
909  enddo
910 
911  write(ig_lst_unit,'(a,9x,f15.3,a)') "Total ",total_memory_all_cpu," Mo"
912 
913  endif
914 
915  return
916 
917 !***********************************************************************************************************************************************************************************
918  end subroutine memory_consumption
919 !***********************************************************************************************************************************************************************************
920 
921 end module mod_init_memory
This module contains subroutines to allocate arrays and to compute an approximation of the total RAM ...
integer function init_array_rank3_int(t, n1, n2, n3, tname)
This subroutine allocates int-value array of rank 3.
integer function init_array_rank1_real_dp(t, n1, tname)
This subroutine allocates real-double-precision-value array of rank 1.
integer function init_array_rank5_real(t, n1, n2, n3, n4, n5, tname)
This subroutine allocates real-value array of order 5.
integer function init_array_rank1_real(t, n1, tname)
This subroutine allocates real-value array of rank 1.
integer function init_array_rank4_int(t, n1, n2, n3, n4, tname)
This subroutine allocates int-value array of order 4.
This module defines all global variables of EFISPEC3D. Scalar variables are initialized directly in t...
Interface init_array_real to redirect allocation to n-rank arrays.
subroutine, public memory_consumption()
Subroutine to compute an approximation of total RAM used by global variables of EFISPEC3D. See module mod_global_variables.
integer function init_array_rank2_real(t, n1, n2, tname)
This subroutine allocates real-value array of rank 2.
integer function init_array_rank1_int(t, n1, tname)
This subroutine allocates integer-value array of rank 1.
integer function init_array_rank2_real_dp(t, n1, n2, tname)
This subroutine allocates real-double-precision-value array of rank 2.
integer function init_array_rank4_real(t, n1, n2, n3, n4, tname)
This subroutine allocates real-value array of order 4.
integer function init_array_rank3_real(t, n1, n2, n3, tname)
This subroutine allocates real-value array of rank 3.
Interface init_array_real_dp to redirect allocation to n-rank arrays.
integer function init_array_rank2_int(t, n1, n2, tname)
This subroutine allocates integer-value array of rank 2.
Interface init_array_int to redirect allocation to n-rank arrays.