FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
hecmw_io.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
6 
7 module hecmw_io
8  use hecmw_util
13  use hecmw_result
14  use hecmw_restart
15  use iso_c_binding
16  implicit none
17 
18  public :: hecmw_get_mesh
19  public :: hecmw_put_mesh
20 
21  interface
22 
23  subroutine hecmw_get_entire_mesh_init_if(filename,err,len) bind(C,name='hecmw_get_entire_mesh_init_if')
24  use iso_c_binding
25  implicit none
26  character(kind=c_char), intent(in) :: filename(*)
27  integer(c_int) :: err
28  integer(c_int), value :: len
29  end subroutine
30 
31  end interface
32 
33 contains
34 
35  !C====================================================================
36  !C Get HEC-MW dist mesh from file
37  !C====================================================================
38 
39  subroutine hecmw_get_mesh(name_ID, mesh)
40  integer(kind=kint) :: ierr
41  character(len=HECMW_NAME_LEN) :: name_id
42  type(hecmwst_local_mesh) :: mesh
43 
44  call hecmw_nullify_mesh(mesh)
45 
46  call hecmw_get_mesh_init_if(name_id,ierr)
48 
49  call hecmw_dist_copy_c2f(mesh, ierr)
51 
54 
55  end subroutine hecmw_get_mesh
56 
57 
58  !C====================================================================
59  !C Put HEC-MW dist mesh to file
60  !C====================================================================
61 
62  subroutine hecmw_put_mesh(name, mesh)
63  integer(kind=kint) :: ierr
64  character(len=HECMW_NAME_LEN) :: name
65  type(hecmwst_local_mesh) :: mesh
66 
67  call hecmw_put_mesh_init_if(ierr)
68  if(ierr /=0) call hecmw_abort(hecmw_comm_get_comm())
69 
70  call hecmw_dist_copy_f2c(mesh, ierr)
71  if(ierr /=0) call hecmw_abort(hecmw_comm_get_comm())
72 
73  call hecmw_put_mesh_if(name, ierr)
74  if(ierr /=0) call hecmw_abort(hecmw_comm_get_comm())
75 
77  if(ierr /=0) call hecmw_abort(hecmw_comm_get_comm())
78  end subroutine hecmw_put_mesh
79 
80  !C====================================================================
81  !C Get HEC-MW entire mesh from msh file
82  !C====================================================================
83 
84  subroutine hecmw_get_entire_mesh(msh_filename, mesh)
85  use hecmw_util
86  integer(kind=kint) :: ierr
87  character(len=HECMW_FILENAME_LEN) :: msh_filename
88  type(hecmwst_local_mesh) :: mesh
89 
90  call hecmw_nullify_mesh(mesh)
91 
93  if(ierr /=0) call hecmw_abort(hecmw_comm_get_comm())
94 
95  call hecmw_dist_copy_c2f(mesh, ierr)
96  if(ierr /=0) call hecmw_abort(hecmw_comm_get_comm())
97 
99  if(ierr /=0) call hecmw_abort(hecmw_comm_get_comm())
100 
101  end subroutine hecmw_get_entire_mesh
102 
103 
104 end module hecmw_io
105 
void hecmw_get_mesh_finalize_if(int *ierr)
void hecmw_get_mesh_init_if(char *name_ID, int *err, int len)
void hecmw_put_mesh_finalize_if(int *err)
void hecmw_put_mesh_init_if(int *err)
void hecmw_put_mesh_if(char *name_ID, int *err, int len)
subroutine, public hecmw_dist_copy_c2f(mesh, ierr)
I/O and Utility memo) Intel 9 compiler generates codes to waste stack memory when an array of string ...
subroutine, public hecmw_dist_copy_f2c(mesh, ierr)
I/O and Utility.
I/O and Utility.
I/O and Utility.
Definition: hecmw_io.f90:7
subroutine hecmw_get_entire_mesh(msh_filename, mesh)
Definition: hecmw_io.f90:85
subroutine, public hecmw_get_mesh(name_ID, mesh)
Definition: hecmw_io.f90:40
subroutine, public hecmw_put_mesh(name, mesh)
Definition: hecmw_io.f90:63
I/O and Utility.
I/O and Utility.
I/O and Utility.
Definition: hecmw_util_f.F90:7
subroutine hecmw_abort(comm, code)
integer(kind=kint), parameter hecmw_exit_input
integer(kind=kint) function hecmw_comm_get_comm()
subroutine hecmw_nullify_mesh(P)
integer(kind=kint), parameter hecmw_filename_len