From email from Jim Edwards:
In PR ESCOMP/CMEPS#221 I added support for the REST_OPTION=end and for writing restart files at the
end of the run in any case except when REST_OPTION = none or never.
Each component model will need updates in the xxx_comp_nuopc.F90 file order to implement this change. Please consider making this change in your next component tag. Let me know if you have any questions or concerns. thanks
Here are the changes I made in the ctsm lnd_comp_nuopc.F90 file:
(Declare a module variable)
logical :: write_restart_at_endofrun = .false.
(Initialize the variable in InitializeRealize)
+ call NUOPC_CompAttributeGet(gcomp, name="write_restart_at_endofrun", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (isPresent .and. isSet) then
+ if (trim(cvalue) .eq. '.true.') write_restart_at_endofrun = .true.
+ end if
(Check the variable in ModelAdvance - Note here that this comes after the alarm_stop)
!--------------------------------
! Determine if time to stop
!--------------------------------
call ESMF_ClockGetAlarm(clock, alarmname='alarm_stop', alarm=alarm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (ESMF_AlarmIsRinging(alarm, rc=rc)) then
if (ChkErr(rc,__LINE__,u_FILE_u)) return
nlend = .true.
call ESMF_AlarmRingerOff( alarm, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else
nlend = .false.
endif
!--------------------------------
! Determine if time to write restart
!--------------------------------
rstwr = .false.
if (nlend .and. write_restart_at_endofrun) then
rstwr = .true.
else
call ESMF_ClockGetAlarm(clock, alarmname='alarm_restart', alarm=alarm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (ESMF_AlarmIsCreated(alarm, rc=rc)) then
if (ESMF_AlarmIsRinging(alarm, rc=rc)) then
if (ChkErr(rc,__LINE__,u_FILE_u)) return
rstwr = .true.
call ESMF_AlarmRingerOff( alarm, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
endif
endif
end if
From email from Jim Edwards:
In PR ESCOMP/CMEPS#221 I added support for the REST_OPTION=end and for writing restart files at the
end of the run in any case except when REST_OPTION = none or never.
Each component model will need updates in the xxx_comp_nuopc.F90 file order to implement this change. Please consider making this change in your next component tag. Let me know if you have any questions or concerns. thanks
Here are the changes I made in the ctsm lnd_comp_nuopc.F90 file:
(Declare a module variable)
(Initialize the variable in InitializeRealize)
(Check the variable in ModelAdvance - Note here that this comes after the alarm_stop)