anchor.diff:    public :: prgvar_get_withdiag
     public :: prgvar_set
     public :: prgvar_get_in
  +  public :: prgvar_get_in_withdiag
     public :: prgvar_set_in
   
     public :: prgvar_get_plane_nopl     ! [add] T.Ohno 110722
  
positive.code:     ! <- [add]&[Mod] H.Yashiro 20110819
  
      write(ADM_LOG_FID,*)
      write(ADM_LOG_FID,*) '====== data range check : prognostic variables ======'
      do nq = 1, DIAG_vmax0
         val_max = GTL_max( DIAG_var   (:,:,:,nq),       &
                            DIAG_var_pl(:,:,:,nq),       &
  
negative.code:     call cnvvar_prg2diag( PRG_var (:,:,:,:), PRG_var_pl (:,:,:,:), & !--- [IN]
                            DIAG_var(:,:,:,:), DIAG_var_pl(:,:,:,:)  ) !--- [OUT]
  
      do l = 1, ADM_lall
      do k = 1, ADM_kall
      do n = 1, ADM_gall
         rhog  (n,k,l) = PRG_var(n,k,l,I_RHOG  )
         rhogvx(n,k,l) = PRG_var(n,k,l,I_RHOGVX)
         rhogvy(n,k,l) = PRG_var(n,k,l,I_RHOGVY)
         rhogvz(n,k,l) = PRG_var(n,k,l,I_RHOGVZ)
         rhogw (n,k,l) = PRG_var(n,k,l,I_RHOGW )
         rhoge (n,k,l) = PRG_var(n,k,l,I_RHOGE )
  
         rho   (n,k,l) = PRG_var(n,k,l,I_RHOG) / VMTR_GSGAM2(n,k,l)
  
         pre   (n,k,l) = DIAG_var(n,k,l,I_pre)
         tem   (n,k,l) = DIAG_var(n,k,l,I_tem)
         vx    (n,k,l) = DIAG_var(n,k,l,I_vx )
         vy    (n,k,l) = DIAG_var(n,k,l,I_vy )
         vz    (n,k,l) = DIAG_var(n,k,l,I_vz )
         w     (n,k,l) = DIAG_var(n,k,l,I_w  )
      enddo
      enddo
      enddo
  
      do nq = 1, TRC_vmax
      do l  = 1, ADM_lall
      do k  = 1, ADM_kall
      do n  = 1, ADM_gall
         rhogq(n,k,l,nq) = PRG_var(n,k,l,PRG_vmax0+nq)
  
         q    (n,k,l,nq) = DIAG_var(n,k,l,DIAG_vmax0+nq)
      enddo
      enddo
      enddo
      enddo
  
      if ( ADM_prc_me == ADM_prc_pl ) then
  
         do l = 1, ADM_lall_pl
         do k = 1, ADM_kall
         do n = 1, ADM_gall_pl
            rhog_pl  (n,k,l) = PRG_var_pl(n,k,l,I_RHOG  )
            rhogvx_pl(n,k,l) = PRG_var_pl(n,k,l,I_RHOGVX)
            rhogvy_pl(n,k,l) = PRG_var_pl(n,k,l,I_RHOGVY)
            rhogvz_pl(n,k,l) = PRG_var_pl(n,k,l,I_RHOGVZ)
            rhogw_pl (n,k,l) = PRG_var_pl(n,k,l,I_RHOGW )
            rhoge_pl (n,k,l) = PRG_var_pl(n,k,l,I_RHOGE )
  
            rho_pl   (n,k,l) = PRG_var_pl(n,k,l,I_RHOG) / VMTR_GSGAM2_pl(n,k,l)
  
            pre_pl   (n,k,l) = DIAG_var_pl(n,k,l,I_pre)
            tem_pl   (n,k,l) = DIAG_var_pl(n,k,l,I_tem)
            vx_pl    (n,k,l) = DIAG_var_pl(n,k,l,I_vx )
            vy_pl    (n,k,l) = DIAG_var_pl(n,k,l,I_vy )
            vz_pl    (n,k,l) = DIAG_var_pl(n,k,l,I_vz )
            w_pl     (n,k,l) = DIAG_var_pl(n,k,l,I_w  )
         enddo
         enddo
         enddo
  
         do nq = 1, TRC_vmax
         do l  = 1, ADM_lall_pl
         do k  = 1, ADM_kall
         do n  = 1, ADM_gall_pl
            rhogq_pl(n,k,l,nq) = PRG_var_pl(n,k,l,PRG_vmax0+nq)
  
            q_pl    (n,k,l,nq) = DIAG_var_pl(n,k,l,DIAG_vmax0+nq)
         enddo
         enddo
         enddo
         enddo
  
      endif
  
      return
    end subroutine prgvar_get_withdiag
  