FE-Project
Loading...
Searching...
No Matches
scale_file_history_meshfield Module Reference

module FElib / File / History More...

Data Types

interface  file_history_meshfield_in
interface  file_history_meshfield_put

Functions/Subroutines

subroutine, public file_history_meshfield_setup (mesh1d_, mesh2d_, mesh3d_, meshcubedsphere2d_, meshcubedsphere3d_, dim_name_postfix_, registered_comp_id)
 Setup a module for file history.
subroutine, public file_history_meshfield_write ()
 Write history data to the file.
subroutine, public file_history_meshfield_finalize ()
 Finalize the file history module.

Variables

integer, parameter component_num_max = 32

Detailed Description

module FElib / File / History

Description
A module for managing file history
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ file_history_meshfield_setup()

subroutine, public scale_file_history_meshfield::file_history_meshfield_setup ( class(meshbase1d), intent(in), optional, target mesh1d_,
class(meshrectdom2d), intent(in), optional, target mesh2d_,
class(meshcubedom3d), intent(in), optional, target mesh3d_,
class(meshcubedspheredom2d), intent(in), optional, target meshcubedsphere2d_,
class(meshcubedspheredom3d), intent(in), optional, target meshcubedsphere3d_,
character(len=*), intent(in), optional dim_name_postfix_,
integer, intent(out), optional registered_comp_id )

Setup a module for file history.

Parameters
[in]mesh1d_An object of 1D mesh when the computational domain is 1D
[in]mesh2d_An object of 2D mesh when the computational domain is rectangular
[in]mesh3d_An object of 3D mesh when the computational domain is cubed
[in]meshcubedsphere2d_An object of 2D mesh when the computational domain is 2D cubed-sphere
[in]meshcubedsphere3d_An object of 3D mesh when the computational domain is 3D cubed-sphere
[in]dim_name_postfix_Postfix for dimension names

Definition at line 196 of file scale_file_history_meshfield.F90.

201
202 use scale_file_h, only: &
203 file_hshort
204 use scale_prc, only: &
205 prc_masterrank, &
206 prc_myrank, &
207 prc_abort
208 use scale_time, only: &
209 time_nowdate, &
210 time_nowsubsec, &
211 time_startdaysec, &
212 time_dtsec, &
213 time_nowstep
214 use scale_calendar, only: &
215 calendar_get_name
216 implicit none
217
218 class(MeshBase1d), intent(in), target, optional :: mesh1D_ !< An object of 1D mesh when the computational domain is 1D
219 class(MeshRectDom2d) , intent(in), target, optional :: mesh2D_ !< An object of 2D mesh when the computational domain is rectangular
220 class(MeshCubeDom3D) , intent(in), target, optional :: mesh3D_ !< An object of 3D mesh when the computational domain is cubed
221 class(MeshCubedSphereDom2D), intent(in), target, optional :: meshCubedsphere2D_ !< An object of 2D mesh when the computational domain is 2D cubed-sphere
222 class(MeshCubedSphereDom3D), intent(in), target, optional :: meshCubedsphere3D_ !< An object of 3D mesh when the computational domain is 3D cubed-sphere
223 character(len=*), intent(in), optional :: dim_name_postfix_ !< Postfix for dimension names
224 integer, intent(out), optional :: registered_comp_id
225
226 character(len=H_MID) :: FILE_HISTORY_MESHFILED_H_TITLE = 'SCALE-DG FILE_HISTORY_MESHFIELD' !< title of the output file
227 character(len=H_MID) :: FILE_HISTORY_MESHFIELD_T_SINCE
228
229 character(len=FILE_HSHORT) :: calendar
230 real(DP) :: start_daysec
231
232 type(FileHistoryMeshFieldComp), pointer :: target_comp
233 integer :: registered_comp_id_
234 !---------------------------------------------------------------------------
235
236 !-
237 if ( comp_num >= component_num_max ) then
238 log_error("FILE_base_meshfield_register_comp",*) 'Exceeding maximum number of components. Check!'
239 call prc_abort
240 end if
241
242 comp_num = comp_num + 1
243 registered_comp_id_ = comp_num
244 if ( present(registered_comp_id) ) then
245 registered_comp_id = registered_comp_id_
246 end if
247
248 target_comp => comp(registered_comp_id_)
249 call target_comp%Init( mesh1d_, mesh2d_, mesh3d_, &
250 meshcubedsphere2d_, meshcubedsphere3d_ , &
251 dim_name_postfix_ )
252
253 !-
254 if ( registered_comp_id_ == 1 ) then
255 default_comp => comp(registered_comp_id_)
256
257 file_history_meshfield_startdate(:) = time_nowdate
258 file_history_meshfield_startsubsec = time_nowsubsec
259
260 start_daysec = time_startdaysec
261 if ( time_nowdate(1) > 0 ) then
262 write(file_history_meshfield_t_since,'(I4.4,5(A1,I2.2))') time_nowdate(1), &
263 '-', time_nowdate(2), &
264 '-', time_nowdate(3), &
265 ' ', time_nowdate(4), &
266 ':', time_nowdate(5), &
267 ':', time_nowdate(6)
268 start_daysec = time_nowsubsec
269 else
270 file_history_meshfield_t_since = ''
271 endif
272
273 ! get calendar name
274 call calendar_get_name( calendar )
275
276 call file_history_setup( file_history_meshfiled_h_title, & ! [IN]
277 h_source, h_institute, & ! [IN]
278 start_daysec, time_dtsec, & ! [IN]
279 time_since = file_history_meshfield_t_since, & ! [IN]
280 calendar = calendar, & ! [IN]
281 default_zcoord = 'model', & ! [IN]
282 myrank = prc_myrank ) ! [IN]
283
284 call file_history_set_nowdate( time_nowdate, time_nowsubsec, time_nowstep )
285
286 file_history_filemeshfiled_disable = .false.
287 end if
288
289 return

References component_num_max.

Referenced by mod_atmos_component::atmos_setup(), and mod_ocean_component::ocean_setup().

◆ file_history_meshfield_write()

subroutine, public scale_file_history_meshfield::file_history_meshfield_write

Write history data to the file.

Definition at line 294 of file scale_file_history_meshfield.F90.

295 implicit none
296 !-------------------------------------------------
297
298 call file_history_write
299 return

Referenced by mod_dg_driver::dg_driver().

◆ file_history_meshfield_finalize()

subroutine, public scale_file_history_meshfield::file_history_meshfield_finalize

Finalize the file history module.

Definition at line 304 of file scale_file_history_meshfield.F90.

305 implicit none
306 !-------------------------------------------------
307
308 call file_history_finalize()
309 call default_comp%Final()
310 return

Referenced by mod_dg_driver::dg_driver(), and mod_dg_prep::dg_prep().

Variable Documentation

◆ component_num_max

integer, parameter scale_file_history_meshfield::component_num_max = 32

Definition at line 82 of file scale_file_history_meshfield.F90.

82 integer, parameter :: COMPONENT_NUM_MAX = 32

Referenced by file_history_meshfield_setup().