diff --git a/src/gsi/aniso_ens_util.f90 b/src/gsi/aniso_ens_util.f90 index 249b011308..f118bee40f 100644 --- a/src/gsi/aniso_ens_util.f90 +++ b/src/gsi/aniso_ens_util.f90 @@ -65,6 +65,7 @@ subroutine ens_uv_to_psichi(u,v,truewind) ! ! program history log: ! 2008-08-21 pondeca +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! input argument list: ! u(nlat,nlon) - earth relative u-field on analysis grid @@ -82,7 +83,7 @@ subroutine ens_uv_to_psichi(u,v,truewind) use kinds, only: i_kind,r_kind,r_single use constants, only: one,two use gridmod, only: nlon,nlat,region_lon,region_lat,region_dx,region_dy, & - rotate_wind_ll2xy + rotate_wind_ll2xy,fv3_regional use wind_fft, only: divvort_to_psichi implicit none @@ -116,19 +117,21 @@ subroutine ens_uv_to_psichi(u,v,truewind) ! minval(region_lon),maxval(region_lon) ! print*,'in ens_uv_to_psichi: region_lat,min,max=', & ! minval(region_lat),maxval(region_lat) - do i=1,nlat - do j=1,nlon - rlon=region_lon(i,j) - rlat=region_lat(i,j) - dlon=float(j)*one - dlat=float(i)*one - ue=u(i,j) - ve=v(i,j) - call rotate_wind_ll2xy(ue,ve,ug,vg,rlon,dlon,dlat) - u(i,j)=ug - v(i,j)=vg + if(.not.fv3_regional)then + do i=1,nlat + do j=1,nlon + rlon=region_lon(i,j) + rlat=region_lat(i,j) + dlon=float(j)*one + dlat=float(i)*one + ue=u(i,j) + ve=v(i,j) + call rotate_wind_ll2xy(ue,ve,ug,vg,rlon,dlon,dlat) + u(i,j)=ug + v(i,j)=vg + enddo enddo - enddo + endif if (truewind) return !========================================================================== !==>divergence and vorticity computation diff --git a/src/gsi/get_gefs_for_regional.f90 b/src/gsi/get_gefs_for_regional.f90 index 022f1f1612..da58d90ec3 100644 --- a/src/gsi/get_gefs_for_regional.f90 +++ b/src/gsi/get_gefs_for_regional.f90 @@ -22,6 +22,7 @@ subroutine get_gefs_for_regional ! 2016-05-19 Carley/s.liu - prevent the GSI from printing out erroneous error ! when using ensembles from different time ! 2016-12-12 tong - add code to get nemsio meta data, if use_gfs_nemsio=True +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! input argument list: ! @@ -34,7 +35,8 @@ subroutine get_gefs_for_regional !$$$ end documentation block use gridmod, only: idsl5,regional,use_gfs_nemsio - use gridmod, only: nlon,nlat,lat2,lon2,nsig,rotate_wind_ll2xy + use gridmod, only: nlon,nlat,lat2,lon2,nsig,rotate_wind_ll2xy,& + fv3_regional use hybrid_ensemble_parameters, only: region_lat_ens,region_lon_ens use hybrid_ensemble_parameters, only: en_perts,ps_bar,nelen use hybrid_ensemble_parameters, only: n_ens,grd_ens,grd_a1,grd_e1,p_e2a,uv_hyb_ens,dual_res @@ -746,37 +748,52 @@ subroutine get_gefs_for_regional jjmin=grd_mix%nlon ratio_x=(nlon-one)/(grd_mix%nlon-one) ratio_y=(nlat-one)/(grd_mix%nlat-one) - do k=1,grd_mix%nsig - ku=k ; kv=ku+grd_mix%nsig ; kt=kv+grd_mix%nsig ; kq=kt+grd_mix%nsig ; koz=kq+grd_mix%nsig - kcw=koz+grd_mix%nsig - do j=1,grd_mix%lon2 - do i=1,grd_mix%lat2 + if(.not. fv3_regional)then + do k=1,grd_mix%nsig + ku=k ; kv=ku+grd_mix%nsig ; kt=kv+grd_mix%nsig ; kq=kt+grd_mix%nsig ; koz=kq+grd_mix%nsig + kcw=koz+grd_mix%nsig + do j=1,grd_mix%lon2 + do i=1,grd_mix%lat2 - ii=i+grd_mix%istart(mm1)-2 - jj=j+grd_mix%jstart(mm1)-2 - ii=min(grd_mix%nlat,max(1,ii)) - jj=min(grd_mix%nlon,max(1,jj)) - iimax=max(ii,iimax) - iimin=min(ii,iimin) - jjmax=max(jj,jjmax) - jjmin=min(jj,jjmin) - dlon_ens=float(jj) - dlat_ens=float(ii) - dlon=one+(dlon_ens-one)*ratio_x - dlat=one+(dlat_ens-one)*ratio_y - - call rotate_wind_ll2xy(work_sub(1,i,j,ku),work_sub(1,i,j,kv), & - uob,vob,region_lon_ens(ii,jj),dlon,dlat) - st_eg(i,j,k,n)=uob - vp_eg(i,j,k,n)=vob - - t_eg(i,j,k,n)=work_sub(1,i,j,kt) ! now pot virtual temp - rh_eg(i,j,k,n)=work_sub(1,i,j,kq) ! now rh - oz_eg(i,j,k,n)=work_sub(1,i,j,koz) - cw_eg(i,j,k,n)=work_sub(1,i,j,kcw) + ii=i+grd_mix%istart(mm1)-2 + jj=j+grd_mix%jstart(mm1)-2 + ii=min(grd_mix%nlat,max(1,ii)) + jj=min(grd_mix%nlon,max(1,jj)) + iimax=max(ii,iimax) + iimin=min(ii,iimin) + jjmax=max(jj,jjmax) + jjmin=min(jj,jjmin) + dlon_ens=float(jj) + dlat_ens=float(ii) + dlon=one+(dlon_ens-one)*ratio_x + dlat=one+(dlat_ens-one)*ratio_y + call rotate_wind_ll2xy(work_sub(1,i,j,ku),work_sub(1,i,j,kv), & + uob,vob,region_lon_ens(ii,jj),dlon,dlat) + st_eg(i,j,k,n)=uob + vp_eg(i,j,k,n)=vob + t_eg(i,j,k,n)=work_sub(1,i,j,kt) ! now pot virtual temp + rh_eg(i,j,k,n)=work_sub(1,i,j,kq) ! now rh + oz_eg(i,j,k,n)=work_sub(1,i,j,koz) + cw_eg(i,j,k,n)=work_sub(1,i,j,kcw) + end do end do end do - end do + else + do k=1,grd_mix%nsig + ku=k ; kv=ku+grd_mix%nsig ; kt=kv+grd_mix%nsig ; kq=kt+grd_mix%nsig ; koz=kq+grd_mix%nsig + kcw=koz+grd_mix%nsig + do j=1,grd_mix%lon2 + do i=1,grd_mix%lat2 + st_eg(i,j,k,n)=work_sub(1,i,j,ku) + vp_eg(i,j,k,n)=work_sub(1,i,j,kv) + t_eg(i,j,k,n)=work_sub(1,i,j,kt) ! now pot virtual temp + rh_eg(i,j,k,n)=work_sub(1,i,j,kq) ! now rh + oz_eg(i,j,k,n)=work_sub(1,i,j,koz) + cw_eg(i,j,k,n)=work_sub(1,i,j,kcw) + end do + end do + end do + endif kz=num_fields ; kps=kz-1 do j=1,grd_mix%lon2 do i=1,grd_mix%lat2 diff --git a/src/gsi/gfs_stratosphere.f90 b/src/gsi/gfs_stratosphere.f90 index 6d6a3de433..67a79acc90 100644 --- a/src/gsi/gfs_stratosphere.f90 +++ b/src/gsi/gfs_stratosphere.f90 @@ -851,6 +851,7 @@ subroutine add_gfs_stratosphere ! of unused variables ! 2016-12-10 tong - add code to gfs nemsio meta data, if use_gfs_nemsio=True ! 2019-09-24 martin - add support for when use_gfs_ncio is True +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! input argument list: ! @@ -864,7 +865,7 @@ subroutine add_gfs_stratosphere use gridmod, only: regional,wrf_nmm_regional,use_gfs_nemsio,use_gfs_ncio use gridmod, only: region_lat,region_lon,aeta1_ll,aeta2_ll,pdtop_ll,pt_ll - use gridmod, only: nlon,nlat,lat2,lon2,nsig,rotate_wind_ll2xy + use gridmod, only: nlon,nlat,lat2,lon2,nsig,rotate_wind_ll2xy,fv3_regional use gridmod, only: use_gfs_ozone,jcap_gfs,nlat_gfs,nlon_gfs use constants,only: zero,one_tenth,half,one,ten,fv,t0c,r0_05,r60,r3600 use mpimod, only: mype @@ -1581,13 +1582,20 @@ subroutine add_gfs_stratosphere if (xsplo(k) > xspli_g(1)) ysplov_g(k)=yspliv_g(1) enddo ! blend contributions from regional and global: - do k=1,nsig - ! rotate gfs wind to nmmb coordinate: - call rotate_wind_ll2xy(ysplou_g(k),ysplov_g(k), & - uob,vob,region_lon(ii,jj),dlon,dlat) - ut(i,j,k)=blend_rm(k)*ysplou_r(k)+blend_gm(k)*uob - vt(i,j,k)=blend_rm(k)*ysplov_r(k)+blend_gm(k)*vob - enddo + if(fv3_regional)then + do k=1,nsig + ut(i,j,k)=blend_rm(k)*ysplou_r(k)+blend_gm(k)*ysplou_g(k) + vt(i,j,k)=blend_rm(k)*ysplov_r(k)+blend_gm(k)*ysplov_g(k) + enddo + else + do k=1,nsig + ! rotate gfs wind to nmmb coordinate: + call rotate_wind_ll2xy(ysplou_g(k),ysplov_g(k), & + uob,vob,region_lon(ii,jj),dlon,dlat) + ut(i,j,k)=blend_rm(k)*ysplou_r(k)+blend_gm(k)*uob + vt(i,j,k)=blend_rm(k)*ysplov_r(k)+blend_gm(k)*vob + enddo + endif ! t -- regional contribution do k=1,nsig_save diff --git a/src/gsi/gsi_rfv3io_mod.f90 b/src/gsi/gsi_rfv3io_mod.f90 index c0366c9b3d..63f66f1735 100644 --- a/src/gsi/gsi_rfv3io_mod.f90 +++ b/src/gsi/gsi_rfv3io_mod.f90 @@ -23,6 +23,7 @@ module gsi_rfv3io_mod ! sub gsi_fv3ncdf_writeuv ! sub gsi_fv3ncdf_writeps ! sub gsi_fv3ncdf_write +! sub gsi_fv3ncdf_write_v1 ! sub check ! ! variable definitions: @@ -178,7 +179,7 @@ subroutine gsi_rfv3io_get_grid_specs(fv3filenamegin,ierr) use netcdf, only: nf90_inquire_variable use mpimod, only: mype use mod_fv3_lola, only: generate_anl_grid - use gridmod, only:nsig,regional_time,regional_fhr,aeta1_ll,aeta2_ll + use gridmod, only:nsig,regional_time,regional_fhr,regional_fmin,aeta1_ll,aeta2_ll use gridmod, only:nlon_regional,nlat_regional,eta1_ll,eta2_ll use kinds, only: i_kind,r_kind use constants, only: half,zero @@ -196,6 +197,7 @@ subroutine gsi_rfv3io_get_grid_specs(fv3filenamegin,ierr) character(len=128) :: name integer(i_kind) myear,mmonth,mday,mhour,mminute,msecond real(r_kind),allocatable:: abk_fv3(:) + integer nlon0,nlat0 coupler_res_filenam=fv3filenamegin%couplerres grid_spec=fv3filenamegin%grid_spec @@ -215,6 +217,7 @@ subroutine gsi_rfv3io_get_grid_specs(fv3filenamegin,ierr) regional_time(5)=mminute regional_time(6)=msecond regional_fhr=zero ! forecast hour set zero for now + regional_fmin=zero ! forecast min set zero for now !!!!!!!!!! grid_spec !!!!!!!!!!!!!!! ierr=0 @@ -317,6 +320,8 @@ subroutine gsi_rfv3io_get_grid_specs(fv3filenamegin,ierr) !!!!!!! setup A grid and interpolation/rotation coeff. call generate_anl_grid(nx,ny,grid_lon,grid_lont,grid_lat,grid_latt) + + deallocate (grid_lon,grid_lat,grid_lont,grid_latt) deallocate (ak,bk,abk_fv3) @@ -671,6 +676,7 @@ subroutine read_fv3_netcdf_guess(fv3filenamegin) else call gsi_fv3ncdf2d_read_v1(dynvars,'ps','PS',ges_ps,mype_p) ges_prsi(:,:,nsig+1,it)=eta1_ll(nsig+1) + ges_ps=ges_ps*0.001_r_kind do k=1,nsig ges_prsi(:,:,k,it)=eta1_ll(k)+eta2_ll(k)*ges_ps enddo @@ -1548,8 +1554,8 @@ subroutine wrfv3_netcdf(fv3filenamegin) call gsi_fv3ncdf_writeuv(dynvars,ges_u,ges_v,mype_v,add_saved) call gsi_fv3ncdf_writeps(dynvars,'delp',ges_ps,mype_p,add_saved) else - call gsi_fv3ncdf_write(dynvars,'t',ges_tsen(1,1,1,it),mype_t,add_saved) - call gsi_fv3ncdf_write(tracers,'sphum',ges_q ,mype_q,add_saved) + call gsi_fv3ncdf_write_v1(dynvars,'t',ges_tsen(1,1,1,it),mype_t,add_saved) + call gsi_fv3ncdf_write_v1(tracers,'sphum',ges_q ,mype_q,add_saved) call gsi_fv3ncdf_writeuv_v1(dynvars,ges_u,ges_v,mype_v,add_saved) call gsi_fv3ncdf_writeps_v1(dynvars,'ps',ges_ps,mype_p,add_saved) @@ -1778,9 +1784,9 @@ subroutine gsi_fv3ncdf_writeps(filename,varname,var,mype_io,add_saved) allocate( work_b(nlon_regional,nlat_regional,nsig)) call check( nf90_open(trim(filename),nf90_write,gfile_loc) ) call check( nf90_inq_varid(gfile_loc,trim(varname),VarId) ) + allocate( workb2(nlon_regional,nlat_regional)) if(add_saved)then - allocate( workb2(nlon_regional,nlat_regional)) allocate( worka2(nlat,nlon)) !!!!!!!! read in guess delp !!!!!!!!!!!!!! call check( nf90_get_var(gfile_loc,VarId,work_b) ) @@ -1813,7 +1819,9 @@ subroutine gsi_fv3ncdf_writeps(filename,varname,var,mype_io,add_saved) call check( nf90_put_var(gfile_loc,VarId,work_b) ) call check( nf90_close(gfile_loc) ) - deallocate(worka2,workb2) + if (allocated(worka2)) deallocate(worka2) + if (allocated(workb2)) deallocate(workb2) + deallocate(work_b,work_a,work_bi) end if !mype_io @@ -1832,6 +1840,7 @@ subroutine gsi_fv3ncdf_writeuv_v1(dynvars,varu,varv,mype_io,add_saved) ! program history log: ! 2019-04-22 lei modified from gsi_nemsio_writeuv_v1 for update ! u_w,v_w,u_s,v_s in the cold start files! +! 2020-03-06 lei added ilev0 fix ! input argument list: ! varu,varv ! add_saved - true: add analysis increments to readin guess then write out @@ -1870,6 +1879,7 @@ subroutine gsi_fv3ncdf_writeuv_v1(dynvars,varu,varv,mype_io,add_saved) integer(i_kind) :: u_wgrd_VarId,v_wgrd_VarId integer(i_kind) :: u_sgrd_VarId,v_sgrd_VarId integer(i_kind) i,j,mm1,n,k,ns,kr,m + integer(i_kind) ilev0 real(r_kind),allocatable,dimension(:):: work real(r_kind),allocatable,dimension(:,:,:):: work_sub,work_au,work_av real(r_kind),allocatable,dimension(:,:,:):: work_bu_s,work_bv_s @@ -1879,6 +1889,7 @@ subroutine gsi_fv3ncdf_writeuv_v1(dynvars,varu,varv,mype_io,add_saved) real(r_kind),allocatable,dimension(:,:):: workbu_w2,workbv_w2 mm1=mype+1 + ilev0=1 allocate( work(max(iglobal,itotsub)*nsig),work_sub(lat1,lon1,nsig)) !!!!!! gather analysis u !! revers k !!!!!!!!!!! @@ -1931,16 +1942,16 @@ subroutine gsi_fv3ncdf_writeuv_v1(dynvars,varu,varv,mype_io,add_saved) deallocate(work,work_sub) !clt u and v would contain winds at either D-grid or A-grid !clt do not diretly use them in between fv3uv2eath and fv3_h_to_ll unless paying -!attention to the actual storage layout +!attent to the actual storage layout call check( nf90_open(trim(dynvars ),nf90_write,gfile_loc) ) allocate( u(nlon_regional,nlat_regional)) allocate( v(nlon_regional,nlat_regional)) - allocate( work_bu_s(nlon_regional,nlat_regional+1,nsig)) - allocate( work_bv_s(nlon_regional,nlat_regional+1,nsig)) - allocate( work_bu_w(nlon_regional+1,nlat_regional,nsig)) - allocate( work_bv_w(nlon_regional+1,nlat_regional,nsig)) + allocate( work_bu_s(nlon_regional,nlat_regional+1,nsig+1)) + allocate( work_bv_s(nlon_regional,nlat_regional+1,nsig+1)) + allocate( work_bu_w(nlon_regional+1,nlat_regional,nsig+1)) + allocate( work_bv_w(nlon_regional+1,nlat_regional,nsig+1)) @@ -1949,8 +1960,6 @@ subroutine gsi_fv3ncdf_writeuv_v1(dynvars,varu,varv,mype_io,add_saved) call check( nf90_inq_varid(gfile_loc,'v_s',v_sgrd_VarId) ) call check( nf90_inq_varid(gfile_loc,'v_w',v_wgrd_VarId) ) - if(add_saved)then - allocate( workau2(nlat,nlon),workav2(nlat,nlon)) allocate( workbu_w2(nlon_regional+1,nlat_regional)) allocate( workbv_w2(nlon_regional+1,nlat_regional)) allocate( workbu_s2(nlon_regional,nlat_regional+1)) @@ -1960,12 +1969,15 @@ subroutine gsi_fv3ncdf_writeuv_v1(dynvars,varu,varv,mype_io,add_saved) call check( nf90_get_var(gfile_loc,u_wgrd_VarId,work_bu_w) ) call check( nf90_get_var(gfile_loc,v_sgrd_VarId,work_bv_s) ) call check( nf90_get_var(gfile_loc,v_wgrd_VarId,work_bv_w) ) + + if(add_saved)then + allocate( workau2(nlat,nlon),workav2(nlat,nlon)) do k=1,nsig do j=1,nlat_regional - u(:,j)=half * (work_bu_s(:,j,k)+ work_bu_s(:,j+1,k)) + u(:,j)=half * (work_bu_s(:,j,ilev0+k)+ work_bu_s(:,j+1,ilev0+k)) enddo do i=1,nlon_regional - v(i,:)=half*(work_bv_w(i,:,k)+work_bv_w(i+1,:,k)) + v(i,:)=half*(work_bv_w(i,:,ilev0+k)+work_bv_w(i+1,:,ilev0+k)) enddo call fv3_h_to_ll(u,workau2,nlon_regional,nlat_regional,nlon,nlat) call fv3_h_to_ll(v,workav2,nlon_regional,nlat_regional,nlon,nlat) @@ -1975,18 +1987,18 @@ subroutine gsi_fv3ncdf_writeuv_v1(dynvars,varu,varv,mype_io,add_saved) call fv3_ll_to_h(work_au(:,:,k),u,nlon,nlat,nlon_regional,nlat_regional,.true.) call fv3_ll_to_h(work_av(:,:,k),v,nlon,nlat,nlon_regional,nlat_regional,.true.) !!!!!!!! add analysis_inc to readin work_b !!!!!!!!!!!!!!!! - do i=2,nlon_regional-1 - workbu_w2(i,:)=half*(u(i,:)+u(i+1,:)) - workbv_w2(i,:)=half*(v(i,:)+v(i+1,:)) + do i=2,nlon_regional + workbu_w2(i,:)=half*(u(i-1,:)+u(i,:)) + workbv_w2(i,:)=half*(v(i-1,:)+v(i,:)) enddo workbu_w2(1,:)=u(1,:) workbv_w2(1,:)=v(1,:) workbu_w2(nlon_regional+1,:)=u(nlon_regional,:) workbv_w2(nlon_regional+1,:)=v(nlon_regional,:) - do j=2,nlat_regional-1 - workbu_s2(:,j)=half*(u(:,j)+u(:,j+1)) - workbv_s2(:,j)=half*(v(:,j)+v(:,j+1)) + do j=2,nlat_regional + workbu_s2(:,j)=half*(u(:,j-1)+u(:,j)) + workbv_s2(:,j)=half*(v(:,j-1)+v(:,j)) enddo workbu_s2(:,1)=u(:,1) workbv_s2(:,1)=v(:,1) @@ -1995,10 +2007,10 @@ subroutine gsi_fv3ncdf_writeuv_v1(dynvars,varu,varv,mype_io,add_saved) - work_bu_w(:,:,k)=work_bu_w(:,:,k)+workbu_w2(:,:) - work_bu_s(:,:,k)=work_bu_s(:,:,k)+workbu_s2(:,:) - work_bv_w(:,:,k)=work_bv_w(:,:,k)+workbv_w2(:,:) - work_bv_s(:,:,k)=work_bv_s(:,:,k)+workbv_s2(:,:) + work_bu_w(:,:,ilev0+k)=work_bu_w(:,:,ilev0+k)+workbu_w2(:,:) + work_bu_s(:,:,ilev0+k)=work_bu_s(:,:,ilev0+k)+workbu_s2(:,:) + work_bv_w(:,:,ilev0+k)=work_bv_w(:,:,ilev0+k)+workbv_w2(:,:) + work_bv_s(:,:,ilev0+k)=work_bv_s(:,:,ilev0+k)+workbv_s2(:,:) enddo deallocate(workau2,workav2) deallocate(workbu_w2,workbv_w2) @@ -2008,23 +2020,23 @@ subroutine gsi_fv3ncdf_writeuv_v1(dynvars,varu,varv,mype_io,add_saved) call fv3_ll_to_h(work_au(:,:,k),u,nlon,nlat,nlon_regional,nlat_regional,.true.) call fv3_ll_to_h(work_av(:,:,k),v,nlon,nlat,nlon_regional,nlat_regional,.true.) - do i=2,nlon_regional-1 - work_bu_w(i,:,k)=half*(u(i,:)+u(i+1,:)) - work_bv_w(i,:,k)=half*(v(i,:)+v(i+1,:)) + do i=2,nlon_regional + work_bu_w(i,:,k)=half*(u(i-1,:)+u(i,:)) + work_bv_w(i,:,k)=half*(v(i-1,:)+v(i,:)) enddo - work_bu_w(1,:,k)=u(1,:) - work_bv_w(1,:,k)=v(1,:) - work_bu_w(nlon_regional+1,:,k)=u(nlon_regional,:) - work_bv_w(nlon_regional+1,:,k)=v(nlon_regional,:) - - do j=2,nlat_regional-1 - work_bu_s(:,j,k)=half*(u(:,j)+u(:,j+1)) - work_bv_s(:,j,k)=half*(v(:,j)+v(:,j+1)) + work_bu_w(1,:,ilev0+k)=u(1,:) + work_bv_w(1,:,ilev0+k)=v(1,:) + work_bu_w(nlon_regional+1,:,ilev0+k)=u(nlon_regional,:) + work_bv_w(nlon_regional+1,:,ilev0+k)=v(nlon_regional,:) + + do j=2,nlat_regional + work_bu_s(:,j,ilev0+k)=half*(u(:,j-1)+u(:,j)) + work_bv_s(:,j,ilev0+k)=half*(v(:,j-1)+v(:,j)) enddo - work_bu_s(:,1,k)=u(:,1) - work_bv_s(:,1,k)=v(:,1) - work_bu_s(:,nlat_regional+1,k)=u(:,nlat_regional) - work_bv_s(:,nlat_regional+1,k)=v(:,nlat_regional) + work_bu_s(:,1,ilev0+k)=u(:,1) + work_bv_s(:,1,ilev0+k)=v(:,1) + work_bu_s(:,nlat_regional+1,ilev0+k)=u(:,nlat_regional) + work_bv_s(:,nlat_regional+1,ilev0+k)=v(:,nlat_regional) enddo @@ -2132,9 +2144,11 @@ subroutine gsi_fv3ncdf_writeps_v1(filename,varname,var,mype_io,add_saved) call check( nf90_put_var(gfile_loc,VarId,work_b) ) call check( nf90_close(gfile_loc) ) - deallocate(worka2,workb2) + if (allocated(worka2)) deallocate(worka2) + if ( allocated(workb2)) deallocate(workb2) deallocate(work_b,work_a,work_bi) + end if !mype_io deallocate(work,work_sub) @@ -2259,6 +2273,118 @@ subroutine check(status) stop end if end subroutine check +subroutine gsi_fv3ncdf_write_v1(filename,varname,var,mype_io,add_saved) +!$$$ subprogram documentation block +! . . . . +! subprogram: gsi_nemsio_write +! pgrmmr: wu +! +! abstract: +! +! program history log: +! 2020-03-05 lei modified from gsi_fv3ncdf_write to gsi_fv3ncdf_write_v1 +! input argument list: +! varu,varv +! add_saved +! mype - mpi task id +! mype_io +! +! output argument list: +! +! attributes: +! language: f90 +! machine: +! +!$$$ end documentation block + + use mpimod, only: mpi_rtype,mpi_comm_world,ierror,npe,mype + use gridmod, only: lat2,lon2,nlon,nlat,lat1,lon1,nsig + use gridmod, only: ijn,displs_g,itotsub,iglobal + use mod_fv3_lola, only: fv3_ll_to_h + use mod_fv3_lola, only: fv3_h_to_ll + use general_commvars_mod, only: ltosi,ltosj + use netcdf, only: nf90_open,nf90_close + use netcdf, only: nf90_write,nf90_inq_varid + use netcdf, only: nf90_put_var,nf90_get_var + implicit none + + real(r_kind) ,intent(in ) :: var(lat2,lon2,nsig) + integer(i_kind),intent(in ) :: mype_io + logical ,intent(in ) :: add_saved + character(*) ,intent(in ) :: varname,filename + + integer(i_kind) :: VarId,gfile_loc + integer(i_kind) :: ilev0 + integer(i_kind) i,j,mm1,k,kr,ns,n,m + real(r_kind),allocatable,dimension(:):: work + real(r_kind),allocatable,dimension(:,:,:):: work_sub,work_a + real(r_kind),allocatable,dimension(:,:,:):: work_b + real(r_kind),allocatable,dimension(:,:):: workb2,worka2 + integer ii + + + mm1=mype+1 + + allocate( work(max(iglobal,itotsub)*nsig),work_sub(lat1,lon1,nsig)) +!!!!!!!! reverse z !!!!!!!!!!!!!! + do k=1,nsig + kr=nsig+1-k + do i=1,lon1 + do j=1,lat1 + work_sub(j,i,kr)=var(j+1,i+1,k) + end do + end do + enddo + call mpi_gatherv(work_sub,ijnz(mm1),mpi_rtype, & + work,ijnz,displsz_g,mpi_rtype,mype_io,mpi_comm_world,ierror) + + if(mype==mype_io) then + allocate( work_a(nlat,nlon,nsig)) + ns=0 + do m=1,npe + do k=1,nsig + do n=displs_g(m)+1,displs_g(m)+ijn(m) + ns=ns+1 + work_a(ltosi(n),ltosj(n),k)=work(ns) + end do + enddo + enddo + + allocate( work_b(nlon_regional,nlat_regional,nsig+1)) + + call check( nf90_open(trim(filename),nf90_write,gfile_loc) ) + call check( nf90_inq_varid(gfile_loc,trim(varname),VarId) ) + call check( nf90_get_var(gfile_loc,VarId,work_b) ) + ilev0=1 + + if(add_saved)then + allocate( workb2(nlon_regional,nlat_regional)) + allocate( worka2(nlat,nlon)) +!clt for being now only lev between (including ) 2 and nsig+1 of work_b (:,:,lev) +!clt are updated + do k=1,nsig + call fv3_h_to_ll(work_b(:,:,ilev0+k),worka2,nlon_regional,nlat_regional,nlon,nlat) +!!!!!!!! analysis_inc: work_a !!!!!!!!!!!!!!!! + work_a(:,:,k)=work_a(:,:,k)-worka2(:,:) + call fv3_ll_to_h(work_a(1,1,k),workb2,nlon,nlat,nlon_regional,nlat_regional,.true.) + work_b(:,:,ilev0+k)=work_b(:,:,ilev0+k)+workb2(:,:) + enddo + deallocate(worka2,workb2) + else + do k=1,nsig + call fv3_ll_to_h(work_a(1,1,k),work_b(1,1,ilev0+k),nlon,nlat,nlon_regional,nlat_regional,.true.) + enddo + endif + + print *,'write out ',trim(varname),' to ',trim(filename) + call check( nf90_put_var(gfile_loc,VarId,work_b) ) + call check( nf90_close(gfile_loc) ) + deallocate(work_b,work_a) + end if !mype_io + + deallocate(work,work_sub) + +end subroutine gsi_fv3ncdf_write_v1 end module gsi_rfv3io_mod diff --git a/src/gsi/read_fl_hdob.f90 b/src/gsi/read_fl_hdob.f90 index 93330c925f..a7c275174a 100644 --- a/src/gsi/read_fl_hdob.f90 +++ b/src/gsi/read_fl_hdob.f90 @@ -23,6 +23,7 @@ subroutine read_fl_hdob(nread,ndata,nodata,infile,obstype,lunout,gstime,twind,si ! linear qc error table and b table ! 2015-10-01 guo - calc ob location once in deg +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! input argument list: ! infile - unit from which to read BUFR data @@ -50,7 +51,7 @@ subroutine read_fl_hdob(nread,ndata,nodata,infile,obstype,lunout,gstime,twind,si r60inv,r10,r100,r2000,hvap,eps,omeps,rv,grav use gridmod, only: diagnostic_reg,regional,nlon,nlat,nsig,& tll2xy,txy2ll,rotate_wind_ll2xy,rotate_wind_xy2ll,& - rlats,rlons,twodvar_regional + rlats,rlons,twodvar_regional,fv3_regional use convinfo, only: nconvtype, & icuse,ictype,icsubtype,ioctype, & ithin_conv,rmesh_conv,pmesh_conv @@ -999,7 +1000,7 @@ subroutine read_fl_hdob(nread,ndata,nodata,infile,obstype,lunout,gstime,twind,si if (pob_mb < r50) woe = woe*r1_2 if (inflate_error) woe = woe*r1_2 if (qcm > lim_qm ) woe = woe*1.0e6_r_kind - if(regional)then + if(regional .and. .not. fv3_regional)then u0 = uob v0 = vob call rotate_wind_ll2xy(u0,v0,uob,vob,dlon_earth,dlon,dlat) diff --git a/src/gsi/read_prepbufr.f90 b/src/gsi/read_prepbufr.f90 index 8e8a08b970..9041d9702b 100644 --- a/src/gsi/read_prepbufr.f90 +++ b/src/gsi/read_prepbufr.f90 @@ -146,6 +146,8 @@ subroutine read_prepbufr(nread,ndata,nodata,infile,obstype,lunout,twindin,sis,& ! 2019-09-27 Su - add hilbert curve application to aircraft winds ! 2019-12-05 mmorris - Update adjust_goescldobs to reject ALL clear cloud obs at night ! +! 2020-05-04 wu - no rotate_wind for fv3_regional + ! input argument list: ! infile - unit from which to read BUFR data ! obstype - observation type to process @@ -173,7 +175,7 @@ subroutine read_prepbufr(nread,ndata,nodata,infile,obstype,lunout,twindin,sis,& use constants,only: rearth,stndrd_atmos_ps,rd,grav use gridmod, only: diagnostic_reg,regional,nlon,nlat,nsig,& tll2xy,txy2ll,rotate_wind_ll2xy,rotate_wind_xy2ll,& - rlats,rlons,twodvar_regional + rlats,rlons,twodvar_regional,fv3_regional use convinfo, only: nconvtype,ctwind, & ncmiter,ncgroup,ncnumgrp,icuse,ictype,icsubtype,ioctype, & ithin_conv,rmesh_conv,pmesh_conv,pmot_conv,ptime_conv, & @@ -2185,7 +2187,7 @@ subroutine read_prepbufr(nread,ndata,nodata,infile,obstype,lunout,twindin,sis,& if(sqrt(uob**2+vob**2)>60.0_r_kind)cycle LOOP_readsb end if - if(regional)then + if(regional .and. .not. fv3_regional)then u0=uob v0=vob call rotate_wind_ll2xy(u0,v0,uob,vob,dlon_earth,dlon,dlat) diff --git a/src/gsi/read_radar.f90 b/src/gsi/read_radar.f90 index 11521f5bf0..9b62951d29 100644 --- a/src/gsi/read_radar.f90 +++ b/src/gsi/read_radar.f90 @@ -60,6 +60,7 @@ subroutine read_radar(nread,ndata,nodata,infile,lunout,obstype,twind,sis,hgtl_fu ! to help fix a multiple data read bug (when l2rwbufr and radarbufr were both ! listed in the OBS_INPUT table) and for added flexibility for experimental setups. ! 2018-02-15 wu - add code for fv3_regional option +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! ! input argument list: @@ -89,7 +90,8 @@ subroutine read_radar(nread,ndata,nodata,infile,lunout,obstype,twind,sis,hgtl_fu use qcmod, only: erradar_inflate,vadfile,newvad use obsmod, only: iadate,ianldate,l_foreaft_thin use gsi_4dvar, only: l4dvar,l4densvar,iwinbgn,winlen,time_4dvar,thin4d - use gridmod, only: regional,nlat,nlon,tll2xy,rlats,rlons,rotate_wind_ll2xy,nsig + use gridmod, only: regional,nlat,nlon,tll2xy,rlats,rlons,rotate_wind_ll2xy,nsig,& + fv3_regional use gridmod, only: wrf_nmm_regional,nems_nmmb_regional,cmaq_regional,wrf_mass_regional use gridmod, only: fv3_regional use convinfo, only: nconvtype,ctwind, & @@ -680,7 +682,7 @@ subroutine read_radar(nread,ndata,nodata,infile,lunout,obstype,twind,sis,hgtl_fu height= thishgt rwnd = thisvr azm_earth = corrected_azimuth - if(regional) then + if(regional .and. .not. fv3_regional) then cosazm_earth=cos(azm_earth*deg2rad) sinazm_earth=sin(azm_earth*deg2rad) call rotate_wind_ll2xy(cosazm_earth,sinazm_earth,cosazm,sinazm,dlon_earth,dlon,dlat) @@ -1088,7 +1090,7 @@ subroutine read_radar(nread,ndata,nodata,infile,lunout,obstype,twind,sis,hgtl_fu height= radar_obs(4,k) rwnd = radar_obs(5,k) azm_earth = r90-radar_obs(6,k) - if(regional) then + if(regional .and. .not. fv3_regional) then cosazm_earth=cos(azm_earth*deg2rad) sinazm_earth=sin(azm_earth*deg2rad) call rotate_wind_ll2xy(cosazm_earth,sinazm_earth,cosazm,sinazm,dlon_earth,dlon,dlat) @@ -1522,7 +1524,7 @@ subroutine read_radar(nread,ndata,nodata,infile,lunout,obstype,twind,sis,hgtl_fu height= z(ii) rwnd = thisvr azm_earth = glob_azimuth8(ii) - if(regional) then + if(regional .and. .not. fv3_regional) then cosazm_earth=cos(azm_earth*deg2rad) sinazm_earth=sin(azm_earth*deg2rad) call rotate_wind_ll2xy(cosazm_earth,sinazm_earth,cosazm,sinazm,dlon_earth,dlon,dlat) @@ -2041,7 +2043,7 @@ subroutine read_radar(nread,ndata,nodata,infile,lunout,obstype,twind,sis,hgtl_fu height= z(i) rwnd = dopbin(i) azm_earth = glob_azimuth8(i) - if(regional) then + if(regional .and. .not. fv3_regional) then cosazm_earth=cos(azm_earth*deg2rad) sinazm_earth=sin(azm_earth*deg2rad) call rotate_wind_ll2xy(cosazm_earth,sinazm_earth,cosazm,sinazm,dlon_earth,dlon,dlat) @@ -2401,7 +2403,8 @@ subroutine read_radar_l2rw_novadqc(ndata,nodata,lunout,obstype,sis,nobs) use qcmod, only: erradar_inflate use oneobmod, only: oneobtest,learthrel_rw use gsi_4dvar, only: l4dvar,l4densvar,winlen,time_4dvar - use gridmod, only: regional,nlat,nlon,tll2xy,rlats,rlons,rotate_wind_ll2xy + use gridmod, only: regional,nlat,nlon,tll2xy,rlats,rlons,rotate_wind_ll2xy,& + fv3_regional use convinfo, only: nconvtype,ncmiter,ncgroup,ncnumgrp,icuse,ioctype use deter_sfc_mod, only: deter_sfc2 use mpimod, only: npe @@ -2630,7 +2633,7 @@ subroutine read_radar_l2rw_novadqc(ndata,nodata,lunout,obstype,sis,nobs) rwnd = thisvr azm_earth = corrected_azimuth - if(regional) then + if(regional .and. .not. fv3_regional) then if(oneobtest .and. learthrel_rw) then ! for non rotated winds!!! cosazm=cos(azm_earth*deg2rad) sinazm=sin(azm_earth*deg2rad) diff --git a/src/gsi/read_radar_wind_ascii.f90 b/src/gsi/read_radar_wind_ascii.f90 index 02200a9d76..2e1b06a50c 100644 --- a/src/gsi/read_radar_wind_ascii.f90 +++ b/src/gsi/read_radar_wind_ascii.f90 @@ -13,6 +13,7 @@ subroutine read_radar_wind_ascii(nread,ndata,nodata,infile,lunout,obstype,sis,hg ! 2011-08-12 carley - fix ob error to 2 m/s ! 2011-08-23 carley - use deter_sfc_mod ! 2011-12-08 carley - add wind rotation (earth to grid) +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! input argument list: ! infile - file from which to read data @@ -116,7 +117,8 @@ subroutine read_radar_wind_ascii(nread,ndata,nodata,infile,lunout,obstype,sis,hg use constants, only: zero,half,one,two,deg2rad,rearth,rad2deg, & one_tenth,r1000,r60,r60inv,r100,r400,grav_equator, & eccentricity,somigliana,grav_ratio,grav,semi_major_axis,flattening - use gridmod, only: regional,tll2xy,rotate_wind_ll2xy,nsig,nlat,nlon + use gridmod, only: regional,tll2xy,rotate_wind_ll2xy,nsig,nlat,nlon,& + fv3_regional use obsmod, only: iadate, & mintiltvr,maxtiltvr,minobrangevr,maxobrangevr, rmesh_vr,zmesh_vr,& doradaroneob,oneoblat,oneoblon,oneobheight,oneobradid @@ -464,7 +466,7 @@ subroutine read_radar_wind_ascii(nread,ndata,nodata,infile,lunout,obstype,sis,hg ! Domain could be rectangular, so ob may be out of ! range at one end, but not the other. - if(regional) then + if(regional .and. .not. fv3_regional) then cosazm_earth=cos(thisazimuthr) sinazm_earth=sin(thisazimuthr) call rotate_wind_ll2xy(cosazm_earth,sinazm_earth,cosazm,sinazm,thislon,dlon,dlat) diff --git a/src/gsi/read_rapidscat.f90 b/src/gsi/read_rapidscat.f90 index fa909d9ca9..dc48991940 100644 --- a/src/gsi/read_rapidscat.f90 +++ b/src/gsi/read_rapidscat.f90 @@ -16,6 +16,7 @@ subroutine read_rapidscat(nread,ndata,nodata,infile,obstype,lunout,gstime,twind, ! 2015-04-03 Ling Liu ! 2015-09-17 Thomas - add l4densvar and thin4d to data selection procedure ! 2016-03-11 j. guo - Fixed {dlat,dlon}_earth_deg in the obs data stream +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! input argument list: ! ithin - flag to thin data @@ -41,7 +42,7 @@ subroutine read_rapidscat(nread,ndata,nodata,infile,obstype,lunout,gstime,twind, use kinds, only: r_kind,r_double,i_kind,r_single use gridmod, only: diagnostic_reg,regional,nlon,nlat,nsig,& tll2xy,txy2ll,rotate_wind_ll2xy,rotate_wind_xy2ll,& - rlats,rlons + rlats,rlons,fv3_regional use qcmod, only: errormod,noiqc use convthin, only: make3grids,map3grids,del3grids,use_all use constants, only: deg2rad,zero,rad2deg,one_tenth,& @@ -620,7 +621,7 @@ subroutine read_rapidscat(nread,ndata,nodata,infile,obstype,lunout,gstime,twind, woe=obserr oelev=r10 - if(regional)then + if(regional .and. .not. fv3_regional)then u0=uob v0=vob call rotate_wind_ll2xy(u0,v0,uob,vob,dlon_earth,dlon,dlat) diff --git a/src/gsi/read_satwnd.f90 b/src/gsi/read_satwnd.f90 index c3fcf290cf..78691edcc5 100644 --- a/src/gsi/read_satwnd.f90 +++ b/src/gsi/read_satwnd.f90 @@ -72,6 +72,8 @@ subroutine read_satwnd(nread,ndata,nodata,infile,obstype,lunout,gstime,twind,sis ! 2019-9-25 Su - modified ithin value criteria to distinguash thinning ! or hilber curve downweighting ! +! 2020-05-04 wu - no rotate_wind for fv3_regional +! ! ! ! input argument list: @@ -98,7 +100,7 @@ subroutine read_satwnd(nread,ndata,nodata,infile,obstype,lunout,gstime,twind,sis use kinds, only: r_kind,r_double,i_kind,r_single use gridmod, only: diagnostic_reg,regional,nlon,nlat,nsig,& tll2xy,txy2ll,rotate_wind_ll2xy,rotate_wind_xy2ll,& - rlats,rlons,twodvar_regional,wrf_nmm_regional + rlats,rlons,twodvar_regional,wrf_nmm_regional,fv3_regional use qcmod, only: errormod,njqc use convthin, only: make3grids,map3grids,map3grids_m,del3grids,use_all use convthin_time, only: make3grids_tm,map3grids_tm,map3grids_m_tm,del3grids_tm,use_all_tm @@ -1365,7 +1367,7 @@ subroutine read_satwnd(nread,ndata,nodata,infile,obstype,lunout,gstime,twind,sis if (qm==3 .or. qm==7) inflate_error=.true. woe=obserr if (inflate_error) woe=woe*r1_2 - if(regional)then + if(regional .and. .not. fv3_regional)then u0=uob v0=vob call rotate_wind_ll2xy(u0,v0,uob,vob,dlon_earth,dlon,dlat) diff --git a/src/gsi/read_sfcwnd.f90 b/src/gsi/read_sfcwnd.f90 index 06fa9f0207..cabe69b84f 100644 --- a/src/gsi/read_sfcwnd.f90 +++ b/src/gsi/read_sfcwnd.f90 @@ -21,6 +21,7 @@ subroutine read_sfcwnd(nread,ndata,nodata,infile,obstype,lunout,gstime,twind,sis ! 2015-10-01 guo - consolidate use of ob location (in deg) ! 2016-03-15 Su - modified the code so that the program won't stop when ! no subtype is found in non linear qc error table and b table +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! input argument list: ! ithin - flag to thin data @@ -46,7 +47,7 @@ subroutine read_sfcwnd(nread,ndata,nodata,infile,obstype,lunout,gstime,twind,sis use kinds, only: r_kind,r_double,i_kind,r_single use gridmod, only: diagnostic_reg,regional,nlon,nlat,nsig,& tll2xy,txy2ll,rotate_wind_ll2xy,rotate_wind_xy2ll,& - rlats,rlons + rlats,rlons,fv3_regional use qcmod, only: errormod,noiqc,njqc use convthin, only: make3grids,map3grids,del3grids,use_all @@ -678,7 +679,7 @@ subroutine read_sfcwnd(nread,ndata,nodata,infile,obstype,lunout,gstime,twind,sis woe=obserr oelev=r10 - if(regional)then + if(regional .and. .not. fv3_regional)then u0=uob v0=vob call rotate_wind_ll2xy(u0,v0,uob,vob,dlon_earth,dlon,dlat) diff --git a/src/gsi/setupuwnd10m.f90 b/src/gsi/setupuwnd10m.f90 index 15a3f386ca..4552a7e81a 100644 --- a/src/gsi/setupuwnd10m.f90 +++ b/src/gsi/setupuwnd10m.f90 @@ -31,6 +31,7 @@ subroutine setupuwnd10m(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_d ! 2017-09-28 todling - add netcdf_diag capability; hidden as contained code ! 2018-01-08 pondeca - addd option l_closeobs to use closest obs to analysis ! time in analysis +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! input argument list: ! lunin - unit from which to read observations @@ -74,7 +75,8 @@ subroutine setupuwnd10m(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_d use oneobmod, only: magoberr,maginnov,oneobtest use gridmod, only: nsig - use gridmod, only: get_ij,twodvar_regional,regional,rotate_wind_xy2ll,pt_ll + use gridmod, only: get_ij,twodvar_regional,regional,rotate_wind_xy2ll,pt_ll,& + fv3_regional use constants, only: zero,tiny_r_kind,one,one_tenth,half,wgtlim,rd,grav,& two,cg_term,three,four,five,ten,huge_single,r1000,r3600,& grav_ratio,flattening,grav,deg2rad,grav_equator,somigliana, & @@ -900,7 +902,7 @@ subroutine contents_binary_diag_(odiag) rdiagbuf(21,ii) = dvdiff ! vob-ges (ms**-1) rdiagbuf(22,ii) = data(ivob,i)-vgesin! vob-ges w/o bias correction (ms**-1) (future slot) - if(regional) then + if(regional .and. .not. fv3_regional) then ! replace positions 17-22 with earth relative wind component information @@ -995,7 +997,7 @@ subroutine contents_netcdf_diag_(odiag) call nc_diag_metadata("v_Obs_Minus_Forecast_adjusted", dvdiff ) call nc_diag_metadata("v_Obs_Minus_Forecast_unadjusted", data(ivob,i)-vgesin) - if(regional) then + if(regional .and. .not. fv3_regional) then ! replace positions 17-22 with earth relative wind component information diff --git a/src/gsi/setupvwnd10m.f90 b/src/gsi/setupvwnd10m.f90 index 7ebcb1c042..0c601e716b 100644 --- a/src/gsi/setupvwnd10m.f90 +++ b/src/gsi/setupvwnd10m.f90 @@ -31,6 +31,7 @@ subroutine setupvwnd10m(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_d ! 2017-09-28 todling - add netcdf_diag capability; hidden as contained code ! 2018-01-08 pondeca - addd option l_closeobs to use closest obs to analysis ! time in analysis +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! input argument list: ! lunin - unit from which to read observations @@ -74,7 +75,8 @@ subroutine setupvwnd10m(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_d use oneobmod, only: magoberr,maginnov,oneobtest use gridmod, only: nsig - use gridmod, only: get_ij,twodvar_regional,regional,rotate_wind_xy2ll,pt_ll + use gridmod, only: get_ij,twodvar_regional,regional,rotate_wind_xy2ll,pt_ll,& + fv3_regional use constants, only: zero,tiny_r_kind,one,one_tenth,half,wgtlim,rd,grav,& two,cg_term,three,four,five,ten,huge_single,r1000,r3600,& grav_ratio,flattening,grav,deg2rad,grav_equator,somigliana, & @@ -900,7 +902,7 @@ subroutine contents_binary_diag_(odiag) rdiagbuf(21,ii) = dudiff ! uob-ges (ms**-1) rdiagbuf(22,ii) = data(iuob,i)-ugesin! uob-ges w/o bias correction (ms**-1) (future slot) - if(regional) then + if(regional .and. .not. fv3_regional) then ! replace positions 17-22 with earth relative wind component information @@ -995,7 +997,7 @@ subroutine contents_netcdf_diag_(odiag) call nc_diag_metadata("v_Obs_Minus_Forecast_adjusted", dudiff ) call nc_diag_metadata("v_Obs_Minus_Forecast_unadjusted", data(iuob,i)-ugesin) - if(regional) then + if(regional .and. .not. fv3_regional) then ! replace positions 17-22 with earth relative wind component information diff --git a/src/gsi/setupw.f90 b/src/gsi/setupw.f90 index 546ef9d051..21fe0e90ad 100644 --- a/src/gsi/setupw.f90 +++ b/src/gsi/setupw.f90 @@ -50,7 +50,7 @@ subroutine setupw(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diagsav use qcmod, only: nvqc use oneobmod, only: oneobtest,oneob_type,magoberr,maginnov use gridmod, only: get_ijk,nsig,twodvar_regional,regional,wrf_nmm_regional,& - rotate_wind_xy2ll,pt_ll + rotate_wind_xy2ll,pt_ll,fv3_regional use guess_grids, only: nfldsig,hrdifsig,geop_hgtl,sfcmod_gfs use guess_grids, only: tropprs,sfcmod_mm5 use guess_grids, only: ges_lnprsl,comp_fact10,pbl_height @@ -215,7 +215,7 @@ subroutine setupw(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diagsav ! error (DOE) calculation to the namelist ! level; they are now loaded by ! aircraftinfo. -! +! 2020-05-04 wu - no rotate_wind for fv3_regional ! ! REMARKS: ! language: f90 @@ -1656,7 +1656,7 @@ subroutine contents_binary_diag_(udiag,vdiag) rdiagbuf(21,ii) = dvdiff ! v obs-ges used in analysis (m/s) rdiagbuf(22,ii) = vob-vgesin ! v obs-ges w/o bias correction (m/s) (future slot) - if(regional) then + if(regional .and. .not. fv3_regional) then ! replace positions 17-22 with earth relative wind component information @@ -1766,7 +1766,7 @@ subroutine contents_netcdf_diag_(udiag,vdiag) call nc_diag_metadata("Wind_Reduction_Factor_at_10m", sngl(factw) ) - if (.not. regional) then + if (.not. regional .or. fv3_regional) then call nc_diag_metadata("u_Observation", sngl(data(iuob,i)) ) call nc_diag_metadata("u_Obs_Minus_Forecast_adjusted", sngl(dudiff) ) call nc_diag_metadata("u_Obs_Minus_Forecast_unadjusted", sngl(uob-ugesin) )