Skip to content

Commit

Permalink
Merge pull request #1842 from jedwards4b/pio2_fix
Browse files Browse the repository at this point in the history
Pio2 fix
Fix runtime issues with latest pio2 development

Test suite: cime_developer using pio1 and latest pio2 develop code
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes
User interface changes?:

Update gh-pages html (Y/N)?:

Code review:
  • Loading branch information
dqwu authored Aug 29, 2017
2 parents 33113cb + bee2770 commit 65ac258
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/components/data_comps/desp/esp_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,13 @@ subroutine esp_pio_modify_variable(id, comm, filename, varname, found)
call esp_modify_array(varr, 1.0e-12_r8, all_equiv)
call pio_write_darray(file, varid, iodesc, varr, ierr)
call esp_pio_handle_error(ierr, subname//'Error writing variable '//trim(varname))
endif

call esp_pio_closefile(file)
if (found) then
! Cleanup
call pio_freedecomp(pio_subsystem, iodesc)
end if

call esp_pio_closefile(file)
if (allocated(varr)) then
deallocate(varr)
end if
Expand Down
16 changes: 13 additions & 3 deletions src/share/util/shr_pcdf_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ subroutine shr_pcdf_defvar0d(fid,fname,vtype)

implicit none

type(file_desc_t),intent(in) :: fid
type(file_desc_t),intent(inout) :: fid
character(len=*) ,intent(in) :: fname
integer(IN) ,intent(in) :: vtype

Expand All @@ -557,15 +557,19 @@ subroutine shr_pcdf_defvar0d(fid,fname,vtype)
!-------------

rcode = pio_def_var(fid,trim(fname),vtype,varid)

if (vtype == PIO_DOUBLE) then
rcode = PIO_put_att(fid, varid, '_FillValue', fillvalue)
else
rcode = PIO_put_att(fid, varid, '_FillValue', ifillvalue)
endif
end subroutine shr_pcdf_defvar0d

!===============================================================================
subroutine shr_pcdf_defvar1d(fid,fname,vtype,dimid)

implicit none

type(file_desc_t),intent(in) :: fid
type(file_desc_t),intent(inout) :: fid
character(len=*) ,intent(in) :: fname
integer(IN) ,intent(in) :: vtype
integer(IN) ,intent(in) :: dimid(:)
Expand All @@ -578,6 +582,11 @@ subroutine shr_pcdf_defvar1d(fid,fname,vtype,dimid)
!-------------

rcode = pio_def_var(fid,trim(fname),vtype,dimid,varid)
if (vtype == PIO_DOUBLE) then
rcode = PIO_put_att(fid, varid, '_FillValue', fillvalue)
else
rcode = PIO_put_att(fid, varid, '_FillValue', ifillvalue)
endif

end subroutine shr_pcdf_defvar1d

Expand Down Expand Up @@ -639,6 +648,7 @@ subroutine shr_pcdf_writer1d(fid,fname,iodesc,r1d)
lfillvalue = fillvalue

rcode = pio_inq_varid(fid,trim(fname),varid)

call pio_write_darray(fid, varid, iodesc, r1d, rcode, fillval=lfillvalue)

end subroutine shr_pcdf_writer1d
Expand Down

0 comments on commit 65ac258

Please sign in to comment.