Skip to content
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
16 changes: 10 additions & 6 deletions cpl/module_cap_cpl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ subroutine diagnose_cplFields(gcomp, clock_fv3, fcstpe, &
character(len=*),parameter :: subname='(module_cap_cpl:diagnose_cplFields)'
type(ESMF_Time) :: currTime
type(ESMF_State) :: state
character(len=240) :: timestr
type(ESMF_TimeInterval) :: timeStep
character(len=240) :: import_timestr, export_timestr
character(len=160) :: nuopcMsg
character(len=160) :: filename
!
call ESMF_ClockGet(clock_fv3, currTime=currTime, rc=rc)
call ESMF_ClockGet(clock_fv3, currTime=currTime, timeStep=timestep, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
call ESMF_TimeGet(currTime, timestring=timestr, rc=rc)
call ESMF_TimeGet(currTime, timestring=import_timestr, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
call ESMF_TimeGet(currTime+timestep, timestring=export_timestr, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

call ESMF_ClockPrint(clock_fv3, options="currTime", preString="current time: ", unit=nuopcMsg)
Expand All @@ -52,7 +55,7 @@ subroutine diagnose_cplFields(gcomp, clock_fv3, fcstpe, &

! Dump Fields out
if (statewrite_flag) then
write(filename,'(A)') 'fv3_cap_import_'//trim(timestr)//'.tile*.nc'
write(filename,'(A)') 'fv3_cap_import_'//trim(import_timestr)//'.tile*.nc'
call State_RWFields_tiles(state,trim(filename), rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
end if
Expand All @@ -68,7 +71,7 @@ subroutine diagnose_cplFields(gcomp, clock_fv3, fcstpe, &

! Dump Fields out
if (statewrite_flag) then
write(filename,'(A)') 'fv3_cap_export_'//trim(timestr)//'.tile*.nc'
write(filename,'(A)') 'fv3_cap_export_'//trim(export_timestr)//'.tile*.nc'
call State_RWFields_tiles(state,trim(filename), rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
end if
Expand Down Expand Up @@ -236,7 +239,8 @@ subroutine State_RWFields_tiles(state,filename,rc)

enddo

call ESMF_FieldBundleWrite(fieldbundle, fileName=trim(filename), convention=convention, purpose=purpose, rc=rc)
call ESMF_FieldBundleWrite(fieldbundle, fileName=trim(filename), convention=convention, purpose=purpose, &
timeslice=1, overwrite=.true., rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

! -- Finalize
Expand Down