48 integer,
private,
parameter :: handle = 1
50 real(RP),
private,
allocatable :: read2d (:,:)
51 real(RP),
private,
allocatable :: read3d (:,:,:)
52 real(RP),
private,
allocatable :: read3dl(:,:,:)
53 real(RP),
private,
allocatable :: read3do(:,:,:)
69 integer,
intent(out) :: dims(6)
72 log_info(
"ParentAtmosSetupSCALE",*)
'Real Case/Atmos Input File Type: SCALE-RM' 109 real(RP),
intent(out) :: lon_org(:,:)
110 real(RP),
intent(out) :: lat_org(:,:)
111 real(RP),
intent(out) :: cz_org (:,:,:)
112 character(len=*),
intent(in) :: basename_org
113 integer,
intent(in) :: dims(6)
116 integer :: xloc, yloc
117 integer :: xs, xe, ys, ye
125 do i = 1,
size( nest_tile_id(:) )
127 rank = nest_tile_id(i)
129 xloc = mod( i-1, nest_tile_num_x ) + 1
130 yloc = int(
real(i-1) /
real(NEST_TILE_NUM_X) ) + 1
139 aggregate=.false., rankid=rank )
141 call file_cartesc_read( fid,
"lon", read2d(:,:) )
142 lon_org(xs:xe,ys:ye) = read2d(:,:) * d2r
144 call file_cartesc_read( fid,
"lat", read2d(:,:) )
145 lat_org(xs:xe,ys:ye) = read2d(:,:) * d2r
147 call file_cartesc_read( fid,
"height", read3d(:,:,:) )
148 cz_org(3:dims(1)+2,xs:xe,ys:ye) = read3d(:,:,:)
150 call file_cartesc_read( fid,
"topo", read2d(:,:), existed=existed )
151 cz_org(2,xs:xe,ys:ye) = read2d(:,:)
155 cz_org(1,:,:) = 0.0_rp
196 thermodyn_specific_heat => atmos_thermodyn_specific_heat, &
197 thermodyn_rhot2temp_pres => atmos_thermodyn_rhot2temp_pres
199 hydrostatic_buildrho_real => atmos_hydrostatic_buildrho_real
212 real(RP),
intent(out) :: velz_org(:,:,:)
213 real(RP),
intent(out) :: velx_org(:,:,:)
214 real(RP),
intent(out) :: vely_org(:,:,:)
215 real(RP),
intent(out) :: pres_org(:,:,:)
216 real(RP),
intent(out) :: dens_org(:,:,:)
217 real(RP),
intent(out) :: pott_org(:,:,:)
218 real(RP),
intent(out) :: qv_org (:,:,:)
219 real(RP),
intent(out) :: qtrc_org(:,:,:,:)
220 real(RP),
intent(in) :: cz_org (:,:,:)
221 character(len=*),
intent(in) :: basename_org
222 logical,
intent(in) :: same_mptype
223 integer,
intent(in) :: dims(6)
224 integer,
intent(in) :: it
226 real(RP) :: momz_org(dims(1)+2,dims(2),dims(3))
227 real(RP) :: momx_org(dims(1)+2,dims(2),dims(3))
228 real(RP) :: momy_org(dims(1)+2,dims(2),dims(3))
229 real(RP) :: rhot_org(dims(1)+2,dims(2),dims(3))
230 real(RP) :: tsfc_org( dims(2),dims(3))
231 real(RP) :: qhyd_org(dims(1)+2,dims(2),dims(3),
n_hyd)
232 real(RP) :: qnum_org(dims(1)+2,dims(2),dims(3),
n_hyd)
233 real(RP) :: qdry (dims(1)+2)
234 real(RP) :: Rtot (dims(1)+2)
235 real(RP) :: CVtot (dims(1)+2)
236 real(RP) :: CPtot (dims(1)+2)
237 real(RP) :: temp_org(dims(1)+2)
243 integer :: xloc, yloc
247 logical :: existed, existed_t2, existed_mslp
248 integer :: k, i, j, iq
251 do i = 1,
size( nest_tile_id(:) )
253 rank = nest_tile_id(i)
255 xloc = mod( i-1, nest_tile_num_x ) + 1
256 yloc = int(
real(i-1) /
real(NEST_TILE_NUM_X) ) + 1
268 aggregate=.false., rankid=rank )
270 call file_cartesc_read( fid,
"T2", read2d(:,:), step=it, existed=existed_t2 )
272 if ( existed_t2 ) tsfc_org(xs:xe,ys:ye) = read2d(:,:)
274 call file_cartesc_read( fid,
"MSLP", read2d(:,:), step=it, existed=existed_mslp )
276 if ( existed_mslp ) pres_org(1,xs:xe,ys:ye) = read2d(:,:)
278 call file_cartesc_read( fid,
"DENS", read3d(:,:,:), step=it )
280 dens_org(3:dims(1)+2,xs:xe,ys:ye) = read3d(:,:,:)
282 call file_cartesc_read( fid,
"MOMZ", read3d(:,:,:), step=it )
284 momz_org(3:dims(1)+2,xs:xe,ys:ye) = read3d(:,:,:)
286 call file_cartesc_read( fid,
"MOMX", read3d(:,:,:), step=it )
288 momx_org(3:dims(1)+2,xs:xe,ys:ye) = read3d(:,:,:)
290 call file_cartesc_read( fid,
"MOMY", read3d(:,:,:), step=it )
292 momy_org(3:dims(1)+2,xs:xe,ys:ye) = read3d(:,:,:)
295 call file_cartesc_read( fid,
"RHOT", read3d(:,:,:), step=it )
297 rhot_org(3:dims(1)+2,xs:xe,ys:ye) = read3d(:,:,:)
301 qhyd_org(:,xs:xe,ys:ye,iq) = 0.0_rp
302 qnum_org(:,xs:xe,ys:ye,iq) = 0.0_rp
305 if ( same_mptype )
then 308 call file_cartesc_read( fid,
tracer_name(iq), read3d(:,:,:), step=it )
310 qtrc_org(3:dims(1)+2,xs:xe,ys:ye,iq) = read3d(:,:,:)
312 qtrc_org(2,xs:xe,ys:ye,iq) = qtrc_org(3,xs:xe,ys:ye,iq)
314 qtrc_org(1,xs:xe,ys:ye,iq) = qtrc_org(3,xs:xe,ys:ye,iq)
319 call file_cartesc_read( fid,
"QV", read3d(:,:,:), step=it, existed=existed )
322 qv_org(3:dims(1)+2,xs:xe,ys:ye) = read3d(:,:,:)
324 qv_org(2,xs:xe,ys:ye) = qv_org(3,xs:xe,ys:ye)
326 qv_org(1,xs:xe,ys:ye) = qv_org(3,xs:xe,ys:ye)
329 qv_org(:,:,:) = 0.0_rp
333 call file_cartesc_read( fid,
hyd_name(iq), read3d(:,:,:), step=it, existed=existed )
336 qhyd_org(3:dims(1)+2,xs:xe,ys:ye,iq) = read3d(:,:,:)
338 qhyd_org(2,xs:xe,ys:ye,iq) = qhyd_org(3,xs:xe,ys:ye,iq)
340 qhyd_org(1,xs:xe,ys:ye,iq) = qhyd_org(3,xs:xe,ys:ye,iq)
343 qhyd_org(:,:,:,iq) = 0.0_rp
347 call file_cartesc_read( fid,
num_name(iq), read3d(:,:,:), step=it, existed=existed )
350 qnum_org(3:dims(1)+2,xs:xe,ys:ye,iq) = read3d(:,:,:)
352 qnum_org(2,xs:xe,ys:ye,iq) = qnum_org(3,xs:xe,ys:ye,iq)
354 qnum_org(1,xs:xe,ys:ye,iq) = qnum_org(3,xs:xe,ys:ye,iq)
357 qnum_org(:,:,:,iq) = 0.0_rp
373 velz_org(k,i,j) = ( momz_org(k-1,i,j) + momz_org(k,i,j) ) / dens_org(k,i,j) * 0.5_rp
380 velz_org(1:3 ,i,j) = 0.0_rp
381 velz_org(dims(1)+2,i,j) = 0.0_rp
390 velx_org(k,i,j) = ( momx_org(k,i-1,j) + momx_org(k,i,j) ) / dens_org(k,i,j) * 0.5_rp
397 velx_org(k,1,j) = momx_org(k,1,j) / dens_org(k,1,j)
401 velx_org(1:2,:,:) = 0.0_rp
408 vely_org(k,i,j) = ( momy_org(k,i,j-1) + momy_org(k,i,j) ) / dens_org(k,i,j) * 0.5_rp
415 vely_org(k,i,1) = momy_org(k,i,1) / dens_org(k,i,1)
419 vely_org(1:2,:,:) = 0.0_rp
425 if (
qa_mp > 0 .AND. .NOT. same_mptype )
then 427 qv_org(:,:,:), qhyd_org(:,:,:,:), &
429 qnum=qnum_org(:,:,:,:) )
443 call thermodyn_specific_heat( dims(1)+2, 3, dims(1)+2,
qa, &
446 qdry(:), rtot(:), cvtot(:), cptot(:) )
448 call thermodyn_rhot2temp_pres( dims(1)+2, 3, dims(1)+2, &
449 dens_org(:,i,j), rhot_org(:,i,j), rtot, cvtot, cptot, &
450 temp_org(:), pres_org(:,i,j) )
456 pott_org(k,i,j) = rhot_org(k,i,j) / dens_org(k,i,j)
460 dz = cz_org(3,i,j) - cz_org(2,i,j)
462 if ( .not. existed_t2 )
then 463 tsfc_org(i,j) = temp_org(3) + laps * dz
465 dens_org(2,i,j) = ( pres_org(3,i,j) + grav * dens_org(3,i,j) * dz * 0.5_rp ) &
466 / ( rdry * tsfc_org(i,j) - grav * dz * 0.5_rp )
467 pres_org(2,i,j) = dens_org(2,i,j) * rdry * tsfc_org(i,j)
468 pott_org(2,i,j) = tsfc_org(i,j) * ( p00 / pres_org(2,i,j) )**(rdry/cpdry)
471 temp_org(1) = tsfc_org(i,j) + laps * cz_org(2,i,j)
472 if ( .not. existed_mslp )
then 473 dens_org(1,i,j) = ( pres_org(2,i,j) + grav * dens_org(2,i,j) * cz_org(2,i,j) * 0.5_rp ) &
474 / ( rdry * temp_org(1) - grav * cz_org(2,i,j) * 0.5_rp )
475 pres_org(1,i,j) = dens_org(1,i,j) * rdry * temp_org(1)
476 pott_org(1,i,j) = temp_org(1) * ( p00 / pres_org(1,i,j) )**(rdry/cpdry)
478 pott_org(1,i,j) = temp_org(1) * ( p00 / pres_org(1,i,j) )**(rdry/cpdry)
479 dens_org(1,i,j) = pres_org(1,i,j) / ( rdry * temp_org(1) )
500 integer,
intent(out) :: ldims(3)
503 log_info(
"ParentLandSetupSCALE",*)
'Real Case/Land Input File Type: SCALE-RM' 509 if ( .NOT.
allocated(read2d) )
then 532 use_file_landwater, &
550 real(RP),
intent(out) :: tg_org (:,:,:)
551 real(RP),
intent(out) :: strg_org (:,:,:)
552 real(RP),
intent(out) :: lst_org (:,:)
553 real(RP),
intent(out) :: ust_org (:,:)
554 real(RP),
intent(out) :: albg_org (:,:,:,:)
555 real(RP),
intent(out) :: topo_org (:,:)
556 real(RP),
intent(out) :: lmask_org(:,:)
557 real(RP),
intent(out) :: llon_org (:,:)
558 real(RP),
intent(out) :: llat_org (:,:)
559 real(RP),
intent(out) :: lz_org (:)
560 character(len=*),
intent(in) :: basename_land
561 integer,
intent(in) :: ldims(3)
562 logical,
intent(in) :: use_file_landwater
563 integer,
intent(in) :: it
567 integer :: xloc, yloc
575 do i = 1,
size( nest_tile_id(:) )
577 rank = nest_tile_id(i)
579 xloc = mod( i-1, nest_tile_num_x ) + 1
580 yloc = int(
real(i-1) /
real(NEST_TILE_NUM_X) ) + 1
589 aggregate=.false., rankid=rank )
591 call file_cartesc_read( fid,
"LAND_TEMP", read3dl(:,:,:), step=it )
592 tg_org(1:ldims(1),xs:xe,ys:ye) = read3dl(:,:,:)
594 if( use_file_landwater )
then 595 call file_cartesc_read( fid,
"LAND_WATER", read3dl(:,:,:), step=it )
596 strg_org(1:ldims(1),xs:xe,ys:ye) = read3dl(:,:,:)
599 call file_cartesc_read( fid,
"lon", read2d(:,:) )
600 llon_org(xs:xe,ys:ye) = read2d(:,:) * d2r
602 call file_cartesc_read( fid,
"lat", read2d(:,:) )
603 llat_org(xs:xe,ys:ye) = read2d(:,:) * d2r
605 call file_cartesc_read( fid,
"LAND_SFC_TEMP", read2d(:,:), step=it )
606 lst_org(xs:xe,ys:ye) = read2d(:,:)
608 call file_get_datainfo( fid,
"URBAN_SFC_TEMP", istep=it, existed=existed )
610 call file_cartesc_read( fid,
"URBAN_SFC_TEMP", read2d(:,:), step=it )
611 ust_org(xs:xe,ys:ye) = read2d(:,:)
613 ust_org(xs:xe,ys:ye) = undef
616 call file_cartesc_read( fid,
"LAND_SFC_ALB_IR_dir", read2d(:,:), step=it )
619 call file_cartesc_read( fid,
"LAND_SFC_ALB_IR_dif", read2d(:,:), step=it )
622 call file_cartesc_read( fid,
"LAND_SFC_ALB_NIR_dir", read2d(:,:), step=it )
625 call file_cartesc_read( fid,
"LAND_SFC_ALB_NIR_dif", read2d(:,:), step=it )
628 call file_cartesc_read( fid,
"LAND_SFC_ALB_VIS_dir", read2d(:,:), step=it )
631 call file_cartesc_read( fid,
"LAND_SFC_ALB_VIS_dif", read2d(:,:), step=it )
634 call file_cartesc_read( fid,
"topo", read2d(:,:) )
635 topo_org(xs:xe,ys:ye) = read2d(:,:)
637 call file_cartesc_read( fid,
"lsmask", read2d(:,:) )
638 lmask_org(xs:xe,ys:ye) = read2d(:,:)
642 call file_read( fid,
"lz", lz_org(:) )
658 integer,
intent(out) :: odims(2)
661 log_info(
"ParentOceanSetupSCALE",*)
'Real Case/Ocean Input File Type: SCALE-RM' 666 if ( .NOT.
allocated(read2d) )
then 695 real(RP),
intent(out) :: olon_org (:,:)
696 real(RP),
intent(out) :: olat_org (:,:)
697 real(RP),
intent(out) :: omask_org(:,:)
698 character(len=*),
intent(in) :: basename_ocean
699 integer,
intent(in) :: odims(2)
702 integer :: xloc, yloc
703 integer :: xs, xe, ys, ye
709 do i = 1,
size( nest_tile_id(:) )
711 rank = nest_tile_id(i)
713 xloc = mod( i-1, nest_tile_num_x ) + 1
714 yloc = int(
real(i-1) /
real(NEST_TILE_NUM_X) ) + 1
723 aggregate=.false., rankid=rank )
725 call file_cartesc_read( fid,
"lon", read2d(:,:) )
726 olon_org(xs:xe,ys:ye) = read2d(:,:) * d2r
728 call file_cartesc_read( fid,
"lat", read2d(:,:) )
729 olat_org(xs:xe,ys:ye) = read2d(:,:) * d2r
731 call file_cartesc_read( fid,
"lsmask", read2d(:,:) )
732 omask_org(xs:xe,ys:ye) = read2d(:,:)
761 real(RP),
intent(out) :: tw_org (:,:)
762 real(RP),
intent(out) :: sst_org (:,:)
763 real(RP),
intent(out) :: albw_org (:,:,:,:)
764 real(RP),
intent(out) :: z0w_org (:,:)
765 real(RP),
intent(out) :: omask_org(:,:)
766 character(len=*),
intent(in) :: basename_ocean
767 integer,
intent(in) :: odims(2)
768 integer,
intent(in) :: it
775 integer :: xloc, yloc
780 do i = 1,
size( nest_tile_id(:) )
782 rank = nest_tile_id(i)
784 xloc = mod( i-1, nest_tile_num_x ) + 1
785 yloc = int(
real(i-1) /
real(NEST_TILE_NUM_X) ) + 1
794 aggregate=.false., rankid=rank )
796 call file_get_datainfo( fid,
"OCEAN_TEMP", dim_rank=ndim )
799 call file_cartesc_read( fid,
"OCEAN_TEMP", read2d(:,:), step=it )
800 tw_org(xs:xe,ys:ye) = read2d(:,:)
802 call file_cartesc_read( fid,
"OCEAN_TEMP", read3do(:,:,:), step=it )
803 tw_org(xs:xe,ys:ye) = read3do(1,:,:)
806 call file_cartesc_read( fid,
"OCEAN_SFC_TEMP", read2d(:,:), step=it )
807 sst_org(xs:xe,ys:ye) = read2d(:,:)
809 call file_cartesc_read( fid,
"OCEAN_SFC_ALB_IR_dir", read2d(:,:), step=it )
812 call file_cartesc_read( fid,
"OCEAN_SFC_ALB_IR_dif", read2d(:,:), step=it )
815 call file_cartesc_read( fid,
"OCEAN_SFC_ALB_NIR_dir", read2d(:,:), step=it )
818 call file_cartesc_read( fid,
"OCEAN_SFC_ALB_NIR_dif", read2d(:,:), step=it )
821 call file_cartesc_read( fid,
"OCEAN_SFC_ALB_VIS_dir", read2d(:,:), step=it )
824 call file_cartesc_read( fid,
"OCEAN_SFC_ALB_VIS_dif", read2d(:,:), step=it )
827 call file_cartesc_read( fid,
"OCEAN_SFC_Z0M", read2d(:,:), step=it )
828 z0w_org(xs:xe,ys:ye) = read2d(:,:)
830 call file_cartesc_read( fid,
"lsmask", read2d(:,:) )
831 omask_org(xs:xe,ys:ye) = read2d(:,:)
integer, dimension(2), public parent_kmax
parent max number in z-direction
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
character(len=h_short), dimension(n_hyd), parameter, public hyd_name
module coupler / surface-atmospehre
integer, public comm_cartesc_nest_tile_num_y
parent tile number in y-direction
real(rp), dimension(qa_max), public tracer_r
module Atmosphere / Physics Cloud Microphysics
integer, parameter, public i_r_vis
module Atmosphere Grid CartesianC metirc
real(rp), public const_d2r
degree to radian
real(rp), public const_laps
lapse rate of ISA [K/m]
character(len=h_short), dimension(qa_max), public tracer_name
real(rp), dimension(qa_max), public tracer_cv
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
real(rp), dimension(qa_max), public tracer_cp
module atmosphere / hydrometeor
integer, dimension(2), public parent_jmax
parent max number in y-direction
subroutine, public atmos_phy_mp_driver_qhyd2qtrc(KA, KS, KE, IA, IS, IE, JA, JS, JE, QV, QHYD, QTRC, QNUM)
real(rp), public const_pre00
pressure reference [Pa]
module atmosphere / hydrostatic barance
real(rp), public const_grav
standard acceleration of gravity [m/s2]
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_metric_rotc
rotation coefficient
module Communication CartesianC nesting
integer, parameter, public i_r_direct
integer, dimension(2), public parent_lkmax
parent max number in lz-direction
integer, dimension(:), allocatable, public comm_cartesc_nest_tile_id
parent tile real id
integer, parameter, public i_r_nir
module atmosphere / thermodyn
integer, dimension(2), public parent_imax
parent max number in x-direction
integer, parameter, public i_r_ir
character(len=h_short), dimension(n_hyd), parameter, public num_name
integer, parameter, public i_r_diffuse
integer, parameter, public n_hyd
module atmosphere / physics / cloud microphysics
integer, public comm_cartesc_nest_tile_num_x
parent tile number in x-direction
real(rp), dimension(qa_max), public tracer_mass