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

remove ESMF_GridCompGetInternalState from use statement, not working… #449

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions mediator/med_phases_aofluxes_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1601,10 +1601,8 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun_a, 'Sa_shum', aoflux_in%shum, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (add_gusts) then
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ekluzek I wish to point out this change required for nag because it doesn't like the unallocated pointer in the subroutine interface even though the pointer is never used. This is a case where the nag compiler is requiring changes we don't otherwise need to make.

Copy link
Member

Choose a reason for hiding this comment

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

I see arguments both ways here, but I lean slightly towards saying that this is an argument for keeping nag: I believe this is enforcing an aspect of the Fortran standard, so by fixing this we (1) make it more likely that our code won't be rejected by various other compilers that we don't currently test with, and (2) avoid the potential for undefined behavior in compilers that accept the code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My main argument for nag itself is that it's found legit subscript overflow problems that for whatever reasons other compilers haven't caught. If we can use different options to catch those problems I'm happy to move away from nag.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In terms of the code here, I see Jim's point that it's annoying here. But, if Bill is right that it's enforcing the standard I do side towards that. But, it also might be something that other compilers could find by using stricter options to enforce the standard?

call fldbun_getfldptr(fldbun_a, 'Faxa_rainc', aoflux_in%rainc, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
call fldbun_getfldptr(fldbun_a, 'Faxa_rainc', aoflux_in%rainc, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if

! extra fields for ufs.frac.aoflux
Expand Down
5 changes: 2 additions & 3 deletions mediator/med_phases_cdeps_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module med_phases_cdeps_mod
use ESMF, only: ESMF_Field, ESMF_FieldGet
use ESMF, only: ESMF_FieldBundleGet, ESMF_FieldBundleIsCreated
use ESMF, only: ESMF_FieldBundleCreate
use ESMF, only: ESMF_GridCompGetInternalState
use ESMF, only: ESMF_SUCCESS, ESMF_LOGMSG_INFO

use med_internalstate_mod, only: InternalState
Expand Down Expand Up @@ -180,12 +179,12 @@ subroutine med_phases_cdeps_run(gcomp, rc)
! Fill file abd variable lists with data
do l = 1, sdat_config%stream(streamid)%nfiles
fileList(l) = trim(sdat_config%stream(streamid)%file(l)%name)
if (maintask) write(logunit,'(a,i2,x,a)') trim(subname)//": file ", l, trim(fileList(l))
if (maintask) write(logunit,'(a,i2,2x,a)') trim(subname)//": file ", l, trim(fileList(l))
end do
do l = 1, sdat_config%stream(streamid)%nvars
varList(l,1) = trim(sdat_config%stream(streamid)%varlist(l)%nameinfile)
varList(l,2) = trim(sdat_config%stream(streamid)%varlist(l)%nameinmodel)
if (maintask) write(logunit,'(a,i2,x,a)') trim(subname)//": variable ", l, trim(varList(l,1))//" -> "//trim(varList(l,2))
if (maintask) write(logunit,'(a,i2,2x,a)') trim(subname)//": variable ", l, trim(varList(l,1))//" -> "//trim(varList(l,2))
end do

! Set PIO related variables
Expand Down
Loading