SCALE-RM
scale_file_external_input_cartesC.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
24  !-----------------------------------------------------------------------------
25  implicit none
26  private
27  !-----------------------------------------------------------------------------
28  !
29  !++ Public procedures
30  !
32 
33  !-----------------------------------------------------------------------------
34  !
35  !++ Public parameters & variables
36  !
37  private :: file_external_input_cartesc_get_dims1d
38  private :: file_external_input_cartesc_get_dims2d
39  private :: file_external_input_cartesc_get_dims3d
40 
41  !-----------------------------------------------------------------------------
42  !
43  !++ Private procedures
44  !
45  !-----------------------------------------------------------------------------
46  !
47  !++ Private parameters & variables
48  !
49  !-----------------------------------------------------------------------------
50 contains
51  !-----------------------------------------------------------------------------
53  !-----------------------------------------------------------------------------
63 
65 
66  file_external_input_get_dims1d => file_external_input_cartesc_get_dims1d
67  file_external_input_get_dims2d => file_external_input_cartesc_get_dims2d
68  file_external_input_get_dims3d => file_external_input_cartesc_get_dims3d
69 
73 
74  return
76 
77  !-----------------------------------------------------------------------------
79  subroutine file_external_input_cartesc_get_dims1d( &
80  dim1_size, &
81  dim1_max, &
82  dim1_S, &
83  varname, &
84  axistype )
85  use scale_prc, only: &
86  prc_abort
87  implicit none
88  integer, intent(out) :: dim1_size
89  integer, intent(out) :: dim1_max
90  integer, intent(out) :: dim1_s
91  character(len=*), intent(in) :: varname
92  character(len=*), intent(in) :: axistype ! axis type (Z/X/Y)
93 
94  select case ( axistype )
95  case ( 'Z' )
96  dim1_size = ka
97  dim1_max = kmax
98  dim1_s = ks
99  case ( 'X' )
100  dim1_size = ia
101  dim1_max = imaxb
102  dim1_s = isb
103  case ( 'Y' )
104  dim1_size = ja
105  dim1_max = jmaxb
106  dim1_s = jsb
107  case ( 'OZ' )
108  dim1_size = oka
109  dim1_max = okmax
110  dim1_s = oks
111  case default
112  log_error("FILE_EXTERNAL_INPUT_CARTESC_get_dims1D",*) 'unsupported axis type. Check! axistype:', trim(axistype), ', item:',trim(varname)
113  call prc_abort
114  end select
115 
116  return
117  end subroutine file_external_input_cartesc_get_dims1d
118 
119  subroutine file_external_input_cartesc_get_dims2d( &
120  dim1_size, &
121  dim1_max, &
122  dim1_S, &
123  dim2_size, &
124  dim2_max, &
125  dim2_S, &
126  transpose, &
127  varname, &
128  axistype )
129  use scale_prc, only: &
130  prc_abort
131  implicit none
132  integer, intent(out) :: dim1_size
133  integer, intent(out) :: dim1_max
134  integer, intent(out) :: dim1_s
135  integer, intent(out) :: dim2_size
136  integer, intent(out) :: dim2_max
137  integer, intent(out) :: dim2_s
138  logical, intent(out) :: transpose
139  character(len=*), intent(in) :: varname
140  character(len=*), intent(in) :: axistype ! axis type (XY/XZ/ZX)
141 
142  select case ( axistype )
143  case ( 'XY' )
144  dim1_size = ia
145  dim1_max = imaxb
146  dim1_s = isb
147  dim2_size = ja
148  dim2_max = jmaxb
149  dim2_s = jsb
150  transpose = .false.
151  case ( 'ZX' )
152  dim1_size = ka
153  dim1_max = kmax
154  dim1_s = ks
155  dim2_size = ia
156  dim2_max = imaxb
157  dim2_s = isb
158  transpose = .false.
159  case ( 'XZ' )
160  dim1_size = ia
161  dim1_max = imaxb
162  dim1_s = isb
163  dim2_size = ka
164  dim2_max = kmax
165  dim2_s = ks
166  transpose = .true.
167  case default
168  log_error("FILE_EXTERNAL_INPUT_CARTESC_get_dims2D",*) 'unsupported axis type. Check! axistype:', trim(axistype), ', item:',trim(varname)
169  call prc_abort
170  end select
171 
172  return
173  end subroutine file_external_input_cartesc_get_dims2d
174 
175  subroutine file_external_input_cartesc_get_dims3d( &
176  dim1_size, &
177  dim1_max, &
178  dim1_S, &
179  dim2_size, &
180  dim2_max, &
181  dim2_S, &
182  dim3_size, &
183  dim3_max, &
184  dim3_S, &
185  transpose, &
186  varname, &
187  axistype )
188  use scale_prc, only: &
189  prc_abort
190  implicit none
191  integer, intent(out) :: dim1_size
192  integer, intent(out) :: dim1_max
193  integer, intent(out) :: dim1_s
194  integer, intent(out) :: dim2_size
195  integer, intent(out) :: dim2_max
196  integer, intent(out) :: dim2_s
197  integer, intent(out) :: dim3_size
198  integer, intent(out) :: dim3_max
199  integer, intent(out) :: dim3_s
200  logical, intent(out) :: transpose
201  character(len=*), intent(in) :: varname
202  character(len=*), intent(in) :: axistype ! axis type (ZXY/XYZ/LXY/XYL/UXY/XYU)
203 
204  select case ( axistype )
205  case ( 'ZXY' )
206  dim1_size = ka
207  dim1_max = kmax
208  dim1_s = ks
209  dim2_size = ia
210  dim2_max = imaxb
211  dim2_s = isb
212  dim3_size = ja
213  dim3_max = jmaxb
214  dim3_s = jsb
215  transpose = .false.
216  case ( 'XYZ' )
217  dim1_size = ia
218  dim1_max = imaxb
219  dim1_s = isb
220  dim2_size = ja
221  dim2_max = jmaxb
222  dim2_s = jsb
223  dim3_size = ka
224  dim3_max = kmax
225  dim3_s = ks
226  transpose = .true.
227  case ( 'OXY' ) ! OCEAN
228  dim1_size = oka
229  dim1_max = okmax
230  dim1_s = oks
231  dim2_size = ia
232  dim2_max = imaxb
233  dim2_s = isb
234  dim3_size = ja
235  dim3_max = jmaxb
236  dim3_s = jsb
237  transpose = .false.
238  case ( 'XYO' ) ! OCEAN
239  dim1_size = ia
240  dim1_max = imaxb
241  dim1_s = isb
242  dim2_size = ja
243  dim2_max = jmaxb
244  dim2_s = jsb
245  dim3_size = oka
246  dim3_max = okmax
247  dim3_s = oks
248  transpose = .true.
249  case ( 'LXY' ) ! LAND
250  dim1_size = lka
251  dim1_max = lkmax
252  dim1_s = lks
253  dim2_size = ia
254  dim2_max = imaxb
255  dim2_s = isb
256  dim3_size = ja
257  dim3_max = jmaxb
258  dim3_s = jsb
259  transpose = .false.
260  case ( 'XYL' ) ! LAND
261  dim1_size = ia
262  dim1_max = imaxb
263  dim1_s = isb
264  dim2_size = ja
265  dim2_max = jmaxb
266  dim2_s = jsb
267  dim3_size = lka
268  dim3_max = lkmax
269  dim3_s = lks
270  transpose = .true.
271  case ( 'UXY' )
272  dim1_size = uka
273  dim1_max = ukmax
274  dim1_s = uks
275  dim2_size = ia
276  dim2_max = imaxb
277  dim2_s = isb
278  dim3_size = ja
279  dim3_max = jmaxb
280  dim3_s = jsb
281  transpose = .false.
282  case ( 'XYU' )
283  dim1_size = ia
284  dim1_max = imaxb
285  dim1_s = isb
286  dim2_size = ja
287  dim2_max = jmaxb
288  dim2_s = jsb
289  dim3_size = uka
290  dim3_max = ukmax
291  dim3_s = uks
292  transpose = .true.
293  case default
294  log_error("FILE_EXTERNAL_INPUT_CARTESC_get_dims3D",*) 'unsupported axis type. Check! axistype:', trim(axistype), ', item:',trim(varname)
295  call prc_abort
296  end select
297 
298  return
299  end subroutine file_external_input_cartesc_get_dims3d
300 
301 
303  fid, varname, &
304  dim_type, &
305  var, &
306  step )
307  use scale_file_cartesc, only: &
308  file_cartesc_read, &
310  implicit none
311  integer, intent(in) :: fid
312  character(len=*), intent(in) :: varname
313  character(len=*), intent(in) :: dim_type
314  real(RP), intent(out) :: var(:)
315  integer, intent(in), optional :: step
316 
317  call file_cartesc_read( fid, varname, dim_type, & ! [IN]
318  var(:), & ! [OUT]
319  step = step ) ! [IN]
320 
321  call file_cartesc_flush( fid )
322 
323  return
325 
327  fid, varname, &
328  dim_type, &
329  var, &
330  step )
331  use scale_file_cartesc, only: &
332  file_cartesc_read, &
334  implicit none
335  integer, intent(in) :: fid
336  character(len=*), intent(in) :: varname
337  character(len=*), intent(in) :: dim_type
338  real(RP), intent(out) :: var(:,:)
339  integer, intent(in), optional :: step
340 
341  call file_cartesc_read( fid, varname, dim_type, & ! [IN]
342  var(:,:), & ! [OUT]
343  step = step ) ! [IN]
344 
345  call file_cartesc_flush( fid )
346 
347  return
349 
351  fid, varname, &
352  dim_type, &
353  var, &
354  step )
355  use scale_file_cartesc, only: &
356  file_cartesc_read, &
358  implicit none
359  integer, intent(in) :: fid
360  character(len=*), intent(in) :: varname
361  character(len=*), intent(in) :: dim_type
362  real(RP), intent(out) :: var(:,:,:)
363  integer, intent(in), optional :: step
364 
365  call file_cartesc_read( fid, varname, dim_type, & ! [IN]
366  var(:,:,:), & ! [OUT]
367  step = step ) ! [IN]
368 
369  call file_cartesc_flush( fid )
370 
371  return
373 
scale_atmos_grid_cartesc_index::isb
integer, public isb
Definition: scale_atmos_grid_cartesC_index.F90:63
scale_file_external_input::file_external_input_read_3d
procedure(read3d), pointer, public file_external_input_read_3d
Definition: scale_file_external_input.F90:143
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
scale_atmos_grid_cartesc_index::jmaxb
integer, public jmaxb
Definition: scale_atmos_grid_cartesC_index.F90:62
scale_precision
module PRECISION
Definition: scale_precision.F90:14
scale_atmos_grid_cartesc_index::ka
integer, public ka
Definition: scale_atmos_grid_cartesC_index.F90:47
scale_land_grid_cartesc_index::lkmax
integer, public lkmax
Definition: scale_land_grid_cartesC_index.F90:32
scale_file_external_input_cartesc
module file / external_input_cartesC
Definition: scale_file_external_input_cartesC.F90:12
scale_ocean_grid_cartesc_index::oka
integer, public oka
Definition: scale_ocean_grid_cartesC_index.F90:36
scale_file_external_input::file_external_input_setup
subroutine, public file_external_input_setup
Setup.
Definition: scale_file_external_input.F90:207
scale_ocean_grid_cartesc_index::okmax
integer, public okmax
Definition: scale_ocean_grid_cartesC_index.F90:32
scale_file_external_input::file_external_input_get_dims3d
procedure(get_dims3d), pointer, public file_external_input_get_dims3d
Definition: scale_file_external_input.F90:136
scale_urban_grid_cartesc_index
module urban / grid / icosahedralA / index
Definition: scale_urban_grid_cartesC_index.F90:11
scale_land_grid_cartesc_index
module land / grid / cartesianC / index
Definition: scale_land_grid_cartesC_index.F90:11
scale_urban_grid_cartesc_index::ukmax
integer, public ukmax
Definition: scale_urban_grid_cartesC_index.F90:32
scale_file_external_input_cartesc::file_external_input_cartesc_read_3d
subroutine file_external_input_cartesc_read_3d(fid, varname, dim_type, var, step)
Definition: scale_file_external_input_cartesC.F90:355
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_file_external_input_cartesc::file_external_input_cartesc_setup
subroutine, public file_external_input_cartesc_setup
Setup.
Definition: scale_file_external_input_cartesC.F90:55
scale_io
module STDIO
Definition: scale_io.F90:10
scale_atmos_grid_cartesc_index
module atmosphere / grid / cartesC index
Definition: scale_atmos_grid_cartesC_index.F90:12
scale_atmos_grid_cartesc_index::ia
integer, public ia
Definition: scale_atmos_grid_cartesC_index.F90:48
scale_atmos_grid_cartesc_index::kmax
integer, public kmax
Definition: scale_atmos_grid_cartesC_index.F90:36
scale_file_external_input::file_external_input_read_2d
procedure(read2d), pointer, public file_external_input_read_2d
Definition: scale_file_external_input.F90:142
scale_prof
module profiler
Definition: scale_prof.F90:11
scale_ocean_grid_cartesc_index
module ocean / grid / cartesianC / index
Definition: scale_ocean_grid_cartesC_index.F90:11
scale_atmos_grid_cartesc_index::ja
integer, public ja
Definition: scale_atmos_grid_cartesC_index.F90:49
scale_file_external_input::file_external_input_get_dims2d
procedure(get_dims2d), pointer, public file_external_input_get_dims2d
Definition: scale_file_external_input.F90:135
scale_file_external_input::file_external_input_read_1d
procedure(read1d), pointer, public file_external_input_read_1d
Definition: scale_file_external_input.F90:141
scale_urban_grid_cartesc_index::uks
integer, public uks
Definition: scale_urban_grid_cartesC_index.F90:37
scale_atmos_grid_cartesc_index::ks
integer, public ks
start point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:51
scale_atmos_grid_cartesc_index::imaxb
integer, public imaxb
Definition: scale_atmos_grid_cartesC_index.F90:61
scale_file_cartesc::file_cartesc_flush
subroutine, public file_cartesc_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
Definition: scale_file_cartesC.F90:997
scale_urban_grid_cartesc_index::uka
integer, public uka
Definition: scale_urban_grid_cartesC_index.F90:36
scale_file_external_input_cartesc::file_external_input_cartesc_read_2d
subroutine file_external_input_cartesc_read_2d(fid, varname, dim_type, var, step)
Definition: scale_file_external_input_cartesC.F90:331
scale_file_external_input
module file / external_input
Definition: scale_file_external_input.F90:12
scale_atmos_grid_cartesc_index::jsb
integer, public jsb
Definition: scale_atmos_grid_cartesC_index.F90:65
scale_file_external_input_cartesc::file_external_input_cartesc_read_1d
subroutine file_external_input_cartesc_read_1d(fid, varname, dim_type, var, step)
Definition: scale_file_external_input_cartesC.F90:307
scale_file_external_input::file_external_input_get_dims1d
procedure(get_dims1d), pointer, public file_external_input_get_dims1d
Definition: scale_file_external_input.F90:134
scale_land_grid_cartesc_index::lks
integer, public lks
Definition: scale_land_grid_cartesC_index.F90:40
scale_file_cartesc
module file / cartesianC
Definition: scale_file_cartesC.F90:11
scale_land_grid_cartesc_index::lka
integer, public lka
Definition: scale_land_grid_cartesC_index.F90:36
scale_ocean_grid_cartesc_index::oks
integer, public oks
Definition: scale_ocean_grid_cartesC_index.F90:37