-
Notifications
You must be signed in to change notification settings - Fork 151
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
cam6_2_005: SE updates; new analytic IC functionality #40
cam6_2_005: SE updates; new analytic IC functionality #40
Conversation
Testing is done. This is ready for commit. |
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.
A few questions, a few comments, and a few things I think need changing.
doc/ChangeLog
Outdated
cheyenne/intel: | ||
|
||
cheyenne/intel/aux_cam: | ||
|
||
izumi/nag: | ||
|
||
izumi/pgi: |
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.
It helps to indicate that the tests were run with no errors (e.g., 'All Pass')
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 didn't update the ChangeLog with this info because I don't know that I've done my final testing. I plan to do that after I get a commit slot.
write(iulog,*) sub//': ERROR: model parameters do not match initial dataset parameters' | ||
write(iulog,*)'Model Parameters: plon = ',plon,' plat = ',plat | ||
write(iulog,*)'Dataset Parameters: dlon = ',mlon,' dlat = ',mlat |
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.
Why is there no masterproc control here?
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 don't think there's a need for masterproc control when the messages are in front of an endrun statement. This isn't normal log output.
src/dynamics/fv/dyn_comp.F90
Outdated
ierr = pio_inq_dimid(fh_topo, 'lon' , lonid) | ||
ierr = pio_inq_dimid(fh_topo, 'lat' , latid) | ||
ierr = pio_inq_dimlen(fh_topo, lonid , mlon) | ||
ierr = pio_inq_dimlen(fh_topo, latid , mlat) | ||
if (mlon /= plon .or. mlat /= plat) then | ||
write(iulog,*) sub//': ERROR: model parameters do not match initial dataset parameters' | ||
write(iulog,*)'Model Parameters: plon = ',plon,' plat = ',plat | ||
write(iulog,*)'Dataset Parameters: dlon = ',mlon,' dlat = ',mlat | ||
call endrun(sub//': ERROR: model parameters do not match initial dataset parameters') | ||
end if |
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.
It seems that you have a similar check starting at 2989 which could be consolidated into a subroutine.
At the very least, please fix the log and endrun calls to mention the correct file (topo, not IV).
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 fixed the error messages to indicate topo file.
src/dynamics/fv/dyn_comp.F90
Outdated
if (.not. present(m_cnst) .or. .not. present(fh_ini)) then | ||
call endrun(sub//': ERROR: m_cnst needs to be present in the'// & | ||
' argument list') | ||
end if |
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 do not understand this logic. If m_cnst
is not present, you have the original error message.
If m_const
is present but fh_ini
is not present, you get an error that m_cnst
needs to be present but it is present. At the very least, correct the error message.
However, it seems to me that m_cnst
is always required in this case and fh_ini
is required if readvar
is .true.
Am I missing something?
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.
Your interpretation of the logic is correct. I moved the check for fh_ini
inside the readvar
condition.
write(errormsg, *) trim(fieldname),' was not present in the input file.' | ||
call endrun('DYN_FIELD_EXISTS: '//errormsg) |
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 recall that we are supposed to log errors as well as endrun them. Has that rule changed (or been mis-remembered)?
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 know the code is not consistent in this regard. I'll suggest that when every task is going to return the same error that the endrun statement is sufficient. That's the case here since every task is looking for the same field in the same file. It seems most useful to include log output when it's possible that only one task will encounter an error, and you don't know which task that will be.
ncnst = size(m_cnst, 1) | ||
do m = 1, ncnst | ||
if (m_cnst(m) == 1) then | ||
! No water vapor in Held-Suarez |
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.
Shouldn't this say 'No water vapor in standard atmosphere'?
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 changed it to ! No water vapor in profile
src/dynamics/se/dyn_comp.F90
Outdated
@@ -1076,7 +1160,8 @@ subroutine read_inidat(dyn_in) | |||
integer, allocatable :: m_ind(:) | |||
real(r8), allocatable :: dbuf4(:,:,:,:) | |||
!---------------------------------------------------------------------------- | |||
|
|||
logical :: lbalance_ps_with_phis=.false. |
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.
What is the purpose of this? It does not seem to be used.
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.
removed.
write(errmsg, '(a,3(i0,a))') ': ntrac (',ntrac,') > qsize (',qsize, & | ||
') but < pcnst (',pcnst,')' |
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.
No longer writing to log?
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.
This is covered by my new rule: all tasks see the same error, so endrun is sufficient.
call endrun(trim(subname)//errmsg) | ||
end if | ||
else if (qsize < pcnst) then | ||
write(errmsg, '(a,2(i0,a))') ': qsize (',qsize,') < pcnst (',pcnst,')' |
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.
No longer writing to log?
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.
new rule applies:)
if (analytic_ic_active()) cnst_start = 2 | ||
|
||
! If using analytic ICs the initial file only needs the horizonal grid | ||
! dimension checked in the case that the file contains constituent mixing |
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.
Why? Don't the levels have to match up?
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.
The purpose of that condition is to prevent overwriting an analytic Q field with one from an IC file. We want to allow an IC file to provide all the tracers when using analytic ICs except for Q. The main use case is to use the new standard atmosphere profile to initialize the dynamic state, but to be able to take all the chemical constituents from an initial file. Peter has found that this is a pretty stable way of starting a full physics run on a new grid for which we don't have a balanced IC file.
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 am not asking about the condition but about the comment. First, I do not understand the comment; While check_file_layout
only checks the horizontal grid, I believe the layers do have to match.
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.
The only thing an initial file must contain is the vertical coordinates. This consistency check is done earlier in dyn_grid_init -> hycoef_init -> hycoef_read.
Before the current changes the IC file would not be checked again if analytic ICs were used. Now we want to allow constituents to be initialized from the IC file if they are available even when the dynamic state is analytic. So we're going to look in the IC file to see whether any constituents except Q are present, and if they are then we need to make sure the horizontal grid is consistent with ncol.
some fixes when modifying url
Update cflx correctly for dms when it is obtained from the ocean
addresses issue #37