SCALE-RM
mod_ocean_vars.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
11 #include "scalelib.h"
13  !-----------------------------------------------------------------------------
14  !
15  !++ used modules
16  !
17  use scale_precision
18  use scale_io
19  use scale_prof
20  use scale_debug
22  use scale_tracer
24  !-----------------------------------------------------------------------------
25  implicit none
26  private
27  !-----------------------------------------------------------------------------
28  !
29  !++ Public procedure
30  !
31  public :: ocean_vars_setup
32  public :: ocean_vars_restart_read
33  public :: ocean_vars_restart_write
34  public :: ocean_vars_history
35  public :: ocean_vars_check
36  public :: ocean_vars_monitor
37 
39  public :: ocean_vars_restart_open
42  public :: ocean_vars_restart_close
43 
44  !-----------------------------------------------------------------------------
45  !
46  !++ Public parameters & variables
47  !
48  logical, public :: ocean_restart_output = .false.
49 
50  character(len=H_LONG), public :: ocean_restart_in_basename = ''
51  logical, public :: ocean_restart_in_aggregate
52  logical, public :: ocean_restart_in_postfix_timelabel = .false.
53  character(len=H_LONG), public :: ocean_restart_out_basename = ''
54  logical, public :: ocean_restart_out_aggregate
55  logical, public :: ocean_restart_out_postfix_timelabel = .true.
56  character(len=H_MID), public :: ocean_restart_out_title = 'OCEAN restart'
57  character(len=H_SHORT), public :: ocean_restart_out_dtype = 'DEFAULT'
58 
59  ! prognostic variables
60  real(rp), public, allocatable :: ocean_temp(:,:,:)
61  real(rp), public, allocatable :: ocean_salt(:,:,:)
62  real(rp), public, allocatable :: ocean_uvel(:,:,:)
63  real(rp), public, allocatable :: ocean_vvel(:,:,:)
64 
65  real(rp), public, allocatable :: ocean_ocn_z0m(:,:)
66 
67  real(rp), public, allocatable :: ocean_sfc_temp (:,:)
68  real(rp), public, allocatable :: ocean_sfc_albedo(:,:,:,:)
69  real(rp), public, allocatable :: ocean_sfc_z0m (:,:)
70  real(rp), public, allocatable :: ocean_sfc_z0h (:,:)
71  real(rp), public, allocatable :: ocean_sfc_z0e (:,:)
72 
73  real(rp), public, allocatable :: ocean_ice_temp(:,:)
74  real(rp), public, allocatable :: ocean_ice_mass(:,:)
75 
76 
77  ! tendency variables
78  real(rp), public, allocatable :: ocean_temp_t(:,:,:)
79  real(rp), public, allocatable :: ocean_salt_t(:,:,:)
80  real(rp), public, allocatable :: ocean_uvel_t(:,:,:)
81  real(rp), public, allocatable :: ocean_vvel_t(:,:,:)
82 
83  real(rp), public, allocatable :: ocean_ice_temp_t(:,:)
84  real(rp), public, allocatable :: ocean_ice_mass_t(:,:)
85 
86  ! recieved from lowermost atmosphere
87  real(rp), public, allocatable :: atmos_temp (:,:)
88  real(rp), public, allocatable :: atmos_pres (:,:)
89  real(rp), public, allocatable :: atmos_w (:,:)
90  real(rp), public, allocatable :: atmos_u (:,:)
91  real(rp), public, allocatable :: atmos_v (:,:)
92  real(rp), public, allocatable :: atmos_dens (:,:)
93  real(rp), public, allocatable :: atmos_qv (:,:)
94  real(rp), public, allocatable :: atmos_pbl (:,:)
95  real(rp), public, allocatable :: atmos_sfc_dens (:,:)
96  real(rp), public, allocatable :: atmos_sfc_pres (:,:)
97  real(rp), public, allocatable :: atmos_sflx_rad_dn(:,:,:,:)
98  real(rp), public, allocatable :: atmos_cossza (:,:)
99  real(rp), public, allocatable :: atmos_sflx_water (:,:)
100  real(rp), public, allocatable :: atmos_sflx_engi (:,:)
101 
102  ! send to uppermost ocean
103  real(rp), public, allocatable, target :: ocean_sflx_gh (:,:)
104  real(rp), public, allocatable, target :: ocean_sflx_water(:,:)
105  real(rp), public, allocatable, target :: ocean_sflx_engi (:,:)
106  real(rp), public, pointer :: ocean_oflx_gh (:,:)
107  real(rp), public, pointer :: ocean_oflx_water(:,:)
108  real(rp), public, pointer :: ocean_oflx_engi (:,:)
109 
110  ! send to lowermost atmosphere
111  real(rp), public, allocatable :: ocean_sflx_mw (:,:)
112  real(rp), public, allocatable :: ocean_sflx_mu (:,:)
113  real(rp), public, allocatable :: ocean_sflx_mv (:,:)
114  real(rp), public, allocatable :: ocean_sflx_sh (:,:)
115  real(rp), public, allocatable :: ocean_sflx_lh (:,:)
116  real(rp), public, allocatable :: ocean_sflx_qtrc(:,:,:)
117  real(rp), public, allocatable :: ocean_u10 (:,:)
118  real(rp), public, allocatable :: ocean_v10 (:,:)
119  real(rp), public, allocatable :: ocean_t2 (:,:)
120  real(rp), public, allocatable :: ocean_q2 (:,:)
121 
122  real(rp), public, allocatable, target :: ocean_ustar(:,:)
123  real(rp), public, allocatable, target :: ocean_tstar(:,:)
124  real(rp), public, allocatable, target :: ocean_qstar(:,:)
125  real(rp), public, allocatable, target :: ocean_wstar(:,:)
126  real(rp), public, allocatable, target :: ocean_rlmo (:,:)
127  real(rp), public, pointer :: ocean_ocn_ustar(:,:)
128  real(rp), public, pointer :: ocean_ocn_tstar(:,:)
129  real(rp), public, pointer :: ocean_ocn_qstar(:,:)
130  real(rp), public, pointer :: ocean_ocn_wstar(:,:)
131  real(rp), public, pointer :: ocean_ocn_rlmo (:,:)
132  real(rp), public, allocatable :: ocean_ice_ustar(:,:)
133  real(rp), public, allocatable :: ocean_ice_tstar(:,:)
134  real(rp), public, allocatable :: ocean_ice_qstar(:,:)
135  real(rp), public, allocatable :: ocean_ice_wstar(:,:)
136  real(rp), public, allocatable :: ocean_ice_rlmo (:,:)
137 
138  ! diagnostic value
139  real(rp), public, allocatable :: ocean_ice_frac (:,:)
140 
141  logical, public :: ice_flag
142 
143  ! external supply of water mass and internel energy to the slab ocean (for conservation check)
144  real(rp), public, allocatable :: ocean_mass_supl (:,:)
145  real(rp), public, allocatable :: ocean_engi_supl (:,:)
146  !-----------------------------------------------------------------------------
147  !
148  !++ Private procedure
149  !
150  !-----------------------------------------------------------------------------
151  !
152  !++ Private parameters & variables
153  !
154  logical, private :: ocean_vars_checkrange = .false.
155  logical, private :: ocean_restart_in_check_coordinates = .true.
156 
157  ! prognostic variables
158  integer, private, parameter :: vmax = 17
159  integer, private, parameter :: i_temp = 1
160  integer, private, parameter :: i_salt = 2
161  integer, private, parameter :: i_uvel = 3
162  integer, private, parameter :: i_vvel = 4
163  integer, private, parameter :: i_ocn_z0m = 5
164  integer, private, parameter :: i_sfc_temp = 6
165  integer, private, parameter :: i_sfc_alb_ir_dir = 7
166  integer, private, parameter :: i_sfc_alb_ir_dif = 8
167  integer, private, parameter :: i_sfc_alb_nir_dir = 9
168  integer, private, parameter :: i_sfc_alb_nir_dif = 10
169  integer, private, parameter :: i_sfc_alb_vis_dir = 11
170  integer, private, parameter :: i_sfc_alb_vis_dif = 12
171  integer, private, parameter :: i_sfc_z0m = 13
172  integer, private, parameter :: i_sfc_z0h = 14
173  integer, private, parameter :: i_sfc_z0e = 15
174  integer, private, parameter :: i_ice_temp = 16
175  integer, private, parameter :: i_ice_mass = 17
176 
177  character(len=H_SHORT), private :: var_name(vmax)
178  character(len=H_MID), private :: var_desc(vmax)
179  character(len=H_MID), private :: var_stdn(vmax)
180  character(len=H_SHORT), private :: var_unit(vmax)
181  integer, private :: var_id(vmax)
182  integer, private :: restart_fid = -1 ! file ID
183 
184  data var_name / 'OCEAN_TEMP', &
185  'OCEAN_SALT', &
186  'OCEAN_UVEL', &
187  'OCEAN_VVEL', &
188  'OCEAN_OCN_Z0M', &
189  'OCEAN_SFC_TEMP', &
190  'OCEAN_SFC_ALB_IR_dir', &
191  'OCEAN_SFC_ALB_IR_dif', &
192  'OCEAN_SFC_ALB_NIR_dir', &
193  'OCEAN_SFC_ALB_NIR_dif', &
194  'OCEAN_SFC_ALB_VIS_dir', &
195  'OCEAN_SFC_ALB_VIS_dif', &
196  'OCEAN_SFC_Z0M', &
197  'OCEAN_SFC_Z0H', &
198  'OCEAN_SFC_Z0E', &
199  'OCEAN_ICE_TEMP', &
200  'OCEAN_ICE_MASS' /
201 
202  data var_desc / 'ocean temperature', &
203  'ocean salinity', &
204  'ocean u-velocity', &
205  'ocean v-velocity', &
206  'open ocean roughness length (momentum)', &
207  'ocean surface skin temperature', &
208  'ocean surface albedo for IR (direct)', &
209  'ocean surface albedo for IR (diffuse)', &
210  'ocean surface albedo for NIR (direct)', &
211  'ocean surface albedo for NIR (diffuse)', &
212  'ocean surface albedo for VIS (direct)', &
213  'ocean surface albedo for VIS (diffuse)', &
214  'ocean surface roughness length (momentum)', &
215  'ocean surface roughness length (heat)', &
216  'ocean surface roughness length (vapor)', &
217  'seaice temperature', &
218  'seaice mass' /
219 
220  data var_stdn / 'sea_water_temperature', &
221  'sea_water_salinity', &
222  'eastward_sea_water_velocity', &
223  'northward_sea_water_velocity', &
224  '', &
225  'sea_surface_skin_temperature', &
226  '', &
227  '', &
228  '', &
229  '', &
230  '', &
231  '', &
232  '', &
233  '', &
234  '', &
235  '', &
236  '' /
237 
238  data var_unit / 'K', &
239  'PSU', &
240  'm/s', &
241  'm/s', &
242  'm', &
243  'K', &
244  '1', &
245  '1', &
246  '1', &
247  '1', &
248  '1', &
249  '1', &
250  'm', &
251  'm', &
252  'm', &
253  'K', &
254  'kg/m2' /
255 
256  ! for monitor
257  integer, parameter :: im_o_temp = 1
258  integer, parameter :: im_i_temp = 2
259  integer, parameter :: im_i_mass = 3
260  integer, parameter :: im_sfc = 4
261  integer, parameter :: im_ssf = 5
262  integer, parameter :: im_mas_supl = 6
263  integer, parameter :: im_t_masflx = 7
264  integer, parameter :: im_o_masflx = 8
265  integer, parameter :: im_i_masflx = 9
266  integer, parameter :: im_o_engi = 10
267  integer, parameter :: im_i_engi = 11
268  integer, parameter :: im_engsfc_gh = 12
269  integer, parameter :: im_engsfc_ei = 13
270  integer, parameter :: im_engssf_gh = 14
271  integer, parameter :: im_engssf_ei = 15
272  integer, parameter :: im_eng_supl = 16
273  integer, parameter :: im_t_engflx = 17
274  integer, parameter :: im_o_engflx = 18
275  integer, parameter :: im_i_engflx = 19
276  integer, parameter :: im_max = 19
277  integer, private :: monit_id(im_max)
278 
279  !-----------------------------------------------------------------------------
280 contains
281  !-----------------------------------------------------------------------------
283  subroutine ocean_vars_setup
284  use scale_prc, only: &
285  prc_abort
286  use scale_const, only: &
287  undef => const_undef
288  use mod_ocean_admin, only: &
290  use scale_monitor, only: &
292  implicit none
293 
294  namelist / param_ocean_vars / &
298  ocean_restart_in_check_coordinates, &
305  ocean_vars_checkrange
306 
307  integer :: ierr
308  integer :: iv
309  !---------------------------------------------------------------------------
310 
311  log_newline
312  log_info("OCEAN_vars_setup",*) 'Setup'
313 
314  select case ( ocean_ice_type )
315  case ( 'NONE','OFF' )
316  ice_flag = .false.
317  case default
318  ice_flag = .true.
319  end select
320 
321  allocate( ocean_temp(okmax,oia,oja) )
322  allocate( ocean_salt(okmax,oia,oja) )
323  allocate( ocean_uvel(okmax,oia,oja) )
324  allocate( ocean_vvel(okmax,oia,oja) )
325  ocean_temp(:,:,:) = undef
326  ocean_salt(:,:,:) = undef
327  ocean_uvel(:,:,:) = undef
328  ocean_vvel(:,:,:) = undef
329 
330  allocate( ocean_ocn_z0m(oia,oja) )
331  ocean_ocn_z0m(:,:) = undef
332 
333  allocate( ocean_sfc_temp(oia,oja) )
335  allocate( ocean_sfc_z0m(oia,oja) )
336  allocate( ocean_sfc_z0h(oia,oja) )
337  allocate( ocean_sfc_z0e(oia,oja) )
338  ocean_sfc_temp(:,:) = undef
339  ocean_sfc_albedo(:,:,:,:) = undef
340  ocean_sfc_z0m(:,:) = undef
341  ocean_sfc_z0h(:,:) = undef
342  ocean_sfc_z0e(:,:) = undef
343 
344  allocate( ocean_temp_t(okmax,oia,oja) )
345  allocate( ocean_salt_t(okmax,oia,oja) )
346  allocate( ocean_uvel_t(okmax,oia,oja) )
347  allocate( ocean_vvel_t(okmax,oia,oja) )
348  ocean_temp_t(:,:,:) = undef
349  ocean_salt_t(:,:,:) = undef
350  ocean_uvel_t(:,:,:) = undef
351  ocean_vvel_t(:,:,:) = undef
352 
353  if ( ice_flag ) then
354  allocate( ocean_ice_temp(oia,oja) )
355  allocate( ocean_ice_mass(oia,oja) )
356  ocean_ice_temp(:,:) = undef
357  ocean_ice_mass(:,:) = undef
358 
359  allocate( ocean_ice_temp_t(oia,oja) )
360  allocate( ocean_ice_mass_t(oia,oja) )
361  ocean_ice_temp_t(:,:) = undef
362  ocean_ice_mass_t(:,:) = undef
363 
364  end if
365 
366  allocate( atmos_temp(oia,oja) )
367  allocate( atmos_pres(oia,oja) )
368  allocate( atmos_w(oia,oja) )
369  allocate( atmos_u(oia,oja) )
370  allocate( atmos_v(oia,oja) )
371  allocate( atmos_dens(oia,oja) )
372  allocate( atmos_qv(oia,oja) )
373  allocate( atmos_pbl(oia,oja) )
374  allocate( atmos_sfc_dens(oia,oja) )
375  allocate( atmos_sfc_pres(oia,oja) )
377  allocate( atmos_cossza(oia,oja) )
378  allocate( atmos_sflx_water(oia,oja) )
379  allocate( atmos_sflx_engi(oia,oja) )
380  atmos_temp(:,:) = undef
381  atmos_pres(:,:) = undef
382  atmos_w(:,:) = undef
383  atmos_u(:,:) = undef
384  atmos_v(:,:) = undef
385  atmos_dens(:,:) = undef
386  atmos_qv(:,:) = undef
387  atmos_pbl(:,:) = undef
388  atmos_sfc_dens(:,:) = undef
389  atmos_sfc_pres(:,:) = undef
390  atmos_sflx_rad_dn(:,:,:,:) = undef
391  atmos_cossza(:,:) = undef
392  atmos_sflx_water(:,:) = undef
393  atmos_sflx_engi(:,:) = undef
394 
395  allocate( ocean_sflx_gh(oia,oja) )
396  allocate( ocean_sflx_water(oia,oja) )
397  allocate( ocean_sflx_engi(oia,oja) )
398  ocean_sflx_gh(:,:) = undef
399  ocean_sflx_water(:,:) = undef
400  ocean_sflx_engi(:,:) = undef
401  if ( ice_flag ) then
402  allocate( ocean_oflx_gh(oia,oja) )
403  allocate( ocean_oflx_water(oia,oja) )
404  allocate( ocean_oflx_engi(oia,oja) )
405  ocean_oflx_gh(:,:) = undef
406  ocean_oflx_water(:,:) = undef
407  ocean_oflx_engi(:,:) = undef
408  else
412  end if
413 
414  allocate( ocean_sflx_mw(oia,oja) )
415  allocate( ocean_sflx_mu(oia,oja) )
416  allocate( ocean_sflx_mv(oia,oja) )
417  allocate( ocean_sflx_sh(oia,oja) )
418  allocate( ocean_sflx_lh(oia,oja) )
419  allocate( ocean_sflx_qtrc(oia,oja,qa) )
420  allocate( ocean_u10(oia,oja) )
421  allocate( ocean_v10(oia,oja) )
422  allocate( ocean_t2(oia,oja) )
423  allocate( ocean_q2(oia,oja) )
424  ocean_sflx_mw(:,:) = undef
425  ocean_sflx_mu(:,:) = undef
426  ocean_sflx_mv(:,:) = undef
427  ocean_sflx_sh(:,:) = undef
428  ocean_sflx_lh(:,:) = undef
429  ocean_sflx_qtrc(:,:,:) = undef
430  ocean_u10(:,:) = undef
431  ocean_v10(:,:) = undef
432  ocean_t2(:,:) = undef
433  ocean_q2(:,:) = undef
434 
435  allocate( ocean_ustar(oia,oja) )
436  allocate( ocean_tstar(oia,oja) )
437  allocate( ocean_qstar(oia,oja) )
438  allocate( ocean_wstar(oia,oja) )
439  allocate( ocean_rlmo(oia,oja) )
440  ocean_ustar(:,:) = undef
441  ocean_tstar(:,:) = undef
442  ocean_qstar(:,:) = undef
443  ocean_wstar(:,:) = undef
444  ocean_rlmo(:,:) = undef
445  if ( ice_flag ) then
446  allocate( ocean_ocn_ustar(oia,oja) )
447  allocate( ocean_ocn_tstar(oia,oja) )
448  allocate( ocean_ocn_qstar(oia,oja) )
449  allocate( ocean_ocn_wstar(oia,oja) )
450  allocate( ocean_ocn_rlmo(oia,oja) )
451  ocean_ocn_ustar(:,:) = undef
452  ocean_ocn_tstar(:,:) = undef
453  ocean_ocn_qstar(:,:) = undef
454  ocean_ocn_wstar(:,:) = undef
455  ocean_ocn_rlmo(:,:) = undef
456  else
462  end if
463  if ( ice_flag ) then
464  allocate( ocean_ice_ustar(oia,oja) )
465  allocate( ocean_ice_tstar(oia,oja) )
466  allocate( ocean_ice_qstar(oia,oja) )
467  allocate( ocean_ice_wstar(oia,oja) )
468  allocate( ocean_ice_rlmo(oia,oja) )
469  ocean_ice_ustar(:,:) = undef
470  ocean_ice_tstar(:,:) = undef
471  ocean_ice_qstar(:,:) = undef
472  ocean_ice_wstar(:,:) = undef
473  ocean_ice_rlmo(:,:) = undef
474  end if
475 
476  allocate( ocean_ice_frac(oia,oja) )
477  ocean_ice_frac(:,:) = undef
478 
479  allocate( ocean_mass_supl(oia,oja) )
480  allocate( ocean_engi_supl(oia,oja) )
481  ocean_mass_supl(:,:) = undef
482  ocean_engi_supl(:,:) = undef
483 
484  !--- read namelist
485  rewind(io_fid_conf)
486  read(io_fid_conf,nml=param_ocean_vars,iostat=ierr)
487  if( ierr < 0 ) then !--- missing
488  log_info("OCEAN_vars_setup",*) 'Not found namelist. Default used.'
489  elseif( ierr > 0 ) then !--- fatal error
490  log_error("OCEAN_vars_setup",*) 'Not appropriate names in namelist PARAM_OCEAN_VARS. Check!'
491  call prc_abort
492  endif
493  log_nml(param_ocean_vars)
494 
495  log_newline
496  log_info("OCEAN_vars_setup",*) 'List of prognostic variables (OCEAN) '
497  log_info_cont('(1x,A,A24,A,A48,A,A12,A)') &
498  ' |','VARNAME ','|','DESCRIPTION ','[','UNIT ',']'
499  do iv = 1, vmax
500  log_info_cont('(1x,A,I3,A,A24,A,A48,A,A12,A)') &
501  'NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
502  enddo
503 
504  log_newline
505  if ( ocean_restart_in_basename /= '' ) then
506  log_info("OCEAN_vars_setup",*) 'Restart input? : YES, file = ', trim(ocean_restart_in_basename)
507  log_info_cont(*) 'Add timelabel? : ', ocean_restart_in_postfix_timelabel
508  else
509  log_info("OCEAN_vars_setup",*) 'Restart input? : NO'
510  endif
511  if ( ocean_restart_output &
512  .AND. ocean_restart_out_basename /= '' ) then
513  log_info("OCEAN_vars_setup",*) 'Restart output? : YES, file = ', trim(ocean_restart_out_basename)
514  log_info_cont(*) 'Add timelabel? : ', ocean_restart_out_postfix_timelabel
515  else
516  log_info("OCEAN_vars_setup",*) 'Restart output? : NO'
517  ocean_restart_output = .false.
518  endif
519 
520  ! monitor
521  call monitor_reg( 'OCN_TEMP', 'sea water temperature', 'K m3', & ! (in)
522  monit_id(im_o_temp), & ! (out)
523  dim_type='OXY', is_tendency=.false. ) ! (in)
524  call monitor_reg( 'OCN_ICE_TEMP', 'sea ice temperature', 'K m3', & ! (in)
525  monit_id(im_i_temp), & ! (out)
526  dim_type='XY', is_tendency=.false. ) ! (in)
527  call monitor_reg( 'OCN_ICE_MASS', 'sea ice mass', 'kg', & ! (in)
528  monit_id(im_i_mass), & ! (out)
529  dim_type='XY', is_tendency=.false. ) ! (in)
530  call monitor_reg( 'OCN_MASFLX_TOP', 'SFC mass flux', 'kg', & ! (in)
531  monit_id(im_sfc), & ! (out)
532  dim_type='XY', is_tendency=.true. ) ! (in)
533  call monitor_reg( 'OCN_MASFLX_MID', 'sea surface mass flux', 'kg', & ! (in)
534  monit_id(im_ssf), & ! (out)
535  dim_type='XY', is_tendency=.true. ) ! (in)
536  call monitor_reg( 'OCN_MAS_SUPL', 'mass supply', 'kg', & ! (in)
537  monit_id(im_mas_supl), & ! (out)
538  dim_type='XY', is_tendency=.true. ) ! (in)
539  call monitor_reg( 'OCN_MASCNV', 'total mass convergence', 'kg', & ! (in)
540  monit_id(im_t_masflx), & ! (out)
541  dim_type='XY', is_tendency=.true. ) ! (in)
542  call monitor_reg( 'OCN_WTR_MASCNV', 'sea water mass convergence', 'kg', & ! (in)
543  monit_id(im_o_masflx), & ! (out)
544  dim_type='XY', is_tendency=.true. ) ! (in)
545  call monitor_reg( 'OCN_ICE_MASCNV', 'sea ice mass convergence', 'kg', & ! (in)
546  monit_id(im_i_masflx), & ! (out)
547  dim_type='XY', is_tendency=.true. ) ! (in)
548  call monitor_reg( 'OCN_WTR_ENGI', 'sea water internal energy', 'J', & ! (in)
549  monit_id(im_o_engi), & ! (out)
550  dim_type='OXY', is_tendency=.false. ) ! (in)
551  call monitor_reg( 'OCN_ICE_ENGI', 'sea ice internal energy', 'J', & ! (in)
552  monit_id(im_i_engi), & ! (out)
553  dim_type='XY', is_tendency=.false. ) ! (in)
554  call monitor_reg( 'OCN_GHFLX_TOP', 'SFC ground heat flux', 'J', & ! (in)
555  monit_id(im_engsfc_gh), & ! (out)
556  dim_type='XY', is_tendency=.true. ) ! (in)
557  call monitor_reg( 'OCN_ENGIFLX_TOP', 'SFC internal energy flux', 'J', & ! (in)
558  monit_id(im_engsfc_ei), & ! (out)
559  dim_type='XY', is_tendency=.true. ) ! (in)
560  call monitor_reg( 'OCN_GHFLX_MID', 'sea surface ground heat flux', 'J', & ! (in)
561  monit_id(im_engssf_gh), & ! (out)
562  dim_type='XY', is_tendency=.true. ) ! (in)
563  call monitor_reg( 'OCN_ENGIFLX_MID', 'sea surface internal energy flux', 'J', & ! (in)
564  monit_id(im_engssf_ei), & ! (out)
565  dim_type='XY', is_tendency=.true. ) ! (in)
566  call monitor_reg( 'OCN_ENGI_SUPL', 'internal energy supply', 'J', & ! (in)
567  monit_id(im_eng_supl), & ! (out)
568  dim_type='XY', is_tendency=.true. ) ! (in)
569  call monitor_reg( 'OCN_ENGICNV', 'total internal energy convergence','J', & ! (in)
570  monit_id(im_t_engflx), & ! (out)
571  dim_type='XY', is_tendency=.true. ) ! (in)
572  call monitor_reg( 'OCN_WTR_ENGICNV', 'sea water internal energy convergence', 'J', & ! (in)
573  monit_id(im_o_engflx), & ! (out)
574  dim_type='XY', is_tendency=.true. ) ! (in)
575  call monitor_reg( 'OCN_ICE_ENGICNV', 'sea ice internal energy convergence', 'J', & ! (in)
576  monit_id(im_i_engflx), & ! (out)
577  dim_type='XY', is_tendency=.true. ) ! (in)
578 
579  return
580  end subroutine ocean_vars_setup
581 
582  !-----------------------------------------------------------------------------
584  subroutine ocean_vars_restart_open
585  use scale_time, only: &
587  use scale_file_cartesc, only: &
589  file_cartesc_check_coordinates
590  use mod_ocean_admin, only: &
591  ocean_do
592  implicit none
593 
594  character(len=19) :: timelabel
595  character(len=H_LONG) :: basename
596  !---------------------------------------------------------------------------
597 
598  log_newline
599  log_info("OCEAN_vars_restart_open",*) 'Open restart file (OCEAN) '
600 
601  if ( ocean_do .and. ocean_restart_in_basename /= '' ) then
602 
604  call time_gettimelabel( timelabel )
605  basename = trim(ocean_restart_in_basename)//'_'//trim(timelabel)
606  else
607  basename = trim(ocean_restart_in_basename)
608  endif
609  log_info_cont(*) 'basename: ', trim(basename)
610 
611  call file_cartesc_open( basename, restart_fid, aggregate=ocean_restart_in_aggregate )
612 
613  if( ocean_restart_in_check_coordinates ) call file_cartesc_check_coordinates( restart_fid )
614 
615  else
616  log_info_cont(*) 'restart file for ocean is not specified.'
617  endif
618 
619  return
620  end subroutine ocean_vars_restart_open
621 
622  !-----------------------------------------------------------------------------
624  subroutine ocean_vars_restart_read
625  use scale_prc, only: &
626  prc_abort
627  use scale_file, only: &
629  use scale_file_cartesc, only: &
630  file_cartesc_read, &
632  use scale_ocean_phy_ice_simple, only: &
635  use mod_ocean_admin, only: &
637  implicit none
638  !---------------------------------------------------------------------------
639 
640  if ( restart_fid /= -1 ) then
641  log_newline
642  log_info("OCEAN_vars_restart_read",*) 'Read from restart file (OCEAN) '
643 
644  call file_cartesc_read( restart_fid, var_name(i_temp), 'OXY', & ! [IN]
645  ocean_temp(:,:,:) ) ! [OUT]
646 ! call FILE_CARTESC_read( restart_fid, VAR_NAME(I_SALT), 'OXY', & ! [IN]
647 ! OCEAN_SALT(:,:,:) ) ! [OUT]
648 ! call FILE_CARTESC_read( restart_fid, VAR_NAME(I_UVEL), 'OXY', & ! [IN]
649 ! OCEAN_UVEL(:,:,:) ) ! [OUT]
650 ! call FILE_CARTESC_read( restart_fid, VAR_NAME(I_VVEL), 'OXY', & ! [IN]
651 ! OCEAN_VVEL(:,:,:) ) ! [OUT]
652  call file_cartesc_read( restart_fid, var_name(i_ocn_z0m), 'XY', & ! [IN]
653  ocean_ocn_z0m(:,:) ) ! [OUT]
654  call file_cartesc_read( restart_fid, var_name(i_sfc_temp), 'XY', & ! [IN]
655  ocean_sfc_temp(:,:) ) ! [OUT]
656  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_ir_dir), 'XY', & ! [IN]
657  ocean_sfc_albedo(:,:,i_r_direct ,i_r_ir ) ) ! [OUT]
658  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_ir_dif), 'XY', & ! [IN]
659  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_ir ) ) ! [OUT]
660  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_nir_dir), 'XY', & ! [IN]
661  ocean_sfc_albedo(:,:,i_r_direct ,i_r_nir) ) ! [OUT]
662  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_nir_dif), 'XY', & ! [IN]
663  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_nir) ) ! [OUT]
664  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_vis_dir), 'XY', & ! [IN]
665  ocean_sfc_albedo(:,:,i_r_direct ,i_r_vis) ) ! [OUT]
666  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_vis_dif), 'XY', & ! [IN]
667  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_vis) ) ! [OUT]
668  call file_cartesc_read( restart_fid, var_name(i_sfc_z0m), 'XY', & ! [IN]
669  ocean_sfc_z0m(:,:) ) ! [OUT]
670  call file_cartesc_read( restart_fid, var_name(i_sfc_z0h), 'XY', & ! [IN]
671  ocean_sfc_z0h(:,:) ) ! [OUT]
672  call file_cartesc_read( restart_fid, var_name(i_sfc_z0e), 'XY', & ! [IN]
673  ocean_sfc_z0e(:,:) ) ! [OUT]
674  if ( ice_flag ) then
675  call file_cartesc_read( restart_fid, var_name(i_ice_temp), 'XY', & ! [IN]
676  ocean_ice_temp(:,:) ) ! [OUT]
677  call file_cartesc_read( restart_fid, var_name(i_ice_mass), 'XY', & ! [IN]
678  ocean_ice_mass(:,:) ) ! [OUT]
679  end if
680 
681  if( file_get_aggregate(restart_fid) ) call file_cartesc_flush( restart_fid ) ! commit all pending read requests
682 
683 
684  if ( ice_flag ) then
686  call ocean_phy_ice_fraction( oia, ois, oie, & ! [IN]
687  oja, ojs, oje, & ! [IN]
688  ocean_ice_mass(:,:), & ! [IN]
689  ocean_ice_frac(:,:) ) ! [OUT]
690  else
691  ocean_ice_frac(:,:) = 0.0_rp
692  endif
693 
694  call ocean_vars_check( force = .true. )
695  else
696  log_error("OCEAN_vars_restart_read",*) 'invalid restart file ID for ocean.'
697  call prc_abort
698  endif
699 
700  return
701  end subroutine ocean_vars_restart_read
702 
703  !-----------------------------------------------------------------------------
705  subroutine ocean_vars_history
706  use scale_file_history, only: &
707  file_history_in
708  use scale_atmos_hydrometeor, only: &
709  i_qv
710  implicit none
711  !---------------------------------------------------------------------------
712 
713  call prof_rapstart('OCN_History', 1)
714 
715  call file_history_in( ocean_temp(:,:,:), &
716  var_name(i_temp), var_desc(i_temp), &
717  var_unit(i_temp), standard_name=var_stdn(i_temp), &
718  dim_type="OXY" )
719 ! call FILE_HISTORY_in( OCEAN_SALT (:,:,:), &
720 ! VAR_NAME(I_SALT), VAR_DESC(I_SALT), &
721 ! VAR_UNIT(I_SALT), standard_name=VAR_STDN(I_SALT), &
722 ! dim_type="OXY" )
723 ! call FILE_HISTORY_in( OCEAN_UVEL (:,:,:), &
724 ! VAR_NAME(I_UVEL), VAR_DESC(I_UVEL), &
725 ! VAR_UNIT(I_UVEL), standard_name=VAR_STDN(I_UVEL), &
726 ! dim_type="OXY" )
727 ! call FILE_HISTORY_in( OCEAN_VVEL (:,:,:), &
728 ! VAR_NAME(I_VVEL), VAR_DESC(I_VVEL), &
729 ! VAR_UNIT(I_VVEL), standard_name=VAR_STDN(I_VVEL), &
730 ! dim_type="OXY" )
731 
732  call file_history_in( ocean_ocn_z0m(:,:), &
733  var_name(i_ocn_z0m), var_desc(i_ocn_z0m), &
734  var_unit(i_ocn_z0m), standard_name=var_stdn(i_ocn_z0m) )
735  call file_history_in( ocean_sfc_temp(:,:), &
736  var_name(i_sfc_temp), var_desc(i_sfc_temp), &
737  var_unit(i_sfc_temp), standard_name=var_stdn(i_sfc_temp) )
738  call file_history_in( ocean_sfc_albedo(:,:,i_r_direct ,i_r_ir ), &
739  var_name(i_sfc_alb_ir_dir), var_desc(i_sfc_alb_ir_dir), &
740  var_unit(i_sfc_alb_ir_dir), standard_name=var_stdn(i_sfc_alb_ir_dir) )
741  call file_history_in( ocean_sfc_albedo(:,:,i_r_diffuse,i_r_ir ), &
742  var_name(i_sfc_alb_ir_dif), var_desc(i_sfc_alb_ir_dif), &
743  var_unit(i_sfc_alb_ir_dif), standard_name=var_stdn(i_sfc_alb_ir_dif) )
744  call file_history_in( ocean_sfc_albedo(:,:,i_r_direct ,i_r_nir), &
745  var_name(i_sfc_alb_nir_dir), var_desc(i_sfc_alb_nir_dir), &
746  var_unit(i_sfc_alb_nir_dir), standard_name=var_stdn(i_sfc_alb_nir_dir) )
747  call file_history_in( ocean_sfc_albedo(:,:,i_r_diffuse,i_r_nir), &
748  var_name(i_sfc_alb_nir_dif), var_desc(i_sfc_alb_nir_dif), &
749  var_unit(i_sfc_alb_nir_dif), standard_name=var_stdn(i_sfc_alb_nir_dif) )
750  call file_history_in( ocean_sfc_albedo(:,:,i_r_direct ,i_r_vis), &
751  var_name(i_sfc_alb_vis_dir), var_desc(i_sfc_alb_vis_dir), &
752  var_unit(i_sfc_alb_vis_dir), standard_name=var_stdn(i_sfc_alb_vis_dir) )
753  call file_history_in( ocean_sfc_albedo(:,:,i_r_diffuse,i_r_vis), &
754  var_name(i_sfc_alb_vis_dif), var_desc(i_sfc_alb_vis_dif), &
755  var_unit(i_sfc_alb_vis_dif), standard_name=var_stdn(i_sfc_alb_vis_dif) )
756  call file_history_in( ocean_sfc_z0m(:,:), &
757  var_name(i_sfc_z0m), var_desc(i_sfc_z0m), &
758  var_unit(i_sfc_z0m), standard_name=var_stdn(i_sfc_z0m) )
759  call file_history_in( ocean_sfc_z0h(:,:), &
760  var_name(i_sfc_z0h), var_desc(i_sfc_z0h), &
761  var_unit(i_sfc_z0h), standard_name=var_stdn(i_sfc_z0h) )
762  call file_history_in( ocean_sfc_z0e(:,:), &
763  var_name(i_sfc_z0e), var_desc(i_sfc_z0e), &
764  var_unit(i_sfc_z0e), standard_name=var_stdn(i_sfc_z0h) )
765 
766  if ( ice_flag ) then
767  call file_history_in( ocean_ice_temp(:,:), &
768  var_name(i_ice_temp), var_desc(i_ice_temp), &
769  var_unit(i_ice_temp), standard_name=var_stdn(i_ice_temp) )
770  call file_history_in( ocean_ice_mass(:,:), &
771  var_name(i_ice_mass), var_desc(i_ice_mass), &
772  var_unit(i_ice_mass), standard_name=var_stdn(i_ice_mass) )
773  end if
774 
775  call file_history_in( ocean_sflx_gh(:,:), 'OCEAN_SFLX_GH', &
776  'ocean subsurface heat flux (downward)', 'J/m2/s' )
777  call file_history_in( ocean_sflx_water(:,:), 'OCEAN_SFLX_water', &
778  'ocean surface liquid water flux (downward)', 'kg/m2/s' )
779  call file_history_in( ocean_sflx_engi(:,:), 'OCEAN_SFLX_ENGI', &
780  'ocean surface internal energy flux (downward)', 'J/m2/s' )
781 
782  call file_history_in( ocean_sflx_mw(:,:), 'OCEAN_SFLX_MW', &
783  'ocean surface w-momentum flux (upward)', 'kg/m2/s' )
784  call file_history_in( ocean_sflx_mu(:,:), 'OCEAN_SFLX_MU', &
785  'ocean surface u-momentum flux (upward)', 'kg/m2/s' )
786  call file_history_in( ocean_sflx_mv(:,:), 'OCEAN_SFLX_MV', &
787  'ocean surface v-momentum flux (upward)', 'kg/m2/s' )
788  call file_history_in( ocean_sflx_sh(:,:), 'OCEAN_SFLX_SH', &
789  'ocean surface sensible heat flux (upward)', 'J/m2/s' )
790  call file_history_in( ocean_sflx_lh(:,:), 'OCEAN_SFLX_LH', &
791  'ocean surface latent heat flux (upward)', 'J/m2/s' )
792  if ( i_qv > 0 ) &
793  call file_history_in( ocean_sflx_qtrc(:,:,i_qv), 'OCEAN_SFLX_evap', &
794  'ocean surface water vapor flux (upward)', 'kg/m2/s' )
795  call file_history_in( ocean_u10(:,:), 'OCEAN_U10', &
796  'ocean 10m x-wind', 'm/s' )
797  call file_history_in( ocean_v10(:,:), 'OCEAN_V10', &
798  'ocean 10m y-wind', 'm/s' )
799  call file_history_in( ocean_t2(:,:), 'OCEAN_T2', &
800  'ocean 2m temperature', 'K' )
801  call file_history_in( ocean_q2(:,:), 'OCEAN_Q2', &
802  'ocean 2m specific humidity', 'kg/kg' )
803  call file_history_in( ocean_ustar(:,:), 'OCEAN_Ustar', &
804  'ocean friction velocity', 'm/s' )
805  call file_history_in( ocean_tstar(:,:), 'OCEAN_Tstar', &
806  'ocean temperature scale', 'K' )
807  call file_history_in( ocean_qstar(:,:), 'OCEAN_Qstar', &
808  'ocean moisture scale', 'kg/kg' )
809  call file_history_in( ocean_wstar(:,:), 'OCEAN_Wstar', &
810  'ocean convective velocity scale', 'm/s' )
811  call file_history_in( ocean_rlmo(:,:), 'OCEAN_RLmo', &
812  'ocean inversed Obukhov length', '1/m' )
813 
814  if ( ice_flag ) then
815  call file_history_in( ocean_ocn_ustar(:,:), 'OCEAN_OCN_Ustar', 'friction velocity on open ocean surface', 'm/s' )
816  call file_history_in( ocean_ocn_tstar(:,:), 'OCEAN_OCN_Tstar', 'temperature scale on open ocean surface', 'K' )
817  call file_history_in( ocean_ocn_qstar(:,:), 'OCEAN_OCN_Qstar', 'moisture scale on open ocean surface', 'kg/kg' )
818  call file_history_in( ocean_ocn_wstar(:,:), 'OCEAN_OCN_Wstar', 'convective velocity scale on open ocean surface', 'm/s' )
819  call file_history_in( ocean_ocn_rlmo(:,:), 'OCEAN_OCN_RLmo', 'inversed Obukhov length on open ocean surface', '1/m' )
820  call file_history_in( ocean_ice_ustar(:,:), 'OCEAN_ICE_Ustar', 'friction velocity on sea ice surface', 'm/s' )
821  call file_history_in( ocean_ice_tstar(:,:), 'OCEAN_ICE_Tstar', 'temperature scale on sea ice surface', 'K', dim_type='XY' )
822  call file_history_in( ocean_ice_qstar(:,:), 'OCEAN_ICE_Qstar', 'moisture scale on sea ice surface', 'kg/kg' )
823  call file_history_in( ocean_ice_wstar(:,:), 'OCEAN_ICE_Wstar', 'convective velocity scale on sea ice surface', 'm/s' )
824  call file_history_in( ocean_ice_rlmo(:,:), 'OCEAN_ICE_RLmo', 'inversed Obukhov length on sea ice surface', '1/m' )
825 
826  call file_history_in( ocean_ice_frac(:,:), 'OCEAN_ICE_FRAC', 'seaice fraction', '1' )
827  end if
828 
829  call prof_rapend ('OCN_History', 1)
830 
831  return
832  end subroutine ocean_vars_history
833 
834  !-----------------------------------------------------------------------------
836  subroutine ocean_vars_check( force )
837  use scale_statistics, only: &
839  statistics_total
840  use scale_atmos_hydrometeor, only: &
841  i_qv
842  use scale_ocean_grid_cartesc_real, only: &
847  use scale_landuse, only: &
849  implicit none
850  logical, intent(in), optional :: force
851  logical :: check
852  !---------------------------------------------------------------------------
853 
854  if ( present(force) ) then
855  check = force
856  else
857  check = ocean_vars_checkrange
858  end if
859 
860  if ( check ) then
861  call valcheck( oka, oks, oke, oia, ois, oie, oja, ojs, oje, &
862  ocean_temp(:,:,:), 0.0_rp, 1000.0_rp, &
863  var_name(i_temp), __file__, __line__, &
864  mask = landuse_exists_ocean(:,:) )
865 ! call VALCHECK( OKA, OKS, OKE, OIA, OIS, OIE, OJA, OJS, OJE, &
866 ! OCEAN_SALT (:,:,:), 0.0_RP, 1000.0_RP, &
867 ! VAR_NAME(I_SALT), __FILE__, __LINE__, &
868 ! mask = LANDUSE_exists_ocean(:,:) )
869 ! call VALCHECK( OKA, OKS, OKE, OIA, OIS, OIE, OJA, OJS, OJE, &
870 ! OCEAN_UVEL (:,:,:), 0.0_RP, 1000.0_RP, &
871 ! VAR_NAME(I_UVEL), __FILE__, __LINE__, &
872 ! mask = LANDUSE_exists_ocean(:,:) )
873 ! call VALCHECK( OKA, OKS, OKE, OIA, OIS, OIE, OJA, OJS, OJE, &
874 ! OCEAN_VVEL (:,:,:), 0.0_RP, 1000.0_RP, &
875 ! VAR_NAME(I_VVEL), __FILE__, __LINE__, &
876 ! mask = LANDUSE_exists_ocean(:,:) )
877 
878  call valcheck( oia, ois, oie, oja, ojs, oje, &
879  ocean_ocn_z0m(:,:), 0.0_rp, 1000.0_rp, &
880  var_name(i_ocn_z0m), __file__, __line__, &
881  mask = landuse_exists_ocean(:,:) )
882  call valcheck( oia, ois, oie, oja, ojs, oje, &
883  ocean_sfc_temp(:,:), 0.0_rp, 1000.0_rp, &
884  var_name(i_sfc_temp), __file__, __line__, &
885  mask = landuse_exists_ocean(:,:) )
886  call valcheck( oia, ois, oie, oja, ojs, oje, &
887  ocean_sfc_albedo(:,:,i_r_direct ,i_r_ir ), 0.0_rp, 2.0_rp, &
888  var_name(i_sfc_alb_ir_dir ), __file__, __line__, &
889  mask = landuse_exists_ocean(:,:) )
890  call valcheck( oia, ois, oie, oja, ojs, oje, &
891  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_ir ), 0.0_rp, 2.0_rp, &
892  var_name(i_sfc_alb_ir_dif ), __file__, __line__, &
893  mask = landuse_exists_ocean(:,:) )
894  call valcheck( oia, ois, oie, oja, ojs, oje, &
895  ocean_sfc_albedo(:,:,i_r_direct ,i_r_nir), 0.0_rp, 2.0_rp, &
896  var_name(i_sfc_alb_nir_dir), __file__, __line__, &
897  mask = landuse_exists_ocean(:,:) )
898  call valcheck( oia, ois, oie, oja, ojs, oje, &
899  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_nir), 0.0_rp, 2.0_rp, &
900  var_name(i_sfc_alb_nir_dif), __file__, __line__, &
901  mask = landuse_exists_ocean(:,:) )
902  call valcheck( oia, ois, oie, oja, ojs, oje, &
903  ocean_sfc_albedo(:,:,i_r_direct ,i_r_vis), 0.0_rp, 2.0_rp, &
904  var_name(i_sfc_alb_vis_dir), __file__, __line__, &
905  mask = landuse_exists_ocean(:,:) )
906  call valcheck( oia, ois, oie, oja, ojs, oje, &
907  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_vis), 0.0_rp, 2.0_rp, &
908  var_name(i_sfc_alb_vis_dif), __file__, __line__, &
909  mask = landuse_exists_ocean(:,:) )
910  call valcheck( oia, ois, oie, oja, ojs, oje, &
911  ocean_sfc_z0m(:,:), 0.0_rp, 1000.0_rp, &
912  var_name(i_sfc_z0m), __file__, __line__, &
913  mask = landuse_exists_ocean(:,:) )
914  call valcheck( oia, ois, oie, oja, ojs, oje, &
915  ocean_sfc_z0h(:,:), 0.0_rp, 1000.0_rp, &
916  var_name(i_sfc_z0h), __file__, __line__, &
917  mask = landuse_exists_ocean(:,:) )
918  call valcheck( oia, ois, oie, oja, ojs, oje, &
919  ocean_sfc_z0e(:,:), 0.0_rp, 1000.0_rp, &
920  var_name(i_sfc_z0e), __file__, __line__, &
921  mask = landuse_exists_ocean(:,:) )
922  if ( ice_flag ) then
923  call valcheck( oia, ois, oie, oja, ojs, oje, &
924  ocean_ice_temp(:,:), 0.0_rp, 1000.0_rp, &
925  var_name(i_ice_temp), __file__, __line__, &
926  mask = landuse_exists_ocean(:,:) )
927  call valcheck( oia, ois, oie, oja, ojs, oje, &
928  ocean_ice_mass(:,:), 0.0_rp, 5e+5_rp, &
929  var_name(i_ice_mass), __file__, __line__, &
930  mask = landuse_exists_ocean(:,:) )
931  end if
932 
933  endif
934 
935  if ( present(force) ) then
936  check = force
937  else
939  end if
940 
941  if ( check ) then
942 
943  call statistics_total( oka, oks, oke, oia, ois, oie, oja, ojs, oje, & ! [IN]
944  ocean_temp(:,:,:), var_name(i_temp), & ! [IN]
945  ocean_grid_cartesc_real_vol(:,:,:), & ! [IN]
947 ! call STATISTICS_total( OKA, OKS, OKE, OIA, OIS, OIE, OJA, OJS, OJE, & ! [IN]
948 ! OCEAN_SALT(:,:,:), VAR_NAME(I_SALT), & ! [IN]
949 ! OCEAN_GRID_CARTESC_REAL_VOL(:,:,:), & ! [IN]
950 ! OCEAN_GRID_CARTESC_REAL_TOTVOL ) ! [IN]
951 ! call STATISTICS_total( OKA, OKS, OKE, OIA, OIS, OIE, OJA, OJS, OJE, & ! [IN]
952 ! OCEAN_UVEL(:,:,:), VAR_NAME(I_UVEL), & ! [IN]
953 ! OCEAN_GRID_CARTESC_REAL_VOL(:,:,:), & ! [IN]
954 ! OCEAN_GRID_CARTESC_REAL_TOTVOL ) ! [IN]
955 ! call STATISTICS_total( OKA, OKS, OKE, OIA, OIS, OIE, OJA, OJS, OJE, & ! [IN]
956 ! OCEAN_VVEL(:,:,:), VAR_NAME(I_VVEL), & ! [IN]
957 ! OCEAN_GRID_CARTESC_REAL_VOL(:,:,:), & ! [IN]
958 ! OCEAN_GRID_CARTESC_REAL_TOTVOL ) ! [IN]
959 
960  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
961  ocean_ocn_z0m(:,:), var_name(i_ocn_z0m), & ! [IN]
962  ocean_grid_cartesc_real_area(:,:), & ! [IN]
964  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
965  ocean_sfc_temp(:,:), var_name(i_sfc_temp), & ! [IN]
966  ocean_grid_cartesc_real_area(:,:), & ! [IN]
968  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
969  ocean_sfc_albedo(:,:,i_r_direct ,i_r_ir ), var_name(i_sfc_alb_ir_dir), & ! [IN]
970  ocean_grid_cartesc_real_area(:,:), & ! [IN]
972  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
973  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_ir ), var_name(i_sfc_alb_ir_dif), & ! [IN]
974  ocean_grid_cartesc_real_area(:,:), & ! [IN]
976  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
977  ocean_sfc_albedo(:,:,i_r_direct ,i_r_nir), var_name(i_sfc_alb_nir_dir), & ! [IN]
978  ocean_grid_cartesc_real_area(:,:), & ! [IN]
980  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
981  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_nir), var_name(i_sfc_alb_nir_dif), & ! [IN]
982  ocean_grid_cartesc_real_area(:,:), & ! [IN]
984  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
985  ocean_sfc_albedo(:,:,i_r_direct ,i_r_vis), var_name(i_sfc_alb_vis_dir), & ! [IN]
986  ocean_grid_cartesc_real_area(:,:), & ! [IN]
988  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
989  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_vis), var_name(i_sfc_alb_vis_dif), & ! [IN]
990  ocean_grid_cartesc_real_area(:,:), & ! [IN]
992  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
993  ocean_sfc_z0m(:,:), var_name(i_sfc_z0m), & ! [IN]
994  ocean_grid_cartesc_real_area(:,:), & ! [IN]
996  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
997  ocean_sfc_z0h(:,:), var_name(i_sfc_z0h), & ! [IN]
998  ocean_grid_cartesc_real_area(:,:), & ! [IN]
1000  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
1001  ocean_sfc_z0e(:,:), var_name(i_sfc_z0e), & ! [IN]
1002  ocean_grid_cartesc_real_area(:,:), & ! [IN]
1004 
1005  if ( ice_flag ) then
1006  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
1007  ocean_ice_temp(:,:), var_name(i_ice_temp), & ! [IN]
1008  ocean_grid_cartesc_real_area(:,:), & ! [IN]
1010  call statistics_total( oia, ois, oie, oja, ojs, oje, & ! [IN]
1011  ocean_ice_mass(:,:), var_name(i_ice_mass), & ! [IN]
1012  ocean_grid_cartesc_real_area(:,:), & ! [IN]
1014  end if
1015 
1016  endif
1017 
1018  return
1019  end subroutine ocean_vars_check
1020 
1021  !-----------------------------------------------------------------------------
1023  subroutine ocean_vars_monitor
1024  use scale_const, only: &
1025  dwatr => const_dwatr
1026  use scale_atmos_hydrometeor, only: &
1027  cv_water, &
1028  cv_ice, &
1029  lhf
1030  use scale_monitor, only: &
1031  monitor_put
1032  implicit none
1033 
1034  real(rp) :: work3d(oka,oia,oja)
1035  real(rp) :: work2d(oia,oja)
1036 
1037  integer :: k, i, j
1038  !---------------------------------------------------------------------------
1039 
1040  call monitor_put( monit_id(im_o_temp), ocean_temp(:,:,:) )
1041  call monitor_put( monit_id(im_i_temp), ocean_ice_temp(:,:) )
1042  call monitor_put( monit_id(im_i_mass), ocean_ice_mass(:,:) )
1043 
1044 
1045  ! mass budget
1046  call monitor_put( monit_id(im_sfc), ocean_sflx_water(:,:) )
1047  call monitor_put( monit_id(im_ssf), ocean_oflx_water(:,:) )
1048  call monitor_put( monit_id(im_mas_supl), ocean_mass_supl(:,:) )
1049  if ( monit_id(im_t_masflx) > 0 ) then
1050  !$omp parallel do
1051  do j = ojs, oje
1052  do i = ois, oie
1053  work2d(i,j) = ocean_sflx_water(i,j) + ocean_mass_supl(i,j)
1054  end do
1055  end do
1056  call monitor_put( monit_id(im_t_masflx), work2d(:,:) )
1057  end if
1058  if ( monit_id(im_o_masflx) > 0 ) then
1059  !$omp parallel do
1060  do j = ojs, oje
1061  do i = ois, oie
1062  work2d(i,j) = ocean_oflx_water(i,j) + ocean_mass_supl(i,j)
1063  end do
1064  end do
1065  call monitor_put( monit_id(im_o_masflx), work2d(:,:) )
1066  end if
1067  if ( monit_id(im_i_masflx) > 0 ) then
1068  !$omp parallel do
1069  do j = ojs, oje
1070  do i = ois, oie
1071  work2d(i,j) = ocean_sflx_water(i,j) - ocean_oflx_water(i,j)
1072  end do
1073  end do
1074  call monitor_put( monit_id(im_i_masflx), work2d(:,:) )
1075  end if
1076 
1077 
1078  ! energy budget
1079  if ( monit_id(im_o_engi) > 0 ) then
1080  !$omp parallel do
1081  do j = ojs, oje
1082  do i = ois, oie
1083  do k = oks, oke
1084  work3d(k,i,j) = cv_water * dwatr * ocean_temp(k,i,j)
1085  end do
1086  end do
1087  end do
1088  call monitor_put( monit_id(im_o_engi), work3d(:,:,:) )
1089  end if
1090  if ( monit_id(im_i_engi) > 0 ) then
1091  !$omp parallel do
1092  do j = ojs, oje
1093  do i = ois, oie
1094  work2d(i,j) = ( cv_ice * ocean_ice_temp(i,j) - lhf ) * ocean_ice_mass(i,j)
1095  end do
1096  end do
1097  call monitor_put( monit_id(im_i_engi), work2d(:,:) )
1098  end if
1099 
1100 
1101  call monitor_put( monit_id(im_engsfc_gh), ocean_sflx_gh(:,:) )
1102  call monitor_put( monit_id(im_engsfc_ei), ocean_sflx_engi(:,:) )
1103  call monitor_put( monit_id(im_engssf_gh), ocean_oflx_gh(:,:) )
1104  call monitor_put( monit_id(im_engssf_ei), ocean_oflx_engi(:,:) )
1105  call monitor_put( monit_id(im_eng_supl) , ocean_engi_supl(:,:) )
1106  if ( monit_id(im_t_engflx) > 0 ) then
1107  !$omp parallel do
1108  do j = ojs, oje
1109  do i = ois, oie
1110  work2d(i,j) = ocean_sflx_gh(i,j) + ocean_sflx_engi(i,j) &
1111  + ocean_engi_supl(i,j)
1112  end do
1113  end do
1114  call monitor_put( monit_id(im_t_engflx), work2d(:,:) )
1115  end if
1116  if ( monit_id(im_o_engflx) > 0 ) then
1117  !$omp parallel do
1118  do j = ojs, oje
1119  do i = ois, oie
1120  work2d(i,j) = ocean_oflx_gh(i,j) + ocean_oflx_engi(i,j) &
1121  + ocean_engi_supl(i,j)
1122  end do
1123  end do
1124  call monitor_put( monit_id(im_o_engflx), work2d(:,:) )
1125  end if
1126  if ( monit_id(im_i_engflx) > 0 ) then
1127  !$omp parallel do
1128  do j = ojs, oje
1129  do i = ois, oie
1130  work2d(i,j) = ocean_sflx_gh(i,j) + ocean_sflx_engi(i,j) &
1131  - ocean_oflx_gh(i,j) - ocean_oflx_engi(i,j)
1132  end do
1133  end do
1134  call monitor_put( monit_id(im_i_engflx), work2d(:,:) )
1135  end if
1136 
1137 
1138  return
1139  end subroutine ocean_vars_monitor
1140 
1141  !-----------------------------------------------------------------------------
1143  subroutine ocean_vars_restart_create
1144  use scale_time, only: &
1146  use scale_file_cartesc, only: &
1148  use mod_ocean_admin, only: &
1149  ocean_do
1150  implicit none
1151 
1152  character(len=19) :: timelabel
1153  character(len=H_LONG) :: basename
1154  !---------------------------------------------------------------------------
1155 
1156  if ( ocean_do .and. ocean_restart_out_basename /= '' ) then
1157  log_newline
1158  log_info("OCEAN_vars_restart_create",*) 'Create restart file (OCEAN) '
1159 
1161  call time_gettimelabel( timelabel )
1162  basename = trim(ocean_restart_out_basename)//'_'//trim(timelabel)
1163  else
1164  basename = trim(ocean_restart_out_basename)
1165  endif
1166  log_info_cont(*) 'basename: ', trim(basename)
1167 
1168  call file_cartesc_create( basename, & ! [IN]
1169  ocean_restart_out_title, & ! [IN]
1170  ocean_restart_out_dtype, & ! [IN]
1171  restart_fid, & ! [OUT]
1172  aggregate = ocean_restart_out_aggregate ) ! [IN]
1173  endif
1174 
1175  return
1176  end subroutine ocean_vars_restart_create
1177 
1178  !-----------------------------------------------------------------------------
1180  subroutine ocean_vars_restart_enddef
1181  use scale_file_cartesc, only: &
1183  implicit none
1184  !---------------------------------------------------------------------------
1185 
1186  if ( restart_fid /= -1 ) then
1187  call file_cartesc_enddef( restart_fid ) ! [IN]
1188  endif
1189 
1190  return
1191  end subroutine ocean_vars_restart_enddef
1192 
1193  !-----------------------------------------------------------------------------
1195  subroutine ocean_vars_restart_close
1196  use scale_file_cartesc, only: &
1198  implicit none
1199  !---------------------------------------------------------------------------
1200 
1201  if ( restart_fid /= -1 ) then
1202  log_newline
1203  log_info("OCEAN_vars_restart_close",*) 'Close restart file (OCEAN) '
1204 
1205  call file_cartesc_close( restart_fid ) ! [IN]
1206 
1207  restart_fid = -1
1208  endif
1209 
1210  return
1211  end subroutine ocean_vars_restart_close
1212 
1213  !-----------------------------------------------------------------------------
1215  subroutine ocean_vars_restart_def_var
1216  use scale_file_cartesc, only: &
1218  implicit none
1219 
1220  integer :: i
1221  !---------------------------------------------------------------------------
1222 
1223  if ( restart_fid /= -1 ) then
1224  do i = i_temp, i_temp
1225  call file_cartesc_def_var( restart_fid, & ! [IN]
1226  var_name(i), var_desc(i), var_unit(i), & ! [IN]
1227  'OXY', ocean_restart_out_dtype, & ! [IN]
1228  var_id(i), & ! [OUT]
1229  standard_name=var_stdn(i) ) ! [IN]
1230  enddo
1231  do i = i_ocn_z0m, i_sfc_z0e
1232  call file_cartesc_def_var( restart_fid, & ! [IN]
1233  var_name(i), var_desc(i), var_unit(i), & ! [IN]
1234  'XY', ocean_restart_out_dtype, & ! [IN]
1235  var_id(i), & ! [OUT]
1236  standard_name=var_stdn(i) ) ! [IN]
1237  enddo
1238  if ( ice_flag ) then
1239  do i = i_ice_temp, i_ice_mass
1240  call file_cartesc_def_var( restart_fid, & ! [IN]
1241  var_name(i), var_desc(i), var_unit(i), & ! [IN]
1242  'XY', ocean_restart_out_dtype, & ! [IN]
1243  var_id(i), & ! [OUT]
1244  standard_name=var_stdn(i) ) ! [IN]
1245  enddo
1246  end if
1247  endif
1248 
1249  return
1250  end subroutine ocean_vars_restart_def_var
1251 
1252  !-----------------------------------------------------------------------------
1254  subroutine ocean_vars_restart_write
1255  use scale_file_cartesc, only: &
1256  file_cartesc_write_var
1257  implicit none
1258  !---------------------------------------------------------------------------
1259 
1260  if ( restart_fid /= -1 ) then
1261  call ocean_vars_check( force = .true. )
1262 
1263  call file_cartesc_write_var( restart_fid, var_id(i_temp), & ! [IN]
1264  ocean_temp(:,:,:), & ! [IN]
1265  var_name(i_temp), 'OXY', fill_halo=.true. ) ! [IN]
1266 ! call FILE_CARTESC_write_var( restart_fid, VAR_ID(I_SALT), & ! [IN]
1267 ! OCEAN_SALT(:,:,:), & ! [IN]
1268 ! VAR_NAME(I_SALT), 'OXY', fill_halo=.true. ) ! [IN]
1269 ! call FILE_CARTESC_write_var( restart_fid, VAR_ID(I_UVEL), & ! [IN]
1270 ! OCEAN_UVEL(:,:,:), & ! [IN]
1271 ! VAR_NAME(I_UVEL), 'OXY', fill_halo=.true. ) ! [IN]
1272 ! call FILE_CARTESC_write_var( restart_fid, VAR_ID(I_VVEL), & ! [IN]
1273 ! OCEAN_VVEL(:,:,:), & ! [IN]
1274 ! VAR_NAME(I_VVEL), 'OXY', fill_halo=.true. ) ! [IN]
1275 
1276  call file_cartesc_write_var( restart_fid, var_id(i_ocn_z0m), & ! [IN]
1277  ocean_ocn_z0m(:,:), & ! [IN]
1278  var_name(i_ocn_z0m), 'XY', fill_halo=.true. ) ! [IN]
1279  call file_cartesc_write_var( restart_fid, var_id(i_sfc_temp), & ! [IN]
1280  ocean_sfc_temp(:,:), & ! [IN]
1281  var_name(i_sfc_temp), 'XY', fill_halo=.true. ) ! [IN]
1282  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_ir_dir), & ! [IN]
1283  ocean_sfc_albedo(:,:,i_r_direct ,i_r_ir ), & ! [IN]
1284  var_name(i_sfc_alb_ir_dir), 'XY', fill_halo=.true. ) ! [IN]
1285  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_ir_dif), & ! [IN]
1286  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_ir ), & ! [IN]
1287  var_name(i_sfc_alb_ir_dif), 'XY', fill_halo=.true. ) ! [IN]
1288  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_nir_dir), & ! [IN]
1289  ocean_sfc_albedo(:,:,i_r_direct ,i_r_nir), & ! [IN]
1290  var_name(i_sfc_alb_nir_dir), 'XY', fill_halo=.true. ) ! [IN]
1291  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_nir_dif), & ! [IN]
1292  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_nir), & ! [IN]
1293  var_name(i_sfc_alb_nir_dif), 'XY', fill_halo=.true. ) ! [IN]
1294  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_vis_dir), & ! [IN]
1295  ocean_sfc_albedo(:,:,i_r_direct ,i_r_vis), & ! [IN]
1296  var_name(i_sfc_alb_vis_dir), 'XY', fill_halo=.true. ) ! [IN]
1297  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_vis_dif), & ! [IN]
1298  ocean_sfc_albedo(:,:,i_r_diffuse,i_r_vis), & ! [IN]
1299  var_name(i_sfc_alb_vis_dif), 'XY', fill_halo=.true. ) ! [IN]
1300  call file_cartesc_write_var( restart_fid, var_id(i_sfc_z0m), & ! [IN]
1301  ocean_sfc_z0m(:,:), & ! [IN]
1302  var_name(i_sfc_z0m), 'XY', fill_halo=.true. ) ! [IN]
1303  call file_cartesc_write_var( restart_fid, var_id(i_sfc_z0h), & ! [IN]
1304  ocean_sfc_z0h(:,:), & ! [IN]
1305  var_name(i_sfc_z0h), 'XY', fill_halo=.true. ) ! [IN]
1306  call file_cartesc_write_var( restart_fid, var_id(i_sfc_z0e), & ! [IN]
1307  ocean_sfc_z0e(:,:), & ! [IN]
1308  var_name(i_sfc_z0e), 'XY', fill_halo=.true. ) ! [IN]
1309  if ( ice_flag ) then
1310  call file_cartesc_write_var( restart_fid, var_id(i_ice_temp), & ! [IN]
1311  ocean_ice_temp(:,:), & ! [IN]
1312  var_name(i_ice_temp), 'XY', fill_halo=.true. ) ! [IN]
1313  call file_cartesc_write_var( restart_fid, var_id(i_ice_mass), & ! [IN]
1314  ocean_ice_mass(:,:), & ! [IN]
1315  var_name(i_ice_mass), 'XY', fill_halo=.true. ) ! [IN]
1316  end if
1317  endif
1318 
1319  return
1320  end subroutine ocean_vars_restart_write
1321 
1322 end module mod_ocean_vars
scale_cpl_sfc_index::n_rad_dir
integer, parameter, public n_rad_dir
Definition: scale_cpl_sfc_index.F90:36
scale_statistics
module Statistics
Definition: scale_statistics.F90:11
mod_ocean_vars::ocean_ocn_z0m
real(rp), dimension(:,:), allocatable, public ocean_ocn_z0m
surface roughness length for momentum, open ocean [m]
Definition: mod_ocean_vars.F90:65
mod_ocean_vars::ocean_sflx_mv
real(rp), dimension(:,:), allocatable, public ocean_sflx_mv
ocean surface v-momentum flux [kg/m/s2]
Definition: mod_ocean_vars.F90:113
mod_ocean_vars::ocean_restart_in_postfix_timelabel
logical, public ocean_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
Definition: mod_ocean_vars.F90:52
mod_ocean_admin::ocean_ice_type
character(len=h_short), public ocean_ice_type
Definition: mod_ocean_admin.F90:40
mod_ocean_vars::ocean_sflx_mu
real(rp), dimension(:,:), allocatable, public ocean_sflx_mu
ocean surface u-momentum flux [kg/m/s2]
Definition: mod_ocean_vars.F90:112
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
scale_cpl_sfc_index::i_r_direct
integer, parameter, public i_r_direct
Definition: scale_cpl_sfc_index.F90:37
mod_ocean_vars::atmos_pbl
real(rp), dimension(:,:), allocatable, public atmos_pbl
Definition: mod_ocean_vars.F90:94
mod_ocean_vars::ocean_ice_temp
real(rp), dimension(:,:), allocatable, public ocean_ice_temp
sea ice temperature [K]
Definition: mod_ocean_vars.F90:73
mod_ocean_vars::ocean_oflx_water
real(rp), dimension(:,:), pointer, public ocean_oflx_water
ocean-ice surface water mass flux [kg/m2/s]
Definition: mod_ocean_vars.F90:107
scale_ocean_grid_cartesc_real::ocean_grid_cartesc_real_totarea
real(rp), public ocean_grid_cartesc_real_totarea
total area
Definition: scale_ocean_grid_cartesC_real.F90:37
mod_ocean_vars::atmos_sflx_engi
real(rp), dimension(:,:), allocatable, public atmos_sflx_engi
Definition: mod_ocean_vars.F90:100
scale_tracer::qa
integer, public qa
Definition: scale_tracer.F90:34
mod_ocean_vars::ocean_vars_restart_open
subroutine, public ocean_vars_restart_open
Open ocean restart file for read.
Definition: mod_ocean_vars.F90:585
scale_ocean_grid_cartesc_index::oke
integer, public oke
Definition: scale_ocean_grid_cartesC_index.F90:38
mod_ocean_vars::ocean_sfc_z0e
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0e
ocean surface roughness length for vapor [m]
Definition: mod_ocean_vars.F90:71
scale_ocean_phy_ice_simple
module ocean / physics / ice / simple
Definition: scale_ocean_phy_ice_simple.F90:12
mod_ocean_vars::ocean_vars_restart_read
subroutine, public ocean_vars_restart_read
Read ocean restart.
Definition: mod_ocean_vars.F90:625
mod_ocean_vars::ocean_sflx_mw
real(rp), dimension(:,:), allocatable, public ocean_sflx_mw
ocean surface w-momentum flux [kg/m/s2]
Definition: mod_ocean_vars.F90:111
scale_file_cartesc::file_cartesc_enddef
subroutine, public file_cartesc_enddef(fid)
Exit netCDF file define mode.
Definition: scale_file_cartesC.F90:943
mod_ocean_vars::ocean_salt_t
real(rp), dimension(:,:,:), allocatable, public ocean_salt_t
tendency of OCEAN_OCN_SALT
Definition: mod_ocean_vars.F90:79
scale_file_cartesc::file_cartesc_def_var
subroutine, public file_cartesc_def_var(fid, varname, desc, unit, dim_type, datatype, vid, standard_name, timeintv, nsteps, cell_measures)
Define a variable to file.
Definition: scale_file_cartesC.F90:3307
scale_cpl_sfc_index::i_r_diffuse
integer, parameter, public i_r_diffuse
Definition: scale_cpl_sfc_index.F90:38
mod_ocean_vars::ocean_ice_rlmo
real(rp), dimension(:,:), allocatable, public ocean_ice_rlmo
Definition: mod_ocean_vars.F90:136
mod_ocean_vars::ocean_q2
real(rp), dimension(:,:), allocatable, public ocean_q2
ocean surface water vapor at 2m [kg/kg]
Definition: mod_ocean_vars.F90:120
scale_ocean_grid_cartesc_index::oie
integer, public oie
Definition: scale_ocean_grid_cartesC_index.F90:42
scale_precision
module PRECISION
Definition: scale_precision.F90:14
mod_ocean_vars::ice_flag
logical, public ice_flag
Definition: mod_ocean_vars.F90:141
mod_ocean_vars::ocean_restart_out_dtype
character(len=h_short), public ocean_restart_out_dtype
REAL4 or REAL8.
Definition: mod_ocean_vars.F90:57
scale_cpl_sfc_index::i_r_ir
integer, parameter, public i_r_ir
Definition: scale_cpl_sfc_index.F90:29
mod_ocean_vars::ocean_ustar
real(rp), dimension(:,:), allocatable, target, public ocean_ustar
ocean surface friction velocity [m/s]
Definition: mod_ocean_vars.F90:122
mod_ocean_vars::ocean_temp_t
real(rp), dimension(:,:,:), allocatable, public ocean_temp_t
tendency of OCEAN_OCN_TEMP
Definition: mod_ocean_vars.F90:78
scale_prof::prof_rapstart
subroutine, public prof_rapstart(rapname_base, level, disable_barrier)
Start raptime.
Definition: scale_prof.F90:159
mod_ocean_vars::atmos_cossza
real(rp), dimension(:,:), allocatable, public atmos_cossza
Definition: mod_ocean_vars.F90:98
mod_ocean_vars::ocean_vars_monitor
subroutine, public ocean_vars_monitor
monitor output
Definition: mod_ocean_vars.F90:1024
scale_atmos_hydrometeor
module atmosphere / hydrometeor
Definition: scale_atmos_hydrometeor.F90:12
mod_ocean_vars::ocean_ice_wstar
real(rp), dimension(:,:), allocatable, public ocean_ice_wstar
Definition: mod_ocean_vars.F90:135
scale_ocean_grid_cartesc_index::oka
integer, public oka
Definition: scale_ocean_grid_cartesC_index.F90:36
mod_ocean_vars::ocean_ice_qstar
real(rp), dimension(:,:), allocatable, public ocean_ice_qstar
Definition: mod_ocean_vars.F90:134
scale_ocean_grid_cartesc_index::okmax
integer, public okmax
Definition: scale_ocean_grid_cartesC_index.F90:32
mod_ocean_vars::ocean_v10
real(rp), dimension(:,:), allocatable, public ocean_v10
ocean surface velocity v at 10m [m/s]
Definition: mod_ocean_vars.F90:118
mod_ocean_vars::ocean_sfc_z0m
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0m
ocean surface roughness length for momentum [m]
Definition: mod_ocean_vars.F90:69
mod_ocean_vars::ocean_sflx_qtrc
real(rp), dimension(:,:,:), allocatable, public ocean_sflx_qtrc
ocean surface tracer flux [kg/m2/s]
Definition: mod_ocean_vars.F90:116
scale_ocean_grid_cartesc_real::ocean_grid_cartesc_real_area
real(rp), dimension(:,:), allocatable, public ocean_grid_cartesc_real_area
area of grid cell
Definition: scale_ocean_grid_cartesC_real.F90:36
scale_file_history
module file_history
Definition: scale_file_history.F90:15
scale_ocean_grid_cartesc_index::ois
integer, public ois
Definition: scale_ocean_grid_cartesC_index.F90:41
scale_file
module file
Definition: scale_file.F90:15
mod_ocean_vars::ocean_restart_in_basename
character(len=h_long), public ocean_restart_in_basename
Basename of the input file.
Definition: mod_ocean_vars.F90:50
mod_ocean_vars::ocean_sflx_sh
real(rp), dimension(:,:), allocatable, public ocean_sflx_sh
ocean surface sensible heat flux [J/m2/s]
Definition: mod_ocean_vars.F90:114
mod_ocean_vars::ocean_ocn_tstar
real(rp), dimension(:,:), pointer, public ocean_ocn_tstar
Definition: mod_ocean_vars.F90:128
mod_ocean_vars::ocean_ocn_ustar
real(rp), dimension(:,:), pointer, public ocean_ocn_ustar
Definition: mod_ocean_vars.F90:127
mod_ocean_vars::ocean_oflx_gh
real(rp), dimension(:,:), pointer, public ocean_oflx_gh
ocean-ice surface water heat flux [J/m2/s]
Definition: mod_ocean_vars.F90:106
scale_prc
module PROCESS
Definition: scale_prc.F90:11
mod_ocean_vars::ocean_restart_output
logical, public ocean_restart_output
Output restart file?
Definition: mod_ocean_vars.F90:48
mod_ocean_vars::ocean_sflx_gh
real(rp), dimension(:,:), allocatable, target, public ocean_sflx_gh
ocean surface water heat flux [J/m2/s]
Definition: mod_ocean_vars.F90:103
scale_precision::rp
integer, parameter, public rp
Definition: scale_precision.F90:41
scale_ocean_grid_cartesc_index::oje
integer, public oje
Definition: scale_ocean_grid_cartesC_index.F90:46
mod_ocean_vars::ocean_vvel_t
real(rp), dimension(:,:,:), allocatable, public ocean_vvel_t
tendency of OCEAN_OCN_VVEL
Definition: mod_ocean_vars.F90:81
mod_ocean_vars::ocean_ocn_qstar
real(rp), dimension(:,:), pointer, public ocean_ocn_qstar
Definition: mod_ocean_vars.F90:129
scale_io
module STDIO
Definition: scale_io.F90:10
mod_ocean_vars::ocean_engi_supl
real(rp), dimension(:,:), allocatable, public ocean_engi_supl
Definition: mod_ocean_vars.F90:145
mod_ocean_vars::atmos_sflx_water
real(rp), dimension(:,:), allocatable, public atmos_sflx_water
Definition: mod_ocean_vars.F90:99
mod_ocean_vars::ocean_vars_restart_def_var
subroutine, public ocean_vars_restart_def_var
Define ocean variables in restart file.
Definition: mod_ocean_vars.F90:1216
scale_cpl_sfc_index::i_r_nir
integer, parameter, public i_r_nir
Definition: scale_cpl_sfc_index.F90:30
mod_ocean_vars::ocean_sfc_z0h
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0h
ocean surface roughness length for heat [m]
Definition: mod_ocean_vars.F90:70
mod_ocean_admin
module Ocean admin
Definition: mod_ocean_admin.F90:11
scale_ocean_grid_cartesc_index::oja
integer, public oja
Definition: scale_ocean_grid_cartesC_index.F90:44
mod_ocean_vars::ocean_uvel_t
real(rp), dimension(:,:,:), allocatable, public ocean_uvel_t
tendency of OCEAN_OCN_UVEL
Definition: mod_ocean_vars.F90:80
scale_tracer::k
real(rp), public k
Definition: scale_tracer.F90:44
scale_const
module CONSTANT
Definition: scale_const.F90:11
mod_ocean_vars::ocean_uvel
real(rp), dimension(:,:,:), allocatable, public ocean_uvel
ocean zonal velocity [m/s]
Definition: mod_ocean_vars.F90:62
scale_debug::check
subroutine, public check(current_line, v)
Undefined value checker.
Definition: scale_debug.F90:56
mod_ocean_vars::atmos_sflx_rad_dn
real(rp), dimension(:,:,:,:), allocatable, public atmos_sflx_rad_dn
Definition: mod_ocean_vars.F90:97
mod_ocean_vars::ocean_vars_restart_enddef
subroutine, public ocean_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_ocean_vars.F90:1181
mod_ocean_vars::atmos_sfc_dens
real(rp), dimension(:,:), allocatable, public atmos_sfc_dens
Definition: mod_ocean_vars.F90:95
mod_ocean_vars::ocean_vars_restart_close
subroutine, public ocean_vars_restart_close
Close restart file.
Definition: mod_ocean_vars.F90:1196
mod_ocean_vars::ocean_ice_temp_t
real(rp), dimension(:,:), allocatable, public ocean_ice_temp_t
tendency of OCEAN_ICE_TEMP
Definition: mod_ocean_vars.F90:83
scale_file_cartesc::file_cartesc_close
subroutine, public file_cartesc_close(fid)
Close a netCDF file.
Definition: scale_file_cartesC.F90:1023
mod_ocean_vars::ocean_restart_out_postfix_timelabel
logical, public ocean_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
Definition: mod_ocean_vars.F90:55
scale_ocean_phy_ice_simple::ocean_phy_ice_freezetemp
real(rp), public ocean_phy_ice_freezetemp
Definition: scale_ocean_phy_ice_simple.F90:44
scale_prof
module profiler
Definition: scale_prof.F90:11
mod_ocean_vars::ocean_tstar
real(rp), dimension(:,:), allocatable, target, public ocean_tstar
ocean surface tempreture scale [K]
Definition: mod_ocean_vars.F90:123
mod_ocean_vars::atmos_temp
real(rp), dimension(:,:), allocatable, public atmos_temp
Definition: mod_ocean_vars.F90:87
mod_ocean_vars::ocean_restart_out_aggregate
logical, public ocean_restart_out_aggregate
Switch to use aggregate file.
Definition: mod_ocean_vars.F90:54
mod_ocean_vars
module OCEAN Variables
Definition: mod_ocean_vars.F90:12
scale_ocean_grid_cartesc_index
module ocean / grid / cartesianC / index
Definition: scale_ocean_grid_cartesC_index.F90:11
scale_monitor::monitor_reg
subroutine, public monitor_reg(name, desc, unit, itemid, ndims, dim_type, is_tendency)
Search existing item, or matching check between requested and registered item.
Definition: scale_monitor.F90:241
mod_ocean_vars::ocean_vars_history
subroutine, public ocean_vars_history
History output set for ocean variables.
Definition: mod_ocean_vars.F90:706
scale_time
module TIME
Definition: scale_time.F90:11
mod_ocean_vars::ocean_ocn_rlmo
real(rp), dimension(:,:), pointer, public ocean_ocn_rlmo
Definition: mod_ocean_vars.F90:131
mod_ocean_vars::ocean_wstar
real(rp), dimension(:,:), allocatable, target, public ocean_wstar
ocean surface convective velocity scale [m/s]
Definition: mod_ocean_vars.F90:125
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
scale_atmos_hydrometeor::i_qv
integer, public i_qv
Definition: scale_atmos_hydrometeor.F90:77
mod_ocean_vars::ocean_mass_supl
real(rp), dimension(:,:), allocatable, public ocean_mass_supl
Definition: mod_ocean_vars.F90:144
mod_ocean_vars::ocean_oflx_engi
real(rp), dimension(:,:), pointer, public ocean_oflx_engi
ocean-ice surface internal energy flux [J/m2/s]
Definition: mod_ocean_vars.F90:108
mod_ocean_vars::ocean_sflx_water
real(rp), dimension(:,:), allocatable, target, public ocean_sflx_water
ocean surface water mass flux [kg/m2/s]
Definition: mod_ocean_vars.F90:104
scale_const::const_dwatr
real(rp), parameter, public const_dwatr
density of water [kg/m3]
Definition: scale_const.F90:82
mod_ocean_vars::ocean_ice_tstar
real(rp), dimension(:,:), allocatable, public ocean_ice_tstar
Definition: mod_ocean_vars.F90:133
scale_landuse::landuse_exists_ocean
logical, dimension(:,:), allocatable, public landuse_exists_ocean
ocean calculation flag
Definition: scale_landuse.F90:49
scale_debug
module DEBUG
Definition: scale_debug.F90:11
mod_ocean_admin::ocean_do
logical, public ocean_do
Definition: mod_ocean_admin.F90:32
mod_ocean_vars::ocean_ice_mass
real(rp), dimension(:,:), allocatable, public ocean_ice_mass
sea ice mass [kg]
Definition: mod_ocean_vars.F90:74
scale_file_cartesc::file_cartesc_create
subroutine, public file_cartesc_create(basename, title, datatype, fid, date, subsec, haszcoord, append, aggregate, single)
Create/open a netCDF file.
Definition: scale_file_cartesC.F90:780
scale_ocean_grid_cartesc_real::ocean_grid_cartesc_real_vol
real(rp), dimension(:,:,:), allocatable, public ocean_grid_cartesc_real_vol
volume of grid cell
Definition: scale_ocean_grid_cartesC_real.F90:38
mod_ocean_vars::ocean_vvel
real(rp), dimension(:,:,:), allocatable, public ocean_vvel
ocean meridional velocity [m/s]
Definition: mod_ocean_vars.F90:63
mod_ocean_vars::ocean_restart_in_aggregate
logical, public ocean_restart_in_aggregate
Switch to use aggregate file.
Definition: mod_ocean_vars.F90:51
scale_file_cartesc::file_cartesc_open
subroutine, public file_cartesc_open(basename, fid, aggregate)
open a netCDF file for read
Definition: scale_file_cartesC.F90:746
scale_statistics::statistics_checktotal
logical, public statistics_checktotal
calc&report variable totals to logfile?
Definition: scale_statistics.F90:64
scale_file_cartesc::file_cartesc_flush
subroutine, public file_cartesc_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
Definition: scale_file_cartesC.F90:997
scale_time::time_gettimelabel
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:91
scale_cpl_sfc_index
module coupler / surface-atmospehre
Definition: scale_cpl_sfc_index.F90:11
mod_ocean_vars::ocean_sflx_engi
real(rp), dimension(:,:), allocatable, target, public ocean_sflx_engi
ocean surface internal energy flux [J/m2/s]
Definition: mod_ocean_vars.F90:105
scale_ocean_grid_cartesc_index::ojs
integer, public ojs
Definition: scale_ocean_grid_cartesC_index.F90:45
scale_cpl_sfc_index::i_r_vis
integer, parameter, public i_r_vis
Definition: scale_cpl_sfc_index.F90:31
mod_ocean_vars::ocean_vars_setup
subroutine, public ocean_vars_setup
Setup.
Definition: mod_ocean_vars.F90:284
mod_ocean_vars::atmos_v
real(rp), dimension(:,:), allocatable, public atmos_v
Definition: mod_ocean_vars.F90:91
mod_ocean_vars::ocean_sfc_albedo
real(rp), dimension(:,:,:,:), allocatable, public ocean_sfc_albedo
ocean surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
Definition: mod_ocean_vars.F90:68
mod_ocean_vars::atmos_dens
real(rp), dimension(:,:), allocatable, public atmos_dens
Definition: mod_ocean_vars.F90:92
mod_ocean_vars::ocean_sfc_temp
real(rp), dimension(:,:), allocatable, public ocean_sfc_temp
ocean surface skin temperature [K]
Definition: mod_ocean_vars.F90:67
scale_atmos_hydrometeor::lhf
real(rp), public lhf
latent heat of fusion for use [J/kg]
Definition: scale_atmos_hydrometeor.F90:128
scale_file::file_get_aggregate
logical function, public file_get_aggregate(fid)
Definition: scale_file.F90:4844
mod_ocean_vars::ocean_vars_restart_write
subroutine, public ocean_vars_restart_write
Write ocean variables to restart file.
Definition: mod_ocean_vars.F90:1255
scale_ocean_phy_ice_simple::ocean_phy_ice_fraction
subroutine, public ocean_phy_ice_fraction(OIA, OIS, OIE, OJA, OJS, OJE, ICE_MASS, ICE_FRAC)
Definition: scale_ocean_phy_ice_simple.F90:170
scale_prof::prof_rapend
subroutine, public prof_rapend(rapname_base, level, disable_barrier)
Save raptime.
Definition: scale_prof.F90:217
scale_ocean_grid_cartesc_real
module ocean / grid / cartesianC / real
Definition: scale_ocean_grid_cartesC_real.F90:12
mod_ocean_vars::ocean_rlmo
real(rp), dimension(:,:), allocatable, target, public ocean_rlmo
ocean surface inversed Obukhov length [1/m]
Definition: mod_ocean_vars.F90:126
scale_ocean_grid_cartesc_index::oia
integer, public oia
Definition: scale_ocean_grid_cartesC_index.F90:40
mod_ocean_vars::ocean_ice_frac
real(rp), dimension(:,:), allocatable, public ocean_ice_frac
area fraction of sea ice [1]
Definition: mod_ocean_vars.F90:139
mod_ocean_vars::ocean_sflx_lh
real(rp), dimension(:,:), allocatable, public ocean_sflx_lh
ocean surface latent heat flux [J/m2/s]
Definition: mod_ocean_vars.F90:115
mod_ocean_vars::ocean_salt
real(rp), dimension(:,:,:), allocatable, public ocean_salt
ocean salinity [PSU]
Definition: mod_ocean_vars.F90:61
scale_landuse
module LANDUSE
Definition: scale_landuse.F90:19
mod_ocean_vars::ocean_ice_mass_t
real(rp), dimension(:,:), allocatable, public ocean_ice_mass_t
tendency of OCEAN_ICE_MASS
Definition: mod_ocean_vars.F90:84
mod_ocean_vars::atmos_pres
real(rp), dimension(:,:), allocatable, public atmos_pres
Definition: mod_ocean_vars.F90:88
scale_cpl_sfc_index::n_rad_rgn
integer, parameter, public n_rad_rgn
Definition: scale_cpl_sfc_index.F90:28
mod_ocean_vars::ocean_u10
real(rp), dimension(:,:), allocatable, public ocean_u10
ocean surface velocity u at 10m [m/s]
Definition: mod_ocean_vars.F90:117
scale_const::const_undef
real(rp), public const_undef
Definition: scale_const.F90:41
mod_ocean_vars::atmos_u
real(rp), dimension(:,:), allocatable, public atmos_u
Definition: mod_ocean_vars.F90:90
mod_ocean_vars::ocean_restart_out_basename
character(len=h_long), public ocean_restart_out_basename
Basename of the output file.
Definition: mod_ocean_vars.F90:53
mod_ocean_vars::ocean_restart_out_title
character(len=h_mid), public ocean_restart_out_title
Title of the output file.
Definition: mod_ocean_vars.F90:56
mod_ocean_vars::atmos_w
real(rp), dimension(:,:), allocatable, public atmos_w
Definition: mod_ocean_vars.F90:89
scale_io::io_fid_conf
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:56
scale_file_cartesc
module file / cartesianC
Definition: scale_file_cartesC.F90:11
mod_ocean_vars::ocean_ocn_wstar
real(rp), dimension(:,:), pointer, public ocean_ocn_wstar
Definition: mod_ocean_vars.F90:130
mod_ocean_vars::ocean_qstar
real(rp), dimension(:,:), allocatable, target, public ocean_qstar
ocean surface moisture scale [kg/kg]
Definition: mod_ocean_vars.F90:124
scale_atmos_hydrometeor::cv_water
real(rp), public cv_water
CV for water [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:132
mod_ocean_vars::ocean_t2
real(rp), dimension(:,:), allocatable, public ocean_t2
ocean surface temperature at 2m [K]
Definition: mod_ocean_vars.F90:119
mod_ocean_vars::ocean_vars_restart_create
subroutine, public ocean_vars_restart_create
Create ocean restart file.
Definition: mod_ocean_vars.F90:1144
scale_ocean_grid_cartesc_real::ocean_grid_cartesc_real_totvol
real(rp), public ocean_grid_cartesc_real_totvol
total volume
Definition: scale_ocean_grid_cartesC_real.F90:39
scale_atmos_hydrometeor::cv_ice
real(rp), public cv_ice
CV for ice [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:134
mod_ocean_vars::atmos_sfc_pres
real(rp), dimension(:,:), allocatable, public atmos_sfc_pres
Definition: mod_ocean_vars.F90:96
mod_ocean_vars::ocean_vars_check
subroutine, public ocean_vars_check(force)
Budget monitor for ocean.
Definition: mod_ocean_vars.F90:837
mod_ocean_vars::ocean_temp
real(rp), dimension(:,:,:), allocatable, public ocean_temp
ocean temperature [K]
Definition: mod_ocean_vars.F90:60
mod_ocean_vars::ocean_ice_ustar
real(rp), dimension(:,:), allocatable, public ocean_ice_ustar
Definition: mod_ocean_vars.F90:132
mod_ocean_vars::atmos_qv
real(rp), dimension(:,:), allocatable, public atmos_qv
Definition: mod_ocean_vars.F90:93
scale_ocean_grid_cartesc_index::oks
integer, public oks
Definition: scale_ocean_grid_cartesC_index.F90:37
scale_monitor
module MONITOR
Definition: scale_monitor.F90:12