11#include "scaleFElib.h"
87 integer :: phytends_commid
88 integer :: phytend_num_tot
91 integer :: hist_comp_id = -1
96 procedure :: init => oceanvars_init
97 procedure :: final => oceanvars_final
98 procedure :: history => oceanvars_history
99 procedure :: read_restart_file => oceanvars_read_restart_file
100 procedure :: write_restart_file_prep => oceanvars_write_restart_file_prep
101 procedure :: write_restart_file => oceanvars_write_restart_file
102 procedure :: write_restart_file_post => oceanvars_write_restart_file_post
169 type(variableinfo) :: prgvar_varinfo(
prgvar_num)
170 DATA prgvar_varinfo / &
172 'K', 1,
'XYZ_O',
'sea_water_temperature' ), &
174 'PSU', 1,
'XYZ_O',
'sea_water_salinity' ), &
175 variableinfo(
prgvar_w_id ,
'OCEAN_WVEL',
'ocean w-velocity', &
176 'm/s', 1,
'XYZ_O',
'vertical_sea_water_velocity' ), &
177 variableinfo(
prgvar_u_id ,
'OCEAN_UVEL',
'ocean u-velocity', &
178 'm/s', 1,
'XYZ_O',
'eastward_sea_water_velocity' ), &
179 variableinfo(
prgvar_v_id ,
'OCEAN_VVEL',
'ocean v-velocity', &
180 'm/s', 1,
'XYZ_O',
'northward_sea_water_velocity' ) /
183 DATA auxvar2d_varinfo / &
185 'K', 1,
'XY_O',
'sea_surface_temperature' ), &
187 '1', 1,
'XY_O',
'sea_surface_albedo_ir_dir' ), &
189 '1', 1,
'XY_O',
'sea_surface_albedo_ir_dif' ), &
191 '1', 1,
'XY_O',
'sea_surface_albedo_nir_dir' ), &
193 '1', 1,
'XY_O',
'sea_surface_albedo_nir_dif' ), &
195 '1', 1,
'XY_O',
'sea_surface_albedo_vis_dir' ), &
197 '1', 1,
'XY_O',
'sea_surface_albedo_vis_dif' ) /
200 DATA phytend_varinfo / &
202 'm2/s2' , 3,
'XYZ_O',
'tendency of physical process for U' ), &
204 'm2/s2' , 3,
'XYZ_O',
'tendency of physical process for V' ), &
206 'm2/s2' , 3,
'XYZ_O',
'tendency of physical process for W' ), &
208 'K/s' , 3,
'XYZ_O',
'tendency of physical process for THERM' ), &
210 'PSU/s' , 3,
'XYZ_O',
'tendency of physical process for SALT' ), &
212 'kg/m3.J/s', 3,
'XYZ_O',
'tendency of physical process for RHOH' ) /
222 subroutine oceanvars_init( this, ocean_mesh )
224 monitor_reg => file_monitor_meshfield_reg
229 class(
oceanvars),
target,
intent(inout) :: this
230 class(
oceanmesh),
target,
intent(inout) :: ocean_mesh
233 logical :: reg_file_hist
235 character(len=H_LONG) :: in_basename =
''
236 logical :: in_postfix_timelabel = .false.
237 character(len=H_LONG) :: out_basename =
''
238 logical :: out_postfix_timelabel = .true.
239 character(len=H_MID) :: out_title =
''
240 character(len=H_SHORT) :: out_dtype =
'DEFAULT'
242 namelist / param_ocean_vars_restart / &
244 in_postfix_timelabel, &
246 out_postfix_timelabel, &
251 logical :: is_specified
258 this%mesh => ocean_mesh
259 mesh3d => ocean_mesh%ptr_mesh
260 call mesh3d%GetMesh2D( mesh2d )
263 call this%PROGVARS_manager%Init()
264 call this%AUXVARS2D_manager%Init()
265 call this%PHYTENDS_manager%Init()
278 reg_file_hist = .true.
280 call this%PROGVARS_manager%Regist( &
281 prgvar_varinfo(iv), mesh3d, &
282 this%PROG_VARS(iv), &
283 reg_file_hist, monitor_flag=.true., fill_zero=.true. )
289 reg_file_hist = .true.
291 call this%AUXVARS2D_manager%Regist( &
292 auxvar2d_varinfo(iv), mesh2d, &
293 this%AUX_VARS2D(iv), &
294 reg_file_hist, fill_zero=.true. )
300 call this%OCN_SFLX(iv)%Init(
"",
"", mesh2d )
306 reg_file_hist = .true.
308 call this%PHYTENDS_manager%Regist( &
309 phytend_varinfo(iv), mesh3d, &
311 reg_file_hist, fill_zero=.true. )
318 call this%ATM_VARS2D(iv)%Init(
"",
"", mesh2d )
324 is_specified = .true.
327 read(io_fid_conf,nml=param_ocean_vars_restart,iostat=ierr)
329 log_info(
"OceanVars_Init",*)
'Not found namelist PARAM_OCEAN_VARS_RESTART. Default used.'
330 is_specified = .false.
331 elseif( ierr > 0 )
then
332 log_error(
"OceanVars_Init",*)
'Not appropriate names in namelist PARAM_OCEAN_VARS_RESTART. Check!'
335 log_nml(param_ocean_vars_restart)
337 if (is_specified)
then
338 call ocean_mesh%Setup_restartfile( this%restart_file, &
339 in_basename, in_postfix_timelabel, &
340 out_basename, out_postfix_timelabel, out_dtype, out_title, &
343 call ocean_mesh%Setup_restartfile( this%restart_file, &
348 end subroutine oceanvars_init
353 subroutine oceanvars_final( this )
360 log_info(
'OceanVars_Final',*)
364 call this%PROGVARS_manager%Final()
365 deallocate( this%PROG_VARS )
367 call this%AUXVARS2D_manager%Final()
368 deallocate( this%AUX_VARS2D )
371 call this%OCN_SFLX(iv)%Final()
373 deallocate( this%OCN_SFLX )
375 call this%PHYTENDS_manager%Final()
376 deallocate( this%PHY_TEND )
379 call this%ATM_VARS2D(iv)%Final()
381 deallocate( this%ATM_VARS2D )
383 call this%restart_file%Final()
385 end subroutine oceanvars_final
390 subroutine oceanvars_history( this )
393 class(
oceanvars),
intent(inout),
target :: this
398 type(meshfield3d) :: tmp_field3d
399 class(meshbase3d),
pointer :: mesh3d
401 type(meshfield2d) :: tmp_field2d
405 mesh3d => this%PROG_VARS(1)%mesh
406 call mesh3d%GetMesh2D(mesh2d)
409 hst_id = this%PROG_VARS(v)%hist_id
413 hst_id = this%AUX_VARS2D(v)%hist_id
418 end subroutine oceanvars_history
423 subroutine oceanvars_read_restart_file( this, ocean_mesh )
428 class(
oceanvars),
intent(inout),
target :: this
429 class(
oceanmesh),
intent(in) :: ocean_mesh
432 class(meshbase3d),
pointer :: mesh3d
437 log_info(
"OceanVar_Read_restart_file",*)
'Open restart file (OCEAN) '
440 call this%restart_file%Open()
445 call this%restart_file%Read_var( dimtype_xyz, this%PROG_VARS(iv)%varname, &
449 call this%restart_file%Read_var( dimtype_xy, this%AUX_VARS2D(iv)%varname, &
450 this%AUX_VARS2D(iv) )
454 log_info(
"OceanVar_Read_restart_file",*)
'Close restart file (OCEAN) '
455 call this%restart_file%Close()
469 end subroutine oceanvars_read_restart_file
474 subroutine oceanvars_write_restart_file_prep( this )
484 integer :: iv, rf_vid
488 log_info(
"OceanVars_Write_restart_file",*)
'Create restart file (OCEAN) '
494 call this%restart_file%Create()
495 call prc_mpibarrier()
503 call this%restart_file%Def_var( this%PROG_VARS(iv), &
504 prgvar_varinfo(iv)%DESC, rf_vid, dimtype_xyz )
508 call this%restart_file%Def_var( this%AUX_VARS2D(iv), &
509 auxvar2d_varinfo(iv)%DESC, rf_vid, dimtype_xy )
513 end subroutine oceanvars_write_restart_file_prep
518 subroutine oceanvars_write_restart_file( this )
528 integer :: iv, rf_vid
531 call this%restart_file%End_def()
536 call this%restart_file%Write_var( rf_vid, this%PROG_VARS(iv) )
540 call this%restart_file%Write_var( rf_vid, this%AUX_VARS2D(iv) )
543 end subroutine oceanvars_write_restart_file
547 subroutine oceanvars_write_restart_file_post( this )
551 log_info(
"OceanVars_Write_restart_file",*)
'Close restart file (OCEAN) '
552 call this%restart_file%Close()
554 end subroutine oceanvars_write_restart_file_post
559 U, V, W, THERM, SALT, &
561 SFC_ALB_IR_dir, SFC_ALB_IR_dif, SFC_ALB_NIR_dir, SFC_ALB_NIR_dif, &
562 SFC_ALB_VIS_dir, SFC_ALB_VIS_dif, &
565 integer,
intent(in) :: domid
571 class(
localmeshfieldbase),
pointer,
intent(out),
optional :: sfc_alb_ir_dir, sfc_alb_ir_dif
572 class(
localmeshfieldbase),
pointer,
intent(out),
optional :: sfc_alb_nir_dir, sfc_alb_nir_dif
573 class(
localmeshfieldbase),
pointer,
intent(out),
optional :: sfc_alb_vis_dir, sfc_alb_vis_dif
574 class(
localmesh3d),
pointer,
intent(out),
optional :: lcmesh3d
576 class(meshfieldbase),
pointer :: field
582 call field%GetLocalMeshField(domid, u)
585 call field%GetLocalMeshField(domid, v)
588 call field%GetLocalMeshField(domid, w)
591 call field%GetLocalMeshField(domid, therm)
594 call field%GetLocalMeshField(domid, salt)
597 call field%GetLocalMeshField(domid, sfc_temp)
599 if (
present(sfc_alb_ir_dir) )
then
601 call field%GetLocalMeshField(domid, sfc_alb_ir_dir)
603 if (
present(sfc_alb_ir_dif) )
then
605 call field%GetLocalMeshField(domid, sfc_alb_ir_dif)
607 if (
present(sfc_alb_nir_dir) )
then
609 call field%GetLocalMeshField(domid, sfc_alb_nir_dir)
611 if (
present(sfc_alb_nir_dif) )
then
613 call field%GetLocalMeshField(domid, sfc_alb_nir_dif)
615 if (
present(sfc_alb_vis_dir) )
then
617 call field%GetLocalMeshField(domid, sfc_alb_vis_dir)
619 if (
present(sfc_alb_vis_dif) )
then
621 call field%GetLocalMeshField(domid, sfc_alb_vis_dif)
626 if (
present(lcmesh3d) )
then
627 call mesh%GetLocalMesh( domid, lcmesh )
632 if (
present(lcmesh3d)) lcmesh3d => lcmesh
integer, parameter, public auxvar2d_sfc_alb_ir_dif_id
integer, parameter, public ocn_sflx_lh_id
latent heat flux at the ocean surface [W/m2]
integer, parameter, public atmvar2d_atm_qv_id
integer, parameter, public atmvar2d_atm_w_id
integer, parameter, public phytend_num
integer, parameter, public auxvar2d_num
integer, parameter, public ocn_sflx_qv_id
water vapor flux at the ocean surface [kg/m2/s]
integer, parameter, public prgvar_drhot_id
integer, parameter, public auxvar2d_sfc_alb_ir_dir_id
integer, parameter, public auxvar2d_sfc_alb_vis_dif_id
integer, parameter, public prgvar_hvec_num
integer, parameter, public auxvar2d_sfc_alb_vis_dir_id
integer, parameter, public atmvar2d_atm_pres_id
integer, parameter, public atmvar2d_atm_u_id
integer, parameter, public prgvar_v_id
integer, parameter, public ocn_sflx_num
Number of ocean surface fluxes.
integer, parameter, public auxvar2d_sfc_alb_nir_dir_id
integer, parameter, public prgvar_w_id
integer, parameter, public auxvar2d_sfc_temp_id
integer, parameter, public prgvar_num
integer, parameter, public prgvar_scalar_num
integer, parameter, public ocn_sflx_mw_id
w-momentum flux at the ocean surface [kg/m/s2]
integer, parameter, public atmvar2d_sflx_rd_lw_dif_id
subroutine, public oceanvars_getlocalmeshprgvars(domid, mesh, prgvars_list, auxvars2d_list, u, v, w, therm, salt, sfc_temp, sfc_alb_ir_dir, sfc_alb_ir_dif, sfc_alb_nir_dir, sfc_alb_nir_dif, sfc_alb_vis_dir, sfc_alb_vis_dif, lcmesh3d)
integer, parameter, public phytend_u_id
integer, parameter, public ocn_sflx_mv_id
v-momentum flux at the ocean surface [kg/m/s2]
integer, parameter, public prgvar_u_id
integer, parameter, public ocn_sflx_sh_id
sensible heat flux at the ocean surface [W/m2]
integer, parameter, public atmvar2d_sfc_dens_id
integer, parameter, public atmvar2d_atm_dens_id
integer, parameter, public phytend_therm_id
integer, parameter, public prgvar_therm_id
integer, parameter, public atmvar2d_atm_temp_id
integer, parameter, public atmvar2d_atm_v_id
integer, parameter, public phytend_rhoh_id
integer, parameter, public auxvar2d_sfc_alb_nir_dif_id
integer, parameter, public phytend_salt_id
integer, parameter, public prgvar_salt_id
integer, parameter, public atmvar2d_sfc_pres_id
integer, parameter, public phytend_v_id
integer, parameter, public ocn_sflx_mu_id
u-momentum flux at the ocean surface [kg/m/s2]
integer, parameter, public atmvar2d_sflx_rd_sw_dir_id
integer, parameter, public atmvar2d_num
integer, parameter, public phytend_w_id
integer, parameter, public atmvar2d_lowest_layer_dz_id
module FElib / Element / Base
module FElib / File / History
module FElib / File / Monitor
module FElib / File / Restart
type(file_restart_meshfield), public restart_file
An object to manage main restart file.
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Local, Base
module FElib / Data / base
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
integer, public meshbase3d_dimtypeid_xy
integer, public meshbase3d_dimtypeid_xyz
module FElib / Mesh / Base
module FElib / Data / base
module FElib / Data / Communication base
module FElib / Data / Communication 3D cubic domain
FElib / model framework / variable manager.
Derived type to manage a computational mesh (base class)
Derived type to manage variables with ocean component.
Derived type representing a 2D reference element.
Derived type representing a 3D reference element.
Derived type representing an arbitrary finite element.
Derived type to manage restart file with each component.
Derived type representing a local mesh for 2D domain.
Derived type to manage a local 3D computational domain.
Derived type to manage a local computational domain (base type)
Derived type representing a field with local mesh (base type)
Derived type to manage a computational mesh (base type for 2D domain)
Derived type to manage a computational mesh (base type for 3D domain)
Base type to manage a computational mesh.
Derived type representing a field with 2D mesh.
Derived type representing a field with 3D mesh.
Derived type representing a field (base type)
Container to save a pointer of MeshField(1D, 2D, 3D) object.
Base derived type to manage data communication with 3D cubic domain.