SCALE-RM
mod_atmos_phy_rd_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_rd_vars_setup
34 
40 
41  !-----------------------------------------------------------------------------
42  !
43  !++ Public parameters & variables
44  !
45  logical, public :: atmos_phy_rd_restart_output = .false.
46 
47  character(len=H_LONG), public :: atmos_phy_rd_restart_in_basename = ''
49  logical, public :: atmos_phy_rd_restart_in_postfix_timelabel = .false.
50  character(len=H_LONG), public :: atmos_phy_rd_restart_out_basename = ''
52  logical, public :: atmos_phy_rd_restart_out_postfix_timelabel = .true.
53  character(len=H_MID), public :: atmos_phy_rd_restart_out_title = 'ATMOS_PHY_RD restart'
54  character(len=H_SHORT), public :: atmos_phy_rd_restart_out_dtype = 'DEFAULT'
55 
56  real(RP), public, allocatable :: atmos_phy_rd_rhoh(:,:,:) ! diavatic heating rate [J/m3/s]
57 
58  real(RP), public, allocatable :: atmos_phy_rd_sflx_lw_up (:,:) ! surface upward longwave flux [J/m2/s]
59  real(RP), public, allocatable :: atmos_phy_rd_sflx_lw_dn (:,:) ! surface downward longwave flux [J/m2/s]
60  real(RP), public, allocatable :: atmos_phy_rd_sflx_sw_up (:,:) ! surface upward shortwave flux [J/m2/s]
61  real(RP), public, allocatable :: atmos_phy_rd_sflx_sw_dn (:,:) ! surface downward shortwave flux [J/m2/s]
62 
63  real(RP), public, allocatable :: atmos_phy_rd_toaflx_lw_up(:,:) ! TOA upward longwave flux [J/m2/s]
64  real(RP), public, allocatable :: atmos_phy_rd_toaflx_lw_dn(:,:) ! TOA downward longwave flux [J/m2/s]
65  real(RP), public, allocatable :: atmos_phy_rd_toaflx_sw_up(:,:) ! TOA upward shortwave flux [J/m2/s]
66  real(RP), public, allocatable :: atmos_phy_rd_toaflx_sw_dn(:,:) ! TOA downward shortwave flux [J/m2/s]
67 
68  real(RP), public, allocatable :: atmos_phy_rd_sflx_down (:,:,:,:) ! surface downward flux (LW/SW,direct/diffuse) [J/m2/s]
69 
70  real(RP), public, allocatable :: atmos_phy_rd_solins (:,:) ! solar insolation flux [J/m2/s]
71  real(RP), public, allocatable :: atmos_phy_rd_cossza (:,:) ! cos(solar zenith angle) (0-1)
72 
73  !-----------------------------------------------------------------------------
74  !
75  !++ Private procedure
76  !
77  !-----------------------------------------------------------------------------
78  !
79  !++ Private parameters & variables
80  !
81  integer, private, parameter :: vmax = 14
82  integer, private, parameter :: i_sflx_lw_up = 1
83  integer, private, parameter :: i_sflx_lw_dn = 2
84  integer, private, parameter :: i_sflx_sw_up = 3
85  integer, private, parameter :: i_sflx_sw_dn = 4
86  integer, private, parameter :: i_toaflx_lw_up = 5
87  integer, private, parameter :: i_toaflx_lw_dn = 6
88  integer, private, parameter :: i_toaflx_sw_up = 7
89  integer, private, parameter :: i_toaflx_sw_dn = 8
90  integer, private, parameter :: i_sflx_ir_dn_dir = 9
91  integer, private, parameter :: i_sflx_ir_dn_dif = 10
92  integer, private, parameter :: i_sflx_nir_dn_dir = 11
93  integer, private, parameter :: i_sflx_nir_dn_dif = 12
94  integer, private, parameter :: i_sflx_vis_dn_dir = 13
95  integer, private, parameter :: i_sflx_vis_dn_dif = 14
96 
97  character(len=H_SHORT), private :: var_name(vmax)
98  character(len=H_MID), private :: var_desc(vmax)
99  character(len=H_MID), private :: var_stdn(vmax)
100  character(len=H_SHORT), private :: var_unit(vmax)
101  integer, private :: var_id(vmax)
102  integer, private :: restart_fid = -1 ! file ID
103 
104  data var_name / 'SFLX_LW_up', &
105  'SFLX_LW_dn', &
106  'SFLX_SW_up', &
107  'SFLX_SW_dn', &
108  'TOAFLX_LW_up', &
109  'TOAFLX_LW_dn', &
110  'TOAFLX_SW_up', &
111  'TOAFLX_SW_dn', &
112  'SFLX_IR_dn_dir', &
113  'SFLX_IR_dn_dif', &
114  'SFLX_NIR_dn_dir', &
115  'SFLX_NIR_dn_dif', &
116  'SFLX_VIS_dn_dir', &
117  'SFLX_VIS_dn_dif' /
118  data var_desc / 'surface upward longwave flux', &
119  'surface downward longwave flux', &
120  'surface upward shortwave flux', &
121  'surface downward shortwave flux', &
122  'TOA upward longwave flux', &
123  'TOA downward longwave flux', &
124  'TOA upward shortwave flux', &
125  'TOA downward shortwave flux', &
126  'sfc. down. flux direct IR', &
127  'sfc. down. flux diffuse IR', &
128  'sfc. down. flux direct NIR', &
129  'sfc. down. flux diffuse NIR', &
130  'sfc. down. flux direct VIS', &
131  'sfc. down. flux diffuse VIS' /
132  data var_stdn / 'surface_upwelling_longwave_flux_in_air', &
133  'surface_downwelling_longwave_flux_in_air', &
134  'surface_upwelling_shortwave_flux_in_air', &
135  'surface_downwelling_shortwave_flux_in_air', &
136  '', &
137  '', &
138  '', &
139  '', &
140  '', &
141  '', &
142  '', &
143  '', &
144  '', &
145  '' /
146  data var_unit / 'W/m2', &
147  'W/m2', &
148  'W/m2', &
149  'W/m2', &
150  'W/m2', &
151  'W/m2', &
152  'W/m2', &
153  'W/m2', &
154  'W/m2', &
155  'W/m2', &
156  'W/m2', &
157  'W/m2', &
158  'W/m2', &
159  'W/m2' /
160 
161  !-----------------------------------------------------------------------------
162 contains
163  !-----------------------------------------------------------------------------
165  subroutine atmos_phy_rd_vars_setup
166  use scale_prc, only: &
167  prc_abort
168  use scale_const, only: &
169  undef => const_undef
170  implicit none
171 
172  namelist / param_atmos_phy_rd_vars / &
182 
183  integer :: ierr
184  integer :: iv
185  !---------------------------------------------------------------------------
186 
187  log_newline
188  log_info("ATMOS_PHY_RD_vars_setup",*) 'Setup'
189 
190  allocate( atmos_phy_rd_rhoh(ka,ia,ja) )
191  atmos_phy_rd_rhoh(:,:,:) = undef
192 
193  allocate( atmos_phy_rd_sflx_lw_up(ia,ja) )
194  allocate( atmos_phy_rd_sflx_lw_dn(ia,ja) )
195  allocate( atmos_phy_rd_sflx_sw_up(ia,ja) )
196  allocate( atmos_phy_rd_sflx_sw_dn(ia,ja) )
197  allocate( atmos_phy_rd_toaflx_lw_up(ia,ja) )
198  allocate( atmos_phy_rd_toaflx_lw_dn(ia,ja) )
199  allocate( atmos_phy_rd_toaflx_sw_up(ia,ja) )
200  allocate( atmos_phy_rd_toaflx_sw_dn(ia,ja) )
201  atmos_phy_rd_sflx_lw_up(:,:) = undef
202  atmos_phy_rd_sflx_lw_dn(:,:) = undef
203  atmos_phy_rd_sflx_sw_up(:,:) = undef
204  atmos_phy_rd_sflx_sw_dn(:,:) = undef
205  atmos_phy_rd_toaflx_lw_up(:,:) = undef
206  atmos_phy_rd_toaflx_lw_dn(:,:) = undef
207  atmos_phy_rd_toaflx_sw_up(:,:) = undef
208  atmos_phy_rd_toaflx_sw_dn(:,:) = undef
209 
211  atmos_phy_rd_sflx_down(:,:,:,:) = undef
212 
213  allocate( atmos_phy_rd_solins(ia,ja) )
214  allocate( atmos_phy_rd_cossza(ia,ja) )
215  atmos_phy_rd_solins(:,:) = undef
216  atmos_phy_rd_cossza(:,:) = undef
217 
218  !--- read namelist
219  rewind(io_fid_conf)
220  read(io_fid_conf,nml=param_atmos_phy_rd_vars,iostat=ierr)
221  if( ierr < 0 ) then !--- missing
222  log_info("ATMOS_PHY_RD_vars_setup",*) 'Not found namelist. Default used.'
223  elseif( ierr > 0 ) then !--- fatal error
224  log_error("ATMOS_PHY_RD_vars_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_RD_VARS. Check!'
225  call prc_abort
226  endif
227  log_nml(param_atmos_phy_rd_vars)
228 
229  log_newline
230  log_info("ATMOS_PHY_RD_vars_setup",*) '[ATMOS_PHY_RD] prognostic/diagnostic variables'
231  log_info_cont('(1x,A,A24,A,A48,A,A12,A)') &
232  ' |', 'VARNAME ','|', &
233  'DESCRIPTION ', '[', 'UNIT ', ']'
234  do iv = 1, vmax
235  log_info_cont('(1x,A,I3,A,A24,A,A48,A,A12,A)') &
236  'NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
237  enddo
238 
239  log_newline
240  if ( atmos_phy_rd_restart_in_basename /= '' ) then
241  log_info("ATMOS_PHY_RD_vars_setup",*) 'Restart input? : YES, file = ', trim(atmos_phy_rd_restart_in_basename)
242  log_info("ATMOS_PHY_RD_vars_setup",*) 'Add timelabel? : ', atmos_phy_rd_restart_in_postfix_timelabel
243  else
244  log_info("ATMOS_PHY_RD_vars_setup",*) 'Restart input? : NO'
245  endif
247  .AND. atmos_phy_rd_restart_out_basename /= '' ) then
248  log_info("ATMOS_PHY_RD_vars_setup",*) 'Restart output? : YES, file = ', trim(atmos_phy_rd_restart_out_basename)
249  log_info("ATMOS_PHY_RD_vars_setup",*) 'Add timelabel? : ', atmos_phy_rd_restart_out_postfix_timelabel
250  else
251  log_info("ATMOS_PHY_RD_vars_setup",*) 'Restart output? : NO'
253  endif
254 
255  return
256  end subroutine atmos_phy_rd_vars_setup
257 
258  !-----------------------------------------------------------------------------
260  subroutine atmos_phy_rd_vars_fillhalo
261  use scale_comm_cartesc, only: &
262  comm_vars8, &
263  comm_wait
264  implicit none
265 
266  integer :: n ,idir, irgn
267  !---------------------------------------------------------------------------
268 
269  call comm_vars8( atmos_phy_rd_sflx_lw_up(:,:), 1 )
270  call comm_vars8( atmos_phy_rd_sflx_lw_dn(:,:), 2 )
271  call comm_vars8( atmos_phy_rd_sflx_sw_up(:,:), 3 )
272  call comm_vars8( atmos_phy_rd_sflx_sw_dn(:,:), 4 )
273  call comm_vars8( atmos_phy_rd_toaflx_lw_up(:,:), 5 )
274  call comm_vars8( atmos_phy_rd_toaflx_lw_dn(:,:), 6 )
275  call comm_vars8( atmos_phy_rd_toaflx_sw_up(:,:), 7 )
276  call comm_vars8( atmos_phy_rd_toaflx_sw_dn(:,:), 8 )
277 
278  n = 8
279  do irgn = i_r_ir, i_r_vis
280  do idir = i_r_direct, i_r_diffuse
281  n = n + 1
282  call comm_vars8( atmos_phy_rd_sflx_down(:,:,idir,irgn), n )
283  enddo
284  enddo
285 
286  call comm_wait ( atmos_phy_rd_sflx_lw_up(:,:), 1 )
287  call comm_wait ( atmos_phy_rd_sflx_lw_dn(:,:), 2 )
288  call comm_wait ( atmos_phy_rd_sflx_sw_up(:,:), 3 )
289  call comm_wait ( atmos_phy_rd_sflx_sw_dn(:,:), 4 )
290  call comm_wait ( atmos_phy_rd_toaflx_lw_up(:,:), 5 )
291  call comm_wait ( atmos_phy_rd_toaflx_lw_dn(:,:), 6 )
292  call comm_wait ( atmos_phy_rd_toaflx_sw_up(:,:), 7 )
293  call comm_wait ( atmos_phy_rd_toaflx_sw_dn(:,:), 8 )
294 
295  n = 8
296  do irgn = i_r_ir, i_r_vis
297  do idir = i_r_direct, i_r_diffuse
298  n = n + 1
299  call comm_wait ( atmos_phy_rd_sflx_down(:,:,idir,irgn), n )
300  enddo
301  enddo
302 
303  return
304  end subroutine atmos_phy_rd_vars_fillhalo
305 
306  !-----------------------------------------------------------------------------
309  use scale_time, only: &
311  use scale_file_cartesc, only: &
313  implicit none
314 
315  character(len=19) :: timelabel
316  character(len=H_LONG) :: basename
317  !---------------------------------------------------------------------------
318 
319  log_newline
320  log_info("ATMOS_PHY_RD_vars_restart_open",*) 'Open restart file (ATMOS_PHY_RD) '
321 
322  if ( atmos_phy_rd_restart_in_basename /= '' ) then
323 
325  call time_gettimelabel( timelabel )
326  basename = trim(atmos_phy_rd_restart_in_basename)//'_'//trim(timelabel)
327  else
328  basename = trim(atmos_phy_rd_restart_in_basename)
329  endif
330 
331  log_info("ATMOS_PHY_RD_vars_restart_open",*) 'basename: ', trim(basename)
332 
333  call file_cartesc_open( basename, restart_fid, aggregate=atmos_phy_rd_restart_in_aggregate )
334  else
335  log_info("ATMOS_PHY_RD_vars_restart_open",*) 'restart file for ATMOS_PHY_RD is not specified.'
336  endif
337 
338  return
339  end subroutine atmos_phy_rd_vars_restart_open
340 
341  !-----------------------------------------------------------------------------
344  use scale_file, only: &
346  use scale_file_cartesc, only: &
347  file_cartesc_read, &
349  implicit none
350  !---------------------------------------------------------------------------
351 
352  if ( restart_fid /= -1 ) then
353  log_newline
354  log_info("ATMOS_PHY_RD_vars_restart_read",*) 'Read from restart file (ATMOS_PHY_RD) '
355 
356  call file_cartesc_read( restart_fid, var_name(i_sflx_lw_up), 'XY', & ! [IN]
357  atmos_phy_rd_sflx_lw_up(:,:) ) ! [OUT]
358  call file_cartesc_read( restart_fid, var_name(i_sflx_lw_dn), 'XY', & ! [IN]
359  atmos_phy_rd_sflx_lw_dn(:,:) ) ! [OUT]
360  call file_cartesc_read( restart_fid, var_name(i_sflx_sw_up), 'XY', & ! [IN]
361  atmos_phy_rd_sflx_sw_up(:,:) ) ! [OUT]
362  call file_cartesc_read( restart_fid, var_name(i_sflx_sw_dn), 'XY', & ! [IN]
363  atmos_phy_rd_sflx_sw_dn(:,:) ) ! [OUT]
364  call file_cartesc_read( restart_fid, var_name(i_toaflx_lw_up), 'XY', & ! [IN]
365  atmos_phy_rd_toaflx_lw_up(:,:) ) ! [OUT]
366  call file_cartesc_read( restart_fid, var_name(i_toaflx_lw_dn), 'XY', & ! [IN]
367  atmos_phy_rd_toaflx_lw_dn(:,:) ) ! [OUT]
368  call file_cartesc_read( restart_fid, var_name(i_toaflx_sw_up), 'XY', & ! [IN]
369  atmos_phy_rd_toaflx_sw_up(:,:) ) ! [OUT]
370  call file_cartesc_read( restart_fid, var_name(i_toaflx_sw_dn), 'XY', & ! [IN]
371  atmos_phy_rd_toaflx_sw_dn(:,:) ) ! [OUT]
372  call file_cartesc_read( restart_fid, var_name(i_sflx_ir_dn_dir), 'XY', & ! [IN]
373  atmos_phy_rd_sflx_down(:,:,i_r_direct ,i_r_ir ) ) ! [OUT]
374  call file_cartesc_read( restart_fid, var_name(i_sflx_ir_dn_dif), 'XY', & ! [IN]
376  call file_cartesc_read( restart_fid, var_name(i_sflx_nir_dn_dir), 'XY', & ! [IN]
378  call file_cartesc_read( restart_fid, var_name(i_sflx_nir_dn_dif), 'XY', & ! [IN]
380  call file_cartesc_read( restart_fid, var_name(i_sflx_vis_dn_dir), 'XY', & ! [IN]
382  call file_cartesc_read( restart_fid, var_name(i_sflx_vis_dn_dif), 'XY', & ! [IN]
384 
385  if ( file_get_aggregate(restart_fid) ) then
386  call file_cartesc_flush( restart_fid ) ! X/Y halos have been read from file
387  else
389  end if
390 
392 
393  else
394  log_info("ATMOS_PHY_RD_vars_restart_read",*) 'invalid restart file ID for ATMOS_PHY_RD.'
395  endif
396 
397  return
398  end subroutine atmos_phy_rd_vars_restart_read
399 
400  !-----------------------------------------------------------------------------
403  use scale_time, only: &
405  use scale_file_cartesc, only: &
407  implicit none
408 
409  character(len=19) :: timelabel
410  character(len=H_LONG) :: basename
411  !---------------------------------------------------------------------------
412 
413  if ( atmos_phy_rd_restart_out_basename /= '' ) then
414 
415  log_newline
416  log_info("ATMOS_PHY_RD_vars_restart_create",*) 'Create restart file (ATMOS_PHY_AE) '
417 
419  call time_gettimelabel( timelabel )
420  basename = trim(atmos_phy_rd_restart_out_basename)//'_'//trim(timelabel)
421  else
422  basename = trim(atmos_phy_rd_restart_out_basename)
423  endif
424 
425  log_info("ATMOS_PHY_RD_vars_restart_create",*) 'basename: ', trim(basename)
426 
427  call file_cartesc_create( &
429  restart_fid, & ! [OUT]
430  aggregate=atmos_phy_rd_restart_out_aggregate ) ! [IN]
431 
432  endif
433 
434  return
435  end subroutine atmos_phy_rd_vars_restart_create
436 
437  !-----------------------------------------------------------------------------
440  use scale_file_cartesc, only: &
442  implicit none
443 
444  if ( restart_fid /= -1 ) then
445  call file_cartesc_enddef( restart_fid ) ! [IN]
446  endif
447 
448  return
449  end subroutine atmos_phy_rd_vars_restart_enddef
450 
451  !-----------------------------------------------------------------------------
454  use scale_file_cartesc, only: &
456  implicit none
457  !---------------------------------------------------------------------------
458 
459  if ( restart_fid /= -1 ) then
460  log_newline
461  log_info("ATMOS_PHY_RD_vars_restart_close",*) 'Close restart file (ATMOS_PHY_RD) '
462 
463  call file_cartesc_close( restart_fid ) ! [IN]
464 
465  restart_fid = -1
466  endif
467 
468  return
469  end subroutine atmos_phy_rd_vars_restart_close
470 
471  !-----------------------------------------------------------------------------
474  use scale_file_cartesc, only: &
476  implicit none
477 
478  integer :: i
479  !---------------------------------------------------------------------------
480 
481  if ( restart_fid /= -1 ) then
482 
483  do i = i_sflx_lw_up, i_sflx_vis_dn_dif
484  call file_cartesc_def_var( restart_fid, & ! [IN]
485  var_name(i), var_desc(i), var_unit(i), & ! [IN]
486  'XY', atmos_phy_rd_restart_out_dtype, & ! [IN]
487  var_id(i), & ! [OUT]
488  standard_name=var_stdn(i) ) ! [IN]
489  end do
490  endif
491 
492  return
493  end subroutine atmos_phy_rd_vars_restart_def_var
494 
495  !-----------------------------------------------------------------------------
498  use scale_file_cartesc, only: &
499  file_cartesc_write_var
500  implicit none
501  !---------------------------------------------------------------------------
502 
503  if ( restart_fid /= -1 ) then
504 
506 
508 
509  call file_cartesc_write_var( restart_fid, var_id(i_sflx_lw_up), & ! [IN]
510  atmos_phy_rd_sflx_lw_up(:,:), & ! [IN]
511  var_name(i_sflx_lw_up), 'XY' ) ! [IN]
512  call file_cartesc_write_var( restart_fid, var_id(i_sflx_lw_dn), & ! [IN]
513  atmos_phy_rd_sflx_lw_dn(:,:), & ! [IN]
514  var_name(i_sflx_lw_dn), 'XY' ) ! [IN]
515  call file_cartesc_write_var( restart_fid, var_id(i_sflx_sw_up), & ! [IN]
516  atmos_phy_rd_sflx_sw_up(:,:), & ! [IN]
517  var_name(i_sflx_sw_up), 'XY' ) ! [IN]
518  call file_cartesc_write_var( restart_fid, var_id(i_sflx_sw_dn), & ! [IN]
519  atmos_phy_rd_sflx_sw_dn(:,:), & ! [IN]
520  var_name(i_sflx_sw_dn), 'XY' ) ! [IN]
521  call file_cartesc_write_var( restart_fid, var_id(i_toaflx_lw_up), & ! [IN]
522  atmos_phy_rd_toaflx_lw_up(:,:), & ! [IN]
523  var_name(i_toaflx_lw_up), 'XY' ) ! [IN]
524  call file_cartesc_write_var( restart_fid, var_id(i_toaflx_lw_dn), & ! [IN]
525  atmos_phy_rd_toaflx_lw_dn(:,:), & ! [IN]
526  var_name(i_toaflx_lw_dn), 'XY' ) ! [IN]
527  call file_cartesc_write_var( restart_fid, var_id(i_toaflx_sw_up), & ! [IN]
528  atmos_phy_rd_toaflx_sw_up(:,:), & ! [IN]
529  var_name(i_toaflx_sw_up), 'XY' ) ! [IN]
530  call file_cartesc_write_var( restart_fid, var_id(i_toaflx_sw_dn), & ! [IN]
531  atmos_phy_rd_toaflx_sw_dn(:,:), & ! [IN]
532  var_name(i_toaflx_sw_dn), 'XY' ) ! [IN]
533  call file_cartesc_write_var( restart_fid, var_id(i_sflx_ir_dn_dir), & ! [IN]
534  atmos_phy_rd_sflx_down(:,:,i_r_direct ,i_r_ir ), & ! [IN]
535  var_name(i_sflx_ir_dn_dir), 'XY' ) ! [IN]
536  call file_cartesc_write_var( restart_fid, var_id(i_sflx_ir_dn_dif), & ! [IN]
538  var_name(i_sflx_ir_dn_dif), 'XY' ) ! [IN]
539  call file_cartesc_write_var( restart_fid, var_id(i_sflx_nir_dn_dir), & ! [IN]
541  var_name(i_sflx_nir_dn_dir), 'XY' ) ! [IN]
542  call file_cartesc_write_var( restart_fid, var_id(i_sflx_nir_dn_dif), & ! [IN]
544  var_name(i_sflx_nir_dn_dif), 'XY' ) ! [IN]
545  call file_cartesc_write_var( restart_fid, var_id(i_sflx_vis_dn_dir), & ! [IN]
547  var_name(i_sflx_vis_dn_dir), 'XY' ) ! [IN]
548  call file_cartesc_write_var( restart_fid, var_id(i_sflx_vis_dn_dif), & ! [IN]
550  var_name(i_sflx_vis_dn_dif), 'XY' ) ! [IN]
551 
552  endif
553 
554  return
555  end subroutine atmos_phy_rd_vars_restart_write
556 
557  !-----------------------------------------------------------------------------
559  use scale_statistics, only: &
561  statistics_total
562  use scale_atmos_grid_cartesc_real, only: &
565  implicit none
566  !---------------------------------------------------------------------------
567 
568  if ( statistics_checktotal ) then
569  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
570  atmos_phy_rd_sflx_lw_up(:,:), & ! [IN]
571  var_name(i_sflx_lw_up), & ! [IN]
572  atmos_grid_cartesc_real_area(:,:), & ! [IN]
574  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
575  atmos_phy_rd_sflx_lw_dn(:,:), & ! [IN]
576  var_name(i_sflx_lw_dn), & ! [IN]
577  atmos_grid_cartesc_real_area(:,:), & ! [IN]
579  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
580  atmos_phy_rd_sflx_sw_up(:,:), & ! [IN]
581  var_name(i_sflx_sw_up), & ! [IN]
582  atmos_grid_cartesc_real_area(:,:), & ! [IN]
584  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
585  atmos_phy_rd_sflx_sw_dn(:,:), & ! [IN]
586  var_name(i_sflx_sw_dn), & ! [IN]
587  atmos_grid_cartesc_real_area(:,:), & ! [IN]
589  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
590  atmos_phy_rd_toaflx_lw_up(:,:), & ! [IN]
591  var_name(i_toaflx_lw_up), & ! [IN]
592  atmos_grid_cartesc_real_area(:,:), & ! [IN]
594  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
595  atmos_phy_rd_toaflx_lw_dn(:,:), & ! [IN]
596  var_name(i_toaflx_lw_dn), & ! [IN]
597  atmos_grid_cartesc_real_area(:,:), & ! [IN]
599  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
600  atmos_phy_rd_toaflx_sw_up(:,:), & ! [IN]
601  var_name(i_toaflx_sw_up), & ! [IN]
602  atmos_grid_cartesc_real_area(:,:), & ! [IN]
604  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
605  atmos_phy_rd_toaflx_sw_dn(:,:), & ! [IN]
606  var_name(i_toaflx_sw_dn), & ! [IN]
607  atmos_grid_cartesc_real_area(:,:), & ! [IN]
609  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
610  atmos_phy_rd_sflx_down(:,:,i_r_direct ,i_r_ir ), & ! [IN]
611  var_name(i_sflx_ir_dn_dir), & ! [IN]
612  atmos_grid_cartesc_real_area(:,:), & ! [IN]
614  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
616  var_name(i_sflx_ir_dn_dif), & ! [IN]
617  atmos_grid_cartesc_real_area(:,:), & ! [IN]
619  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
621  var_name(i_sflx_nir_dn_dir), & ! [IN]
622  atmos_grid_cartesc_real_area(:,:), & ! [IN]
624  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
626  var_name(i_sflx_nir_dn_dif), & ! [IN]
627  atmos_grid_cartesc_real_area(:,:), & ! [IN]
629  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
631  var_name(i_sflx_vis_dn_dir), & ! [IN]
632  atmos_grid_cartesc_real_area(:,:), & ! [IN]
634  call statistics_total( ia, is, ie, ja, js, je, & ! [IN]
636  var_name(i_sflx_vis_dn_dif), & ! [IN]
637  atmos_grid_cartesc_real_area(:,:), & ! [IN]
639  end if
640 
641  return
642  end subroutine atmos_phy_rd_vars_checktotal
643 
644 end module mod_atmos_phy_rd_vars
logical, public atmos_phy_rd_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
subroutine, public atmos_phy_rd_vars_restart_close
Close restart file.
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_rd_sflx_down
subroutine, public atmos_phy_rd_vars_restart_create
Create restart file.
module coupler / surface-atmospehre
character(len=h_long), public atmos_phy_rd_restart_in_basename
Basename of the input file.
integer, public ia
of whole cells: x, local, with HALO
integer, parameter, public i_r_vis
character(len=h_mid), public atmos_phy_rd_restart_out_title
title of the output file
real(rp), dimension(:,:,:), allocatable, public atmos_phy_rd_rhoh
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_rd_sflx_lw_up
logical, public statistics_checktotal
calc&report variable totals to logfile?
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_sw_up
real(rp), public const_undef
Definition: scale_const.F90:41
logical, public atmos_phy_rd_restart_in_aggregate
Switch to use aggregate file.
module COMMUNICATION
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_lw_dn
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_cossza
module Atmosphere / Physics Radiation
character(len=h_long), public atmos_phy_rd_restart_out_basename
Basename of the output file.
subroutine, public atmos_phy_rd_vars_restart_open
Open restart file for read.
integer, public is
start point of inner domain: x, local
module file
Definition: scale_file.F90:15
integer, public ie
end point of inner domain: x, local
logical, public atmos_phy_rd_restart_out_aggregate
Switch to use aggregate file.
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_rd_sflx_sw_up
subroutine, public atmos_phy_rd_vars_restart_def_var
Define variables in restart file.
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:94
module atmosphere / grid / cartesC index
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_sw_dn
module PROCESS
Definition: scale_prc.F90:11
integer, public je
end point of inner domain: y, local
subroutine, public file_cartesc_enddef(fid)
Exit netCDF file define mode.
module TIME
Definition: scale_time.F90:16
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_lw_dn
logical, public atmos_phy_rd_restart_output
output restart file?
subroutine, public atmos_phy_rd_vars_setup
Setup.
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
module CONSTANT
Definition: scale_const.F90:11
integer, public js
start point of inner domain: y, local
integer, parameter, public i_r_direct
subroutine, public atmos_phy_rd_vars_restart_write
Write variables to restart file.
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.
character(len=h_short), public atmos_phy_rd_restart_out_dtype
REAL4 or REAL8.
logical function, public file_get_aggregate(fid)
module profiler
Definition: scale_prof.F90:11
integer, parameter, public i_r_nir
module Atmosphere GRID CartesC Real(real space)
subroutine, public atmos_phy_rd_vars_restart_enddef
Exit netCDF define mode.
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_sw_dn
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_area
horizontal area ( xy, normal z) [m2]
module PRECISION
module file / cartesianC
integer, public ka
of whole cells: z, local, with HALO
subroutine, public atmos_phy_rd_vars_restart_read
Read restart.
subroutine, public atmos_phy_rd_vars_fillhalo
HALO Communication.
module Statistics
integer, parameter, public i_r_ir
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_rd_solins
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), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_lw_up
logical, public atmos_phy_rd_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
real(rp), public atmos_grid_cartesc_real_totarea
total area (xy, local) [m2]