diff --git a/sorc/ncep_post.fd/INITPOST_NETCDF.f b/sorc/ncep_post.fd/INITPOST_NETCDF.f index ba78397e9..150c0d557 100644 --- a/sorc/ncep_post.fd/INITPOST_NETCDF.f +++ b/sorc/ncep_post.fd/INITPOST_NETCDF.f @@ -18,6 +18,7 @@ !> 2022-03-22 | Wen Meng | Read PWAT from model !> 2022-04-08 | Bo Cui | 2D decomposition for unified fv3 read interfaces !> 2022-06-05 | Hui-Ya Chuang | Modify dx/dy computation for RRFS domain over north pole +!> 2022-07-10 | Wen Meng | Output lat/lon on four coner points of rotated lat-lon grids in text file. !> !> @author Hui-Ya Chuang @date 2016-03-04 SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d) @@ -71,7 +72,8 @@ SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d) ista, iend, ista_2l, iend_2u,iend_m use gridspec_mod, only: maptype, gridtype, latstart, latlast, lonstart, lonlast, cenlon, & dxval, dyval, truelat2, truelat1, psmapf, cenlat,lonstartv, lonlastv, cenlonv, & - latstartv, latlastv, cenlatv,latstart_r,latlast_r,lonstart_r,lonlast_r, STANDLON + latstartv, latlastv,cenlatv,latstart_r,latlast_r,lonstart_r,lonlast_r, STANDLON, & + latse,lonse,latnw,lonnw use upp_physics, only: fpvsnew !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - implicit none @@ -104,7 +106,7 @@ SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d) character(len=20) :: VarName, VcoordName integer :: Status, fldsize, fldst, recn, recn_vvel character startdate*19,SysDepInfo*80,cgar*1 - character startdate2(19)*4 + character startdate2(19)*4, flatlon*40 logical :: read_lonlat=.true. ! ! NOTE: SOME INTEGER VARIABLES ARE READ INTO DUMMY ( A REAL ). THIS IS OK @@ -468,8 +470,8 @@ SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d) dyval=dum_const*gdsdegr end if - print*,'lonstart,latstart,cenlon,cenlat,dyval,dxval', & - lonstart,latstart,cenlon,cenlat,dyval,dxval +! print*,'lonstart,latstart,cenlon,cenlat,dyval,dxval', & +! lonstart,latstart,cenlon,cenlat,dyval,dxval ! Jili Dong add support for regular lat lon (2019/03/22) start else if(trim(varcharval)=='latlon')then @@ -763,9 +765,13 @@ SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d) if(convert_rad_to_deg)then lonstart = nint(dummy(1,1)*gdsdegr)*180./pi lonlast = nint(dummy(im,jm)*gdsdegr)*180./pi + lonse = nint(dummy(im,1)*gdsdegr)*180./pi + lonnw = nint(dummy(1,jm)*gdsdegr)*180./pi else lonstart = nint(dummy(1,1)*gdsdegr) lonlast = nint(dummy(im,jm)*gdsdegr) + lonse = nint(dummy(im,1)*gdsdegr) + lonnw = nint(dummy(1,jm)*gdsdegr) end if ! Jili Dong add support for regular lat lon (2019/03/22) start @@ -820,9 +826,13 @@ SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d) if(convert_rad_to_deg)then latstart = nint(dummy(1,1)*gdsdegr)*180./pi latlast = nint(dummy(im,jm)*gdsdegr)*180./pi + latse = nint(dummy(im,1)*gdsdegr)*180./pi + latnw = nint(dummy(1,jm)*gdsdegr)*180./pi else latstart = nint(dummy(1,1)*gdsdegr) latlast = nint(dummy(im,jm)*gdsdegr) + latse = nint(dummy(im,1)*gdsdegr) + latnw = nint(dummy(1,jm)*gdsdegr) end if end if print*,'laststart,latlast = ',latstart,latlast @@ -3549,6 +3559,16 @@ SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d) WRITE(igdout)0 WRITE(igdout)0 WRITE(igdout)0 + ELSE IF(MAPTYPE == 207)THEN !Rotated lat-lon grid + write(flatlon,1001)ifhr + open(112,file=trim(flatlon),form='formatted', & + status='unknown') + write(112,1002)LATSTART/1000,LONSTART/1000,& + LATSE/1000,LONSE/1000,LATNW/1000,LONNW/1000,& + LATLAST/1000,LONLAST/1000 + 1001 format('latlons_corners.txt.f',I3.3) + 1002 format(4(I6,I7,X)) + close(112) END IF end if !