Summary
As part of the MAPL3 migration, MAPL_UnpackDateTime (and all legacy integer-packed time) is being removed from MAPL_Base (tracked in GEOS-ESM/MAPL#4805 and GEOS-ESM/MAPL#4811). idfupd.F90 must be updated to use ESMF_Time directly — no integer-packed datetime should remain.
File
src/Applications/@GEOSgcm_App/idfupd.F90
Background
idfupd.F90 uses MAPL_GetResource to read 2-element integer arrays (datetime(2)) from RC files and from the cap_restart file, where datetime(1) is YYYYMMDD and datetime(2) is HHMMSS. It then calls MAPL_UnpackDateTime to extract the individual components (yy, mm, dd, h, m, s) before passing them to ESMF_TimeSet.
There are 4 call sites (lines ~540, ~565, ~595, ~698).
Change needed
The goal is to eliminate the integer datetime(2) intermediate entirely and work with ESMF_Time directly:
-
For RC file resources (BEG_DATE:, END_DATE:, JOB_SGMT:/JOB_DURATION:): Replace MAPL_GetResource(..., datetime, label=...) + MAPL_UnpackDateTime + ESMF_TimeSet with a direct read of an ISO8601 datetime string using MAPL_GetResource (string overload) and ESMF_TimeSet string interface — or read year/month/day/hour/minute/second components individually as already done in the fallback branches below each if(STATUS==ESMF_SUCCESS) block, and use ESMF_TimeSet(yy=...,mm=...,dd=...,h=...,m=...,s=...) directly.
-
For cap_restart file (line ~695-698): The file is read as read(UNIT,100) datetime with format (i8.8,1x,i6.6). Replace with reading the two integers directly into component variables and calling ESMF_TimeSet with keyword arguments — or update the restart format to ISO8601 if the broader team agrees.
-
Remove integer :: datetime(2), all MAPL_UnpackDateTime calls, and the corresponding use of MAPL_UnpackDateTime.
Note
The fallback branches (individual BEG_YY:, BEG_MM:, etc. resource items) already use the right pattern — the MAPL_UnpackDateTime branches should be brought in line with those.
Blocks
GEOS-ESM/MAPL#4811 (deletion of MAPL_UnpackDateTime from Base_Base.F90)
Summary
As part of the MAPL3 migration,
MAPL_UnpackDateTime(and all legacy integer-packed time) is being removed fromMAPL_Base(tracked in GEOS-ESM/MAPL#4805 and GEOS-ESM/MAPL#4811).idfupd.F90must be updated to useESMF_Timedirectly — no integer-packed datetime should remain.File
src/Applications/@GEOSgcm_App/idfupd.F90Background
idfupd.F90usesMAPL_GetResourceto read 2-element integer arrays (datetime(2)) from RC files and from thecap_restartfile, wheredatetime(1)is YYYYMMDD anddatetime(2)is HHMMSS. It then callsMAPL_UnpackDateTimeto extract the individual components (yy, mm, dd, h, m, s) before passing them toESMF_TimeSet.There are 4 call sites (lines ~540, ~565, ~595, ~698).
Change needed
The goal is to eliminate the integer
datetime(2)intermediate entirely and work withESMF_Timedirectly:For RC file resources (
BEG_DATE:,END_DATE:,JOB_SGMT:/JOB_DURATION:): ReplaceMAPL_GetResource(..., datetime, label=...)+MAPL_UnpackDateTime+ESMF_TimeSetwith a direct read of an ISO8601 datetime string usingMAPL_GetResource(string overload) andESMF_TimeSetstring interface — or read year/month/day/hour/minute/second components individually as already done in the fallback branches below eachif(STATUS==ESMF_SUCCESS)block, and useESMF_TimeSet(yy=...,mm=...,dd=...,h=...,m=...,s=...)directly.For
cap_restartfile (line ~695-698): The file is read asread(UNIT,100) datetimewith format(i8.8,1x,i6.6). Replace with reading the two integers directly into component variables and callingESMF_TimeSetwith keyword arguments — or update the restart format to ISO8601 if the broader team agrees.Remove
integer :: datetime(2), allMAPL_UnpackDateTimecalls, and the correspondinguseofMAPL_UnpackDateTime.Note
The fallback branches (individual
BEG_YY:,BEG_MM:, etc. resource items) already use the right pattern — theMAPL_UnpackDateTimebranches should be brought in line with those.Blocks
GEOS-ESM/MAPL#4811 (deletion of
MAPL_UnpackDateTimefromBase_Base.F90)