25 #include <fms_platform.h> 26 use mpp_domains_mod
, only: domain2d
27 use fms_io_mod
, only: restart_file_type
28 use time_manager_mod
, only: time_type
29 use horiz_interp_type_mod
, only: horiz_interp_type
30 use mpp_mod
, only: mpp_broadcast
31 use platform_mod
, only: r8_kind
34 integer,
public,
parameter ::
r_grid = r8_kind
52 integer ::id_ps, id_slp, id_ua, id_va, id_pt, id_omga, id_vort, &
53 id_tm, id_pv, id_zsurf, id_oro, id_sgh, id_divg, id_w, &
54 id_ke, id_te, id_zs, id_ze, id_mq, id_vorts, id_us, id_vs, &
55 id_tq, id_rh, id_c15, id_c25, id_c35, id_c45, &
56 id_f15, id_f25, id_f35, id_f45, id_ctp, &
57 id_ppt, id_ts, id_tb, id_ctt, id_pmask, id_pmaskv2, &
58 id_delp, id_delz, id_zratio, id_ws, id_iw, id_lw, &
60 id_qn, id_qn200, id_qn500, id_qn850, id_qp, id_mdt, &
61 id_qdt, id_aam, id_amdt, &
62 id_acly, id_acl, id_acl2, &
63 id_dbz, id_maxdbz, id_basedbz, id_dbz4km, id_dbztop, id_dbz_m10c, &
64 id_ctz, id_w1km, id_wmaxup, id_wmaxdn, id_cape, id_cin, id_diss
67 integer :: id_vort200, id_vort500, id_w500, id_w700
68 integer :: id_vort850, id_w850, id_x850, id_srh25, &
69 id_uh03, id_uh25, id_theta_e, &
70 id_w200, id_s200, id_sl12, id_sl13, id_w5km, id_rain5km, id_w2500m
71 integer :: id_srh1, id_srh3, id_ustm, id_vstm
73 integer,
allocatable :: id_u(:), id_v(:), id_t(:), id_h(:), id_q(:), id_omg(:)
75 integer:: id_u_plev, id_v_plev, id_t_plev, id_h_plev, id_q_plev, id_omg_plev
77 integer :: id_rh10, id_rh50, id_rh100, id_rh200, id_rh250, id_rh300, &
78 id_rh500, id_rh700, id_rh850, id_rh925, id_rh1000
79 integer :: id_dp10, id_dp50, id_dp100, id_dp200, id_dp250, id_dp300, &
80 id_dp500, id_dp700, id_dp850, id_dp925, id_dp1000
82 integer :: id_rh1000_cmip, id_rh925_cmip, id_rh850_cmip, id_rh700_cmip, id_rh500_cmip, &
83 id_rh300_cmip, id_rh250_cmip, id_rh100_cmip, id_rh50_cmip, id_rh10_cmip
85 integer :: id_hght3d, id_any_hght
86 integer :: id_u100m, id_v100m, id_w100m
89 integer ic_ps, ic_ua, ic_va, ic_ppt
91 integer,
allocatable :: id_tracer(:)
93 integer,
allocatable :: id_tracer_dmmr(:)
94 integer,
allocatable :: id_tracer_dvmr(:)
95 real,
allocatable :: w_mr(:)
97 real,
allocatable :: phalf(:)
98 real,
allocatable :: zsurf(:,:)
99 real,
allocatable :: zxg(:,:)
100 real,
allocatable :: pt1(:)
102 integer :: id_prer, id_prei, id_pres, id_preg
103 integer :: id_qv_dt_gfdlmp, id_t_dt_gfdlmp, id_ql_dt_gfdlmp, id_qi_dt_gfdlmp
104 integer :: id_u_dt_gfdlmp, id_v_dt_gfdlmp
105 integer :: id_t_dt_phys, id_qv_dt_phys, id_ql_dt_phys, id_qi_dt_phys, id_u_dt_phys, id_v_dt_phys
106 integer :: id_intqv, id_intql, id_intqi, id_intqr, id_intqs, id_intqg
108 integer :: id_uw, id_vw, id_hw, id_qvw, id_qlw, id_qiw, id_o3w
110 logical :: initialized = .false.
111 real sphum, liq_wat, ice_wat
112 real rainwat, snowwat, graupel
124 real(kind=R_GRID),
allocatable,
dimension(:,:,:) :: grid_64, agrid_64
125 real(kind=R_GRID),
allocatable,
dimension(:,:) :: area_64, area_c_64
126 real(kind=R_GRID),
allocatable,
dimension(:,:) :: sina_64, cosa_64
127 real(kind=R_GRID),
allocatable,
dimension(:,:) :: dx_64, dy_64
128 real(kind=R_GRID),
allocatable,
dimension(:,:) :: dxc_64, dyc_64
129 real(kind=R_GRID),
allocatable,
dimension(:,:) :: dxa_64, dya_64
131 real,
allocatable,
dimension(:,:,:) :: grid, agrid
132 real,
allocatable,
dimension(:,:) :: area, area_c
133 real,
allocatable,
dimension(:,:) :: rarea, rarea_c
135 real,
allocatable,
dimension(:,:) :: sina, cosa
136 real,
allocatable,
dimension(:,:,:) :: e1,e2
137 real,
allocatable,
dimension(:,:) :: dx, dy
138 real,
allocatable,
dimension(:,:) :: dxc, dyc
139 real,
allocatable,
dimension(:,:) :: dxa, dya
140 real,
allocatable,
dimension(:,:) :: rdx, rdy
141 real,
allocatable,
dimension(:,:) :: rdxc, rdyc
142 real,
allocatable,
dimension(:,:) :: rdxa, rdya
145 real(kind=R_GRID),
allocatable :: edge_s(:)
146 real(kind=R_GRID),
allocatable :: edge_n(:)
147 real(kind=R_GRID),
allocatable :: edge_w(:)
148 real(kind=R_GRID),
allocatable :: edge_e(:)
150 real(kind=R_GRID),
allocatable :: edge_vect_s(:)
151 real(kind=R_GRID),
allocatable :: edge_vect_n(:)
152 real(kind=R_GRID),
allocatable :: edge_vect_w(:)
153 real(kind=R_GRID),
allocatable :: edge_vect_e(:)
155 real(kind=R_GRID),
allocatable :: ex_s(:)
156 real(kind=R_GRID),
allocatable :: ex_n(:)
157 real(kind=R_GRID),
allocatable :: ex_w(:)
158 real(kind=R_GRID),
allocatable :: ex_e(:)
160 real,
allocatable :: l2c_u(:,:), l2c_v(:,:)
162 real,
allocatable :: divg_u(:,:), divg_v(:,:)
164 real,
allocatable :: del6_u(:,:), del6_v(:,:)
166 real,
allocatable :: a11(:,:)
167 real,
allocatable :: a12(:,:)
168 real,
allocatable :: a21(:,:)
169 real,
allocatable :: a22(:,:)
171 real,
allocatable :: z11(:,:)
172 real,
allocatable :: z12(:,:)
173 real,
allocatable :: z21(:,:)
174 real,
allocatable :: z22(:,:)
178 real,
allocatable :: cosa_u(:,:)
179 real,
allocatable :: cosa_v(:,:)
180 real,
allocatable :: cosa_s(:,:)
181 real,
allocatable :: sina_u(:,:)
182 real,
allocatable :: sina_v(:,:)
183 real,
allocatable :: rsin_u(:,:)
184 real,
allocatable :: rsin_v(:,:)
185 real,
allocatable :: rsina(:,:)
186 real,
allocatable :: rsin2(:,:)
187 real(kind=R_GRID),
allocatable :: ee1(:,:,:)
188 real(kind=R_GRID),
allocatable :: ee2(:,:,:)
189 real(kind=R_GRID),
allocatable :: ec1(:,:,:)
190 real(kind=R_GRID),
allocatable :: ec2(:,:,:)
191 real(kind=R_GRID),
allocatable :: ew(:,:,:,:)
192 real(kind=R_GRID),
allocatable :: es(:,:,:,:)
197 real,
allocatable :: sin_sg(:,:,:)
198 real,
allocatable :: cos_sg(:,:,:)
202 real(kind=R_GRID),
allocatable :: en1(:,:,:)
203 real(kind=R_GRID),
allocatable :: en2(:,:,:)
206 real,
allocatable :: eww(:,:)
207 real,
allocatable :: ess(:,:)
210 real(kind=R_GRID),
allocatable :: vlon(:,:,:), vlat(:,:,:)
211 real,
allocatable :: fc(:,:), f0(:,:)
213 integer,
dimension(:,:,:),
allocatable :: iinta, jinta, iintb, jintb
217 integer :: npx_g, npy_g, ntiles_g
219 real(kind=R_GRID) :: global_area
220 logical :: g_sum_initialized = .false.
221 logical:: sw_corner, se_corner, ne_corner, nw_corner
223 real(kind=R_GRID) :: da_min, da_max, da_min_c, da_max_c
228 logical :: latlon = .false.
229 logical :: cubed_sphere = .false.
230 logical :: have_south_pole = .false.
231 logical :: have_north_pole = .false.
232 logical :: stretched_grid = .false.
234 logical :: square_domain = .false.
236 integer,
pointer :: grid_type
242 logical,
pointer :: nested
243 logical,
pointer :: regional
244 logical :: bounded_domain
264 character(len=80) :: grid_name =
'Gnomonic' 265 character(len=120):: grid_file =
'Inline' 266 integer :: grid_type = 0
276 integer :: hord_mt = 9
293 integer :: kord_mt = 8
298 integer :: kord_wz = 8
303 integer :: hord_vt = 9
308 integer :: hord_tm = 9
311 integer :: hord_dp = 9
315 integer :: kord_tm = -8
320 integer :: hord_tr = 12
327 integer :: kord_tr = 8
334 real :: lim_fac = 1.0
342 integer :: nord_tr = 0
367 real :: d2_bg_k1 = 4.
376 real :: d2_bg_k2 = 2.
380 real :: d2_divg_max_k1 = 0.15
381 real :: d2_divg_max_k2 = 0.08
382 real :: damp_k_k1 = 0.2
383 real :: damp_k_k2 = 0.12
386 integer :: n_zs_filter = 0
394 integer :: nord_zs_filter = 4
402 logical :: full_zs_filter = .false.
412 logical :: rf_fast = .false.
419 logical :: consv_am = .false.
422 logical :: do_sat_adj= .false.
423 logical :: do_f3d = .false.
424 logical :: no_dycore = .false.
429 logical :: convert_ke = .false.
435 logical :: do_vort_damp = .false.
447 logical :: use_old_omega = .true.
463 integer :: n_sponge = 0
489 logical :: warm_start = .false.
493 logical :: inline_q = .true.
498 logical :: adiabatic = .true.
502 integer :: n_sponge = 1
526 logical :: warm_start = .true.
530 logical :: inline_q = .false.
534 logical :: adiabatic = .false.
539 real :: shift_fac = 18.
549 logical :: do_schmidt = .false.
552 logical :: do_cube_transform = .false.
553 real(kind=R_GRID) :: stretch_fac = 1.
562 real(kind=R_GRID) :: target_lat = -90.
569 real(kind=R_GRID) :: target_lon = 0.
582 logical :: reset_eta = .false.
604 integer :: n_split = 0
609 real :: fac_n_spl = 1.0
613 integer :: m_split = 0
614 integer :: k_split = 1
617 logical :: use_logp = .false.
637 integer :: q_split = 0
642 integer :: print_freq = 0
647 logical :: write_3d_diags = .true.
667 character(24) :: npz_type =
'gfs' 669 character(24) :: npz_type =
'' 672 integer :: npz_rst = 0
691 integer :: dnrts = -1
693 integer :: ntiles = 1
699 integer :: nf_omega = 1
702 integer :: fv_sg_adj = -1
710 real :: sg_cutoff = -1
712 integer :: na_init = 0
719 logical :: nudge_dz = .false.
732 real :: dry_mass = 98290.
737 integer :: nt_prog = 0
738 integer :: nt_phys = 0
748 real :: delt_max = 1.
763 real :: consv_te = 0.
783 real :: rf_cutoff = 30.e2
785 logical :: filter_phys = .false.
786 logical :: dwind_2d = .false.
794 logical :: breed_vortex_inline = .false.
798 logical :: range_warn = .false.
804 logical :: fill = .false.
807 logical :: fill_dp = .false.
815 logical :: fill_wz = .false.
816 logical :: fill_gfs = .true.
817 logical :: check_negative = .false.
818 logical :: non_ortho = .true.
819 logical :: moist_phys = .true.
820 logical :: do_held_suarez = .false.
823 logical :: do_reed_physics = .false.
824 logical :: reed_cond_only = .false.
825 logical :: reproduce_sum = .true.
832 logical :: adjust_dry_mass = .false.
840 logical :: fv_debug = .false.
842 logical :: srf_init = .false.
843 logical :: mountain = .true.
850 logical :: old_divg_damp = .false.
861 logical :: remap_t = .true.
869 logical :: z_tracer = .false.
874 logical :: fv_land = .false.
885 logical :: nudge = .false.
889 logical :: nudge_ic = .false.
893 logical :: ncep_ic = .false.
898 logical :: nggps_ic = .false.
902 logical :: ecmwf_ic = .false.
905 logical :: gfs_phil = .false.
907 logical :: agrid_vel_rst = .false.
912 logical :: use_new_ncep = .false.
913 logical :: use_ncep_phy = .false.
914 logical :: fv_diag_ic = .false.
916 logical :: external_ic = .false.
924 logical :: external_eta = .false.
929 logical :: read_increment = .false.
931 logical :: do_skeb = .false.
932 integer :: skeb_npass = 11
934 character(len=128) :: res_latlon_dynamics =
'INPUT/fv_rst.res.nc' 936 character(len=128) :: res_latlon_tracers =
'INPUT/atmos_tracers.res.nc' 946 logical :: hydrostatic = .true.
949 logical :: phys_hydrostatic = .true.
955 logical :: use_hydro_pressure = .false.
959 logical :: do_uni_zfull = .false.
966 logical :: hybrid_z = .false.
970 logical :: make_nh = .false.
974 logical :: make_hybrid_z = .false.
978 logical :: nudge_qv = .false.
986 real :: add_noise = -1.
990 logical :: butterfly_effect = .false.
994 integer :: a2b_ord = 4
999 integer :: c2l_ord = 4
1005 integer :: nrows_blend = 0
1007 real(kind=R_GRID) :: dx_const = 1000.
1011 real(kind=R_GRID) :: dy_const = 1000.
1015 real(kind=R_GRID) :: deglat = 15.
1020 real(kind=R_GRID) :: deglon_start = -30., deglon_stop = 30., &
1021 deglat_start = -30., deglat_stop = 30.
1023 logical :: regional = .false.
1025 integer :: bc_update_interval = 3
1027 logical :: regional_bcs_from_gsi = .false.
1029 logical :: write_restart_with_bcs = .false.
1032 integer,
pointer :: grid_number
1035 logical :: adj_mass_vmr = .false.
1047 real,
allocatable,
dimension(:,:,:) :: west_t1, east_t1, south_t1, north_t1
1048 real,
allocatable,
dimension(:,:,:) :: west_t0, east_t0, south_t0, north_t0
1050 integer :: istag, jstag
1052 logical :: allocated = .false.
1053 logical :: initialized = .false.
1059 real,
allocatable,
dimension(:,:,:,:) :: west_t1, east_t1, south_t1, north_t1
1060 real,
allocatable,
dimension(:,:,:,:) :: west_t0, east_t0, south_t0, north_t0
1062 integer :: istag, jstag
1064 logical :: allocated = .false.
1065 logical :: initialized = .false.
1072 logical :: do_remap_bc
1073 integer,
allocatable,
dimension(:,:,:) :: ind_h, ind_u, ind_v, ind_b
1074 real,
allocatable,
dimension(:,:,:) :: wt_h, wt_u, wt_v, wt_b
1081 integer :: refinement = 3
1089 integer :: parent_tile = 1
1096 logical :: nested = .false.
1098 integer :: nestbctype = 1
1099 integer :: nsponge = 0
1100 integer :: nestupdate = 7
1103 logical :: twowaynest = .false.
1106 integer :: ioffset, joffset
1107 integer :: nlevel = 0
1109 integer :: nest_timestep = 0
1110 integer :: tracer_nest_timestep = 0
1111 real :: s_weight = 1.e-6
1112 logical :: first_step = .true.
1113 integer :: refinement_of_global = 1
1114 integer :: npx_global
1115 integer :: upoff = 1
1116 integer :: isu = -999, ieu = -1000, jsu = -999, jeu = -1000
1117 real :: update_blend = 1.
1118 logical,
allocatable :: do_remap_bc(:)
1123 integer :: num_nest_level
1127 integer,
allocatable,
dimension(:,:,:) :: ind_h, ind_u, ind_v, ind_b
1128 real,
allocatable,
dimension(:,:,:) :: wt_h, wt_u, wt_v, wt_b
1133 logical,
allocatable,
dimension(:) :: child_grids
1135 logical :: parent_proc, child_proc
1136 logical :: parent_of_twoway = .false.
1156 logical :: do_flux_bcs, do_2way_flux_bcs
1157 type(restart_file_type) :: bcfile_ne, bcfile_sw
1163 real, _allocatable :: phys_t_dt(:,:,:)
1164 real, _allocatable :: phys_qv_dt(:,:,:)
1165 real, _allocatable :: phys_ql_dt(:,:,:)
1166 real, _allocatable :: phys_qi_dt(:,:,:)
1167 real, _allocatable :: phys_u_dt(:,:,:)
1168 real, _allocatable :: phys_v_dt(:,:,:)
1189 integer :: is, ie, js, je
1190 integer :: isd, ied, jsd, jed
1191 integer :: isc, iec, jsc, jec
1199 integer :: is_north ,ie_north ,js_north ,je_north &
1200 ,is_south ,ie_south ,js_south ,je_south &
1201 ,is_east ,ie_east ,js_east ,je_east &
1202 ,is_west ,ie_west ,js_west ,je_west
1204 integer :: is_north_uvs ,ie_north_uvs ,js_north_uvs ,je_north_uvs &
1205 ,is_south_uvs ,ie_south_uvs ,js_south_uvs ,je_south_uvs &
1206 ,is_east_uvs ,ie_east_uvs ,js_east_uvs ,je_east_uvs &
1207 ,is_west_uvs ,ie_west_uvs ,js_west_uvs ,je_west_uvs
1209 integer :: is_north_uvw ,ie_north_uvw ,js_north_uvw ,je_north_uvw &
1210 ,is_south_uvw ,ie_south_uvw ,js_south_uvw ,je_south_uvw &
1211 ,is_east_uvw ,ie_east_uvw ,js_east_uvw ,je_east_uvw &
1212 ,is_west_uvw ,ie_west_uvw ,js_west_uvw ,je_west_uvw
1218 logical :: allocated = .false.
1219 logical :: dummy = .false.
1220 integer :: grid_number = 1
1221 character(len=32) :: nml_filename =
"input.nml" 1225 type(time_type) :: time_init, time, run_length, time_end, time_step_atmos
1229 real,
dimension(2048) :: fdiag = 0.
1232 logical :: grid_active = .true.
1253 real, _allocatable :: u(:,:,:) _null
1254 real, _allocatable :: v(:,:,:) _null
1255 real, _allocatable :: pt(:,:,:) _null
1256 real, _allocatable :: delp(:,:,:) _null
1257 real, _allocatable :: q(:,:,:,:) _null
1258 real, _allocatable :: qdiag(:,:,:,:) _null
1263 real, _allocatable :: w(:,:,:) _null
1264 real, _allocatable :: delz(:,:,:) _null
1265 real, _allocatable :: ze0(:,:,:) _null
1266 real, _allocatable :: q_con(:,:,:) _null
1273 real, _allocatable :: ps (:,:) _null
1274 real, _allocatable :: pe (:,:,: ) _null
1275 real, _allocatable :: pk (:,:,:) _null
1276 real, _allocatable :: peln(:,:,:) _null
1277 real, _allocatable :: pkz (:,:,:) _null
1280 real, _allocatable :: u_srf(:,:) _null
1281 real, _allocatable :: v_srf(:,:) _null
1282 real, _allocatable :: sgh(:,:) _null
1283 real, _allocatable :: oro(:,:) _null
1284 real, _allocatable :: ts(:,:) _null
1286 real, _allocatable :: diss_est(:,:,:) _null
1291 real, _allocatable :: phis(:,:) _null
1292 real, _allocatable :: omga(:,:,:) _null
1293 real, _allocatable :: ua(:,:,:) _null
1294 real, _allocatable :: va(:,:,:) _null
1295 real, _allocatable :: uc(:,:,:) _null
1296 real, _allocatable :: vc(:,:,:) _null
1298 real, _allocatable :: ak(:) _null
1299 real, _allocatable :: bk(:) _null
1304 real, _allocatable :: mfx(:,:,:) _null
1305 real, _allocatable :: mfy(:,:,:) _null
1307 real, _allocatable :: cx(:,:,:) _null
1308 real, _allocatable :: cy(:,:,:) _null
1313 integer,
pointer :: npx, npy, npz, ncnst, ng
1315 integer,
allocatable,
dimension(:) :: pelist
1321 type(domain2d) :: domain
1324 type(domain2d) :: domain_for_coupler
1326 integer :: num_contact, npes_per_tile, global_tile, tile_of_mosaic, npes_this_grid
1327 integer :: layout(2), io_layout(2) = (/ 1,1 /)
1361 type(restart_file_type) :: fv_restart, sst_restart, fv_tile_restart, &
1362 rsf_restart, mg_restart, lnd_restart, tra_restart
1367 real(kind=R_GRID),
allocatable,
dimension(:,:,:,:) :: grid_global
1369 integer :: atmos_axes(4)
1381 npx_in, npy_in, npz_in, ndims_in, ncnst_in, nq_in, dummy, alloc_2d, ngrids_in)
1389 integer,
intent(IN) :: isd_in, ied_in, jsd_in, jed_in, is_in, ie_in, js_in, je_in
1390 integer,
intent(IN) :: npx_in, npy_in, npz_in, ndims_in, ncnst_in, nq_in
1391 logical,
intent(IN) :: dummy, alloc_2d
1392 integer,
intent(IN) :: ngrids_in
1393 integer:: isd, ied, jsd, jed, is, ie, js, je
1394 integer:: npx, npy, npz, ndims, ncnst, nq, ng
1397 integer:: isd_2d, ied_2d, jsd_2d, jed_2d, is_2d, ie_2d, js_2d, je_2d
1398 integer:: npx_2d, npy_2d, npz_2d, ndims_2d, ncnst_2d, nq_2d, ng_2d
1400 integer :: i,j,k, ns, n
1402 if (atm%allocated)
return 1436 if ((.not. dummy) .or. alloc_2d)
then 1485 atm%npx => atm%flagstruct%npx
1486 atm%npy => atm%flagstruct%npy
1487 atm%npz => atm%flagstruct%npz
1488 atm%ncnst => atm%flagstruct%ncnst
1495 atm%flagstruct%ndims = ndims_in
1497 allocate ( atm%u(isd:ied ,jsd:jed+1,npz) )
1498 allocate ( atm%v(isd:ied+1,jsd:jed ,npz) )
1500 allocate ( atm%pt(isd:ied ,jsd:jed ,npz) )
1501 allocate ( atm%delp(isd:ied ,jsd:jed ,npz) )
1502 allocate ( atm%q(isd:ied ,jsd:jed ,npz, nq) )
1503 allocate (atm%qdiag(isd:ied ,jsd:jed ,npz, nq+1:ncnst) )
1506 allocate ( atm%ps(isd:ied ,jsd:jed) )
1507 allocate ( atm%pe(is-1:ie+1, npz+1,js-1:je+1) )
1508 allocate ( atm%pk(is:ie ,js:je , npz+1) )
1509 allocate ( atm%peln(is:ie,npz+1,js:je) )
1510 allocate ( atm%pkz(is:ie,js:je,npz) )
1512 allocate ( atm%u_srf(is:ie,js:je) )
1513 allocate ( atm%v_srf(is:ie,js:je) )
1515 if ( atm%flagstruct%fv_land )
then 1516 allocate ( atm%sgh(is:ie,js:je) )
1517 allocate ( atm%oro(is:ie,js:je) )
1519 allocate ( atm%oro(1,1) )
1523 allocate ( atm%diss_est(isd:ied ,jsd:jed ,npz) )
1524 allocate ( atm%ts(is:ie,js:je) )
1525 allocate ( atm%phis(isd:ied ,jsd:jed ) )
1526 allocate ( atm%omga(isd:ied ,jsd:jed ,npz) ); atm%omga=0.
1527 allocate ( atm%ua(isd:ied ,jsd:jed ,npz) )
1528 allocate ( atm%va(isd:ied ,jsd:jed ,npz) )
1529 allocate ( atm%uc(isd:ied+1,jsd:jed ,npz) )
1530 allocate ( atm%vc(isd:ied ,jsd:jed+1,npz) )
1532 allocate ( atm%mfx(is:ie+1, js:je, npz) )
1533 allocate ( atm%mfy(is:ie , js:je+1,npz) )
1534 allocate ( atm%cx(is:ie+1, jsd:jed, npz) )
1535 allocate ( atm%cy(isd:ied ,js:je+1, npz) )
1537 allocate ( atm%ak(npz_2d+1) )
1538 allocate ( atm%bk(npz_2d+1) )
1543 if ( atm%flagstruct%hydrostatic )
then 1545 allocate ( atm%w(isd:isd, jsd:jsd ,1) )
1546 allocate ( atm%delz(is:is, js:js ,1) )
1547 allocate ( atm%ze0(is:is, js:js ,1) )
1549 allocate ( atm%w(isd:ied, jsd:jed ,npz ) )
1550 allocate ( atm%delz(is:ie, js:je ,npz) )
1551 if( atm%flagstruct%hybrid_z )
then 1552 allocate ( atm%ze0(is:ie, js:je ,npz+1) )
1554 allocate ( atm%ze0(is:is, js:js ,1) )
1560 allocate ( atm%q_con(isd:ied,jsd:jed,1:npz) )
1562 allocate ( atm%q_con(isd:isd,jsd:jsd,1) )
1590 if ( .not. atm%flagstruct%hydrostatic )
then 1624 allocate ( atm%gridstruct% area(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1625 allocate ( atm%gridstruct% area_64(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1626 allocate ( atm%gridstruct%rarea(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1628 allocate ( atm%gridstruct% area_c(isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1629 allocate ( atm%gridstruct% area_c_64(isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1630 allocate ( atm%gridstruct%rarea_c(isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1632 allocate ( atm%gridstruct% dx(isd_2d:ied_2d ,jsd_2d:jed_2d+1) )
1633 allocate ( atm%gridstruct% dx_64(isd_2d:ied_2d ,jsd_2d:jed_2d+1) )
1634 allocate ( atm%gridstruct%rdx(isd_2d:ied_2d ,jsd_2d:jed_2d+1) )
1635 allocate ( atm%gridstruct% dy(isd_2d:ied_2d+1,jsd_2d:jed_2d ) )
1636 allocate ( atm%gridstruct% dy_64(isd_2d:ied_2d+1,jsd_2d:jed_2d ) )
1637 allocate ( atm%gridstruct%rdy(isd_2d:ied_2d+1,jsd_2d:jed_2d ) )
1639 allocate ( atm%gridstruct% dxc(isd_2d:ied_2d+1,jsd_2d:jed_2d ) )
1640 allocate ( atm%gridstruct% dxc_64(isd_2d:ied_2d+1,jsd_2d:jed_2d ) )
1641 allocate ( atm%gridstruct%rdxc(isd_2d:ied_2d+1,jsd_2d:jed_2d ) )
1642 allocate ( atm%gridstruct% dyc(isd_2d:ied_2d ,jsd_2d:jed_2d+1) )
1643 allocate ( atm%gridstruct% dyc_64(isd_2d:ied_2d ,jsd_2d:jed_2d+1) )
1644 allocate ( atm%gridstruct%rdyc(isd_2d:ied_2d ,jsd_2d:jed_2d+1) )
1646 allocate ( atm%gridstruct% dxa(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1647 allocate ( atm%gridstruct% dxa_64(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1648 allocate ( atm%gridstruct%rdxa(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1649 allocate ( atm%gridstruct% dya(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1650 allocate ( atm%gridstruct% dya_64(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1651 allocate ( atm%gridstruct%rdya(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1653 allocate ( atm%gridstruct%grid (isd_2d:ied_2d+1,jsd_2d:jed_2d+1,1:ndims_2d) )
1654 allocate ( atm%gridstruct%grid_64 (isd_2d:ied_2d+1,jsd_2d:jed_2d+1,1:ndims_2d) )
1655 allocate ( atm%gridstruct%agrid(isd_2d:ied_2d ,jsd_2d:jed_2d ,1:ndims_2d) )
1656 allocate ( atm%gridstruct%agrid_64(isd_2d:ied_2d ,jsd_2d:jed_2d ,1:ndims_2d) )
1657 allocate ( atm%gridstruct% sina(isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1658 allocate ( atm%gridstruct% sina_64(isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1659 allocate ( atm%gridstruct%rsina(is_2d:ie_2d+1,js_2d:je_2d+1) )
1660 allocate ( atm%gridstruct% cosa(isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1661 allocate ( atm%gridstruct% cosa_64(isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1663 allocate ( atm%gridstruct% e1(3,isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1664 allocate ( atm%gridstruct% e2(3,isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1666 allocate (atm%gridstruct%iinta(4, isd_2d:ied_2d ,jsd_2d:jed_2d), &
1667 atm%gridstruct%jinta(4, isd_2d:ied_2d ,jsd_2d:jed_2d), &
1668 atm%gridstruct%iintb(4, is_2d:ie_2d+1 ,js_2d:je_2d+1), &
1669 atm%gridstruct%jintb(4, is_2d:ie_2d+1 ,js_2d:je_2d+1) )
1671 allocate ( atm%gridstruct%edge_s(npx_2d) )
1672 allocate ( atm%gridstruct%edge_n(npx_2d) )
1673 allocate ( atm%gridstruct%edge_w(npy_2d) )
1674 allocate ( atm%gridstruct%edge_e(npy_2d) )
1676 allocate ( atm%gridstruct%edge_vect_s(isd_2d:ied_2d) )
1677 allocate ( atm%gridstruct%edge_vect_n(isd_2d:ied_2d) )
1678 allocate ( atm%gridstruct%edge_vect_w(jsd_2d:jed_2d) )
1679 allocate ( atm%gridstruct%edge_vect_e(jsd_2d:jed_2d) )
1681 allocate ( atm%gridstruct%ex_s(npx_2d) )
1682 allocate ( atm%gridstruct%ex_n(npx_2d) )
1683 allocate ( atm%gridstruct%ex_w(npy_2d) )
1684 allocate ( atm%gridstruct%ex_e(npy_2d) )
1687 allocate ( atm%gridstruct%l2c_u(is_2d:ie_2d, js_2d:je_2d+1) )
1688 allocate ( atm%gridstruct%l2c_v(is_2d:ie_2d+1,js_2d:je_2d) )
1691 allocate ( atm%gridstruct%divg_u(isd_2d:ied_2d, jsd_2d:jed_2d+1) )
1692 allocate ( atm%gridstruct%divg_v(isd_2d:ied_2d+1,jsd_2d:jed_2d) )
1694 allocate ( atm%gridstruct%del6_u(isd_2d:ied_2d, jsd_2d:jed_2d+1) )
1695 allocate ( atm%gridstruct%del6_v(isd_2d:ied_2d+1,jsd_2d:jed_2d) )
1697 allocate ( atm%gridstruct%z11(is_2d-1:ie_2d+1,js_2d-1:je_2d+1) )
1698 allocate ( atm%gridstruct%z12(is_2d-1:ie_2d+1,js_2d-1:je_2d+1) )
1699 allocate ( atm%gridstruct%z21(is_2d-1:ie_2d+1,js_2d-1:je_2d+1) )
1700 allocate ( atm%gridstruct%z22(is_2d-1:ie_2d+1,js_2d-1:je_2d+1) )
1705 allocate ( atm%gridstruct%a11(is_2d-1:ie_2d+1,js_2d-1:je_2d+1) )
1706 allocate ( atm%gridstruct%a12(is_2d-1:ie_2d+1,js_2d-1:je_2d+1) )
1707 allocate ( atm%gridstruct%a21(is_2d-1:ie_2d+1,js_2d-1:je_2d+1) )
1708 allocate ( atm%gridstruct%a22(is_2d-1:ie_2d+1,js_2d-1:je_2d+1) )
1709 allocate ( atm%gridstruct%vlon(is_2d-2:ie_2d+2,js_2d-2:je_2d+2,3) )
1710 allocate ( atm%gridstruct%vlat(is_2d-2:ie_2d+2,js_2d-2:je_2d+2,3) )
1712 allocate ( atm%gridstruct%f0(isd_2d:ied_2d ,jsd_2d:jed_2d ) )
1713 allocate ( atm%gridstruct%fC(isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1716 allocate( atm%gridstruct%ee1(3,isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1717 allocate( atm%gridstruct%ee2(3,isd_2d:ied_2d+1,jsd_2d:jed_2d+1) )
1720 allocate( atm%gridstruct%ec1(3,isd_2d:ied_2d,jsd_2d:jed_2d) )
1721 allocate( atm%gridstruct%ec2(3,isd_2d:ied_2d,jsd_2d:jed_2d) )
1724 allocate( atm%gridstruct%ew(3,isd_2d:ied_2d+1,jsd_2d:jed_2d, 2) )
1725 allocate( atm%gridstruct%es(3,isd_2d:ied_2d ,jsd_2d:jed_2d+1,2) )
1728 allocate( atm%gridstruct%en1(3,is_2d:ie_2d, js_2d:je_2d+1) )
1729 allocate( atm%gridstruct%en2(3,is_2d:ie_2d+1,js_2d:je_2d ) )
1731 allocate ( atm%gridstruct%cosa_u(isd_2d:ied_2d+1,jsd_2d:jed_2d) )
1732 allocate ( atm%gridstruct%sina_u(isd_2d:ied_2d+1,jsd_2d:jed_2d) )
1733 allocate ( atm%gridstruct%rsin_u(isd_2d:ied_2d+1,jsd_2d:jed_2d) )
1735 allocate ( atm%gridstruct%cosa_v(isd_2d:ied_2d,jsd_2d:jed_2d+1) )
1736 allocate ( atm%gridstruct%sina_v(isd_2d:ied_2d,jsd_2d:jed_2d+1) )
1737 allocate ( atm%gridstruct%rsin_v(isd_2d:ied_2d,jsd_2d:jed_2d+1) )
1739 allocate ( atm%gridstruct%cosa_s(isd_2d:ied_2d,jsd_2d:jed_2d) )
1741 allocate ( atm%gridstruct%rsin2(isd_2d:ied_2d,jsd_2d:jed_2d) )
1752 allocate ( atm%gridstruct%cos_sg(isd_2d:ied_2d,jsd_2d:jed_2d,9) )
1753 allocate ( atm%gridstruct%sin_sg(isd_2d:ied_2d,jsd_2d:jed_2d,9) )
1755 allocate( atm%gridstruct%eww(3,4) )
1756 allocate( atm%gridstruct%ess(3,4) )
1758 if (atm%neststruct%nested)
then 1761 allocate(atm%neststruct%ind_h(isd:ied,jsd:jed,4))
1762 allocate(atm%neststruct%ind_u(isd:ied,jsd:jed+1,4))
1763 allocate(atm%neststruct%ind_v(isd:ied+1,jsd:jed,4))
1765 allocate(atm%neststruct%wt_h(isd:ied, jsd:jed, 4))
1766 allocate(atm%neststruct%wt_u(isd:ied, jsd:jed+1,4))
1767 allocate(atm%neststruct%wt_v(isd:ied+1, jsd:jed, 4))
1768 allocate(atm%neststruct%ind_b(isd:ied+1,jsd:jed+1,4))
1769 allocate(atm%neststruct%wt_b(isd:ied+1, jsd:jed+1,4))
1771 ns = atm%neststruct%nsponge
1781 allocate(atm%neststruct%q_BC(ncnst))
1796 if (.not.atm%flagstruct%hydrostatic)
then 1806 if( ngrids_in > 1 )
then 1807 if (atm%flagstruct%grid_type < 4)
then 1808 if (atm%neststruct%nested)
then 1809 allocate(atm%grid_global(1-atm%ng:npx_2d +atm%ng,1-atm%ng:npy_2d +atm%ng,2,1))
1811 allocate(atm%grid_global(1-atm%ng:npx_2d +atm%ng,1-atm%ng:npy_2d +atm%ng,2,1:6))
1818 atm%gridstruct%nested => atm%neststruct%nested
1819 atm%gridstruct%grid_type => atm%flagstruct%grid_type
1820 atm%flagstruct%grid_number => atm%grid_number
1821 atm%gridstruct%regional => atm%flagstruct%regional
1822 atm%gridstruct%bounded_domain = atm%flagstruct%regional .or. atm%neststruct%nested
1823 if (atm%neststruct%nested) atm%neststruct%parent_grid => atm%parent_grid
1825 atm%allocated = .true.
1826 if (dummy) atm%dummy = .true.
1838 if (.not.atm%allocated)
return 1840 deallocate ( atm%u )
1841 deallocate ( atm%v )
1842 deallocate ( atm%pt )
1843 deallocate ( atm%delp )
1844 deallocate ( atm%q )
1845 deallocate ( atm%qdiag )
1846 deallocate ( atm%ps )
1847 deallocate ( atm%pe )
1848 deallocate ( atm%pk )
1849 deallocate ( atm%peln )
1850 deallocate ( atm%pkz )
1851 deallocate ( atm%phis )
1852 deallocate ( atm%omga )
1853 deallocate ( atm%ua )
1854 deallocate ( atm%va )
1855 deallocate ( atm%uc )
1856 deallocate ( atm%vc )
1857 deallocate ( atm%mfx )
1858 deallocate ( atm%mfy )
1859 deallocate ( atm%cx )
1860 deallocate ( atm%cy )
1861 deallocate ( atm%ak )
1862 deallocate ( atm%bk )
1864 deallocate ( atm%u_srf )
1865 deallocate ( atm%v_srf )
1866 if( atm%flagstruct%fv_land )
deallocate ( atm%sgh )
1867 deallocate ( atm%oro )
1869 deallocate ( atm%w )
1870 deallocate ( atm%delz )
1871 deallocate ( atm%ze0 )
1872 deallocate ( atm%q_con )
1874 deallocate ( atm%gridstruct% area )
1875 deallocate ( atm%gridstruct%rarea )
1877 deallocate ( atm%gridstruct% area_c )
1878 deallocate ( atm%gridstruct%rarea_c )
1880 deallocate ( atm%gridstruct% dx )
1881 deallocate ( atm%gridstruct%rdx )
1882 deallocate ( atm%gridstruct% dy )
1883 deallocate ( atm%gridstruct%rdy )
1885 deallocate ( atm%gridstruct% dxc )
1886 deallocate ( atm%gridstruct%rdxc )
1887 deallocate ( atm%gridstruct% dyc )
1888 deallocate ( atm%gridstruct%rdyc )
1890 deallocate ( atm%gridstruct% dxa )
1891 deallocate ( atm%gridstruct%rdxa )
1892 deallocate ( atm%gridstruct% dya )
1893 deallocate ( atm%gridstruct%rdya )
1895 deallocate ( atm%gridstruct%grid )
1896 deallocate ( atm%gridstruct%agrid )
1897 deallocate ( atm%gridstruct%sina )
1898 deallocate ( atm%gridstruct%cosa )
1900 deallocate ( atm%gridstruct% e1 )
1901 deallocate ( atm%gridstruct% e2 )
1906 deallocate (atm%gridstruct%iinta, &
1907 atm%gridstruct%jinta, &
1908 atm%gridstruct%iintb, &
1909 atm%gridstruct%jintb )
1911 deallocate ( atm%gridstruct%edge_s )
1912 deallocate ( atm%gridstruct%edge_n )
1913 deallocate ( atm%gridstruct%edge_w )
1914 deallocate ( atm%gridstruct%edge_e )
1916 deallocate ( atm%gridstruct%edge_vect_s )
1917 deallocate ( atm%gridstruct%edge_vect_n )
1918 deallocate ( atm%gridstruct%edge_vect_w )
1919 deallocate ( atm%gridstruct%edge_vect_e )
1921 deallocate ( atm%gridstruct%ex_s )
1922 deallocate ( atm%gridstruct%ex_n )
1923 deallocate ( atm%gridstruct%ex_w )
1924 deallocate ( atm%gridstruct%ex_e )
1927 deallocate ( atm%gridstruct%l2c_u )
1928 deallocate ( atm%gridstruct%l2c_v )
1930 deallocate ( atm%gridstruct%divg_u )
1931 deallocate ( atm%gridstruct%divg_v )
1934 deallocate ( atm%gridstruct%z11 )
1935 deallocate ( atm%gridstruct%z12 )
1936 deallocate ( atm%gridstruct%z21 )
1937 deallocate ( atm%gridstruct%z22 )
1939 deallocate ( atm%gridstruct%a11 )
1940 deallocate ( atm%gridstruct%a12 )
1941 deallocate ( atm%gridstruct%a21 )
1942 deallocate ( atm%gridstruct%a22 )
1943 deallocate ( atm%gridstruct%vlon )
1944 deallocate ( atm%gridstruct%vlat )
1946 deallocate ( atm%gridstruct%f0 )
1947 deallocate ( atm%gridstruct%fC )
1950 deallocate( atm%gridstruct%ee1 )
1951 deallocate( atm%gridstruct%ee2 )
1954 deallocate( atm%gridstruct%ec1 )
1955 deallocate( atm%gridstruct%ec2 )
1958 deallocate( atm%gridstruct%ew )
1959 deallocate( atm%gridstruct%es )
1962 deallocate( atm%gridstruct%en1 )
1963 deallocate( atm%gridstruct%en2 )
1965 deallocate ( atm%gridstruct%cosa_u )
1966 deallocate ( atm%gridstruct%sina_u )
1967 deallocate ( atm%gridstruct%rsin_u )
1969 deallocate ( atm%gridstruct%cosa_v )
1970 deallocate ( atm%gridstruct%sina_v )
1971 deallocate ( atm%gridstruct%rsin_v )
1973 deallocate ( atm%gridstruct%cosa_s )
1975 deallocate ( atm%gridstruct%rsin2 )
1986 deallocate ( atm%gridstruct%cos_sg )
1987 deallocate ( atm%gridstruct%sin_sg )
1989 deallocate( atm%gridstruct%eww )
1990 deallocate( atm%gridstruct%ess )
1992 if (atm%neststruct%nested)
then 1993 deallocate(atm%neststruct%ind_h)
1994 deallocate(atm%neststruct%ind_u)
1995 deallocate(atm%neststruct%ind_v)
1997 deallocate(atm%neststruct%wt_h)
1998 deallocate(atm%neststruct%wt_u)
1999 deallocate(atm%neststruct%wt_v)
2001 deallocate(atm%neststruct%ind_b)
2002 deallocate(atm%neststruct%wt_b)
2011 if (
allocated(atm%neststruct%q_BC))
then 2012 do n=1,
size(atm%neststruct%q_BC)
2025 if (.not.atm%flagstruct%hydrostatic)
then 2033 if (atm%flagstruct%grid_type < 4)
then 2034 if(
allocated(atm%grid_global))
deallocate(atm%grid_global)
2037 atm%allocated = .false.
2046 integer,
intent(IN) :: ns, istag, jstag
2047 logical,
intent(IN) :: dummy
2049 integer :: is, ie, js, je, isd, ied, jsd, jed, npx, npy, npz, ng
2051 if (bc%allocated)
return 2069 call allocate_fv_nest_bc_type_3d(bc,is,ie,js,je,isd,ied,jsd,jed,npx,npy,npz,ng,ns,istag,jstag,dummy)
2074 subroutine allocate_fv_nest_bc_type_3d(BC,is,ie,js,je,isd,ied,jsd,jed,npx,npy,npz,ng,ns,istag,jstag,dummy)
2077 integer,
intent(IN) :: ns, istag, jstag
2078 logical,
intent(IN) :: dummy
2080 integer,
intent(IN) :: is, ie, js, je, isd, ied, jsd, jed, npx, npy, npz, ng
2082 if (bc%allocated)
return 2085 if (ie == npx-1 .and. .not. dummy)
then 2086 allocate(bc%east_t1(ie+1-ns+istag:ied+istag,jsd:jed+jstag,npz))
2087 allocate(bc%east_t0(ie+1-ns+istag:ied+istag,jsd:jed+jstag,npz))
2090 do i=ie+1-ns+istag,ied+istag
2091 bc%east_t1(i,j,k) = 0.
2092 bc%east_t0(i,j,k) = 0.
2097 allocate(bc%east_t1(1,1,npz))
2098 allocate(bc%east_t0(1,1,npz))
2101 if (js == 1 .and. .not. dummy)
then 2102 allocate(bc%south_t1(isd:ied+istag,jsd:js-1+ns,npz))
2103 allocate(bc%south_t0(isd:ied+istag,jsd:js-1+ns,npz))
2107 bc%south_t1(i,j,k) = 0.
2108 bc%south_t0(i,j,k) = 0.
2113 allocate(bc%south_t1(1,1,npz))
2114 allocate(bc%south_t0(1,1,npz))
2117 if (is == 1 .and. .not. dummy)
then 2118 allocate(bc%west_t1(isd:is-1+ns,jsd:jed+jstag,npz))
2119 allocate(bc%west_t0(isd:is-1+ns,jsd:jed+jstag,npz))
2123 bc%west_t1(i,j,k) = 0.
2124 bc%west_t0(i,j,k) = 0.
2129 allocate(bc%west_t1(1,1,npz))
2130 allocate(bc%west_t0(1,1,npz))
2133 if (je == npy-1 .and. .not. dummy)
then 2134 allocate(bc%north_t1(isd:ied+istag,je+1-ns+jstag:jed+jstag,npz))
2135 allocate(bc%north_t0(isd:ied+istag,je+1-ns+jstag:jed+jstag,npz))
2137 do j=je+1-ns+jstag,jed+jstag
2139 bc%north_t1(i,j,k) = 0.
2140 bc%north_t0(i,j,k) = 0.
2145 allocate(bc%north_t1(1,1,npz))
2146 allocate(bc%north_t0(1,1,npz))
2149 bc%allocated = .true.
2157 if (.not. bc%allocated)
return 2159 deallocate(bc%north_t1)
2160 deallocate(bc%south_t1)
2161 deallocate(bc%west_t1)
2162 deallocate(bc%east_t1)
2164 if (
allocated(bc%north_t0))
then 2165 deallocate(bc%north_t0)
2166 deallocate(bc%south_t0)
2167 deallocate(bc%west_t0)
2168 deallocate(bc%east_t0)
2171 bc%allocated = .false.
subroutine allocate_fv_atmos_type(Atm, isd_in, ied_in, jsd_in, jed_in, is_in, ie_in, js_in, je_in, npx_in, npy_in, npz_in, ndims_in, ncnst_in, nq_in, dummy, alloc_2d, ngrids_in)
The subroutine 'allocate_fv_atmos_type' allocates the fv_atmos_type.
subroutine allocate_fv_nest_bc_type_3d_atm(BC, Atm, ns, istag, jstag, dummy)
The type 'fv_grid_type' is made up of grid-dependent information from fv_grid_tools and fv_grid_utils...
integer, parameter max_step
integer, parameter, public r_grid
'allocate_fv_nest_BC_type' is an interface to subroutines that allocate the 'fv_nest_BC_type' structu...
'deallocate_fv_nest_BC_type' is an interface to a subroutine that deallocates the 'fv_nest_BC_type' s...
subroutine allocate_fv_nest_bc_type_3d(BC, is, ie, js, je, isd, ied, jsd, jed, npx, npy, npz, ng, ns, istag, jstag, dummy)
The module 'fv_arrays' contains the 'fv_atmos_type' and associated datatypes.
subroutine deallocate_fv_nest_bc_type_3d(BC)
subroutine deallocate_fv_atmos_type(Atm)
The subroutine 'deallocate_fv_atmos_type' deallocates the fv_atmos_type.