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