55 real(RP),
parameter :: missval_tg = 50.0_rp
56 real(RP),
parameter :: missval_strg = 0.0_rp
57 real(RP),
parameter :: missval_sst = 273.1506_rp
60 real(SP),
allocatable :: read1dx(:)
61 real(SP),
allocatable :: read1dy(:)
62 real(SP),
allocatable :: read1dz(:)
63 real(SP),
allocatable :: read3ds(:,:,:,:)
64 real(SP),
allocatable :: read4d (:,:,:,:)
66 real(SP),
allocatable :: read1dlz(:)
67 real(SP),
allocatable :: read4dl(:,:,:,:)
81 integer,
intent(out) :: dims(6)
82 integer,
intent(out) :: timelen
83 character(len=H_LONG),
intent(in) :: basename_org
85 character(len=H_LONG) :: basename
86 integer :: dims_ncm(4)
90 if(
io_l )
write(
io_fid_log,*)
'+++ Real Case/Atom Input File Type: NICAM-NETCDF' 91 basename =
"ms_pres"//trim(basename_org)
92 call filegetshape( dims_ncm(:), trim(basename),
"ms_pres", 1, single=.true. )
105 allocate( read1dx( dims(2) ) )
106 allocate( read1dy( dims(3) ) )
107 allocate( read1dz( dims(1) ) )
108 allocate( read3ds( 1, dims(2), dims(3), 1 ) )
109 allocate( read4d( dims(1), dims(2), dims(3), 1 ) )
129 real(RP),
intent(out) :: lon_org(:,:)
130 real(RP),
intent(out) :: lat_org(:,:)
131 real(RP),
intent(out) :: cz_org(:,:,:)
132 character(len=H_LONG),
intent(in) :: basename_num
133 integer,
intent(in) :: dims(6)
135 character(len=H_LONG) :: basename
139 if(
io_l )
write(
io_fid_log,*)
'+++ ScaleLib/IO[realinput]/Categ[AtomOpenNICAM]' 141 basename =
"ms_pres"//trim(basename_num)
142 call fileread( read1dx(:), trim(basename),
"lon", 1, 1, single=.true. )
144 lon_org(:,j) = read1dx(:) * d2r
147 call fileread( read1dy(:), trim(basename),
"lat", 1, 1, single=.true. )
149 lat_org(i,:) = read1dy(:) * d2r
152 call fileread( read1dz(:), trim(basename),
"lev", 1, 1, single=.true. )
155 cz_org(3:,i,j) = read1dz(:)
159 call externalfileread( read4d(:,:,:,:), trim(basename),
"ms_pres", 1, 1, myrank, inicam, single=.true. )
162 do k = dims(1)+2, 3, -1
166 if ( read4d(k-2,i,j,1) <= 0.0_rp )
then 168 cz_org(1:k,i,j) = 0.0_rp
197 externalfilereadoffset
200 real(RP),
intent(out) :: velz_org(:,:,:)
201 real(RP),
intent(out) :: velx_org(:,:,:)
202 real(RP),
intent(out) :: vely_org(:,:,:)
203 real(RP),
intent(out) :: pres_org(:,:,:)
204 real(RP),
intent(out) :: temp_org(:,:,:)
205 real(RP),
intent(out) :: qtrc_org(:,:,:,:)
206 character(len=*),
intent(in) :: basename_num
207 integer,
intent(in) :: dims(6)
208 integer,
intent(in) :: it
210 real(RP) :: tsfc_org (dims(2),dims(3))
211 real(RP) :: slp_org (dims(2),dims(3))
212 real(RP) :: qvsfc_org(dims(2),dims(3))
220 character(len=H_LONG) :: basename
223 if(
io_l )
write(
io_fid_log,*)
'+++ ScaleLib/IO[realinput]/Categ[AtomInputNICAM]' 226 basename =
"ms_u"//trim(basename_num)
227 call externalfilereadoffset( read4d(:,:,:,:), trim(basename),
"ms_u", it, it, myrank, inicam, single=.true. )
231 if ( abs(abs(read4d(k,i,j,1))-300.0_sp) < sqrt(eps) )
then 232 velx_org(k+2,i,j) = 0.0_rp
234 velx_org(k+2,i,j) =
real( read4D(k,i,j,1), kind=
rp )
237 velx_org(1:2,i,j) = 0.0_rp
241 basename =
"ms_v"//trim(basename_num)
242 call externalfilereadoffset( read4d(:,:,:,:), &
252 if ( abs(abs(read4d(k,i,j,1))-300.0_sp) < sqrt(eps) )
then 253 vely_org(k+2,i,j) = 0.0_rp
255 vely_org(k+2,i,j) =
real( read4D(k,i,j,1), kind=
rp )
258 vely_org(1:2,i,j) = 0.0_rp
262 velz_org(:,:,:) = 0.0_rp
269 basename =
"ms_tem"//trim(basename_num)
270 call externalfilereadoffset( read4d(:,:,:,:), trim(basename),
"ms_tem", it, it, myrank, inicam, single=.true. )
273 do k = dims(1), 1, -1
274 if ( read4d(k,i,j,1) <= 50.0_sp )
then 278 temp_org(1:k+2,i,j) =
real( read4D(k,i,j,1), kind=
rp )
288 basename =
"ss_slp"//trim(basename_num)
289 call externalfilereadoffset( read3ds(:,:,:,:), trim(basename),
"ss_slp", it, it, myrank, inicam, single=.true. )
290 slp_org(:,:) =
real( read3DS(1,:,:,1), kind=
rp )
291 basename =
"ms_pres"//trim(basename_num)
292 call externalfileread( read4d(:,:,:,:), trim(basename),
"ms_pres", it, it, myrank, inicam, single=.true. )
293 pres_org(3:,:,:) = read4d(:,:,:,1)
296 do k = dims(1), 1, -1
297 if ( read4d(k,i,j,1) < 0.0_sp )
then 300 pres_org(k+2,i,j) =
real( read4D(k,i,j,1), kind=
rp )
305 pott = temp_org(k+3,i,j) * (p00/pres_org(k+3,i,j))**rovcp
307 pres_org(1:k+2,i,j) = slp_org(i,j)
308 temp_org(1:k+2,i,j) = pott * (slp_org(i,j)/p00)**rovcp
312 basename =
"ss_q2m"//trim(basename_num)
313 call externalfileread( read3ds(:,:,:,:), trim(basename),
"ss_q2m", it, it, myrank, inicam, single=.true. )
314 qvsfc_org(:,:) =
real( read3DS(1,:,:,1), kind=
rp )
315 qtrc_org(:,:,:,:) = 0.0_rp
316 basename =
"ms_qv"//trim(basename_num)
317 call externalfileread( read4d(:,:,:,:), trim(basename),
"ms_qv", it, it, myrank, inicam, single=.true. )
320 do k = dims(1), 1, -1
321 if ( read4d(k,i,j,1) < 0.0_sp )
then 322 qtrc_org(1:k+2,i,j,
i_qv) = qvsfc_org(i,j)
325 qtrc_org(k+2,i,j,
i_qv) =
real( read4D(k,i,j,1), kind=
rp )
328 qtrc_org(1:2,i,j,
i_qv) = qvsfc_org(i,j)
345 integer,
intent(out) :: ldims(3)
346 character(len=H_LONG),
intent(in) :: basename_org
348 character(len=H_LONG) :: basename
349 integer :: dims_ncm(4)
353 if(
io_l )
write(
io_fid_log,*)
'+++ Real Case/Land Input File Type: NICAM-NETCDF' 354 basename =
"la_tg"//trim(basename_org)
355 call filegetshape( dims_ncm(:), trim(basename),
"la_tg", 1, single=.true. )
357 ldims(1) = dims_ncm(3)
358 ldims(2) = dims_ncm(1)
359 ldims(3) = dims_ncm(2)
361 if ( .not.
allocated(read1dx) )
then 362 allocate( read1dx( ldims(2) ) )
363 allocate( read1dy( ldims(3) ) )
364 allocate( read3ds( 1, ldims(2), ldims(3), 1 ) )
367 allocate( read1dlz( ldims(1) ) )
368 allocate( read4dl( ldims(1), ldims(2), ldims(3), 1 ) )
385 use_file_landwater, &
396 externalfilereadoffset
399 real(RP),
intent(out) :: tg_org(:,:,:)
400 real(RP),
intent(out) :: strg_org(:,:,:)
401 real(RP),
intent(out) :: lst_org(:,:)
402 real(RP),
intent(out) :: llon_org(:,:)
403 real(RP),
intent(out) :: llat_org(:,:)
404 real(RP),
intent(out) :: lz_org(:)
405 real(RP),
intent(out) :: topo_org(:,:)
406 real(RP),
intent(out) :: lmask_org(:,:)
407 character(len=*),
intent(in) :: basename_num
408 integer,
intent(in) :: ldims(3)
409 logical,
intent(in) :: use_file_landwater
410 integer,
intent(in) :: it
415 character(len=H_LONG) :: basename
418 if(
io_l )
write(
io_fid_log,*)
'+++ ScaleLib/IO[realinput]/Categ[LandInputNICAM]' 420 basename =
"la_tg"//trim(basename_num)
421 call fileread( read1dlz(:), trim(basename),
"lev", 1, 1, single=.true. )
422 lz_org(:) = read1dlz(:)
424 call fileread( read1dx(:), trim(basename),
"lon", 1, 1, single=.true. )
426 llon_org(:,j) = read1dx(:) * d2r
429 call fileread( read1dy(:), trim(basename),
"lat", 1, 1, single=.true. )
431 llat_org(i,:) = read1dy(:) * d2r
434 basename =
"lsmask"//trim(basename_num)
435 call externalfileread( read3ds(:,:,:,:), &
443 lmask_org(:,:) =
real( read3DS(1,:,:,1), kind=
rp )
445 basename =
"la_tg"//trim(basename_num)
446 call externalfilereadoffset( read4dl(:,:,:,:), &
453 tg_org(:,:,:) =
real( read4DL(:,:,:,1), kind=
rp )
455 if( use_file_landwater )
then 456 basename =
"la_wg"//trim(basename_num)
457 call externalfilereadoffset( read4dl(:,:,:,:), &
464 strg_org(:,:,:) =
real( read4DL(:,:,:,1), kind=
rp )
467 basename =
"ss_tem_sfc"//trim(basename_num)
468 call externalfileread( read3ds(:,:,:,:), &
475 lst_org(:,:) =
real( read3DS(1,:,:,1), kind=
rp )
482 if ( abs(tg_org(k,i,j) -missval_tg ) < eps ) tg_org(k,i,j) = undef
483 if ( abs(strg_org(k,i,j)-missval_strg) < eps ) strg_org(k,i,j) = undef
503 integer,
intent(out) :: odims(2)
504 integer,
intent(out) :: timelen
505 character(len=H_LONG),
intent(in) :: basename_org
507 character(len=H_LONG) :: basename
508 integer :: dims_ncm(4)
512 if(
io_l )
write(
io_fid_log,*)
'+++ Real Case/Ocean Input File Type: NICAM-NETCDF' 514 basename =
"oa_sst"//trim(basename_org)
515 call filegetshape( dims_ncm(:), trim(basename),
"oa_sst", 1, single=.true. )
516 odims(1) = dims_ncm(1)
517 odims(2) = dims_ncm(2)
519 timelen = dims_ncm(4)
521 if ( .not.
allocated(read1dx) )
then 522 allocate( read1dx( odims(1) ) )
523 allocate( read1dy( odims(2) ) )
524 allocate( read3ds( 1, odims(1), odims(2), 1 ) )
545 real(RP),
intent(out) :: olon_org(:,:)
546 real(RP),
intent(out) :: olat_org(:,:)
547 real(RP),
intent(out) :: omask_org(:,:)
548 character(len=H_LONG),
intent(in) :: basename_num
549 integer,
intent(in) :: odims(2)
551 character(len=H_LONG) :: basename
555 if(
io_l )
write(
io_fid_log,*)
'+++ ScaleLib/IO[realinput]/Categ[OceanOpenNICAM]' 557 basename =
"oa_sst"//trim(basename_num)
558 call fileread( read1dx(:), trim(basename),
"lon", 1, 1, single=.true. )
560 olon_org(:,j) = read1dx(:) * d2r
563 call fileread( read1dy(:), trim(basename),
"lat", 1, 1, single=.true. )
565 olat_org(i,:) = read1dy(:) * d2r
568 basename =
"lsmask"//trim(basename_num)
569 call externalfileread( read3ds(:,:,:,:), &
577 omask_org(:,:) =
real( read3DS(1,:,:,1), kind=
rp )
599 externalfilereadoffset
602 real(RP),
intent(out) :: tw_org(:,:)
603 real(RP),
intent(out) :: sst_org(:,:)
604 character(len=*),
intent(in) :: basename_num
605 integer,
intent(in) :: odims(2)
606 real(RP),
intent(in) :: omask_org(:,:)
607 integer,
intent(in) :: it
612 character(len=H_LONG) :: basename
615 if(
io_l )
write(
io_fid_log,*)
'+++ ScaleLib/IO[realinput]/Categ[OceanInputNICAM]' 618 basename =
"oa_sst"//trim(basename_num)
619 call externalfilereadoffset( read3ds(:,:,:,:), &
626 sst_org(:,:) =
real( read3DS(1,:,:,1), kind=
rp )
637 if ( abs(omask_org(i,j)-1.0_rp) < eps )
then 640 sst_org(i,j) = ( sst_org(i,j) - missval_sst*omask_org(i,j) ) &
641 / ( 1.0_rp - omask_org(i,j) )
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
subroutine, public prc_mpistop
Abort MPI.
integer, parameter, public inicam
logical, public io_l
output log or not? (this process)
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
real(rp), public const_d2r
degree to radian
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
real(rp), public const_undef
real(rp), public const_pre00
pressure reference [Pa]
integer, public prc_myrank
process num in local communicator
real(rp), public const_eps
small number
integer, public io_fid_log
Log file ID.
integer, parameter, public rp