81 function linterp_1d(this, var_name, year, month, day, hour, min, sec)
result(err_message)
83 character(len=*),
intent(in) :: var_name
84 integer,
intent(in) :: year, month, day, hour, min, sec
85 character(len=128) :: err_message
86 integer :: ti(1), tf(1), ntime
87 real(kind_phys) :: w1, w2
90 call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf)
92 ntime =
size(this%tend2d%T(1,:))
96 if (tf(1) .le. ntime)
then
97 this%tend1d%T = w1*this%tend2d%T(:,ti(1)) + w2*this%tend2d%T(:,tf(1))
99 this%tend1d%T = this%tend2d%T(:,1)
102 if (tf(1) .le. ntime)
then
103 this%tend1d%u = w1*this%tend2d%u(:,ti(1)) + w2*this%tend2d%u(:,tf(1))
105 this%tend1d%u = this%tend2d%u(:,1)
108 if (tf(1) .le. ntime)
then
109 this%tend1d%v = w1*this%tend2d%v(:,ti(1)) + w2*this%tend2d%v(:,tf(1))
111 this%tend1d%v = this%tend2d%v(:,1)
114 if (tf(1) .le. ntime)
then
115 this%tend1d%q = w1*this%tend2d%q(:,ti(1)) + w2*this%tend2d%q(:,tf(1))
117 this%tend1d%q = this%tend2d%q(:,1)
127 function linterp_2d(this, var_name, lon, lat, year, month, day, hour, min, sec)
result(err_message)
129 character(len=*),
intent(in) :: var_name
130 integer,
intent(in) :: year, month, day, hour, min, sec
131 real(kind_phys),
intent(in) :: lon, lat
132 character(len=128) :: err_message
133 integer :: ti(1), tf(1), inearest
134 real(kind_phys) :: w1, w2
137 call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf)
140 inearest = this%find_nearest_loc_2d_1d(lon,lat)
142 select case(var_name)
144 this%tend1d%T = w1*this%tend3d%T(inearest,:,ti(1)) + w2*this%tend3d%T(inearest,:,tf(1))
146 this%tend1d%u = w1*this%tend3d%u(inearest,:,ti(1)) + w2*this%tend3d%u(inearest,:,tf(1))
148 this%tend1d%v = w1*this%tend3d%v(inearest,:,ti(1)) + w2*this%tend3d%v(inearest,:,tf(1))
150 this%tend1d%q = w1*this%tend3d%q(inearest,:,ti(1)) + w2*this%tend3d%q(inearest,:,tf(1))
166 subroutine cmp_time_wts(this, year, month, day, hour, minute, sec, w1, w2, ti, tf)
169 integer,
intent(in) :: year, month, day, hour, minute, sec
171 integer,
intent(out) :: ti(1), tf(1)
172 real(kind_phys),
intent(out) :: w1, w2
174 real(kind_phys) :: hrofday
176 hrofday = hour*3600. + minute*60. + sec
179 w1 = ((hour+1)*3600 - hrofday)/3600
185 subroutine sim_lwrad( year, month, day, hour, min, sec, process)
187 integer,
intent(in) :: year, month, day, hour, min, sec
188 character(len=128) :: errmsg
190 if (
allocated(process%tend2d%T))
then
191 errmsg = process%linterp(
"T", year,month,day,hour,min,sec)
197 subroutine sim_swrad( year, month, day, hour, min, sec, process)
199 integer,
intent(in) :: year, month, day, hour, min, sec
200 character(len=128) :: errmsg
202 if (
allocated(process%tend2d%T))
then
203 errmsg = process%linterp(
"T", year,month,day,hour,min,sec)
209 subroutine sim_gwd( year, month, day, hour, min, sec, process)
211 integer,
intent(in) :: year, month, day, hour, min, sec
212 character(len=128) :: errmsg
214 if (
allocated(process%tend2d%T))
then
215 errmsg = process%linterp(
"T", year,month,day,hour,min,sec)
217 if (
allocated(process%tend2d%u))
then
218 errmsg = process%linterp(
"u", year,month,day,hour,min,sec)
220 if (
allocated(process%tend2d%v))
then
221 errmsg = process%linterp(
"v", year,month,day,hour,min,sec)
227 subroutine sim_pbl( year, month, day, hour, min, sec, process)
229 integer,
intent(in) :: year, month, day, hour, min, sec
230 character(len=128) :: errmsg
232 if (
allocated(process%tend2d%T))
then
233 errmsg = process%linterp(
"T", year,month,day,hour,min,sec)
235 if (
allocated(process%tend2d%u))
then
236 errmsg = process%linterp(
"u", year,month,day,hour,min,sec)
238 if (
allocated(process%tend2d%v))
then
239 errmsg = process%linterp(
"v", year,month,day,hour,min,sec)
241 if (
allocated(process%tend2d%q))
then
242 errmsg = process%linterp(
"q", year,month,day,hour,min,sec)
248 subroutine sim_dcnv( year, month, day, hour, min, sec, process)
250 integer,
intent(in) :: year, month, day, hour, min, sec
251 character(len=128) :: errmsg
253 if (
allocated(process%tend2d%T))
then
254 errmsg = process%linterp(
"T", year,month,day,hour,min,sec)
256 if (
allocated(process%tend2d%u))
then
257 errmsg = process%linterp(
"u", year,month,day,hour,min,sec)
259 if (
allocated(process%tend2d%v))
then
260 errmsg = process%linterp(
"v", year,month,day,hour,min,sec)
262 if (
allocated(process%tend2d%q))
then
263 errmsg = process%linterp(
"q", year,month,day,hour,min,sec)
269 subroutine sim_scnv( year, month, day, hour, min, sec, process)
271 integer,
intent(in) :: year, month, day, hour, min, sec
272 character(len=128) :: errmsg
274 if (
allocated(process%tend2d%T))
then
275 errmsg = process%linterp(
"T", year,month,day,hour,min,sec)
277 if (
allocated(process%tend2d%u))
then
278 errmsg = process%linterp(
"u", year,month,day,hour,min,sec)
280 if (
allocated(process%tend2d%v))
then
281 errmsg = process%linterp(
"v", year,month,day,hour,min,sec)
283 if (
allocated(process%tend2d%q))
then
284 errmsg = process%linterp(
"q", year,month,day,hour,min,sec)
290 subroutine sim_cldmp( year, month, day, hour, min, sec, process)
292 integer,
intent(in) :: year, month, day, hour, min, sec
293 character(len=128) :: errmsg
295 if (
allocated(process%tend2d%T))
then
296 errmsg = process%linterp(
"T", year,month,day,hour,min,sec)
298 if (
allocated(process%tend2d%q))
then
299 errmsg = process%linterp(
"q", year,month,day,hour,min,sec)