-
Notifications
You must be signed in to change notification settings - Fork 158
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
Bugfixes #8
Bugfixes #8
Changes from 9 commits
e198c52
0e01f02
d47965c
2d73753
7e91866
3e01822
94842bc
b71e959
2eb8b2c
248196c
bddc70c
97d12bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
[submodule "atmos_cubed_sphere"] | ||
path = atmos_cubed_sphere | ||
url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere | ||
branch = dev/emc | ||
url = https://github.com/junwang-noaa/GFDL_atmos_cubed_sphere | ||
branch = regfv3_rst | ||
[submodule "ccpp/framework"] | ||
path = ccpp/framework | ||
url = https://github.com/NCAR/ccpp-framework | ||
[submodule "ccpp/physics"] | ||
path = ccpp/physics | ||
url = https://github.com/NCAR/ccpp-physics | ||
url = https://github.com/junwang-noaa/ccpp-physics | ||
branch = gfdlmp_update |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,7 @@ module module_wrt_grid_comp | |
logical,save :: first_init=.false. | ||
logical,save :: first_run=.false. | ||
logical,save :: first_getlatlon=.true. | ||
logical,save :: change_wrtidate=.false. | ||
! | ||
!----------------------------------------------------------------------- | ||
! | ||
|
@@ -173,7 +174,8 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) | |
real(ESMF_KIND_R4) :: valueR4 | ||
real(ESMF_KIND_R8) :: valueR8 | ||
|
||
integer :: attCount, axeslen, jidx, noutfile | ||
integer :: attCount, axeslen, jidx, idx, noutfile | ||
character(19) :: newdate | ||
character(128) :: FBlist_outfilename(100), outfile_name | ||
character(128),dimension(:,:), allocatable :: outfilename | ||
real(8), dimension(:), allocatable :: slat | ||
|
@@ -183,7 +185,6 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) | |
real(ESMF_KIND_R8) :: geo_lon, geo_lat | ||
real(ESMF_KIND_R8) :: lon1_r8, lat1_r8 | ||
real(ESMF_KIND_R8) :: x1, y1, x, y | ||
type(ESMF_Time) :: IO_BASETIME_IAU | ||
type(ESMF_TimeInterval) :: IAU_offsetTI | ||
type(ESMF_DataCopy_Flag) :: copyflag=ESMF_DATACOPY_REFERENCE | ||
! real(8),parameter :: PI=3.14159265358979d0 | ||
|
@@ -469,8 +470,31 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) | |
call ESMF_Finalize(endflag=ESMF_END_ABORT) | ||
|
||
endif | ||
! | ||
!----------------------------------------------------------------------- | ||
!*** get write grid component initial time from clock | ||
!----------------------------------------------------------------------- | ||
! | ||
call ESMF_ClockGet(clock =CLOCK & !<-- The ESMF Clock | ||
,startTime=wrt_int_state%IO_BASETIME & !<-- The Clock's starting time | ||
,rc =RC) | ||
|
||
|
||
call ESMF_TimeGet(time=wrt_int_state%IO_BASETIME,yy=idate(1),mm=idate(2),dd=idate(3),h=idate(4), & | ||
m=idate(5),s=idate(6),rc=rc) | ||
! if (lprnt) write(0,*) 'in wrt initial, io_baseline time=',idate,'rc=',rc | ||
idate(7) = 1 | ||
wrt_int_state%idate = idate | ||
wrt_int_state%fdate = idate | ||
if(iau_offset > 0 ) then | ||
call ESMF_TimeIntervalSet(IAU_offsetTI, h=iau_offset, rc=rc) | ||
wrt_int_state%IO_BASETIME = wrt_int_state%IO_BASETIME + IAU_offsetTI | ||
call ESMF_TimeGet(time=wrt_int_state%IO_BASETIME,yy=idate(1),mm=idate(2),dd=idate(3),h=idate(4), & | ||
m=idate(5),s=idate(6),rc=rc) | ||
wrt_int_state%idate = idate | ||
change_wrtidate = .true. | ||
if (lprnt) print *,'in wrt initial, with iau, io_baseline time=',idate,'rc=',rc | ||
endif | ||
! | ||
! Create field bundle | ||
!------------------------------------------------------------------- | ||
! | ||
|
@@ -867,6 +891,17 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) | |
|
||
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return | ||
|
||
! add iau here | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more informative comment please There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added comments "! update the time:units when idate on write grid component is changed" |
||
if ( index(trim(attNameList(i)),'time:units')>0) then | ||
if ( change_wrtidate ) then | ||
idx = index(trim(valueS),' since ') | ||
if(lprnt) print *,'in write grid comp, time:unit=',trim(valueS) | ||
write(newdate,'(I4.4,a,I2.2,a,I2.2,a,I2.2,a,I2.2,a,I2.2)') idate(1),'-', & | ||
idate(2),'-',idate(3),' ',idate(4),':',idate(5),':',idate(6) | ||
valueS = valueS(1:idx+6)//newdate | ||
if(lprnt) print *,'in write grid comp, new time:unit=',trim(valueS) | ||
endif | ||
endif | ||
call ESMF_AttributeSet(wrtgrid, convention="NetCDF", purpose="FV3", & | ||
name=trim(attNameList(i)), value=valueS, rc=rc) | ||
|
||
|
@@ -1036,28 +1071,6 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) | |
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return | ||
! | ||
!----------------------------------------------------------------------- | ||
!*** SET THE IO_BaseTime TO THE INITIAL CLOCK TIME. | ||
!----------------------------------------------------------------------- | ||
! | ||
call ESMF_ClockGet(clock =CLOCK & !<-- The ESMF Clock | ||
,startTime=wrt_int_state%IO_BASETIME & !<-- The Clock's starting time | ||
,rc =RC) | ||
|
||
call ESMF_TimeGet(time=wrt_int_state%IO_BASETIME,yy=idate(1),mm=idate(2),dd=idate(3),h=idate(4), & | ||
m=idate(5),s=idate(6),rc=rc) | ||
! if (lprnt) write(0,*) 'in wrt initial, io_baseline time=',idate,'rc=',rc | ||
idate(7) = 1 | ||
wrt_int_state%idate = idate | ||
wrt_int_state%fdate = idate | ||
if(iau_offset > 0 ) then | ||
call ESMF_TimeIntervalSet(IAU_offsetTI, h=iau_offset, rc=rc) | ||
IO_BASETIME_IAU = wrt_int_state%IO_BASETIME + IAU_offsetTI | ||
call ESMF_TimeGet(time=IO_BASETIME_IAU,yy=idate(1),mm=idate(2),dd=idate(3),h=idate(4), & | ||
m=idate(5),s=idate(6),rc=rc) | ||
! if (lprnt) write(0,*) 'in wrt initial, with iau, io_baseline time=',idate,'rc=',rc | ||
endif | ||
! | ||
!----------------------------------------------------------------------- | ||
!*** SET THE FIRST HISTORY FILE'S TIME INDEX. | ||
!----------------------------------------------------------------------- | ||
! | ||
|
@@ -1251,9 +1264,10 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) | |
! | ||
nf_seconds = nf_hours*3600+nf_minuteS*60+nseconds+real(nseconds_num)/real(nseconds_den) | ||
! shift forecast hour by iau_offset if iau is on. | ||
nf_seconds = nf_seconds - iau_offset*3600 | ||
!nf_seconds = nf_seconds - iau_offset*3600 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can delete this commented out line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
wrt_int_state%nfhour = nf_seconds/3600. | ||
nf_hours = int(nf_seconds/3600.) | ||
if(mype == lead_write_task) print *,'in write grid comp, nf_hours=',nf_hours | ||
! if iau_offset > nf_hours, don't write out anything | ||
if (nf_hours < 0) return | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment here since it's not obvious what's going on. Something like "update idate when IAU is enabled to reference center of IAU window"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments "! update IO-BASETIME and idate on write grid comp when IAU is enabled"