SCALE-RM
mod_atmos_phy_rd_vars.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
12 !-------------------------------------------------------------------------------
13 #include "inc_openmp.h"
15  !-----------------------------------------------------------------------------
16  !
17  !++ used modules
18  !
19  use scale_precision
20  use scale_stdio
21  use scale_prof
23  use scale_tracer
24  !-----------------------------------------------------------------------------
25  implicit none
26  private
27  !-----------------------------------------------------------------------------
28  !
29  !++ Public procedure
30  !
31  public :: atmos_phy_rd_vars_setup
36 
42 
43  !-----------------------------------------------------------------------------
44  !
45  !++ Public parameters & variables
46  !
47  logical, public :: atmos_phy_rd_restart_output = .false.
48 
49  character(len=H_LONG), public :: atmos_phy_rd_restart_in_basename = ''
50  logical, public :: atmos_phy_rd_restart_in_postfix_timelabel = .false.
51  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_rhot_t(:,:,:) ! tendency RHOT [K*kg/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_downall(:,:,:,:) ! 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 = 12
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_lw_dir = 9
91  integer, private, parameter :: i_sflx_lw_dif = 10
92  integer, private, parameter :: i_sflx_sw_dir = 11
93  integer, private, parameter :: i_sflx_sw_dif = 12
94 
95  character(len=H_SHORT), private :: var_name(vmax)
96  character(len=H_MID), private :: var_desc(vmax)
97  character(len=H_SHORT), private :: var_unit(vmax)
98  integer, private :: var_id(vmax)
99  integer, private :: restart_fid = -1 ! file ID
100 
101  data var_name / 'SFLX_LW_up', &
102  'SFLX_LW_dn', &
103  'SFLX_SW_up', &
104  'SFLX_SW_dn', &
105  'TOAFLX_LW_up', &
106  'TOAFLX_LW_dn', &
107  'TOAFLX_SW_up', &
108  'TOAFLX_SW_dn', &
109  'SFLX_LW_dir', &
110  'SFLX_LW_dif', &
111  'SFLX_SW_dir', &
112  'SFLX_SW_dif' /
113  data var_desc / 'surface upward longwave flux', &
114  'surface downward longwave flux', &
115  'surface upward shortwave flux', &
116  'surface downward shortwave flux', &
117  'TOA upward longwave flux', &
118  'TOA downward longwave flux', &
119  'TOA upward shortwave flux', &
120  'TOA downward shortwave flux', &
121  'sfc. down. longwave flux direct', &
122  'sfc. down. longwave flux diffuse', &
123  'sfc. down. shortwave flux direct', &
124  'sfc. down. shortwave flux diffuse' /
125  data var_unit / 'W/m2', &
126  'W/m2', &
127  'W/m2', &
128  'W/m2', &
129  'W/m2', &
130  'W/m2', &
131  'W/m2', &
132  'W/m2', &
133  'W/m2', &
134  'W/m2', &
135  'W/m2', &
136  'W/m2' /
137 
138  !-----------------------------------------------------------------------------
139 contains
140  !-----------------------------------------------------------------------------
142  subroutine atmos_phy_rd_vars_setup
143  use scale_process, only: &
145  use scale_const, only: &
146  undef => const_undef
147  implicit none
148 
149  namelist / param_atmos_phy_rd_vars / &
157 
158  integer :: ierr
159  integer :: iv
160  !---------------------------------------------------------------------------
161 
162  if( io_l ) write(io_fid_log,*)
163  if( io_l ) write(io_fid_log,*) '++++++ Module[VARS] / Categ[ATMOS PHY_RD] / Origin[SCALE-RM]'
164 
165  allocate( atmos_phy_rd_rhot_t(ka,ia,ja) )
166  atmos_phy_rd_rhot_t(:,:,:) = undef
167 
168  allocate( atmos_phy_rd_sflx_lw_up(ia,ja) )
169  allocate( atmos_phy_rd_sflx_lw_dn(ia,ja) )
170  allocate( atmos_phy_rd_sflx_sw_up(ia,ja) )
171  allocate( atmos_phy_rd_sflx_sw_dn(ia,ja) )
172  allocate( atmos_phy_rd_toaflx_lw_up(ia,ja) )
173  allocate( atmos_phy_rd_toaflx_lw_dn(ia,ja) )
174  allocate( atmos_phy_rd_toaflx_sw_up(ia,ja) )
175  allocate( atmos_phy_rd_toaflx_sw_dn(ia,ja) )
176  atmos_phy_rd_sflx_lw_up(:,:) = undef
177  atmos_phy_rd_sflx_lw_dn(:,:) = undef
178  atmos_phy_rd_sflx_sw_up(:,:) = undef
179  atmos_phy_rd_sflx_sw_dn(:,:) = undef
180  atmos_phy_rd_toaflx_lw_up(:,:) = undef
181  atmos_phy_rd_toaflx_lw_dn(:,:) = undef
182  atmos_phy_rd_toaflx_sw_up(:,:) = undef
183  atmos_phy_rd_toaflx_sw_dn(:,:) = undef
184 
185  allocate( atmos_phy_rd_sflx_downall(ia,ja,2,2) )
186  atmos_phy_rd_sflx_downall(:,:,:,:) = undef
187 
188  allocate( atmos_phy_rd_solins(ia,ja) )
189  allocate( atmos_phy_rd_cossza(ia,ja) )
190  atmos_phy_rd_solins(:,:) = undef
191  atmos_phy_rd_cossza(:,:) = undef
192 
193  !--- read namelist
194  rewind(io_fid_conf)
195  read(io_fid_conf,nml=param_atmos_phy_rd_vars,iostat=ierr)
196  if( ierr < 0 ) then !--- missing
197  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
198  elseif( ierr > 0 ) then !--- fatal error
199  write(*,*) 'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_RD_VARS. Check!'
200  call prc_mpistop
201  endif
202  if( io_nml ) write(io_fid_nml,nml=param_atmos_phy_rd_vars)
203 
204  if( io_l ) write(io_fid_log,*)
205  if( io_l ) write(io_fid_log,*) '*** [ATMOS_PHY_RD] prognostic/diagnostic variables'
206  if( io_l ) write(io_fid_log,'(1x,A,A24,A,A48,A,A12,A)') &
207  '*** |', 'VARNAME ','|', &
208  'DESCRIPTION ', '[', 'UNIT ', ']'
209  do iv = 1, vmax
210  if( io_l ) write(io_fid_log,'(1x,A,I3,A,A24,A,A48,A,A12,A)') &
211  '*** NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
212  enddo
213 
214  if( io_l ) write(io_fid_log,*)
215  if ( atmos_phy_rd_restart_in_basename /= '' ) then
216  if( io_l ) write(io_fid_log,*) '*** Restart input? : YES, file = ', trim(atmos_phy_rd_restart_in_basename)
217  if( io_l ) write(io_fid_log,*) '*** Add timelabel? : ', atmos_phy_rd_restart_in_postfix_timelabel
218  else
219  if( io_l ) write(io_fid_log,*) '*** Restart input? : NO'
220  endif
222  .AND. atmos_phy_rd_restart_out_basename /= '' ) then
223  if( io_l ) write(io_fid_log,*) '*** Restart output? : YES, file = ', trim(atmos_phy_rd_restart_out_basename)
224  if( io_l ) write(io_fid_log,*) '*** Add timelabel? : ', atmos_phy_rd_restart_out_postfix_timelabel
225  else
226  if( io_l ) write(io_fid_log,*) '*** Restart output? : NO'
228  endif
229 
230  return
231  end subroutine atmos_phy_rd_vars_setup
232 
233  !-----------------------------------------------------------------------------
235  subroutine atmos_phy_rd_vars_fillhalo
236  use scale_comm, only: &
237  comm_vars8, &
238  comm_wait
239  implicit none
240 
241  integer :: n ,iw, id
242  !---------------------------------------------------------------------------
243 
244  call comm_vars8( atmos_phy_rd_sflx_lw_up(:,:), 1 )
245  call comm_vars8( atmos_phy_rd_sflx_lw_dn(:,:), 2 )
246  call comm_vars8( atmos_phy_rd_sflx_sw_up(:,:), 3 )
247  call comm_vars8( atmos_phy_rd_sflx_sw_dn(:,:), 4 )
248  call comm_vars8( atmos_phy_rd_toaflx_lw_up(:,:), 5 )
249  call comm_vars8( atmos_phy_rd_toaflx_lw_dn(:,:), 6 )
250  call comm_vars8( atmos_phy_rd_toaflx_sw_up(:,:), 7 )
251  call comm_vars8( atmos_phy_rd_toaflx_sw_dn(:,:), 8 )
252 
253  n = 8
254  do id = 1, 2 ! direct/diffuse
255  do iw = 1, 2 ! SW/LW
256  n = n + 1
257  call comm_vars8( atmos_phy_rd_sflx_downall(:,:,iw,id), n )
258  enddo
259  enddo
260 
261  call comm_wait ( atmos_phy_rd_sflx_lw_up(:,:), 1 )
262  call comm_wait ( atmos_phy_rd_sflx_lw_dn(:,:), 2 )
263  call comm_wait ( atmos_phy_rd_sflx_sw_up(:,:), 3 )
264  call comm_wait ( atmos_phy_rd_sflx_sw_dn(:,:), 4 )
265  call comm_wait ( atmos_phy_rd_toaflx_lw_up(:,:), 5 )
266  call comm_wait ( atmos_phy_rd_toaflx_lw_dn(:,:), 6 )
267  call comm_wait ( atmos_phy_rd_toaflx_sw_up(:,:), 7 )
268  call comm_wait ( atmos_phy_rd_toaflx_sw_dn(:,:), 8 )
269 
270  n = 8
271  do id = 1, 2 ! direct/diffuse
272  do iw = 1, 2 ! SW/LW
273  n = n + 1
274  call comm_wait ( atmos_phy_rd_sflx_downall(:,:,iw,id), n )
275  enddo
276  enddo
277 
278  return
279  end subroutine atmos_phy_rd_vars_fillhalo
280 
281  !-----------------------------------------------------------------------------
284  use scale_time, only: &
286  use scale_fileio, only: &
288  implicit none
289 
290  character(len=19) :: timelabel
291  character(len=H_LONG) :: basename
292  !---------------------------------------------------------------------------
293 
294  if( io_l ) write(io_fid_log,*)
295  if( io_l ) write(io_fid_log,*) '*** Open restart file (ATMOS_PHY_RD) ***'
296 
297  if ( atmos_phy_rd_restart_in_basename /= '' ) then
298 
300  call time_gettimelabel( timelabel )
301  basename = trim(atmos_phy_rd_restart_in_basename)//'_'//trim(timelabel)
302  else
303  basename = trim(atmos_phy_rd_restart_in_basename)
304  endif
305 
306  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(basename)
307 
308  call fileio_open( restart_fid, basename )
309  else
310  if( io_l ) write(io_fid_log,*) '*** restart file for ATMOS_PHY_RD is not specified.'
311  endif
312 
313  return
314  end subroutine atmos_phy_rd_vars_restart_open
315 
316 
317  !-----------------------------------------------------------------------------
320  use scale_rm_statistics, only: &
322  stat_total
323  use scale_fileio, only: &
324  fileio_read, &
326  implicit none
327 
328  real(RP) :: total
329  !---------------------------------------------------------------------------
330 
331  if ( restart_fid /= -1 ) then
332  if( io_l ) write(io_fid_log,*)
333  if( io_l ) write(io_fid_log,*) '*** Read from restart file (ATMOS_PHY_RD) ***'
334 
335  call fileio_read( atmos_phy_rd_sflx_lw_up(:,:), & ! [OUT]
336  restart_fid, var_name(1) , 'XY', step=1 ) ! [IN]
337  call fileio_read( atmos_phy_rd_sflx_lw_dn(:,:), & ! [OUT]
338  restart_fid, var_name(2) , 'XY', step=1 ) ! [IN]
339  call fileio_read( atmos_phy_rd_sflx_sw_up(:,:), & ! [OUT]
340  restart_fid, var_name(3) , 'XY', step=1 ) ! [IN]
341  call fileio_read( atmos_phy_rd_sflx_sw_dn(:,:), & ! [OUT]
342  restart_fid, var_name(4) , 'XY', step=1 ) ! [IN]
343  call fileio_read( atmos_phy_rd_toaflx_lw_up(:,:), & ! [OUT]
344  restart_fid, var_name(5) , 'XY', step=1 ) ! [IN]
345  call fileio_read( atmos_phy_rd_toaflx_lw_dn(:,:), & ! [OUT]
346  restart_fid, var_name(6) , 'XY', step=1 ) ! [IN]
347  call fileio_read( atmos_phy_rd_toaflx_sw_up(:,:), & ! [OUT]
348  restart_fid, var_name(7) , 'XY', step=1 ) ! [IN]
349  call fileio_read( atmos_phy_rd_toaflx_sw_dn(:,:), & ! [OUT]
350  restart_fid, var_name(8) , 'XY', step=1 ) ! [IN]
351  call fileio_read( atmos_phy_rd_sflx_downall(:,:,1,1), & ! [OUT]
352  restart_fid, var_name(9) , 'XY', step=1 ) ! [IN]
353  call fileio_read( atmos_phy_rd_sflx_downall(:,:,1,2), & ! [OUT]
354  restart_fid, var_name(10), 'XY', step=1 ) ! [IN]
355  call fileio_read( atmos_phy_rd_sflx_downall(:,:,2,1), & ! [OUT]
356  restart_fid, var_name(11), 'XY', step=1 ) ! [IN]
357  call fileio_read( atmos_phy_rd_sflx_downall(:,:,2,2), & ! [OUT]
358  restart_fid, var_name(12), 'XY', step=1 ) ! [IN]
359 
360  if ( io_aggregate ) then
361  call fileio_flush( restart_fid ) ! X/Y halos have been read from file
362  else
364  end if
365 
366  if ( statistics_checktotal ) then
367  call stat_total( total, atmos_phy_rd_sflx_lw_up(:,:), var_name(1) )
368  call stat_total( total, atmos_phy_rd_sflx_lw_dn(:,:), var_name(2) )
369  call stat_total( total, atmos_phy_rd_sflx_sw_up(:,:), var_name(3) )
370  call stat_total( total, atmos_phy_rd_sflx_sw_dn(:,:), var_name(4) )
371  call stat_total( total, atmos_phy_rd_toaflx_lw_up(:,:), var_name(5) )
372  call stat_total( total, atmos_phy_rd_toaflx_lw_dn(:,:), var_name(6) )
373  call stat_total( total, atmos_phy_rd_toaflx_sw_up(:,:), var_name(7) )
374  call stat_total( total, atmos_phy_rd_toaflx_sw_dn(:,:), var_name(8) )
375  call stat_total( total, atmos_phy_rd_sflx_downall(:,:,1,1), var_name(9) )
376  call stat_total( total, atmos_phy_rd_sflx_downall(:,:,1,2), var_name(10) )
377  call stat_total( total, atmos_phy_rd_sflx_downall(:,:,2,1), var_name(11) )
378  call stat_total( total, atmos_phy_rd_sflx_downall(:,:,2,2), var_name(12) )
379  end if
380  else
381  if( io_l ) write(io_fid_log,*) '*** invalid restart file ID for ATMOS_PHY_RD.'
382  endif
383 
384  return
385  end subroutine atmos_phy_rd_vars_restart_read
386 
387  !-----------------------------------------------------------------------------
389  subroutine atmos_phy_rd_vars_external_in( &
390  init_value_in )
391  implicit none
392 
393  real(RP), intent(in) :: init_value_in
394  !---------------------------------------------------------------------------
395 
396  if( io_l ) write(io_fid_log,*)
397  if( io_l ) write(io_fid_log,*) '*** External Input (PHY_RD) ***'
398 
399  atmos_phy_rd_sflx_lw_up(:,:) = init_value_in
400  atmos_phy_rd_sflx_lw_dn(:,:) = init_value_in
401  atmos_phy_rd_sflx_sw_up(:,:) = init_value_in
402  atmos_phy_rd_sflx_sw_dn(:,:) = init_value_in
403  atmos_phy_rd_toaflx_lw_up(:,:) = init_value_in
404  atmos_phy_rd_toaflx_lw_dn(:,:) = init_value_in
405  atmos_phy_rd_toaflx_sw_up(:,:) = init_value_in
406  atmos_phy_rd_toaflx_sw_dn(:,:) = init_value_in
407  atmos_phy_rd_sflx_downall(:,:,:,:) = init_value_in
408 
409  return
410  end subroutine atmos_phy_rd_vars_external_in
411 
412  !-----------------------------------------------------------------------------
415  use scale_time, only: &
417  use scale_fileio, only: &
419  implicit none
420 
421  character(len=19) :: timelabel
422  character(len=H_LONG) :: basename
423  !---------------------------------------------------------------------------
424 
425  if ( atmos_phy_rd_restart_out_basename /= '' ) then
426 
427  if( io_l ) write(io_fid_log,*)
428  if( io_l ) write(io_fid_log,*) '*** Create restart file (ATMOS_PHY_AE) ***'
429 
431  call time_gettimelabel( timelabel )
432  basename = trim(atmos_phy_rd_restart_out_basename)//'_'//trim(timelabel)
433  else
434  basename = trim(atmos_phy_rd_restart_out_basename)
435  endif
436 
437  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(basename)
438 
439  call fileio_create( restart_fid, & ! [OUT]
441 
442  endif
443 
444  return
445  end subroutine atmos_phy_rd_vars_restart_create
446 
447  !-----------------------------------------------------------------------------
450  use scale_fileio, only: &
452  implicit none
453 
454  if ( restart_fid /= -1 ) then
455  call fileio_enddef( restart_fid ) ! [IN]
456  endif
457 
458  return
459  end subroutine atmos_phy_rd_vars_restart_enddef
460 
461  !-----------------------------------------------------------------------------
464  use scale_fileio, only: &
466  implicit none
467  !---------------------------------------------------------------------------
468 
469  if ( restart_fid /= -1 ) then
470  if( io_l ) write(io_fid_log,*)
471  if( io_l ) write(io_fid_log,*) '*** Close restart file (ATMOS_PHY_RD) ***'
472 
473  call fileio_close( restart_fid ) ! [IN]
474 
475  restart_fid = -1
476  endif
477 
478  return
479  end subroutine atmos_phy_rd_vars_restart_close
480 
481  !-----------------------------------------------------------------------------
484  use scale_fileio, only: &
486  implicit none
487  !---------------------------------------------------------------------------
488 
489  if ( restart_fid /= -1 ) then
490 
491  call fileio_def_var( restart_fid, var_id(1), var_name(1) , var_desc(1) , var_unit(1) , &
492  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
493  call fileio_def_var( restart_fid, var_id(2), var_name(2) , var_desc(2) , var_unit(2) , &
494  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
495  call fileio_def_var( restart_fid, var_id(3), var_name(3) , var_desc(3) , var_unit(3) , &
496  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
497  call fileio_def_var( restart_fid, var_id(4), var_name(4) , var_desc(4) , var_unit(4) , &
498  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
499  call fileio_def_var( restart_fid, var_id(5), var_name(5) , var_desc(5) , var_unit(5) , &
500  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
501  call fileio_def_var( restart_fid, var_id(6), var_name(6) , var_desc(6) , var_unit(6) , &
502  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
503  call fileio_def_var( restart_fid, var_id(7), var_name(7) , var_desc(7) , var_unit(7) , &
504  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
505  call fileio_def_var( restart_fid, var_id(8), var_name(8) , var_desc(8) , var_unit(8) , &
506  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
507  call fileio_def_var( restart_fid, var_id(9), var_name(9) , var_desc(9) , var_unit(9) , &
508  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
509  call fileio_def_var( restart_fid, var_id(10), var_name(10), var_desc(10), var_unit(10), &
510  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
511  call fileio_def_var( restart_fid, var_id(11), var_name(11), var_desc(11), var_unit(11), &
512  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
513  call fileio_def_var( restart_fid, var_id(12), var_name(12), var_desc(12), var_unit(12), &
514  'XY', atmos_phy_rd_restart_out_dtype ) ! [IN]
515 
516  endif
517 
518  return
519  end subroutine atmos_phy_rd_vars_restart_def_var
520 
521  !-----------------------------------------------------------------------------
524  use scale_rm_statistics, only: &
526  stat_total
527  use scale_fileio, only: &
528  fileio_write_var
529  implicit none
530 
531  real(RP) :: total
532  !---------------------------------------------------------------------------
533 
534  if ( restart_fid /= -1 ) then
535 
537 
538  if ( statistics_checktotal ) then
539  call stat_total( total, atmos_phy_rd_sflx_lw_up(:,:), var_name(1) )
540  call stat_total( total, atmos_phy_rd_sflx_lw_dn(:,:), var_name(2) )
541  call stat_total( total, atmos_phy_rd_sflx_sw_up(:,:), var_name(3) )
542  call stat_total( total, atmos_phy_rd_sflx_sw_dn(:,:), var_name(4) )
543  call stat_total( total, atmos_phy_rd_toaflx_lw_up(:,:), var_name(5) )
544  call stat_total( total, atmos_phy_rd_toaflx_lw_dn(:,:), var_name(6) )
545  call stat_total( total, atmos_phy_rd_toaflx_sw_up(:,:), var_name(7) )
546  call stat_total( total, atmos_phy_rd_toaflx_sw_dn(:,:), var_name(8) )
547  call stat_total( total, atmos_phy_rd_sflx_downall(:,:,1,1), var_name(9) )
548  call stat_total( total, atmos_phy_rd_sflx_downall(:,:,1,2), var_name(10) )
549  call stat_total( total, atmos_phy_rd_sflx_downall(:,:,2,1), var_name(11) )
550  call stat_total( total, atmos_phy_rd_sflx_downall(:,:,2,2), var_name(12) )
551  endif
552 
553  call fileio_write_var( restart_fid, var_id(1), atmos_phy_rd_sflx_lw_up(:,:), &
554  var_name(1) , 'XY' ) ! [IN]
555  call fileio_write_var( restart_fid, var_id(2), atmos_phy_rd_sflx_lw_dn(:,:), &
556  var_name(2) , 'XY' ) ! [IN]
557  call fileio_write_var( restart_fid, var_id(3), atmos_phy_rd_sflx_sw_up(:,:), &
558  var_name(3) , 'XY' ) ! [IN]
559  call fileio_write_var( restart_fid, var_id(4), atmos_phy_rd_sflx_sw_dn(:,:), &
560  var_name(4) , 'XY' ) ! [IN]
561  call fileio_write_var( restart_fid, var_id(5), atmos_phy_rd_toaflx_lw_up(:,:), &
562  var_name(5) , 'XY' ) ! [IN]
563  call fileio_write_var( restart_fid, var_id(6), atmos_phy_rd_toaflx_lw_dn(:,:), &
564  var_name(6) , 'XY' ) ! [IN]
565  call fileio_write_var( restart_fid, var_id(7), atmos_phy_rd_toaflx_sw_up(:,:), &
566  var_name(7) , 'XY' ) ! [IN]
567  call fileio_write_var( restart_fid, var_id(8), atmos_phy_rd_toaflx_sw_dn(:,:), &
568  var_name(8) , 'XY' ) ! [IN]
569  call fileio_write_var( restart_fid, var_id(9), atmos_phy_rd_sflx_downall(:,:,1,1), &
570  var_name(9) , 'XY' ) ! [IN]
571  call fileio_write_var( restart_fid, var_id(10), atmos_phy_rd_sflx_downall(:,:,1,2), &
572  var_name(10), 'XY' ) ! [IN]
573  call fileio_write_var( restart_fid, var_id(11), atmos_phy_rd_sflx_downall(:,:,2,1), &
574  var_name(11), 'XY' ) ! [IN]
575  call fileio_write_var( restart_fid, var_id(12), atmos_phy_rd_sflx_downall(:,:,2,2), &
576  var_name(12), 'XY' ) ! [IN]
577 
578  endif
579 
580  return
581  end subroutine atmos_phy_rd_vars_restart_write
582 
583 end module mod_atmos_phy_rd_vars
logical, public atmos_phy_rd_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
logical, public statistics_checktotal
calc&report variable totals to logfile?
subroutine, public atmos_phy_rd_vars_restart_close
Close restart file.
subroutine, public atmos_phy_rd_vars_restart_create
Create restart file.
subroutine, public prc_mpistop
Abort MPI.
character(len=h_long), public atmos_phy_rd_restart_in_basename
Basename of the input file.
subroutine, public atmos_phy_rd_vars_external_in(init_value_in)
Input from External I/O.
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:61
character(len=h_mid), public atmos_phy_rd_restart_out_title
title of the output file
subroutine, public fileio_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
module STDIO
Definition: scale_stdio.F90:12
real(rp), dimension(:,:,:), allocatable, public atmos_phy_rd_rhot_t
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_lw_up
module FILE I/O (netcdf)
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_sw_up
real(rp), public const_undef
Definition: scale_const.F90:43
module Statistics
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.
module grid index
logical, public io_nml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:62
module TRACER
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_sw_up
integer, public ia
of whole cells: x, local, with HALO
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:90
integer, public ka
of whole cells: z, local, with HALO
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_sw_dn
subroutine, public fileio_create(fid, basename, title, datatype, date, subsec, append, nozcoord)
Create/open a netCDF file.
module COMMUNICATION
Definition: scale_comm.F90:23
module TIME
Definition: scale_time.F90:15
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_lw_dn
module PROCESS
logical, public atmos_phy_rd_restart_output
output restart file?
subroutine, public atmos_phy_rd_vars_setup
Setup.
module CONSTANT
Definition: scale_const.F90:14
subroutine, public atmos_phy_rd_vars_restart_write
Write variables to restart file.
character(len=h_short), public atmos_phy_rd_restart_out_dtype
REAL4 or REAL8.
subroutine, public fileio_enddef(fid)
Exit netCDF file define mode.
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_rd_sflx_downall
module profiler
Definition: scale_prof.F90:10
subroutine, public atmos_phy_rd_vars_restart_enddef
Exit netCDF define mode.
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_sw_dn
logical, public io_aggregate
do parallel I/O through PnetCDF
Definition: scale_stdio.F90:66
subroutine, public fileio_open(fid, basename)
open a netCDF file for read
module PRECISION
subroutine, public fileio_def_var(fid, vid, varname, desc, unit, axistype, datatype, timeintv, nsteps)
Define a variable to file.
subroutine, public atmos_phy_rd_vars_restart_read
Read restart.
subroutine, public atmos_phy_rd_vars_fillhalo
HALO Communication.
subroutine, public fileio_close(fid)
Close a netCDF file.
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_solins
integer, public io_fid_nml
Log file ID (only for output namelist)
Definition: scale_stdio.F90:57
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?
integer, public ja
of whole cells: y, local, with HALO