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

Adding datetime in rpointer file with backward compatibility #486

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

nmizukami
Copy link
Collaborator

Adding string of datetime (yyyy-mm-dd-sssss format) to the end of rpointer.rof for only cesm-coupling mode. This is the backward compatibility. standalone does not use this for now.

Resolve #484

@nmizukami nmizukami added enhancement Improving usability, performance or other types of enhancements cesm-coupling For cesm coupling labels Oct 21, 2024
@nmizukami nmizukami requested a review from ekluzek October 21, 2024 11:54
Copy link
Collaborator

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a couple comments/suggestions. And a larger thing that I'll make an issue about.


ierr=0; message='io_rpfile/'

if (present(curDatetime)) then
sec_in_day = curDatetime%hour()*60*60+curDatetime%minute()*60+nint(curDatetime%sec())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change 60*60 to nint(secphour) and 60 to nint(secpmin) in public_vars

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

locfn = './'// trim(rpntfil)//trim(inst_suffix)
nio = getavu() ! get available unit number

! construct rpoint file name with datetime - simDatetime has three datetime at previous(0), current(1) and next(2) time stamp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change rpoint to rpointer

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

!--------------------------------------------------------

if (masterproc) then
write(iulog,*) 'Reading restart pointer file....'
endif

nio = getavu()
locfn = './'// trim(rpntfil)//trim(inst_suffix)
nio = getavu() ! get available unit number
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, that new FORTRAN constructs allow you to NOT need getavu() anymore. There's a way to open a file with an available unit.

This would be a good modernization effort to do. But, not completely required.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the only thing in RtmFileUtils that is maybe useful is opnfil, but the use of getavu and relavu could be removed and handled within opnfil.

Copy link
Collaborator Author

@nmizukami nmizukami Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for suggestions on ascii file handling (#490). I will clean this up with another PR. This RtmFileUtils and ascii_utils could be merged and several routines (getavu and relavu, getSpareUnit) can be removed.

@nmizukami nmizukami merged commit 3a8342d into ESCOMP:cesm-coupling Oct 30, 2024
@nmizukami nmizukami deleted the cesm-coupling_rpointer_name branch October 30, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cesm-coupling For cesm coupling enhancement Improving usability, performance or other types of enhancements
Development

Successfully merging this pull request may close these issues.

Add timestamp to rpointer files, but make it backwards compatible with files without the timestamp
2 participants