Skip to content

Commit

Permalink
Merge tag 'cime4.4.7' into geotrace_cime
Browse files Browse the repository at this point in the history
PR #388 - Makefilecleanup
PR #391 - fix testreporter.pl, SMS and PFS test output, cori queue settings
PR #392 - Resubmit sets continue run

Conflicts:
	cime_config/cesm/allactive/config_compsets.xml
	driver_cpl/cime_config/config_component.xml

Tested in geotrace3_cac_n31_cam5_4_51 - BFB
  • Loading branch information
cacraigucar committed Mar 12, 2016
2 parents f04027b + eca0682 commit 0a1a994
Show file tree
Hide file tree
Showing 10 changed files with 1,331 additions and 775 deletions.
222 changes: 188 additions & 34 deletions share/csm_share/shr/shr_dmodel_mod.F90

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions share/csm_share/shr/shr_map_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2919,7 +2919,7 @@ subroutine shr_map_getWts(Xdst,Ydst,Xsrc,Ysrc,pti,ptj,ptw,pnum,units)

!--- is lat/lon degrees or radians? needed for X wraparound ---
if (present(units)) then
if (trim(units) == 'degrees') then
if (index(units,'degrees').ne.0) then
csize = 360._SHR_KIND_R8
elseif (trim(units) == 'radians') then
csize = c2*pi
Expand All @@ -2945,6 +2945,7 @@ subroutine shr_map_getWts(Xdst,Ydst,Xsrc,Ysrc,pti,ptj,ptw,pnum,units)
if (yd > cpole + 1.0e-3 .or. &
yd < -cpole - 1.0e-3) then
write(s_logunit,*) trim(subname),' ERROR: yd outside bounds ',yd
write(s_logunit,*) trim(subname),' cpole = ', cpole
call shr_map_abort(subName//' ERROR yd outside 90 degree bounds')
endif
if (yd > cpole) yd = cpole
Expand Down Expand Up @@ -3375,7 +3376,11 @@ logical function shr_map_checkRad(Grid)
shr_map_checkRad = .false.
rmin = minval(Grid)
rmax = maxval(Grid)
if ((rmax - rmin) < 1.01_SHR_KIND_R8*c2*pi) shr_map_checkRad = .true.
if (rmax.ne.rmin) then
shr_map_checkRad = ((rmax - rmin) < 1.01_SHR_KIND_R8*c2*pi)
else
shr_map_checkRad = .true.
end if

end function shr_map_checkRad

Expand Down
193 changes: 190 additions & 3 deletions share/csm_share/shr/shr_ncread_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ module shr_ncread_mod
end interface

interface shr_ncread_tField ; module procedure &
shr_ncread_tField3dR8, &
shr_ncread_tField2dR8, &
shr_ncread_tField1dR8, &
shr_ncread_tField3dIN, &
shr_ncread_tField2dIN, &
shr_ncread_tField1dIN
end interface
Expand Down Expand Up @@ -200,7 +202,7 @@ subroutine shr_ncread_varDimNum(fileName, varName, ns, rc)

!--- read variable info ---
rcode = nf90_inq_varid(fid,trim(varName),vid)
call shr_ncread_handleErr(rCode, subName//" ERROR inq varid")
call shr_ncread_handleErr(rCode, subName//" ERROR inq varid: "//trim(varName))
rcode = nf90_inquire_variable(fid,vid,ndims=ns)
call shr_ncread_handleErr(rCode, subName//" ERROR inq var")
if (debug > 1 .and. s_loglev > 0) write(s_logunit,F01) trim(varName)//' has dims = ',ns
Expand Down Expand Up @@ -309,7 +311,7 @@ subroutine shr_ncread_varDimSizeID(fileName, varName, dnum, ns, rc)
call shr_ncread_open(fileName,fid,rCode)

rCode = nf90_inq_varid(fid,trim(varName),vid)
call shr_ncread_handleErr(rCode,subName//' ERROR inq varid vid')
call shr_ncread_handleErr(rCode,subName//' ERROR inq varid: '//trim(varName))
rCode = nf90_inquire_variable(fid,vid,ndims=ndims)
call shr_ncread_handleErr(rCode,subName//' ERROR inquire variable ndims')
allocate(dids(ndims))
Expand Down Expand Up @@ -382,7 +384,7 @@ subroutine shr_ncread_varDimSizes(fileName, varName, n1, n2, n3, n4, n5, n6, rc)
call shr_ncread_open(fileName,fid,rCode)

rCode = nf90_inq_varid(fid,trim(varName),vid)
call shr_ncread_handleErr(rCode,subName//' ERROR inq varid vid')
call shr_ncread_handleErr(rCode,subName//' ERROR inq varid: '//trim(varName))
rCode = nf90_inquire_variable(fid,vid,ndims=ndims)
call shr_ncread_handleErr(rCode,subName//' ERROR inquire variable ndims')
allocate(dids(ndims))
Expand Down Expand Up @@ -702,6 +704,98 @@ end subroutine shr_ncread_domain
!===============================================================================
!BOP ===========================================================================
!
! !IROUTINE: shr_ncread_tField3dR8 -- read in field data from a file
!
! !DESCRIPTION:
! Read in field data from a netcdf file. This is a special routine
! built specificallly for CCSM. The idea is to read a snapshot of
! (possibly) time-varying data from a netcdf file. The array is a
! 3d real*8 field in this case. Inputs are filename, timeslice
! (integer), and variable name. Optional inputs include the
! time dimension name and the 2 dimension names for the array.
! If dim1 is sent as an optional argument, dim2 must also be sent.
! Otherwise, the time dimension is assumed to be the third
! dimension and the first 2 dimensions are associated with the
! 3d array.
!
! \newline
! General Usage:
! call shr_ncread_tField('myfile',6,'sst',a3d)
! \newline
! !REVISION HISTORY:
! 2005-Apr-28 - T. Craig - first version
!
! !INTERFACE: ------------------------------------------------------------------

subroutine shr_ncread_tField3dR8(fn, tIndex, fldName, fld, dim1, dim2, dim3, tName, fidi, rc)

implicit none

! !INPUT/OUTPUT PARAMETERS:

character(*) ,intent(in) :: fn ! nc file name
integer(SHR_KIND_IN),intent(in) :: tIndex ! time-coord index
character(*) ,intent(in) :: fldName ! name of field
real(SHR_KIND_R8) ,intent(out) :: fld(:,:,:) ! field array
character(*) ,intent(in) ,optional :: dim1 ! name of dim1 in fld
character(*) ,intent(in) ,optional :: dim2 ! name of dim2 in fld
character(*) ,intent(in) ,optional :: dim3 ! name of dim3 in fld
character(*) ,intent(in) ,optional :: tName ! name of tIndex dim
integer(SHR_KIND_IN),intent(in) ,optional :: fidi ! file id
integer(SHR_KIND_IN),intent(out),optional :: rc ! return code

!EOP

!----- local -----
real(SHR_KIND_R8),allocatable :: lfld(:,:,:,:) ! local 4d array
integer(SHR_KIND_IN) :: rCode ! error code

!----- formats -----
character(*),parameter :: subName = "(shr_ncread_tField3dR8)"
character(*),parameter :: F00 = "('(shr_ncread_tField3dR8) ',4a)"

!-------------------------------------------------------------------------------
!
!-------------------------------------------------------------------------------
allocate(lfld(size(fld,1),size(fld,2),size(fld,3),1))

if (present(dim1).and.present(dim2).and.present(dim3).and.present(tName)) then
if (.not.present(fidi)) then
call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4=tName,dim4i=tIndex,rc=rCode)
else
call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4=tName,dim4i=tIndex,fidi=fidi,rc=rCode)
endif
elseif (present(dim1).and.present(dim2).and.present(dim3)) then
if (.not.present(fidi)) then
call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4i=tIndex,rc=rCode)
else
call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4i=tIndex,fidi=fidi,rc=rCode)
endif
elseif (present(tName)) then
if (.not.present(fidi)) then
call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim4=tName,dim4i=tIndex,rc=rCode)
else
call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim4=tName,dim4i=tIndex,fidi=fidi,rc=rCode)
endif
elseif (.not.present(dim1).and..not.present(dim2).and..not.present(dim3).and..not.present(tName)) then
if (.not.present(fidi)) then
call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim4i=tIndex,rc=rCode)
else
call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim4i=tIndex,fidi=fidi,rc=rCode)
endif
else
call shr_ncread_abort(subName//' ERROR argument combination not supported')
endif

fld(:,:,:) = lfld(:,:,:,1)
deallocate(lfld)

if (present(rc)) rc = rCode

end subroutine shr_ncread_tField3dR8
!===============================================================================
!BOP ===========================================================================
!
! !IROUTINE: shr_ncread_tField2dR8 -- read in field data from a file
!
! !DESCRIPTION:
Expand Down Expand Up @@ -882,6 +976,99 @@ end subroutine shr_ncread_tField1dR8
!===============================================================================
!BOP ===========================================================================
!
! !IROUTINE: shr_ncread_tField3dIN -- read in field data from a file
!
! !DESCRIPTION:
! Read in field data from a netcdf file. This is a special routine
! built specificallly for CCSM. The idea is to read a snapshot of
! (possibly) time-varying data from a netcdf file. The array is a
! 3d integer field in this case. Inputs are filename, timeslice
! (integer), and variable name. Optional inputs include the
! time dimension name and the 2 dimension names for the array.
! If dim1 is sent as an optional argument, dim2 must also be sent.
! Otherwise, the time dimension is assumed to be the third
! dimension and the first 2 dimensions are associated with the
! 3d array.
!
! \newline
! General Usage:
! call shr_ncread_tField('myfile',1,'index',i3d)
! \newline
! !REVISION HISTORY:
! 2005-Apr-28 - T. Craig - first version
!
! !INTERFACE: ------------------------------------------------------------------

subroutine shr_ncread_tField3dIN(fn, tIndex, fldName, fld, dim1, dim2, dim3, tName, fidi, rc)

implicit none

! !INPUT/OUTPUT PARAMETERS:

character(*) ,intent(in) :: fn ! nc file name
integer(SHR_KIND_IN),intent(in) :: tIndex ! time-coord index
character(*) ,intent(in) :: fldName ! name of field
integer(SHR_KIND_IN),intent(out) :: fld(:,:,:) ! field array
character(*) ,intent(in) ,optional :: dim1 ! name of dim1 in fld
character(*) ,intent(in) ,optional :: dim2 ! name of dim2 in fld
character(*) ,intent(in) ,optional :: dim3 ! name of dim3 in fld
character(*) ,intent(in) ,optional :: tName ! name of tIndex dim
integer(SHR_KIND_IN),intent(in) ,optional :: fidi ! file id
integer(SHR_KIND_IN),intent(out),optional :: rc ! return code

!EOP

!----- local -----
integer(SHR_KIND_IN),allocatable :: lfld(:,:,:,:) ! local 4d array
integer(SHR_KIND_IN) :: rCode ! error code

!----- formats -----
character(*),parameter :: subName = "(shr_ncread_tField3dIN)"
character(*),parameter :: F00 = "('(shr_ncread_tField3dIN) ',4a)"

!-------------------------------------------------------------------------------
!
!-------------------------------------------------------------------------------

allocate(lfld(size(fld,1),size(fld,2),size(fld,3),1))

if (present(dim1).and.present(dim2).and.present(dim3).and.present(tName)) then
if (.not.present(fidi)) then
call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4=tName,dim4i=tIndex,rc=rCode)
else
call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4=tName,dim4i=tIndex,fidi=fidi,rc=rCode)
endif
elseif (present(dim1).and.present(dim2).and.present(dim3)) then
if (.not.present(fidi)) then
call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4i=tIndex,rc=rCode)
else
call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4i=tIndex,fidi=fidi,rc=rCode)
endif
elseif (present(tName)) then
if (.not.present(fidi)) then
call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim4=tName,dim4i=tIndex,rc=rCode)
else
call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim4=tName,dim4i=tIndex,fidi=fidi,rc=rCode)
endif
elseif (.not.present(dim1).and..not.present(dim2).and..not.present(dim3).and..not.present(tName)) then
if (.not.present(fidi)) then
call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim4i=tIndex,rc=rCode)
else
call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim4i=tIndex,fidi=fidi,rc=rCode)
endif
else
call shr_ncread_abort(subName//' ERROR argument combination not supported')
endif

fld(:,:,:) = lfld(:,:,:,1)
deallocate(lfld)

if (present(rc)) rc = rCode

end subroutine shr_ncread_tField3dIN
!===============================================================================
!BOP ===========================================================================
!
! !IROUTINE: shr_ncread_tField2dIN -- read in field data from a file
!
! !DESCRIPTION:
Expand Down
Loading

0 comments on commit 0a1a994

Please sign in to comment.