SCALE-RM
mod_atmos_phy_sf_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
21  use scale_tracer
23  !-----------------------------------------------------------------------------
24  implicit none
25  private
26  !-----------------------------------------------------------------------------
27  !
28  !++ Public procedure
29  !
30  public :: atmos_phy_sf_vars_setup
34 
40 
41  !-----------------------------------------------------------------------------
42  !
43  !++ Public parameters & variables
44  !
45  logical, public :: atmos_phy_sf_restart_output = .false.
46 
47  character(len=H_LONG), public :: atmos_phy_sf_restart_in_basename = ''
49  logical, public :: atmos_phy_sf_restart_in_postfix_timelabel = .false.
50  character(len=H_LONG), public :: atmos_phy_sf_restart_out_basename = ''
52  logical, public :: atmos_phy_sf_restart_out_postfix_timelabel = .true.
53  character(len=H_MID), public :: atmos_phy_sf_restart_out_title = 'ATMOS_PHY_SF restart'
54  character(len=H_SHORT), public :: atmos_phy_sf_restart_out_dtype = 'DEFAULT'
55 
56  real(RP), public, allocatable :: atmos_phy_sf_dens_t (:,:) ! tendency DENS [ kg/m3/s]
57  real(RP), public, allocatable :: atmos_phy_sf_momz_t (:,:) ! tendency MOMZ [m/s*kg/m2/s]
58  real(RP), public, allocatable :: atmos_phy_sf_rhou_t (:,:) ! tendency rho*U [m/s*kg/m2/s]
59  real(RP), public, allocatable :: atmos_phy_sf_rhov_t (:,:) ! tendency rho*V [m/s*kg/m2/s]
60  real(RP), public, allocatable :: atmos_phy_sf_rhoh (:,:) ! diabatic heating [J/m3/s]
61  real(RP), public, allocatable :: atmos_phy_sf_rhot_t (:,:) ! tendency RHOT [K *kg/m3/s]
62  real(RP), public, allocatable :: atmos_phy_sf_rhoq_t (:,:,:) ! tendency rho*QTRC [ kg/kg/s]
63 
64  real(RP), public, allocatable :: atmos_phy_sf_sfc_temp (:,:) ! surface skin temperature [K]
65  real(RP), public, allocatable :: atmos_phy_sf_sfc_albedo(:,:,:,:) ! surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
66  real(RP), public, allocatable :: atmos_phy_sf_sfc_z0m (:,:) ! surface roughness length, ocean only [m]
67  real(RP), public, allocatable :: atmos_phy_sf_sfc_z0h (:,:) ! surface roughness length, ocean only [m]
68  real(RP), public, allocatable :: atmos_phy_sf_sfc_z0e (:,:) ! surface roughness length, ocean only [m]
69 
70  ! surface diagnostic variables
71  real(RP), public, allocatable :: atmos_phy_sf_sfc_dens (:,:) ! surface atmosphere density [kg/m3]
72  real(RP), public, allocatable :: atmos_phy_sf_sfc_pres (:,:) ! surface atmosphere pressure [Pa]
73 
74  real(RP), public, allocatable :: atmos_phy_sf_sflx_mw (:,:) ! z-momentum flux (area center) [m/s*kg/m2/s]
75  real(RP), public, allocatable :: atmos_phy_sf_sflx_mu (:,:) ! x-momentum flux (area center) [m/s*kg/m2/s]
76  real(RP), public, allocatable :: atmos_phy_sf_sflx_mv (:,:) ! y-momentum flux (area center) [m/s*kg/m2/s]
77  real(RP), public, allocatable :: atmos_phy_sf_sflx_sh (:,:) ! sensible heat flux [J/m2/s]
78  real(RP), public, allocatable :: atmos_phy_sf_sflx_lh (:,:) ! latent heat flux [J/m2/s]
79  real(RP), public, allocatable :: atmos_phy_sf_sflx_gh (:,:) ! ground heat flux [J/m2/s]
80  real(RP), public, allocatable, target :: atmos_phy_sf_sflx_qtrc (:,:,:) ! tracer mass flux [kg/m2/s]
81  real(RP), public, pointer :: atmos_phy_sf_sflx_qv (:,:)
82 
83  real(RP), public, allocatable :: atmos_phy_sf_u10 (:,:) ! 10m x-wind [m/s]
84  real(RP), public, allocatable :: atmos_phy_sf_v10 (:,:) ! 10m y-wind [m/s]
85  real(RP), public, allocatable :: atmos_phy_sf_t2 (:,:) ! 2m temperature [K]
86  real(RP), public, allocatable :: atmos_phy_sf_q2 (:,:) ! 2m specific humidity [kg/kg]
87 
88  real(RP), public, allocatable :: atmos_phy_sf_l_mo (:,:) ! monin-obukov length
89 
90 ! real(RP), public, allocatable :: ATMOS_PHY_SF_SFLX_QEMIS(:,:,:) ! tracer emission flux [kg/m2/s]
91 ! real(RP), public, allocatable :: ATMOS_PHY_SF_SFLX_QDEP (:,:,:) ! tracer deposition flux [kg/m2/s]
92 ! real(RP), public, allocatable :: ATMOS_PHY_SF_SFLX_VDEP (:,:,:) ! tracer deposition velocity [m/s]
93 
94  !-----------------------------------------------------------------------------
95  !
96  !++ Private procedure
97  !
98  !-----------------------------------------------------------------------------
99  !
100  !++ Private parameters & variables
101  !
102  integer, private, parameter :: vmax = 10
103  integer, private, parameter :: i_sfc_temp = 1
104  integer, private, parameter :: i_sfc_alb_ir_dir = 2
105  integer, private, parameter :: i_sfc_alb_ir_dif = 3
106  integer, private, parameter :: i_sfc_alb_nir_dir = 4
107  integer, private, parameter :: i_sfc_alb_nir_dif = 5
108  integer, private, parameter :: i_sfc_alb_vis_dir = 6
109  integer, private, parameter :: i_sfc_alb_vis_dif = 7
110  integer, private, parameter :: i_sfc_z0m = 8
111  integer, private, parameter :: i_sfc_z0h = 9
112  integer, private, parameter :: i_sfc_z0e = 10
113 
114  character(len=H_SHORT), private :: var_name(vmax)
115  character(len=H_MID), private :: var_desc(vmax)
116  character(len=H_MID), private :: var_stdn(vmax)
117  character(len=H_SHORT), private :: var_unit(vmax)
118  integer, private :: var_id(vmax)
119  integer, private :: restart_fid = -1 ! file ID
120 
121  data var_name / 'SFC_TEMP', &
122  'SFC_ALB_IR_dir', &
123  'SFC_ALB_IR_dif', &
124  'SFC_ALB_NIR_dir', &
125  'SFC_ALB_NIR_dif', &
126  'SFC_ALB_VIS_dir', &
127  'SFC_ALB_VIS_dif', &
128  'SFC_Z0M', &
129  'SFC_Z0H', &
130  'SFC_Z0E' /
131 
132  data var_desc / 'surface skin temperature', &
133  'surface albedo for IR, direct ', &
134  'surface albedo for IR, diffuse', &
135  'surface albedo for NIR, direct ', &
136  'surface albedo for NIR, diffuse', &
137  'surface albedo for VIS, direct ', &
138  'surface albedo for VIS, diffuse', &
139  'surface roughness length (momentum)', &
140  'surface roughness length (heat)', &
141  'surface roughness length (vapor)' /
142 
143  data var_stdn / 'surface_temp', &
144  '', &
145  '', &
146  '', &
147  '', &
148  '', &
149  '', &
150  'surface_roughness_length_for_momentum_in_air', &
151  'surface_roughness_length_for_heat_in_air', &
152  '' /
153 
154  data var_unit / 'K', &
155  '1', &
156  '1', &
157  '1', &
158  '1', &
159  '1', &
160  '1', &
161  'm', &
162  'm', &
163  'm' /
164 
165  real(RP), private :: atmos_phy_sf_default_sfc_temp = 300.0_rp
166  real(RP), private :: atmos_phy_sf_default_sfc_albedo_lw = 0.04_rp
167  real(RP), private :: atmos_phy_sf_default_sfc_albedo_sw = 0.10_rp
168  real(RP), private :: atmos_phy_sf_default_sfc_z0 = 1e-4_rp
169 
170  real(RP), allocatable, target :: zero(:,:)
171 
172  !-----------------------------------------------------------------------------
173 contains
174  !-----------------------------------------------------------------------------
176  subroutine atmos_phy_sf_vars_setup
177  use scale_prc, only: &
178  prc_abort
179  use scale_const, only: &
180  undef => const_undef
181  use scale_atmos_hydrometeor, only: &
182  i_qv
183  implicit none
184 
185  namelist / param_atmos_phy_sf_vars / &
195  atmos_phy_sf_default_sfc_temp, &
196  atmos_phy_sf_default_sfc_albedo_lw, &
197  atmos_phy_sf_default_sfc_albedo_sw, &
198  atmos_phy_sf_default_sfc_z0
199 
200  integer :: ierr
201  integer :: iv
202  !---------------------------------------------------------------------------
203 
204  log_newline
205  log_info("ATMOS_PHY_SF_vars_setup",*) 'Setup'
206 
207  allocate( atmos_phy_sf_dens_t(ia,ja) )
208  allocate( atmos_phy_sf_momz_t(ia,ja) )
209  allocate( atmos_phy_sf_rhou_t(ia,ja) )
210  allocate( atmos_phy_sf_rhov_t(ia,ja) )
211  allocate( atmos_phy_sf_rhot_t(ia,ja) )
212  allocate( atmos_phy_sf_rhoh(ia,ja) )
213  allocate( atmos_phy_sf_rhoq_t(ia,ja,qa) )
214  atmos_phy_sf_dens_t(:,:) = undef
215  atmos_phy_sf_momz_t(:,:) = undef
216  atmos_phy_sf_rhou_t(:,:) = undef
217  atmos_phy_sf_rhov_t(:,:) = undef
218  atmos_phy_sf_rhot_t(:,:) = undef
219  atmos_phy_sf_rhoh(:,:) = undef
220  atmos_phy_sf_rhoq_t(:,:,:) = undef
221 
222  allocate( atmos_phy_sf_sfc_temp(ia,ja) )
224  allocate( atmos_phy_sf_sfc_z0m(ia,ja) )
225  allocate( atmos_phy_sf_sfc_z0h(ia,ja) )
226  allocate( atmos_phy_sf_sfc_z0e(ia,ja) )
227  atmos_phy_sf_sfc_temp(:,:) = atmos_phy_sf_default_sfc_temp
228  atmos_phy_sf_sfc_albedo(:,:,i_r_direct ,i_r_ir ) = atmos_phy_sf_default_sfc_albedo_lw
229  atmos_phy_sf_sfc_albedo(:,:,i_r_diffuse,i_r_ir ) = atmos_phy_sf_default_sfc_albedo_lw
230  atmos_phy_sf_sfc_albedo(:,:,i_r_direct ,i_r_nir) = atmos_phy_sf_default_sfc_albedo_sw
231  atmos_phy_sf_sfc_albedo(:,:,i_r_diffuse,i_r_nir) = atmos_phy_sf_default_sfc_albedo_sw
232  atmos_phy_sf_sfc_albedo(:,:,i_r_direct ,i_r_vis) = atmos_phy_sf_default_sfc_albedo_sw
233  atmos_phy_sf_sfc_albedo(:,:,i_r_diffuse,i_r_vis) = atmos_phy_sf_default_sfc_albedo_sw
234  atmos_phy_sf_sfc_z0m(:,:) = atmos_phy_sf_default_sfc_z0
235  atmos_phy_sf_sfc_z0h(:,:) = atmos_phy_sf_default_sfc_z0
236  atmos_phy_sf_sfc_z0e(:,:) = atmos_phy_sf_default_sfc_z0
237 
238  allocate( atmos_phy_sf_sfc_dens(ia,ja) )
239  allocate( atmos_phy_sf_sfc_pres(ia,ja) )
240  atmos_phy_sf_sfc_dens(:,:) = undef
241  atmos_phy_sf_sfc_pres(:,:) = undef
242 
243  allocate( atmos_phy_sf_sflx_mw(ia,ja) )
244  allocate( atmos_phy_sf_sflx_mu(ia,ja) )
245  allocate( atmos_phy_sf_sflx_mv(ia,ja) )
246  allocate( atmos_phy_sf_sflx_sh(ia,ja) )
247  allocate( atmos_phy_sf_sflx_lh(ia,ja) )
248  allocate( atmos_phy_sf_sflx_gh(ia,ja) )
249  allocate( atmos_phy_sf_sflx_qtrc(ia,ja,max(qa,1)) )
250  atmos_phy_sf_sflx_mw(:,:) = undef
251  atmos_phy_sf_sflx_mu(:,:) = undef
252  atmos_phy_sf_sflx_mv(:,:) = undef
253  atmos_phy_sf_sflx_sh(:,:) = undef
254  atmos_phy_sf_sflx_lh(:,:) = undef
255  atmos_phy_sf_sflx_gh(:,:) = undef
256  atmos_phy_sf_sflx_qtrc(:,:,:) = undef
257 
258  allocate( atmos_phy_sf_u10(ia,ja) )
259  allocate( atmos_phy_sf_v10(ia,ja) )
260  allocate( atmos_phy_sf_t2(ia,ja) )
261  allocate( atmos_phy_sf_q2(ia,ja) )
262  allocate( atmos_phy_sf_l_mo(ia,ja) )
263  atmos_phy_sf_u10(:,:) = undef
264  atmos_phy_sf_v10(:,:) = undef
265  atmos_phy_sf_t2(:,:) = undef
266  atmos_phy_sf_q2(:,:) = undef
267  atmos_phy_sf_l_mo(:,:) = undef
268 
269  !--- read namelist
270  rewind(io_fid_conf)
271  read(io_fid_conf,nml=param_atmos_phy_sf_vars,iostat=ierr)
272  if( ierr < 0 ) then !--- missing
273  log_info("ATMOS_PHY_SF_vars_setup",*) 'Not found namelist. Default used.'
274  elseif( ierr > 0 ) then !--- fatal error
275  log_error("ATMOS_PHY_SF_vars_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_SF_VARS. Check!'
276  call prc_abort
277  endif
278  log_nml(param_atmos_phy_sf_vars)
279 
280  log_newline
281  log_info("ATMOS_PHY_SF_vars_setup",*) '[ATMOS_PHY_SF] prognostic/diagnostic variables'
282  log_info_cont('(1x,A,A24,A,A48,A,A12,A)') &
283  ' |', 'VARNAME ','|', &
284  'DESCRIPTION ', '[', 'UNIT ', ']'
285  do iv = 1, vmax
286  log_info_cont('(1x,A,I3,A,A24,A,A48,A,A12,A)') &
287  'NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
288  enddo
289 
290  log_newline
291  if ( atmos_phy_sf_restart_in_basename /= '' ) then
292  log_info("ATMOS_PHY_SF_vars_setup",*) 'Restart input? : YES, file = ', trim(atmos_phy_sf_restart_in_basename)
293  log_info("ATMOS_PHY_SF_vars_setup",*) 'Add timelabel? : ', atmos_phy_sf_restart_in_postfix_timelabel
294  else
295  log_info("ATMOS_PHY_SF_vars_setup",*) 'Restart input? : NO'
296  endif
298  .AND. atmos_phy_sf_restart_out_basename /= '' ) then
299  log_info("ATMOS_PHY_SF_vars_setup",*) 'Restart output? : YES, file = ', trim(atmos_phy_sf_restart_out_basename)
300  log_info("ATMOS_PHY_SF_vars_setup",*) 'Add timelabel? : ', atmos_phy_sf_restart_out_postfix_timelabel
301  else
302  log_info("ATMOS_PHY_SF_vars_setup",*) 'Restart output? : NO'
304  endif
305 
306  if ( i_qv > 0 ) then
308  else
309  allocate( zero(ia,ja) )
310  atmos_phy_sf_sflx_qv => zero
311  end if
312 
313  return
314  end subroutine atmos_phy_sf_vars_setup
315 
316  !-----------------------------------------------------------------------------
318  subroutine atmos_phy_sf_vars_fillhalo
319  use scale_comm_cartesc, only: &
320  comm_vars8, &
321  comm_wait
322  implicit none
323 
324  integer :: n ,idir, irgn
325  !---------------------------------------------------------------------------
326 
327  call comm_vars8( atmos_phy_sf_sfc_temp(:,:), 1 )
328  call comm_vars8( atmos_phy_sf_sfc_z0m(:,:), 2 )
329  call comm_vars8( atmos_phy_sf_sfc_z0h(:,:), 3 )
330  call comm_vars8( atmos_phy_sf_sfc_z0e(:,:), 4 )
331 
332  n = 4
333  do irgn = i_r_ir, i_r_vis
334  do idir = i_r_direct, i_r_diffuse
335  n = n + 1
336  call comm_vars8( atmos_phy_sf_sfc_albedo(:,:,idir,irgn), n )
337  enddo
338  enddo
339 
340  call comm_wait ( atmos_phy_sf_sfc_temp(:,:), 1 )
341  call comm_wait ( atmos_phy_sf_sfc_z0m(:,:), 2 )
342  call comm_wait ( atmos_phy_sf_sfc_z0h(:,:), 3 )
343  call comm_wait ( atmos_phy_sf_sfc_z0e(:,:), 4 )
344 
345  n = 4
346  do irgn = i_r_ir, i_r_vis
347  do idir = i_r_direct, i_r_diffuse
348  n = n + 1
349  call comm_wait ( atmos_phy_sf_sfc_albedo(:,:,idir,irgn), n )
350  enddo
351  enddo
352 
353  return
354  end subroutine atmos_phy_sf_vars_fillhalo
355 
356  !-----------------------------------------------------------------------------
359  use scale_time, only: &
361  use scale_file_cartesc, only: &
363  implicit none
364 
365  character(len=19) :: timelabel
366  character(len=H_LONG) :: basename
367  !---------------------------------------------------------------------------
368 
369  log_newline
370  log_info("ATMOS_PHY_SF_vars_restart_open",*) 'Open restart file (ATMOS_PHY_SF) '
371 
372  if ( atmos_phy_sf_restart_in_basename /= '' ) then
373 
375  call time_gettimelabel( timelabel )
376  basename = trim(atmos_phy_sf_restart_in_basename)//'_'//trim(timelabel)
377  else
378  basename = trim(atmos_phy_sf_restart_in_basename)
379  endif
380 
381  log_info("ATMOS_PHY_SF_vars_restart_open",*) 'basename: ', trim(basename)
382 
383  call file_cartesc_open( basename, restart_fid, aggregate=atmos_phy_sf_restart_in_aggregate )
384 
385  else
386  log_info("ATMOS_PHY_SF_vars_restart_open",*) 'restart file for ATMOS_PHY_SF is not specified.'
387  endif
388 
389  return
390  end subroutine atmos_phy_sf_vars_restart_open
391 
392  !-----------------------------------------------------------------------------
395  use scale_file, only: &
397  use scale_file_cartesc, only: &
398  file_cartesc_read, &
400  implicit none
401  !---------------------------------------------------------------------------
402 
403  if ( restart_fid /= -1 ) then
404  log_newline
405  log_info("ATMOS_PHY_SF_vars_restart_read",*) 'Read from restart file (ATMOS_PHY_SF) '
406 
407  call file_cartesc_read( restart_fid, var_name(i_sfc_temp), 'XY', & ! [IN]
408  atmos_phy_sf_sfc_temp(:,:) ) ! [OUT]
409  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_ir_dir), 'XY', & ! [IN]
410  atmos_phy_sf_sfc_albedo(:,:,i_r_direct ,i_r_ir ) ) ! [OUT]
411  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_ir_dif), 'XY', & ! [IN]
413  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_nir_dir), 'XY', & ! [IN]
415  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_nir_dif), 'XY', & ! [IN]
417  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_vis_dir), 'XY', & ! [IN]
419  call file_cartesc_read( restart_fid, var_name(i_sfc_alb_vis_dif), 'XY', & ! [IN]
421  call file_cartesc_read( restart_fid, var_name(i_sfc_z0m), 'XY', & ! [IN]
422  atmos_phy_sf_sfc_z0m(:,:) ) ! [OUT]
423  call file_cartesc_read( restart_fid, var_name(i_sfc_z0h), 'XY', & ! [IN]
424  atmos_phy_sf_sfc_z0h(:,:) ) ! [OUT]
425  call file_cartesc_read( restart_fid, var_name(i_sfc_z0e), 'XY', & ! [IN]
426  atmos_phy_sf_sfc_z0e(:,:) ) ! [OUT]
427 
428  if ( file_get_aggregate(restart_fid) ) then
429  call file_cartesc_flush( restart_fid ) ! X/Y halos have been read from file
430  else
432  end if
433 
435 
436  else
437  log_info("ATMOS_PHY_SF_vars_restart_read",*) 'invalid restart file ID for ATMOS_PHY_SF.'
438  endif
439 
440  return
441  end subroutine atmos_phy_sf_vars_restart_read
442 
443  !-----------------------------------------------------------------------------
446  use scale_time, only: &
448  use scale_file_cartesc, only: &
450  implicit none
451 
452  character(len=19) :: timelabel
453  character(len=H_LONG) :: basename
454  !---------------------------------------------------------------------------
455 
456  if ( atmos_phy_sf_restart_out_basename /= '' ) then
457 
458  log_newline
459  log_info("ATMOS_PHY_SF_vars_restart_create",*) 'Create restart file (ATMOS_PHY_AE) '
460 
462  call time_gettimelabel( timelabel )
463  basename = trim(atmos_phy_sf_restart_out_basename)//'_'//trim(timelabel)
464  else
465  basename = trim(atmos_phy_sf_restart_out_basename)
466  endif
467 
468  log_info("ATMOS_PHY_SF_vars_restart_create",*) 'basename: ', trim(basename)
469 
470  call file_cartesc_create( &
472  restart_fid, & ! [OUT]
473  aggregate=atmos_phy_sf_restart_out_aggregate ) ! [IN]
474  endif
475 
476  return
477  end subroutine atmos_phy_sf_vars_restart_create
478 
479  !-----------------------------------------------------------------------------
482  use scale_file_cartesc, only: &
484  implicit none
485 
486  if ( restart_fid /= -1 ) then
487  call file_cartesc_enddef( restart_fid ) ! [IN]
488  endif
489 
490  return
491  end subroutine atmos_phy_sf_vars_restart_enddef
492 
493  !-----------------------------------------------------------------------------
496  use scale_file_cartesc, only: &
498  implicit none
499  !---------------------------------------------------------------------------
500 
501  if ( restart_fid /= -1 ) then
502  log_newline
503  log_info("ATMOS_PHY_SF_vars_restart_close",*) 'Close restart file (ATMOS_PHY_SF) '
504 
505  call file_cartesc_close( restart_fid ) ! [IN]
506 
507  restart_fid = -1
508  endif
509 
510  return
511  end subroutine atmos_phy_sf_vars_restart_close
512 
513  !-----------------------------------------------------------------------------
516  use scale_file_cartesc, only: &
518  implicit none
519 
520  integer :: i
521  !---------------------------------------------------------------------------
522 
523  if ( restart_fid /= -1 ) then
524 
525  do i = i_sfc_temp, i_sfc_z0e
526  call file_cartesc_def_var( restart_fid, & ! [IN]
527  var_name(i), var_desc(i), var_unit(i), & ! [IN]
528  'XY', atmos_phy_sf_restart_out_dtype, & ! [IN]
529  var_id(i), & ! [OUT]
530  standard_name=var_stdn(i) ) ! [IN]
531  end do
532 
533  endif
534 
535  return
536  end subroutine atmos_phy_sf_vars_restart_def_var
537 
538  !-----------------------------------------------------------------------------
541  use scale_file_cartesc, only: &
542  file_cartesc_write_var
543  implicit none
544  !---------------------------------------------------------------------------
545 
546  if ( restart_fid /= -1 ) then
547 
549 
551 
552  call file_cartesc_write_var( restart_fid, var_id(i_sfc_temp), & ! [IN]
553  atmos_phy_sf_sfc_temp(:,:), & ! [IN]
554  var_name(i_sfc_temp), 'XY' ) ! [IN]
555  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_ir_dir), & ! [IN]
556  atmos_phy_sf_sfc_albedo(:,:,i_r_direct ,i_r_ir ), & ! [IN]
557  var_name(i_sfc_alb_ir_dir), 'XY' ) ! [IN]
558  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_ir_dif), & ! [IN]
560  var_name(i_sfc_alb_ir_dif), 'XY' ) ! [IN]
561  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_nir_dir), & ! [IN]
563  var_name(i_sfc_alb_nir_dir), 'XY' ) ! [IN]
564  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_nir_dif), & ! [IN]
566  var_name(i_sfc_alb_nir_dif), 'XY' ) ! [IN]
567  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_vis_dir), & ! [IN]
569  var_name(i_sfc_alb_vis_dir), 'XY' ) ! [IN]
570  call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_vis_dif), & ! [IN]
572  var_name(i_sfc_alb_vis_dif), 'XY' ) ! [IN]
573  call file_cartesc_write_var( restart_fid, var_id(i_sfc_z0m), & ! [IN]
574  atmos_phy_sf_sfc_z0m(:,:), & ! [IN]
575  var_name(i_sfc_z0m), 'XY' ) ! [IN]
576  call file_cartesc_write_var( restart_fid, var_id(i_sfc_z0h), & ! [IN]
577  atmos_phy_sf_sfc_z0h(:,:), & ! [IN]
578  var_name(i_sfc_z0h), 'XY' ) ! [IN]
579  call file_cartesc_write_var( restart_fid, var_id(i_sfc_z0e), & ! [IN]
580  atmos_phy_sf_sfc_z0e(:,:), & ! [IN]
581  var_name(i_sfc_z0e), 'XY' ) ! [IN]
582 
583  endif
584 
585  return
586  end subroutine atmos_phy_sf_vars_restart_write
587 
588  !-----------------------------------------------------------------------------
590  use scale_statistics, only: &
592  statistics_total
593  use scale_atmos_grid_cartesc_real, only: &
596  implicit none
597  !---------------------------------------------------------------------------
598 
599  if ( statistics_checktotal ) then
600  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
601  atmos_phy_sf_sfc_temp(:,:), & ! [IN]
602  var_name(i_sfc_temp), & ! [IN]
603  atmos_grid_cartesc_real_area(:,:), & ! [IN]
605  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
606  atmos_phy_sf_sfc_albedo(:,:,i_r_direct ,i_r_ir ), & ! [IN]
607  var_name(i_sfc_alb_ir_dir), & ! [IN]
608  atmos_grid_cartesc_real_area(:,:), & ! [IN]
610  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
612  var_name(i_sfc_alb_ir_dif), & ! [IN]
613  atmos_grid_cartesc_real_area(:,:), & ! [IN]
615  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
617  var_name(i_sfc_alb_nir_dir), & ! [IN]
618  atmos_grid_cartesc_real_area(:,:), & ! [IN]
620  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
622  var_name(i_sfc_alb_nir_dif), & ! [IN]
623  atmos_grid_cartesc_real_area(:,:), & ! [IN]
625  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
627  var_name(i_sfc_alb_vis_dir), & ! [IN]
628  atmos_grid_cartesc_real_area(:,:), & ! [IN]
630  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
632  var_name(i_sfc_alb_vis_dif), & ! [IN]
633  atmos_grid_cartesc_real_area(:,:), & ! [IN]
635  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
636  atmos_phy_sf_sfc_z0m(:,:), & ! [IN]
637  var_name(i_sfc_z0m), & ! [IN]
638  atmos_grid_cartesc_real_area(:,:), & ! [IN]
640  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
641  atmos_phy_sf_sfc_z0h(:,:), & ! [IN]
642  var_name(i_sfc_z0h), & ! [IN]
643  atmos_grid_cartesc_real_area(:,:), & ! [IN]
645  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
646  atmos_phy_sf_sfc_z0e(:,:), & ! [IN]
647  var_name(i_sfc_z0e), & ! [IN]
648  atmos_grid_cartesc_real_area(:,:), & ! [IN]
650  endif
651 
652  return
653  end subroutine atmos_phy_sf_vars_checktotal
654 
655 end module mod_atmos_phy_sf_vars
subroutine, public atmos_phy_sf_vars_restart_def_var
Write restart.
logical, public atmos_phy_sf_restart_out_aggregate
Switch to use aggregate file.
subroutine, public atmos_phy_sf_vars_restart_open
Open restart file for read.
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_rhou_t
subroutine, public atmos_phy_sf_vars_restart_read
Read restart.
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_rhot_t
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_z0e
character(len=h_long), public atmos_phy_sf_restart_out_basename
Basename of the output file.
module coupler / surface-atmospehre
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_rhoh
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_mw
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_momz_t
logical, public atmos_phy_sf_restart_in_aggregate
Switch to use aggregate file.
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_v10
integer, public ia
of whole cells: x, local, with HALO
integer, parameter, public i_r_vis
integer, public qa
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_temp
integer, public ja
of whole cells: y, local, with HALO
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
integer, parameter, public n_rad_dir
integer, parameter, public n_rad_rgn
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_mv
subroutine, public atmos_phy_sf_vars_restart_enddef
Exit netCDF define mode.
logical, public statistics_checktotal
calc&report variable totals to logfile?
subroutine, public atmos_phy_sf_vars_setup
Setup.
real(rp), public const_undef
Definition: scale_const.F90:41
module COMMUNICATION
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_l_mo
integer, public is
start point of inner domain: x, local
real(rp), dimension(:,:,:), allocatable, public atmos_phy_sf_rhoq_t
module file
Definition: scale_file.F90:15
module ATMOSPHERIC Surface Variables
subroutine, public atmos_phy_sf_vars_restart_write
Write variables to restart file.
subroutine, public atmos_phy_sf_vars_restart_close
Close restart file.
integer, public ie
end point of inner domain: x, local
subroutine, public file_cartesc_create(basename, title, datatype, fid, date, subsec, haszcoord, append, aggregate, single)
Create/open a netCDF file.
module TRACER
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_sf_sfc_albedo
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_u10
module atmosphere / hydrometeor
subroutine, public atmos_phy_sf_vars_fillhalo
HALO Communication.
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_z0h
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:94
module atmosphere / grid / cartesC index
module PROCESS
Definition: scale_prc.F90:11
integer, public je
end point of inner domain: y, local
character(len=h_long), public atmos_phy_sf_restart_in_basename
Basename of the input file.
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_lh
character(len=h_short), public atmos_phy_sf_restart_out_dtype
REAL4 or REAL8.
subroutine, public file_cartesc_enddef(fid)
Exit netCDF file define mode.
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_pres
module TIME
Definition: scale_time.F90:16
character(len=h_mid), public atmos_phy_sf_restart_out_title
title of the output file
real(rp), dimension(:,:,:), allocatable, target, public atmos_phy_sf_sflx_qtrc
logical, public atmos_phy_sf_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
module CONSTANT
Definition: scale_const.F90:11
real(rp), dimension(:,:), pointer, public atmos_phy_sf_sflx_qv
integer, public js
start point of inner domain: y, local
integer, parameter, public i_r_direct
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.
logical function, public file_get_aggregate(fid)
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_sh
subroutine, public atmos_phy_sf_vars_restart_create
Create restart file.
module profiler
Definition: scale_prof.F90:11
integer, parameter, public i_r_nir
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_q2
module Atmosphere GRID CartesC Real(real space)
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_area
horizontal area ( xy, normal z) [m2]
module PRECISION
module file / cartesianC
logical, public atmos_phy_sf_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_rhov_t
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_z0m
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_t2
module Statistics
integer, parameter, public i_r_ir
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_dens_t
module STDIO
Definition: scale_io.F90:10
integer, parameter, public i_r_diffuse
subroutine, public file_cartesc_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_dens
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_gh
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_mu
subroutine, public file_cartesc_open(basename, fid, aggregate)
open a netCDF file for read
subroutine, public file_cartesc_close(fid)
Close a netCDF file.
real(rp), public atmos_grid_cartesc_real_totarea
total area (xy, local) [m2]
logical, public atmos_phy_sf_restart_output
output restart file?