27 ni(:,:,:), nr(:,:,:), nc(:,:,:), nwfa(:,:,:), nifa(:,:,:), ng(:,:,:), qb(:,:,:)
46 subroutine init_mpas_59lev_convective_data_for_test(nlev)
48 integer,
intent(in) :: nlev
49 real(wp),
dimension(nlev) :: klevs, qv_in, qc_in, qr_in, qi_in, qs_in, qg_in, ni_in, nr_in, nc_in, &
50 nwfa_in, nifa_in, theta_in, ng_in, volg_in, pressure_in, w_in, dz_in
58 open (2, file =
'./data/mpas_59lev_test.txt', status =
'old')
62 read(2,*) klevs(k), qv_in(k), qc_in(k), qr_in(k), qi_in(k), qs_in(k), &
63 qg_in(k), ni_in(k), nr_in(k), nc_in(k), nwfa_in(k), nifa_in(k), &
64 theta_in(k), ng_in(k), volg_in(k), pressure_in(k), w_in(k), dz_in(k)
68 if(.not.
allocated(qv))
allocate(qv(ite-its+1, kte-kts+1, jte-jts+1))
69 if(.not.
allocated(qc))
allocate(qc(ite-its+1, kte-kts+1, jte-jts+1))
70 if(.not.
allocated(qr))
allocate(qr(ite-its+1, kte-kts+1, jte-jts+1))
71 if(.not.
allocated(qi))
allocate(qi(ite-its+1, kte-kts+1, jte-jts+1))
72 if(.not.
allocated(qs))
allocate(qs(ite-its+1, kte-kts+1, jte-jts+1))
73 if(.not.
allocated(qg))
allocate(qg(ite-its+1, kte-kts+1, jte-jts+1))
74 if(.not.
allocated(ni))
allocate(ni(ite-its+1, kte-kts+1, jte-jts+1))
75 if(.not.
allocated(nr))
allocate(nr(ite-its+1, kte-kts+1, jte-jts+1))
76 if(.not.
allocated(nc))
allocate(nc(ite-its+1, kte-kts+1, jte-jts+1))
77 if(.not.
allocated(nwfa))
allocate(nwfa(ite-its+1, kte-kts+1, jte-jts+1))
78 if(.not.
allocated(nifa))
allocate(nifa(ite-its+1, kte-kts+1, jte-jts+1))
79 if(.not.
allocated(ng))
allocate(ng(ite-its+1, kte-kts+1, jte-jts+1))
80 if(.not.
allocated(qb))
allocate(qb(ite-its+1, kte-kts+1, jte-jts+1))
81 if(.not.
allocated(th))
allocate(th(ite-its+1, kte-kts+1, jte-jts+1))
82 if(.not.
allocated(p))
allocate(p(ite-its+1, kte-kts+1, jte-jts+1))
83 if(.not.
allocated(pii))
allocate(pii(ite-its+1, kte-kts+1, jte-jts+1))
84 if(.not.
allocated(w))
allocate(w(ite-its+1, kte-kts+1, jte-jts+1))
85 if(.not.
allocated(dz))
allocate(dz(ite-its+1, kte-kts+1, jte-jts+1))
86 if(.not.
allocated(refl_10cm))
allocate(refl_10cm(ite-its+1, kte-kts+1, jte-jts+1))
87 if(.not.
allocated(re_cloud))
allocate(re_cloud(ite-its+1, kte-kts+1, jte-jts+1))
88 if(.not.
allocated(re_ice))
allocate(re_ice(ite-its+1, kte-kts+1, jte-jts+1))
89 if(.not.
allocated(re_snow))
allocate(re_snow(ite-its+1, kte-kts+1, jte-jts+1))
91 qv = reshape(qv_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
92 qc = reshape(qc_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
93 qr = reshape(qr_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
94 qi = reshape(qi_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
95 qs = reshape(qs_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
96 qg = reshape(qg_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
97 ni = reshape(ni_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
98 nr = reshape(nr_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
99 nc = reshape(nc_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
100 nwfa = reshape(nwfa_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
101 nifa = reshape(nifa_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
102 ng = reshape(ng_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
103 qb = reshape(volg_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
104 th = reshape(theta_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
105 p = reshape(pressure_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
106 w = reshape(w_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
107 dz = reshape(dz_in, (/ite-its+1, kte-kts+1, jte-jts+1/))
109 pii = (p/100000.0)**0.286
124 subroutine mpas_test()
130 integer :: t, itimestep, i, j, k
133 call init_mpas_59lev_convective_data_for_test(nlev=59)
136 call init_tempo_flags_for_test_all_true()
139 write(*,*)
'--- calling tempo_init()'
140 call tempo_init(l_mp_tables, hail_aware_flag, aerosol_aware_flag)
143 do t = 1, integration_length_sec
147 write(*,*)
'--- calling tempo_3d_to_1d_driver()'
150 if (t == integration_length_sec)
then
151 write(*,*)
'Final timestep for TEMPO microphysics: ', t
154 call tempo_3d_to_1d_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, nc=nc, ng=ng, qb=qb, &
155 nwfa=nwfa, nifa=nifa, nwfa2d=nwfa2d, nifa2d=nwfa2d, th=th, pii=pii, p=p, w=w, dz=dz, dt_in=dt_in, &
156 itimestep=itimestep, rainnc=rainnc, rainncv=rainncv, sr=sr, &
157 refl_10cm=refl_10cm, re_cloud=re_cloud, re_ice=re_ice, re_snow=re_snow, &
158 has_reqc=0, has_reqi=0, has_reqs=0, &
159 ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
160 ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
161 its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte)
165 open(1, file =
'mpas_59lev_test_results.txt')
166 write(1,*)
'klev qv qc qr qi qs qg ni nr nc nwfa nifa theta ng volg pressure w dz'
171 write(1,*) k, qv(i,k,j), qc(i,k,j), qr(i,k,j), qi(i,k,j), qs(i,k,j), qg(i,k,j), ni(i,k,j), nr(i,k,j), &
172 nc(i,k,j), nwfa(i,k,j), nifa(i,k,j), th(i,k,j), ng(i,k,j), qb(i,k,j), p(i,k,j), w(i,k,j), dz(i,k,j)