37 character(len=255) :: trajpath
38 character(len=255) :: trajfile
50 type(c_ptr),
intent(in) :: c_conf
55 character(len=20) :: ststep
56 type(duration) :: dtstep
57 real(kind=kind_real) :: dt
62 ststep = config_get_string(c_conf,len(ststep),
"tstep")
64 dt =
real(duration_seconds(dtstep),
kind_real)
69 self%readtraj = config_get_int(c_conf,
"readtraj")
70 if (self%readtraj == 1)
then 71 self%trajpath = config_get_string(c_conf,len(self%trajpath),
"trajpath")
72 self%trajfile = config_get_string(c_conf,len(self%trajfile),
"trajfile")
78 self%fv3jedi_lm%conf%do_dyn = config_get_int(c_conf,
"lm_do_dyn")
79 self%fv3jedi_lm%conf%do_phy_trb = config_get_int(c_conf,
"lm_do_trb")
80 self%fv3jedi_lm%conf%do_phy_mst = config_get_int(c_conf,
"lm_do_mst")
82 call self%fv3jedi_lm%create(dt,geom%npx,geom%npy,geom%npz,geom%ptop,geom%ak,geom%bk)
91 if ((self%fv3jedi_lm%conf%do_phy_trb .ne. 0 .and. self%readtraj == 0) .or. &
92 (self%fv3jedi_lm%conf%do_phy_mst .ne. 0 .and. self%readtraj == 0) )
then 93 call abor1_ftn(
"fv3jedi_model | FV3 : unless reading the trajecotory physics should be off")
107 call self%fv3jedi_lm%delete()
119 call self%fv3jedi_lm%init_nl()
130 type(datetime),
intent(in) :: vdate
132 character(len=20) :: vdatec
134 if (self%readtraj == 0)
then 137 call self%fv3jedi_lm%step_nl()
142 call datetime_to_string(vdate, vdatec)
157 call self%fv3jedi_lm%final_nl()
166 type(fv3jedi_state),
intent(in) :: state
167 type(fv3jedi_lm_type),
intent(inout) :: lm
171 lm%traj%ua = state%ua
172 lm%traj%va = state%va
174 lm%traj%delp = state%delp
176 lm%traj%qi = state%qi
177 lm%traj%ql = state%ql
178 lm%traj%o3 = state%o3
180 if (.not. lm%conf%hydrostatic)
then 182 lm%traj%delz = state%delz
185 lm%traj%phis = state%phis
194 type(fv3jedi_lm_type),
intent(in) :: lm
195 type(fv3jedi_state),
intent(inout) :: state
199 state%ua = lm%traj%ua
200 state%va = lm%traj%va
202 state%delp = lm%traj%delp
204 state%qi = lm%traj%qi
205 state%ql = lm%traj%ql
206 state%o3 = lm%traj%o3
208 if (.not. lm%conf%hydrostatic)
then 210 state%delz = lm%traj%delz
213 state%phis = lm%traj%phis
222 type(fv3jedi_model),
intent(in) :: self
223 type(fv3jedi_state),
intent(inout) :: state
224 character(len=20),
intent(in) :: vdatec
226 character(len=255) :: date, path, fname1, fname2, filename
227 character(len=4) :: yyyy,mm,dd,hh,mn
228 character(len=20) :: var
229 integer,
allocatable :: istart(:), icount(:)
230 integer :: ncid, ncstat, dimid, varid
234 logical :: tiledimension = .false.
236 integer :: isc,iec,jsc,jec
238 write(date,*) vdatec(1:4),vdatec(6:7),vdatec(9:10),
'_',vdatec(12:13),vdatec(15:16),
'z.nc4' 246 fname1 = self%trajfile
256 filename = trim(path)//trim(fname1)//trim(yyyy)//trim(mm)//trim(dd)//
"_"//trim(hh)//trim(mn)//trim(fname2)
258 if (self%fv3jedi_lm%conf%rpe) print*,
' ' 259 if (self%fv3jedi_lm%conf%rpe) print*,
'Reading trajectory: ', trim(filename)
260 if (self%fv3jedi_lm%conf%rpe) print*,
' ' 263 ncstat = nf90_open(trim(filename), nf90_nowrite, ncid)
264 if(ncstat /= nf90_noerr) print *,
"OPEN: "//trim(nf90_strerror(ncstat))
267 ncstat = nf90_inq_dimid(ncid,
"lon", dimid)
268 if(ncstat /= nf90_noerr) print *,
"lon: "//trim(nf90_strerror(ncstat))
269 ncstat = nf90_inquire_dimension(ncid, dimid, len = im)
270 if(ncstat /= nf90_noerr) print *,
"lon:"//trim(nf90_strerror(ncstat))
272 ncstat = nf90_inq_dimid(ncid,
"lat", dimid)
273 if(ncstat /= nf90_noerr) print *,
"lat: "//trim(nf90_strerror(ncstat))
274 ncstat = nf90_inquire_dimension(ncid, dimid, len = jm)
275 if(ncstat /= nf90_noerr) print *,
"lat: "//trim(nf90_strerror(ncstat))
278 if ( (im == state%npx-1) .and. (jm == 6*(state%npy-1) ) )
then 279 tiledimension = .false.
280 tileoff = (state%ntile-1)*(jm/state%ntiles)
282 tiledimension = .true.
284 call abor1_ftn(
"Trajectory GEOS: tile dimension in file not done yet")
290 istart(2) = tileoff + jsc
294 icount(1) = iec-isc+1
295 icount(2) = jec-jsc+1
300 ncstat = nf90_inq_varid(ncid, trim(var), varid)
301 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
302 ncstat = nf90_get_var(ncid, varid, state%ud(isc:iec,jsc:jec,:), istart, icount)
303 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
306 ncstat = nf90_inq_varid(ncid, trim(var), varid)
307 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
308 ncstat = nf90_get_var(ncid, varid, state%vd(isc:iec,jsc:jec,:), istart, icount)
309 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
312 ncstat = nf90_inq_varid(ncid, trim(var), varid)
313 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
314 ncstat = nf90_get_var(ncid, varid, state%ua(isc:iec,jsc:jec,:), istart, icount)
315 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
318 ncstat = nf90_inq_varid(ncid, trim(var), varid)
319 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
320 ncstat = nf90_get_var(ncid, varid, state%va(isc:iec,jsc:jec,:), istart, icount)
321 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
324 ncstat = nf90_inq_varid(ncid, trim(var), varid)
325 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
326 ncstat = nf90_get_var(ncid, varid, state%t(isc:iec,jsc:jec,:), istart, icount)
327 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
330 ncstat = nf90_inq_varid(ncid, trim(var), varid)
331 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
332 ncstat = nf90_get_var(ncid, varid, state%delp(isc:iec,jsc:jec,:), istart, icount)
333 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
336 ncstat = nf90_inq_varid(ncid, trim(var), varid)
337 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
338 ncstat = nf90_get_var(ncid, varid, state%q(isc:iec,jsc:jec,:), istart, icount)
339 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
342 ncstat = nf90_inq_varid(ncid, trim(var), varid)
343 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
344 ncstat = nf90_get_var(ncid, varid, state%qi(isc:iec,jsc:jec,:), istart, icount)
345 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
348 ncstat = nf90_inq_varid(ncid, trim(var), varid)
349 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
350 ncstat = nf90_get_var(ncid, varid, state%ql(isc:iec,jsc:jec,:), istart, icount)
351 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
354 ncstat = nf90_inq_varid(ncid, trim(var), varid)
355 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
356 ncstat = nf90_get_var(ncid, varid, state%o3(isc:iec,jsc:jec,:), istart, icount)
357 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
359 if (.not.self%fv3jedi_lm%conf%hydrostatic)
then 362 ncstat = nf90_inq_varid(ncid, trim(var), varid)
363 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
364 ncstat = nf90_get_var(ncid, varid, state%w(isc:iec,jsc:jec,:), istart, icount)
365 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
368 ncstat = nf90_inq_varid(ncid, trim(var), varid)
369 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
370 ncstat = nf90_get_var(ncid, varid, state%delz(isc:iec,jsc:jec,:), istart, icount)
371 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
375 if (self%fv3jedi_lm%conf%do_phy_mst .ne. 0)
then 378 ncstat = nf90_inq_varid(ncid, trim(var), varid)
379 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
380 ncstat = nf90_get_var(ncid, varid, state%qls(isc:iec,jsc:jec,:), istart, icount)
381 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
384 ncstat = nf90_inq_varid(ncid, trim(var), varid)
385 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
386 ncstat = nf90_get_var(ncid, varid, state%qcn(isc:iec,jsc:jec,:), istart, icount)
387 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
390 ncstat = nf90_inq_varid(ncid, trim(var), varid)
391 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
392 ncstat = nf90_get_var(ncid, varid, state%cfcn(isc:iec,jsc:jec,:), istart, icount)
393 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
397 deallocate(istart,icount)
402 istart(2) = tileoff + jsc
405 icount(1) = iec-isc+1
406 icount(2) = jec-jsc+1
410 ncstat = nf90_inq_varid(ncid, trim(var), varid)
411 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
412 ncstat = nf90_get_var(ncid, varid, state%phis(isc:iec,jsc:jec), istart, icount)
413 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
416 ncstat = nf90_inq_varid(ncid, trim(var), varid)
417 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
418 ncstat = nf90_get_var(ncid, varid, state%frocean(isc:iec,jsc:jec), istart, icount)
419 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
422 ncstat = nf90_inq_varid(ncid, trim(var), varid)
423 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
424 ncstat = nf90_get_var(ncid, varid, state%frland(isc:iec,jsc:jec), istart, icount)
425 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
428 ncstat = nf90_inq_varid(ncid, trim(var), varid)
429 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
430 ncstat = nf90_get_var(ncid, varid, state%varflt(isc:iec,jsc:jec), istart, icount)
431 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
434 ncstat = nf90_inq_varid(ncid, trim(var), varid)
435 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
436 ncstat = nf90_get_var(ncid, varid, state%ustar(isc:iec,jsc:jec), istart, icount)
437 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
440 ncstat = nf90_inq_varid(ncid, trim(var), varid)
441 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
442 ncstat = nf90_get_var(ncid, varid, state%bstar(isc:iec,jsc:jec), istart, icount)
443 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
446 ncstat = nf90_inq_varid(ncid, trim(var), varid)
447 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
448 ncstat = nf90_get_var(ncid, varid, state%zpbl(isc:iec,jsc:jec), istart, icount)
449 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
452 ncstat = nf90_inq_varid(ncid, trim(var), varid)
453 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
454 ncstat = nf90_get_var(ncid, varid, state%cm(isc:iec,jsc:jec), istart, icount)
455 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
458 ncstat = nf90_inq_varid(ncid, trim(var), varid)
459 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
460 ncstat = nf90_get_var(ncid, varid, state%ct(isc:iec,jsc:jec), istart, icount)
461 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
464 ncstat = nf90_inq_varid(ncid, trim(var), varid)
465 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
466 ncstat = nf90_get_var(ncid, varid, state%cq(isc:iec,jsc:jec), istart, icount)
467 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
470 ncstat = nf90_inq_varid(ncid, trim(var), varid)
471 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
472 ncstat = nf90_get_var(ncid, varid, state%kcbl(isc:iec,jsc:jec), istart, icount)
473 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
476 ncstat = nf90_inq_varid(ncid, trim(var), varid)
477 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
478 ncstat = nf90_get_var(ncid, varid, state%ts(isc:iec,jsc:jec), istart, icount)
479 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
482 ncstat = nf90_inq_varid(ncid, trim(var), varid)
483 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
484 ncstat = nf90_get_var(ncid, varid, state%khl(isc:iec,jsc:jec), istart, icount)
485 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
488 ncstat = nf90_inq_varid(ncid, trim(var), varid)
489 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
490 ncstat = nf90_get_var(ncid, varid, state%khu(isc:iec,jsc:jec), istart, icount)
491 if(ncstat /= nf90_noerr) print *, trim(var)//trim(nf90_strerror(ncstat))
494 ncstat = nf90_close(ncid)
495 if(ncstat /= nf90_noerr) print *,
"CLOSE: "//trim(nf90_strerror(ncstat))
497 deallocate(istart,icount)
Fortran derived type to hold FV3JEDI increment.
Top level for fv3jedi linearized model.
subroutine, public model_initialize(self, state)
Fortran derived type to hold FV3JEDI state.
Fortran derived type to hold geometry data for the FV3JEDI model.
subroutine lm_to_state(lm, state)
Handle state for the FV3JEDI odel.
Fortran derived type to hold model definition.
subroutine, public model_finalize(self, state)
Handle increment for the FV3JEDI model.
subroutine, public model_create(self, geom, c_conf)
Fortran module handling geometry for the FV3 model.
subroutine, public model_step(self, state, vdate)
subroutine state_to_lm(state, lm)
subroutine, public model_delete(self)
integer, parameter, public kind_real
subroutine read_state(self, state, vdatec)