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

tmpstr not defined in ice_init.F90 #798

Closed
dabail10 opened this issue Nov 30, 2022 · 9 comments
Closed

tmpstr not defined in ice_init.F90 #798

dabail10 opened this issue Nov 30, 2022 · 9 comments

Comments

@dabail10
Copy link
Contributor

Looks like this code is scheduled for deprecation, but it does not compile because tmpstr is not defined.

! each task gets unique ice log filename when if test is true, for debugging
if (1 == 0) then
call get_fileUnit(nu_diag)
write(tmpstr,'(a,i4.4)') "ice.log.task_",my_task
open(nu_diag,file=tmpstr)
endif

@eclare108213
Copy link
Contributor

Just need to change tmpstr to tmpstr2. Amazing this hasn't been caught before now. Which compiler?

@apcraig
Copy link
Contributor

apcraig commented Dec 1, 2022

This is never compiled in standalone mode, it's within a CESMCOUPLED ifdef. This section of code is only on if you manually change (1 == 0) to (1 == 1). What it does is give each task a unique ice.log file to write to, so you can separate the output from each task by file. This would only be used for debugging. I wonder if compilers are skipping that code because it's guaranteed to not be used unless you set (1 == 1). This is not scheduled for deprecation. I think it's a hidden feature. What machine did it not compile on? Were you trying to use it (i.e. setting 1==1)?

@dabail10
Copy link
Contributor Author

dabail10 commented Dec 1, 2022

This was on cheyenne intel. I can't recall if I had optimization turned off.

@dabail10
Copy link
Contributor Author

dabail10 commented Dec 1, 2022

This was within CESM, so CESMCOUPLED is turned on.

@dabail10
Copy link
Contributor Author

dabail10 commented Dec 1, 2022

I have a PR coming with the saltflux stuff and I will fix it there.

@dabail10 dabail10 self-assigned this Dec 1, 2022
@apcraig
Copy link
Contributor

apcraig commented Dec 1, 2022

I knew it was in CESM, but was just pointing out that the standalone model would not have caught this. I just checked RASM. The code is there and CESMCOUPLED is on. We have a slightly older version. tmpstr is defined there. My guess is that when I was cleaning up compiler warning messages about unused variables and such, I removed tmpstr from the module. This would not have been needed for standalone. I suspect it's my fault and probably happened fairly recently. Sorry about that. Thanks @dabail10 for fixing this.

@dabail10
Copy link
Contributor Author

dabail10 commented Dec 1, 2022

No worries. Testing my changes now.

@dabail10 dabail10 mentioned this issue Dec 2, 2022
18 tasks
@eclare108213
Copy link
Contributor

Can we close this issue now?

@dabail10
Copy link
Contributor Author

dabail10 commented Dec 7, 2022

Fixed in #799.

@dabail10 dabail10 closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants