FE-Project
Loading...
Searching...
No Matches
mod_ocean_vars.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module Ocean / Variables
3!!
4!! @par Description
5!! Module to manage variables with ocean component
6!!
7!! @author Yuta Kawai, Team SCALE
8!!
9!<
10!-------------------------------------------------------------------------------
11#include "scaleFElib.h"
13 !-----------------------------------------------------------------------------
14 !
15 !++ Used modules
16 !
17 use scale_precision
18 use scale_io
19 use scale_prc
20 use scale_debug
21
22 use scale_element_base, only: &
24 use scale_mesh_base, only: meshbase
25 use scale_mesh_base2d, only: &
27 use scale_mesh_base3d, only: &
28 meshbase3d, &
29 dimtype_xy => meshbase3d_dimtypeid_xy, &
30 dimtype_xyz => meshbase3d_dimtypeid_xyz
31
35 use scale_localmeshfield_base, only: &
37 use scale_meshfield_base, only: &
39
42
44
45 use scale_model_var_manager, only: &
46 modelvarmanager, variableinfo
47
48 use mod_ocean_mesh, only: oceanmesh
49 !-----------------------------------------------------------------------------
50 implicit none
51 private
52
53 !-----------------------------------------------------------------------------
54 !
55 !++ Public type & procedures
56 !
57
58 !> Derived type to manage variables with ocean component
59 type, public :: oceanvars
60 class(oceanmesh), pointer :: mesh !< Pointer to an object to manage a primary mesh for ocean component
61
62 !- prognostic variables
63 type(meshfield3d), allocatable :: prog_vars(:) !< Array of 3D prognostic variables
64 type(modelvarmanager) :: progvars_manager !< An object to manage prognostic variables
65
66 !- tracer variables (Dummy for future use)
67 type(meshfield3d), allocatable :: qtrc_vars(:) !< Array of 3D tracer variables
68 type(modelvarmanager) :: qtrcvars_manager !< An object to manage tracer variables
69
70 !- auxiliary variables (3D) (Dummy for future use)
71 type(meshfield3d), allocatable :: aux_vars(:) !< Array of 3D auxiliary variables
72 type(modelvarmanager) :: auxvars_manager !< Object to manage 3D auxiliary variables
73
74 !- auxiliary variables (2D)
75 type(meshfield2d), allocatable :: aux_vars2d(:) !< Array of 2D auxiliary variables
76 type(modelvarmanager) :: auxvars2d_manager !< An object to manage 2D auxiliary variables
77
78 !- atmospheric variables (2D)
79 type(meshfield2d), allocatable :: atm_vars2d(:) !< Array of 2D atmospheric variables
80
81 !- ocean surface fluxes sent to CPL buffer
82 type(meshfield2d), allocatable :: ocn_sflx(:) !< Array of 2D ocean surface fluxes sent to CPL buffer
83
84 !- Tendency with physics
85 type(meshfield3d), allocatable :: phy_tend(:) !< Array of tendency variables with physics
86 type(modelvarmanager) :: phytends_manager !< Object to manage tendency variables with physics
87 integer :: phytends_commid
88 integer :: phytend_num_tot !< Total number of tendency variables with physics
89
90 !- history file
91 integer :: hist_comp_id = -1 !< Component ID for history file
92
93 !- restart file
94 type(file_restart_meshfield_component) :: restart_file !< Object to manage restart file for ocean component
95 contains
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
103 end type oceanvars
104
106
107 !-----------------------------------------------------------------------------
108 !
109 !++ Public parameters & variables
110 !
111 integer, public, parameter :: prgvar_therm_id = 1 ! Variable associated with energy equation (DRHOT or ETOT)
112 integer, public, parameter :: prgvar_drhot_id = 1
113 integer, public, parameter :: prgvar_salt_id = 2
114 integer, public, parameter :: prgvar_w_id = 3
115 integer, public, parameter :: prgvar_u_id = 4
116 integer, public, parameter :: prgvar_v_id = 5
117 integer, public, parameter :: prgvar_scalar_num = 3
118 integer, public, parameter :: prgvar_hvec_num = 1
119 integer, public, parameter :: prgvar_num = 5
120
121 integer, public, parameter :: phytend_u_id = 1
122 integer, public, parameter :: phytend_v_id = 2
123 integer, public, parameter :: phytend_w_id = 3
124 integer, public, parameter :: phytend_therm_id = 4
125 integer, public, parameter :: phytend_salt_id = 5
126 integer, public, parameter :: phytend_rhoh_id = 6
127 integer, public, parameter :: phytend_num = 6
128
129 integer, public, parameter :: auxvar2d_sfc_temp_id = 1
130 integer, public, parameter :: auxvar2d_sfc_alb_ir_dir_id = 2
131 integer, public, parameter :: auxvar2d_sfc_alb_ir_dif_id = 3
132 integer, public, parameter :: auxvar2d_sfc_alb_nir_dir_id = 4
133 integer, public, parameter :: auxvar2d_sfc_alb_nir_dif_id = 5
134 integer, public, parameter :: auxvar2d_sfc_alb_vis_dir_id = 6
135 integer, public, parameter :: auxvar2d_sfc_alb_vis_dif_id = 7
136 integer, public, parameter :: auxvar2d_num = 7
137
138 ! Lower atmosphere variables received from CPL buffer
139 integer, public, parameter :: atmvar2d_sfc_dens_id = 1
140 integer, public, parameter :: atmvar2d_sfc_pres_id = 2
141 integer, public, parameter :: atmvar2d_atm_temp_id = 3
142 integer, public, parameter :: atmvar2d_atm_dens_id = 4
143 integer, public, parameter :: atmvar2d_atm_pres_id = 5
144 integer, public, parameter :: atmvar2d_atm_w_id = 6
145 integer, public, parameter :: atmvar2d_atm_u_id = 7
146 integer, public, parameter :: atmvar2d_atm_v_id = 8
147 integer, public, parameter :: atmvar2d_atm_qv_id = 9
148 integer, public, parameter :: atmvar2d_sflx_rd_sw_dir_id = 10
149 integer, public, parameter :: atmvar2d_sflx_rd_lw_dif_id = 11
150 integer, public, parameter :: atmvar2d_lowest_layer_dz_id = 12
151 integer, public, parameter :: atmvar2d_num = 12
152
153 ! Ocean surface fluxes sent to CPL buffer
154 integer, public, parameter :: ocn_sflx_mw_id = 1 !< w-momentum flux at the ocean surface [kg/m/s2]
155 integer, public, parameter :: ocn_sflx_mu_id = 2 !< u-momentum flux at the ocean surface [kg/m/s2]
156 integer, public, parameter :: ocn_sflx_mv_id = 3 !< v-momentum flux at the ocean surface [kg/m/s2]
157 integer, public, parameter :: ocn_sflx_sh_id = 4 !< sensible heat flux at the ocean surface [W/m2]
158 integer, public, parameter :: ocn_sflx_lh_id = 5 !< latent heat flux at the ocean surface [W/m2]
159 integer, public, parameter :: ocn_sflx_qv_id = 6 !< water vapor flux at the ocean surface [kg/m2/s]
160 integer, public, parameter :: ocn_sflx_num = 6 !< Number of ocean surface fluxes
161
162 ! Diagnostic variables
163
164 !-----------------------------------------------------------------------------
165 !
166 !++ Private procedures & variables
167 !
168
169 type(variableinfo) :: prgvar_varinfo(prgvar_num)
170 DATA prgvar_varinfo / &
171 variableinfo( prgvar_therm_id , 'OCEAN_THERM', 'ocean temperature', &
172 'K', 1, 'XYZ_O', 'sea_water_temperature' ), &
173 variableinfo( prgvar_salt_id , 'OCEAN_SALT', 'ocean salinity', &
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' ) /
181
182 type(variableinfo) :: auxvar2d_varinfo(auxvar2d_num)
183 DATA auxvar2d_varinfo / &
184 variableinfo( auxvar2d_sfc_temp_id , 'OCEAN_SFC_TEMP', 'ocean surface temperature', &
185 'K', 1, 'XY_O', 'sea_surface_temperature' ), &
186 variableinfo( auxvar2d_sfc_alb_ir_dir_id , 'OCEAN_SFC_ALB_IR_DIR', 'ocean surface albedo IR (direct)', &
187 '1', 1, 'XY_O', 'sea_surface_albedo_ir_dir' ), &
188 variableinfo( auxvar2d_sfc_alb_ir_dif_id , 'OCEAN_SFC_ALB_IR_DIF', 'ocean surface albedo IR (diffuse)', &
189 '1', 1, 'XY_O', 'sea_surface_albedo_ir_dif' ), &
190 variableinfo( auxvar2d_sfc_alb_nir_dir_id , 'OCEAN_SFC_ALB_NIR_DIR', 'ocean surface albedo NIR (direct)', &
191 '1', 1, 'XY_O', 'sea_surface_albedo_nir_dir' ), &
192 variableinfo( auxvar2d_sfc_alb_nir_dif_id , 'OCEAN_SFC_ALB_NIR_DIF', 'ocean surface albedo NIR (diffuse)', &
193 '1', 1, 'XY_O', 'sea_surface_albedo_nir_dif' ), &
194 variableinfo( auxvar2d_sfc_alb_vis_dir_id , 'OCEAN_SFC_ALB_VIS_DIR', 'ocean surface albedo VIS (direct)', &
195 '1', 1, 'XY_O', 'sea_surface_albedo_vis_dir' ), &
196 variableinfo( auxvar2d_sfc_alb_vis_dif_id , 'OCEAN_SFC_ALB_VIS_DIF', 'ocean surface albedo VIS (diffuse)', &
197 '1', 1, 'XY_O', 'sea_surface_albedo_vis_dif' ) /
198
199 type(variableinfo) :: phytend_varinfo(phytend_num)
200 DATA phytend_varinfo / &
201 variableinfo( phytend_u_id, 'U_tp', 'U_tp', &
202 'm2/s2' , 3, 'XYZ_O', 'tendency of physical process for U' ), &
203 variableinfo( phytend_v_id, 'V_tp', 'V_tp', &
204 'm2/s2' , 3, 'XYZ_O', 'tendency of physical process for V' ), &
205 variableinfo( phytend_w_id, 'W_tp', 'W_tp', &
206 'm2/s2' , 3, 'XYZ_O', 'tendency of physical process for W' ), &
207 variableinfo( phytend_therm_id, 'THERM_tp', 'THERM_tp', &
208 'K/s' , 3, 'XYZ_O', 'tendency of physical process for THERM' ), &
209 variableinfo( phytend_salt_id, 'SALT_tp', 'SALT_tp', &
210 'PSU/s' , 3, 'XYZ_O', 'tendency of physical process for SALT' ), &
211 variableinfo( phytend_rhoh_id, 'RHOH_p', 'RHOH_p', &
212 'kg/m3.J/s', 3, 'XYZ_O', 'tendency of physical process for RHOH' ) /
213
214
215contains
216
217 !> Setup an object to manage variables with ocean component
218 !!
219 !! @param model_mesh Object to manage computational mesh of ocean model
220 !!
221!OCL SERIAL
222 subroutine oceanvars_init( this, ocean_mesh )
224 monitor_reg => file_monitor_meshfield_reg
227 implicit none
228
229 class(oceanvars), target, intent(inout) :: this
230 class(oceanmesh), target, intent(inout) :: ocean_mesh
231
232 integer :: iv
233 logical :: reg_file_hist
234
235 character(len=H_LONG) :: in_basename = '' !< Basename of the input file
236 logical :: in_postfix_timelabel = .false. !< Add timelabel to the basename of input file?
237 character(len=H_LONG) :: out_basename = '' !< Basename of the output file
238 logical :: out_postfix_timelabel = .true. !< Add timelabel to the basename of output file?
239 character(len=H_MID) :: out_title = '' !< Title of the output file
240 character(len=H_SHORT) :: out_dtype = 'DEFAULT' !< REAL4 or REAL8
241
242 namelist / param_ocean_vars_restart / &
243 in_basename, &
244 in_postfix_timelabel, &
245 out_basename, &
246 out_postfix_timelabel, &
247 out_title, &
248 out_dtype
249
250 integer :: ierr
251 logical :: is_specified
252
253 class(meshbase3d), pointer :: mesh3d
254 class(meshbase2d), pointer :: mesh2d
255
256 !---------------------------------------------------------
257
258 this%mesh => ocean_mesh
259 mesh3d => ocean_mesh%ptr_mesh
260 call mesh3d%GetMesh2D( mesh2d )
261
262 !-
263 call this%PROGVARS_manager%Init()
264 call this%AUXVARS2D_manager%Init()
265 call this%PHYTENDS_manager%Init()
266
267 this%PHYTEND_NUM_TOT = phytend_num
268
269 allocate( this%PROG_VARS(prgvar_num) )
270 allocate( this%AUX_VARS2D(auxvar2d_num) )
271 allocate( this%OCN_SFLX(ocn_sflx_num) )
272 allocate( this%PHY_TEND(phytend_num) )
273 allocate( this%ATM_VARS2D(atmvar2d_num) )
274 !$acc enter data create( this%PROG_VARS, this%AUX_VARS2D, this%PHY_TEND, this%ATM_VARS2D, this%OCN_SFLX )
275
276 !- Initialize prognostic variables
277
278 reg_file_hist = .true.
279 do iv = 1, prgvar_num
280 call this%PROGVARS_manager%Regist( &
281 prgvar_varinfo(iv), mesh3d, & ! (in)
282 this%PROG_VARS(iv), & ! (inout)
283 reg_file_hist, monitor_flag=.true., fill_zero=.true. ) ! (out)
284 !$acc update device( this%PROG_VARS(iv) )
285 end do
286
287 !- Initialize auxiliary variables (2D)
288
289 reg_file_hist = .true.
290 do iv = 1, auxvar2d_num
291 call this%AUXVARS2D_manager%Regist( &
292 auxvar2d_varinfo(iv), mesh2d, & ! (in)
293 this%AUX_VARS2D(iv), & ! (inout)
294 reg_file_hist, fill_zero=.true. ) ! (in)
295 !$acc update device( this%AUX_VARS2D(iv) )
296 end do
297
298 !- Initialize ocean surface fluxes sent to CPL buffer
299 do iv = 1, ocn_sflx_num
300 call this%OCN_SFLX(iv)%Init( "", "", mesh2d )
301 !$acc update device( this%OCN_SFLX(iv) )
302 end do
303
304 !- Initialize tendency variables with physics
305
306 reg_file_hist = .true.
307 do iv=1, phytend_num
308 call this%PHYTENDS_manager%Regist( &
309 phytend_varinfo(iv), mesh3d, & ! (in)
310 this%PHY_TEND(iv), & ! (inout)
311 reg_file_hist, fill_zero=.true. ) ! (in)
312 !$acc update device( this%PHY_TEND(iv) )
313 end do
314
315 !- Initialize atmospheric variables (2D)
316
317 do iv =1, atmvar2d_num
318 call this%ATM_VARS2D(iv)%Init( "", "", mesh2d )
319 !$acc update device( this%ATM_VARS2D(iv) )
320 end do
321
322 !-- Setup information for input/output restart files.
323
324 is_specified = .true.
325 !- read namelist
326 rewind(io_fid_conf)
327 read(io_fid_conf,nml=param_ocean_vars_restart,iostat=ierr)
328 if( ierr < 0 ) then !--- missing
329 log_info("OceanVars_Init",*) 'Not found namelist PARAM_OCEAN_VARS_RESTART. Default used.'
330 is_specified = .false.
331 elseif( ierr > 0 ) then !--- fatal error
332 log_error("OceanVars_Init",*) 'Not appropriate names in namelist PARAM_OCEAN_VARS_RESTART. Check!'
333 call prc_abort
334 endif
335 log_nml(param_ocean_vars_restart)
336
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, &
341 prgvar_num + auxvar2d_num, "_O" )
342 else
343 call ocean_mesh%Setup_restartfile( this%restart_file, &
344 prgvar_num + auxvar2d_num, "_O" )
345 end if
346
347 return
348 end subroutine oceanvars_init
349
350 !> Finalize an object to manage variables with ocean component
351 !!
352!OCL SERIAL
353 subroutine oceanvars_final( this )
354 implicit none
355 class(oceanvars), intent(inout) :: this
356
357 integer :: iv
358 !--------------------------------------------------
359
360 log_info('OceanVars_Final',*)
361
362 !$acc exit data delete( this%PROG_VARS, this%AUX_VARS2D, this%PHY_TEND, this%ATM_VARS2D )
363
364 call this%PROGVARS_manager%Final()
365 deallocate( this%PROG_VARS )
366
367 call this%AUXVARS2D_manager%Final()
368 deallocate( this%AUX_VARS2D )
369
370 do iv=1, ocn_sflx_num
371 call this%OCN_SFLX(iv)%Final()
372 end do
373 deallocate( this%OCN_SFLX )
374
375 call this%PHYTENDS_manager%Final()
376 deallocate( this%PHY_TEND )
377
378 do iv=1, atmvar2d_num
379 call this%ATM_VARS2D(iv)%Final()
380 end do
381 deallocate( this%ATM_VARS2D )
382
383 call this%restart_file%Final()
384 return
385 end subroutine oceanvars_final
386
387 !> Put data with oceanic variables to history file
388 !!
389!OCL SERIAL
390 subroutine oceanvars_history( this )
392 implicit none
393 class(oceanvars), intent(inout), target :: this
394
395 integer :: v
396 integer :: hst_id
397
398 type(meshfield3d) :: tmp_field3d
399 class(meshbase3d), pointer :: mesh3d
400
401 type(meshfield2d) :: tmp_field2d
402 class(meshbase2d), pointer :: mesh2d
403 !-------------------------------------------------------------------------
404
405 mesh3d => this%PROG_VARS(1)%mesh
406 call mesh3d%GetMesh2D(mesh2d)
407
408 do v = 1, prgvar_num
409 hst_id = this%PROG_VARS(v)%hist_id
410 if ( hst_id > 0 ) call file_history_meshfield_put( hst_id, this%PROG_VARS(v), this%hist_comp_id )
411 end do
412 do v = 1, auxvar2d_num
413 hst_id = this%AUX_VARS2D(v)%hist_id
414 if ( hst_id > 0 ) call file_history_meshfield_put( hst_id, this%AUX_VARS2D(v), this%hist_comp_id )
415 end do
416
417 return
418 end subroutine oceanvars_history
419
420!> Read data with oceanic variables from restart file
421!!
422!OCL SERIAL
423 subroutine oceanvars_read_restart_file( this, ocean_mesh )
426 implicit none
427
428 class(oceanvars), intent(inout), target :: this
429 class(oceanmesh), intent(in) :: ocean_mesh
430
431 integer :: iv
432 class(meshbase3d), pointer :: mesh3d
433 class(localmesh3d), pointer :: lcmesh3d
434 !---------------------------------------
435
436 log_newline
437 log_info("OceanVar_Read_restart_file",*) 'Open restart file (OCEAN) '
438
439 !- Open restart file
440 call this%restart_file%Open()
441
442 !- Read restart file
443
444 do iv=1, prgvar_num
445 call this%restart_file%Read_var( dimtype_xyz, this%PROG_VARS(iv)%varname, &
446 this%PROG_VARS(iv) )
447 end do
448 do iv=1, auxvar2d_num
449 call this%restart_file%Read_var( dimtype_xy, this%AUX_VARS2D(iv)%varname, &
450 this%AUX_VARS2D(iv) )
451 end do
452
453 !- Close restart file
454 log_info("OceanVar_Read_restart_file",*) 'Close restart file (OCEAN) '
455 call this%restart_file%Close()
456
457 !-- Prepare diagnostic variables
458
459 !-- Check read data
460 ! call this%Check( force = .true. )
461
462 !-- Calculate diagnostic variables
463 ! call this%Calc_diagnostics()
464
465 !-- Communicate halo data of diagnostic variables
466 ! call this%AUXVARS_manager%MeshFieldComm_Exchange()
467
468 return
469 end subroutine oceanvars_read_restart_file
470
471 !> Write data with oceanic variables to restart file
472 !!
473!OCL SERIAL
474 subroutine oceanvars_write_restart_file_prep( this )
475 ! use scale_ocn_dyn_dgm_nonhydro3d_common, only: &
476 ! ocn_dyn_dgm_nonhydro3d_common_get_varinfo
477
478 implicit none
479 class(oceanvars), intent(inout) :: this
480
481 ! type(VariableInfo) :: prgvar_info(PRGVAR_NUM)
482 ! type(VariableInfo) :: auxvar2D_info(AUXVAR2D_NUM)
483
484 integer :: iv, rf_vid
485 !---------------------------------------
486
487 log_newline
488 log_info("OceanVars_Write_restart_file",*) 'Create restart file (OCEAN) '
489
490 !- Check data which will be written to restart file
491 ! call this%Check( force = .true. )
492
493 !- Create restart file
494 call this%restart_file%Create()
495 call prc_mpibarrier()
496
497 !- Define variables
498
499 ! call ocn_dyn_dgm_nonhydro3d_common_get_varinfo( prgvar_info, auxvar2D_info )
500
501 do iv=1, prgvar_num
502 rf_vid = iv
503 call this%restart_file%Def_var( this%PROG_VARS(iv), &
504 prgvar_varinfo(iv)%DESC, rf_vid, dimtype_xyz )
505 end do
506 do iv=1, auxvar2d_num
507 rf_vid = prgvar_num + iv
508 call this%restart_file%Def_var( this%AUX_VARS2D(iv), &
509 auxvar2d_varinfo(iv)%DESC, rf_vid, dimtype_xy )
510 end do
511
512 return
513 end subroutine oceanvars_write_restart_file_prep
514
515 !> Write data with oceanic variables to restart file
516 !!
517!OCL SERIAL
518 subroutine oceanvars_write_restart_file( this )
519 ! use scale_ocn_dyn_dgm_nonhydro3d_common, only: &
520 ! ocn_dyn_dgm_nonhydro3d_common_get_varinfo
521
522 implicit none
523 class(oceanvars), intent(inout) :: this
524
525 ! type(VariableInfo) :: prgvar_info(PRGVAR_NUM)
526 ! type(VariableInfo) :: auxvar2D_info(AUXVAR2D_NUM)
527
528 integer :: iv, rf_vid
529 !---------------------------------------
530
531 call this%restart_file%End_def()
532
533 !- Write restart file
534 do iv=1, prgvar_num
535 rf_vid = iv
536 call this%restart_file%Write_var( rf_vid, this%PROG_VARS(iv) )
537 end do
538 do iv=1, auxvar2d_num
539 rf_vid = prgvar_num + iv
540 call this%restart_file%Write_var( rf_vid, this%AUX_VARS2D(iv) )
541 end do
542 return
543 end subroutine oceanvars_write_restart_file
544
545 !> Close restart file for oceanic variables
546!OCL SERIAL
547 subroutine oceanvars_write_restart_file_post( this )
548 implicit none
549 class(oceanvars), intent(inout) :: this
550 !---------------------------------------
551 log_info("OceanVars_Write_restart_file",*) 'Close restart file (OCEAN) '
552 call this%restart_file%Close()
553 return
554 end subroutine oceanvars_write_restart_file_post
555
556!OCL SERIAL
557!OCL SERIAL
558 subroutine oceanvars_getlocalmeshprgvars( domID, mesh, prgvars_list, auxvars2D_list, &
559 U, V, W, THERM, SALT, &
560 SFC_TEMP, &
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, &
563 lcmesh3D )
564 implicit none
565 integer, intent(in) :: domid
566 class(meshbase), intent(in) :: mesh
567 class(modelvarmanager), intent(inout) :: prgvars_list
568 class(modelvarmanager), intent(inout) :: auxvars2d_list
569 class(localmeshfieldbase), pointer, intent(out) :: u, v, w, therm, salt
570 class(localmeshfieldbase), pointer, intent(out) :: sfc_temp
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
575
576 class(meshfieldbase), pointer :: field
577 class(localmeshbase), pointer :: lcmesh
578 !-------------------------------------------------------
579
580 !--
581 call prgvars_list%Get(prgvar_u_id, field)
582 call field%GetLocalMeshField(domid, u)
583
584 call prgvars_list%Get(prgvar_v_id, field)
585 call field%GetLocalMeshField(domid, v)
586
587 call prgvars_list%Get(prgvar_w_id, field)
588 call field%GetLocalMeshField(domid, w)
589
590 call prgvars_list%Get(prgvar_therm_id, field)
591 call field%GetLocalMeshField(domid, therm)
592
593 call prgvars_list%Get(prgvar_salt_id, field)
594 call field%GetLocalMeshField(domid, salt)
595
596 call auxvars2d_list%Get(auxvar2d_sfc_temp_id, field)
597 call field%GetLocalMeshField(domid, sfc_temp)
598
599 if ( present(sfc_alb_ir_dir) ) then
600 call auxvars2d_list%Get(auxvar2d_sfc_alb_ir_dir_id, field)
601 call field%GetLocalMeshField(domid, sfc_alb_ir_dir)
602 end if
603 if ( present(sfc_alb_ir_dif) ) then
604 call auxvars2d_list%Get(auxvar2d_sfc_alb_ir_dif_id, field)
605 call field%GetLocalMeshField(domid, sfc_alb_ir_dif)
606 end if
607 if ( present(sfc_alb_nir_dir) ) then
608 call auxvars2d_list%Get(auxvar2d_sfc_alb_nir_dir_id, field)
609 call field%GetLocalMeshField(domid, sfc_alb_nir_dir)
610 end if
611 if ( present(sfc_alb_nir_dif) ) then
612 call auxvars2d_list%Get(auxvar2d_sfc_alb_nir_dif_id, field)
613 call field%GetLocalMeshField(domid, sfc_alb_nir_dif)
614 end if
615 if ( present(sfc_alb_vis_dir) ) then
616 call auxvars2d_list%Get(auxvar2d_sfc_alb_vis_dir_id, field)
617 call field%GetLocalMeshField(domid, sfc_alb_vis_dir)
618 end if
619 if ( present(sfc_alb_vis_dif) ) then
620 call auxvars2d_list%Get(auxvar2d_sfc_alb_vis_dif_id, field)
621 call field%GetLocalMeshField(domid, sfc_alb_vis_dif)
622 end if
623
624 !---
625
626 if ( present(lcmesh3d) ) then
627 call mesh%GetLocalMesh( domid, lcmesh )
628 nullify( lcmesh3d )
629
630 select type(lcmesh)
631 type is (localmesh3d)
632 if (present(lcmesh3d)) lcmesh3d => lcmesh
633 end select
634 end if
635
636 return
637 end subroutine oceanvars_getlocalmeshprgvars
638end module mod_ocean_vars
module Ocean / Mesh
module Ocean / Variables
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
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 / 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.