Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output lat/lon on four corner points of rotated lat-lon grids in text file #531

Merged
merged 3 commits into from
Jul 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions sorc/ncep_post.fd/INITPOST_NETCDF.f
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
!
Expand Down