-
Notifications
You must be signed in to change notification settings - Fork 79
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
alarms based on nsteps #447
Conversation
The proposed fix for this is to move nuopc_shr_methods.F90 into cdeps/share and |
@jedwards4b If I understand, we already utilize some of the modules w/in CDEPS/share when we build CMEPS. So I think adding this nuopc_shr_method in that location would work. |
@DeniseWorthen One thing that I wasn't sure of is if you use the same *_cpl_dt variables as cesm does. If not we will need to figure out how to do this for ufs. |
@jedwards4b I see. No, we don't use the cpl_dt variables in the same way. For restarts, ATM controls it's own restart writing frequency and we just ensure that the coupled components (using restart_n, restart_option) are in sync w/ that. We don't currently have any use case where we use nsteps as the restart frequency. But, unrelated, this comes along at the same time that I need to make sure we can always write restarts at the end-of-run (this is for when we use IAU). For some reason, I have in mind that the write_restart_at_endofrun option was not working. |
mediator/med_time_mod.F90
Outdated
if (ChkErr(rc,__LINE__,u_FILE_u)) return | ||
AlarmInterval = AlarmInterval * opt_n | ||
if (mod(AlarmInterval, TimestepInterval) /= (timestepinterval*0)) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write a comment here as to why you are multiplying by 0.
@DeniseWorthen I've added more error checking so that if someone in UFS does try to use the nsteps option it will throw an error. I also tested REST_OPTION='end' and fixed an issue, but it seems that issue would only affect cesm - the fix was in the driver code. Maybe the ufs driver is similar and needs the same change, but I don't have access to that code. |
@jedwards4b I'm having trouble w/ the gust variables again. I've made this change
Which I think I can fix. It seems the last gust PR created a duplicate line for getting the I'm not sure what to do with the |
@DeniseWorthen Your latest comment does not seem to be related to this PR. Can you remove it and put it in the right place? Did you mean to put it here? #446 |
Adding code to fix REST_OPTION=end turns out to be a can of worms - for this to work stop_alarm must be set first and I'm finding that that is not the case in at least some of the nuopc component caps. ugh |
@jedwards4b I don't think the issue is related to #446. The current main contains CMEPS/mediator/med_phases_aofluxes_mod.F90 Line 1720 in a077536
and then a few lines down CMEPS/mediator/med_phases_aofluxes_mod.F90 Lines 1752 to 1757 in a077536
This was done by @uturuncoglu in d56c50c. We now have another variable
|
@jedwards4b I can't test your branch because it contains the changes related to gusts that are raising an issue on my side |
but that change was not introduced here - find the pr that introduced the problem or open a new issue. |
@jedwards4b Yes, thanks. I was trying to be responsive and test your nsteps PR. I am not able to test because the previous PR (which I will find) was merged w/o testing by UFS. So this is the first I've seen this failure. I'm sorry if I've been unclear. |
@jedwards4b I've had to put this aside for a couple of days while I work on finishing something. But I will get back to it soon. |
okay - I plan to work on it more anyway when derecho comes back. There are three distinct copies of subroutine alarmInit in cmeps - I plan to merge these into a single routine, I also figured out a better solution to the REST_OPTION='end' issue. |
@DeniseWorthen can you try this PR again and see if it works for you now. |
Yes, will do. I'm not able to get onto Derecho right now though. It's still down for me. |
yes, it's still down for everyone - i didn't realize that you were testing there too. |
@DeniseWorthen I've updated to the latest cmeps main and tested this with cesm - do you want to try it again? |
@jedwards4b Sure. I'll start the tests later today. |
@jedwards4b I can't compile because it can't find |
Sorry - can you try with this CDEPS branch:
|
Thanks. I think remember now that I did this before in testing. I can compile it now, so I'll start the tests. |
@jedwards4b This doesn't cause any issues. I do get a new field in the CDEPS restart files (strlen) but that is the only impact. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be fewer changes to have med_time_mod.F90 simply use nuopc_shr_methods directly and not get rid of the file. That way it becomes explicit as to what is happening and there are much fewer changes to this code.
Description of changes
Fixes the case of alarms based on nsteps when components have different individual timesteps.
Specific notes
Contributors other than yourself, if any: @mvertens - Mariana was essential to this work, I was trying to work in the Fortran when she pointed out that we could avoid the problem by converting nsteps to another unit (seconds) in the python. This made it much easier.
CMEPS Issues Fixed #443
Are changes expected to change answers? bfb
Any User Interface Changes (namelist or namelist defaults changes)?
Testing performed
Please describe the tests along with the target model and machine(s)
If possible, please also added hashes that were used in the testing
The test was to run ./create_newcase --case /glade/derecho/scratch/jedwards/f.cam6_3_144.ne30.datest --res ne30pg3_ne30pg3_mg17 --compset FMTHIST --run-unsupported
then set
Prior to this change the cpl and mosart restart files are not written at the proper time.
This change should not affect any other alarm settings, only those using nsteps.
@DeniseWorthen I have used nuopc_shr_methods.F90 in the mediator for this change, unfortunately this file is not shared with UFS. We need to discuss how to rearrange the code so that this works for UFS models.