51 real(RP),
parameter :: missval_tg = 50.0_rp
52 real(RP),
parameter :: missval_strg = 0.0_rp
53 real(RP),
parameter :: missval_sst = 273.1506_rp
56 real(SP),
allocatable :: read1dx(:)
57 real(SP),
allocatable :: read1dy(:)
58 real(SP),
allocatable :: read1dz(:)
59 real(SP),
allocatable :: read3d (:,:,:)
61 real(SP),
allocatable :: read3dl(:,:,:)
75 integer,
intent(out) :: dims(6)
76 integer,
intent(out) :: timelen
77 character(len=*),
intent(in) :: basename_org
79 character(len=H_LONG) :: basename
80 integer :: dims_ncm(4)
84 log_info(
"ParentAtmosSetupNICAM",*)
'Real Case/Atmos Input File Type: NICAM-NETCDF' 85 basename =
"ms_pres"//trim(basename_org)
86 call file_get_shape( basename,
"ms_pres", &
101 allocate( read1dx( dims(2) ) )
102 allocate( read1dy( dims(3) ) )
103 allocate( read1dz( dims(1) ) )
104 allocate( read3d( dims(1), dims(2), dims(3) ) )
123 real(RP),
intent(out) :: lon_org(:,:)
124 real(RP),
intent(out) :: lat_org(:,:)
125 real(RP),
intent(out) :: cz_org(:,:,:)
126 character(len=*),
intent(in) :: basename_num
127 integer,
intent(in) :: dims(6)
129 character(len=H_LONG) :: basename
134 basename =
"ms_pres"//trim(basename_num)
135 call file_open( basename, fid, single=.true., postfix=
"" )
137 call file_read( fid,
"lon", read1dx(:) )
139 lon_org(:,j) = read1dx(:) * d2r
142 call file_read( fid,
"lat", read1dy(:) )
144 lat_org(i,:) = read1dy(:) * d2r
147 call file_read( fid,
"lev", read1dz(:) )
150 cz_org(3:,i,j) = read1dz(:)
154 call file_read( fid,
"ms_pres", read3d(:,:,:) )
157 do k = dims(1)+2, 3, -1
161 if ( read3d(i,j,k-2) <= 0.0_rp )
then 163 cz_org(1:k,i,j) = 0.0_rp
166 cz_org(k,i,j) = read3d(i,j,k)
198 real(RP),
intent(out) :: velz_org(:,:,:)
199 real(RP),
intent(out) :: velx_org(:,:,:)
200 real(RP),
intent(out) :: vely_org(:,:,:)
201 real(RP),
intent(out) :: pres_org(:,:,:)
202 real(RP),
intent(out) :: temp_org(:,:,:)
203 real(RP),
intent(out) :: qtrc_org(:,:,:,:)
204 character(len=*),
intent(in) :: basename_num
205 integer,
intent(in) :: dims(6)
206 integer,
intent(in) :: it
208 real(RP) :: tsfc_org (dims(2),dims(3))
209 real(RP) :: slp_org (dims(2),dims(3))
210 real(RP) :: qvsfc_org(dims(2),dims(3))
218 character(len=H_LONG) :: basename
221 basename =
"ms_u"//trim(basename_num)
222 call file_read( basename,
"ms_u", read3d(:,:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
226 if ( abs(abs(read3d(i,j,k))-300.0_sp) < sqrt(eps) )
then 227 velx_org(k+2,i,j) = 0.0_rp
229 velx_org(k+2,i,j) = read3d(i,j,k)
232 velx_org(1:2,i,j) = 0.0_rp
236 basename =
"ms_v"//trim(basename_num)
237 call file_read( basename,
"ms_v", read3d(:,:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
241 if ( abs(abs(read3d(i,j,k))-300.0_sp) < sqrt(eps) )
then 242 vely_org(k+2,i,j) = 0.0_rp
244 vely_org(k+2,i,j) = read3d(i,j,k)
247 vely_org(1:2,i,j) = 0.0_rp
251 velz_org(:,:,:) = 0.0_rp
258 basename =
"ms_tem"//trim(basename_num)
259 call file_read( basename,
"ms_tem", read3d(:,:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
262 do k = dims(1), 1, -1
263 if ( read3d(i,j,k) <= 50.0_rp )
then 264 temp_org(1:k+2,i,j) = temp_org(k+3,i,j)
267 temp_org(k+2,i,j) = read3d(i,j,k)
277 basename =
"ss_slp"//trim(basename_num)
278 call file_read( basename,
"ss_slp", slp_org(:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
280 basename =
"ms_pres"//trim(basename_num)
281 call file_read( basename,
"ms_pres", read3d(:,:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
284 do k = dims(1), 1, -1
285 if ( read3d(i,j,k) < 0.0_rp )
then 288 pres_org(k+2,i,j) = read3d(i,j,k)
293 pott = temp_org(k+3,i,j) * (p00/pres_org(k+3,i,j))**rovcp
295 pres_org(1:k+2,i,j) = slp_org(i,j)
296 temp_org(1:k+2,i,j) = pott * (slp_org(i,j)/p00)**rovcp
300 basename =
"ss_q2m"//trim(basename_num)
301 call file_read( basename,
"ss_q2m", qvsfc_org(:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
303 qtrc_org(:,:,:,:) = 0.0_rp
304 basename =
"ms_qv"//trim(basename_num)
305 call file_read( basename,
"ms_qv", read3d(:,:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
308 do k = dims(1), 1, -1
309 if ( read3d(i,j,k) < 0.0_rp )
then 312 qtrc_org(k+2,i,j,
i_qv) = read3d(i,j,k)
315 qtrc_org(1:k+2,i,j,
i_qv) = qvsfc_org(i,j)
332 integer,
intent(out) :: ldims(3)
333 character(len=*),
intent(in) :: basename_org
335 character(len=H_LONG) :: basename
336 integer :: dims_ncm(4)
340 log_info(
"ParentLandSetupNICAM",*)
'Real Case/Land Input File Type: NICAM-NETCDF' 341 basename =
"la_tg"//trim(basename_org)
342 call file_get_shape( basename,
"la_tg", &
346 ldims(1) = dims_ncm(3)
347 ldims(2) = dims_ncm(1)
348 ldims(3) = dims_ncm(2)
350 if ( .not.
allocated(read1dx) )
then 351 allocate( read1dx( ldims(2) ) )
352 allocate( read1dy( ldims(3) ) )
355 allocate( read3dl( ldims(2), ldims(3), ldims(1) ) )
372 use_file_landwater, &
383 real(RP),
intent(out) :: tg_org(:,:,:)
384 real(RP),
intent(out) :: strg_org(:,:,:)
385 real(RP),
intent(out) :: lst_org(:,:)
386 real(RP),
intent(out) :: llon_org(:,:)
387 real(RP),
intent(out) :: llat_org(:,:)
388 real(RP),
intent(out) :: lz_org(:)
389 real(RP),
intent(out) :: topo_org(:,:)
390 real(RP),
intent(out) :: lmask_org(:,:)
391 character(len=*),
intent(in) :: basename_num
392 integer,
intent(in) :: ldims(3)
393 logical,
intent(in) :: use_file_landwater
394 integer,
intent(in) :: it
399 character(len=H_LONG) :: basename
402 basename =
"la_tg"//trim(basename_num)
403 call file_read( basename,
"lev", lz_org(:), single=.true., postfix=
"" )
405 call file_read( basename,
"lon", read1dx(:), single=.true., postfix=
"" )
407 llon_org(:,j) = read1dx(:) * d2r
410 call file_read( basename,
"lat", read1dy(:), single=.true., postfix=
"" )
412 llat_org(i,:) = read1dy(:) * d2r
415 basename =
"lsmask"//trim(basename_num)
416 call file_read( basename,
"lsmask", lmask_org(:,:), step=it, rankid=myrank, single=.true., allow_missing=.true., missing_value=undef, postfix=
"" )
418 basename =
"la_tg"//trim(basename_num)
419 call file_read( basename,
"la_tg", read3dl(:,:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
423 tg_org(k,i,j) = read3dl(i,j,k)
428 if( use_file_landwater )
then 429 basename =
"la_wg"//trim(basename_num)
430 call file_read( basename,
"la_wg", read3dl(:,:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
434 strg_org(k,i,j) = read3dl(i,j,k)
440 basename =
"ss_tem_sfc"//trim(basename_num)
441 call file_read( basename,
"ss_tem_sfc", lst_org(:,:), step=it, rankid=myrank, single=.true., postfix=
"" )
447 if ( abs(tg_org(k,i,j) -missval_tg ) < eps ) tg_org(k,i,j) = undef
448 if ( abs(strg_org(k,i,j)-missval_strg) < eps ) strg_org(k,i,j) = undef
468 integer,
intent(out) :: odims(2)
469 integer,
intent(out) :: timelen
470 character(len=*),
intent(in) :: basename_org
472 character(len=H_LONG) :: basename
473 integer :: dims_ncm(4)
477 log_info(
"ParentOceanSetupNICAM",*)
'Real Case/Ocean Input File Type: NICAM-NETCDF' 479 basename =
"oa_sst"//trim(basename_org)
480 call file_get_shape( basename,
"oa_sst", &
483 odims(1) = dims_ncm(1)
484 odims(2) = dims_ncm(2)
486 timelen = dims_ncm(4)
488 if ( .not.
allocated(read1dx) )
then 489 allocate( read1dx( odims(1) ) )
490 allocate( read1dy( odims(2) ) )
510 real(RP),
intent(out) :: olon_org(:,:)
511 real(RP),
intent(out) :: olat_org(:,:)
512 real(RP),
intent(out) :: omask_org(:,:)
513 character(len=*),
intent(in) :: basename_num
514 integer,
intent(in) :: odims(2)
516 character(len=H_LONG) :: basename
520 basename =
"oa_sst"//trim(basename_num)
521 call file_read( basename,
"lon", read1dx(:), single=.true., postfix=
"" )
523 olon_org(:,j) = read1dx(:) * d2r
526 call file_read( basename,
"lat", read1dy(:), single=.true., postfix=
"" )
528 olat_org(i,:) = read1dy(:) * d2r
531 basename =
"lsmask"//trim(basename_num)
532 call file_read( basename,
"lsmask", omask_org(:,:), step=1, rankid=myrank, single=.true., allow_missing=.true., missing_value=undef, postfix=
"" )
554 real(RP),
intent(out) :: tw_org(:,:)
555 real(RP),
intent(out) :: sst_org(:,:)
556 character(len=*),
intent(in) :: basename_num
557 integer,
intent(in) :: odims(2)
558 real(RP),
intent(in) :: omask_org(:,:)
559 integer,
intent(in) :: it
564 character(len=H_LONG) :: basename
567 basename =
"oa_sst"//trim(basename_num)
568 call file_read( basename,
"oa_sst", sst_org(:,:), step=1, rankid=myrank, single=.true., postfix=
"" )
577 if ( abs(omask_org(i,j)-1.0_rp) < eps )
then 580 sst_org(i,j) = ( sst_org(i,j) - missval_sst*omask_org(i,j) ) &
581 / ( 1.0_rp - omask_org(i,j) )
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
real(rp), public const_d2r
degree to radian
subroutine, public file_open(basename, fid, mode, single, aggregate, rankid, postfix)
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
real(rp), public const_undef
module atmosphere / hydrometeor
real(rp), public const_pre00
pressure reference [Pa]
integer, public prc_myrank
process num in local communicator
subroutine, public prc_abort
Abort Process.
real(rp), public const_eps
small number