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

cam6_2_005: SE updates; new analytic IC functionality #40

Merged
merged 13 commits into from
Dec 4, 2019

Conversation

brian-eaton
Copy link
Collaborator

addresses issue #37

@brian-eaton brian-eaton added enhancement New feature or request cam_development answer changing answer changing tag labels Nov 27, 2019
@brian-eaton brian-eaton self-assigned this Nov 27, 2019
@brian-eaton
Copy link
Collaborator Author

Testing is done. This is ready for commit.

Copy link
Collaborator

@gold2718 gold2718 left a 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
Comment on lines 188 to 194
cheyenne/intel:

cheyenne/intel/aux_cam:

izumi/nag:

izumi/pgi:
Copy link
Collaborator

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')

Copy link
Collaborator Author

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.

Comment on lines +2994 to +2996
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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Comment on lines 3070 to 3079
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
Copy link
Collaborator

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).

Copy link
Collaborator Author

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.

Comment on lines 3220 to 3223
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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Comment on lines +3371 to +3372
write(errormsg, *) trim(fieldname),' was not present in the input file.'
call endrun('DYN_FIELD_EXISTS: '//errormsg)
Copy link
Collaborator

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)?

Copy link
Collaborator Author

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
Copy link
Collaborator

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'?

Copy link
Collaborator Author

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

@@ -1076,7 +1160,8 @@ subroutine read_inidat(dyn_in)
integer, allocatable :: m_ind(:)
real(r8), allocatable :: dbuf4(:,:,:,:)
!----------------------------------------------------------------------------

logical :: lbalance_ps_with_phis=.false.
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed.

Comment on lines +1419 to +1420
write(errmsg, '(a,3(i0,a))') ': ntrac (',ntrac,') > qsize (',qsize, &
') but < pcnst (',pcnst,')'
Copy link
Collaborator

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?

Copy link
Collaborator Author

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,')'
Copy link
Collaborator

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?

Copy link
Collaborator Author

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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@brian-eaton brian-eaton merged commit a7f193d into ESCOMP:cam_development Dec 4, 2019
@brian-eaton brian-eaton deleted the se_cam6_2_004 branch December 4, 2019 00:21
@cacraigucar cacraigucar changed the title Se cam6 2 004 cam6_2_005: SE updates; new analytic IC functionality Dec 4, 2019
jedwards4b added a commit to jedwards4b/CAM that referenced this pull request Jun 1, 2024
gold2718 added a commit to gold2718/CAM that referenced this pull request Dec 1, 2024
Update cflx correctly for dms when it is obtained from the ocean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answer changing answer changing tag enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants