14 subroutine gfs_gwd_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, dvdt, dtdt, &
15 & dugwd, dvgwd, flag_for_gwd_generic_tend, dtend, dtidx, index_of_temperature, index_of_x_wind, &
16 & index_of_y_wind, index_of_process_orographic_gwd, errmsg, errflg)
21 logical,
intent(in) :: lssav, ldiag3d, flag_for_gwd_generic_tend
23 real(kind=kind_phys),
intent(in) :: dusfcg(:), dvsfcg(:)
24 real(kind=kind_phys),
intent(in) :: dudt(:,:), dvdt(:,:), dtdt(:,:)
25 real(kind=kind_phys),
intent(in) :: dtf
27 real(kind=kind_phys),
intent(inout) :: dugwd(:), dvgwd(:)
30 real(kind=kind_phys),
intent(inout),
optional :: dtend(:,:,:)
31 integer,
intent(in) :: dtidx(:,:), index_of_temperature, &
32 & index_of_x_wind, index_of_y_wind, index_of_process_orographic_gwd
34 character(len=*),
intent(out) :: errmsg
35 integer,
intent(out) :: errflg
44 dugwd(:) = dugwd(:) + dusfcg(:)*dtf
45 dvgwd(:) = dvgwd(:) + dvsfcg(:)*dtf
47 if (ldiag3d .and. flag_for_gwd_generic_tend)
then
48 idtend = dtidx(index_of_temperature, index_of_process_orographic_gwd)
50 dtend(:,:,idtend) = dtend(:,:,idtend) + dtdt*dtf
53 idtend = dtidx(index_of_x_wind, index_of_process_orographic_gwd)
55 dtend(:,:,idtend) = dtend(:,:,idtend) + dudt*dtf
58 idtend = dtidx(index_of_y_wind, index_of_process_orographic_gwd)
60 dtend(:,:,idtend) = dtend(:,:,idtend) + dvdt*dtf