Skip to content

Commit

Permalink
Add CESM1_PIO for fill value check (#675)
Browse files Browse the repository at this point in the history
* Add CESM1_PIO for fill value check

* Revert PIO_FILL_DOUBLE change for now
  • Loading branch information
dabail10 committed Dec 18, 2021
1 parent 4c9024c commit dfc6a11
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cicecore/cicedynB/infrastructure/io/io_pio2/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,8 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3,diag, &
status = pio_inq_varid(File,trim(vname),vardesc)

if (status /= PIO_noerr) then
call abort_ice(subname//"ERROR: CICE restart? Missing variable: "//trim(vname))
call abort_ice(subname// &
"ERROR: CICE restart? Missing variable: "//trim(vname))
endif

status = pio_inq_varndims(File, vardesc, ndims)
Expand All @@ -728,7 +729,10 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3,diag, &
! if (ndim3 == ncat .and. ncat>1) then
if (ndim3 == ncat .and. ndims == 3) then
call pio_read_darray(File, vardesc, iodesc3d_ncat, work, status)
where (work == PIO_FILL_DOUBLE) work = c0
!#ifndef CESM1_PIO
!! This only works for PIO2
! where (work == PIO_FILL_DOUBLE) work = c0
!#endif
if (present(field_loc)) then
do n=1,ndim3
call ice_HaloUpdate (work(:,:,n,:), halo_info, &
Expand All @@ -738,7 +742,10 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3,diag, &
! elseif (ndim3 == 1) then
elseif (ndim3 == 1 .and. ndims == 2) then
call pio_read_darray(File, vardesc, iodesc2d, work, status)
where (work == PIO_FILL_DOUBLE) work = c0
!#ifndef CESM1_PIO
!! This only works for PIO2
! where (work == PIO_FILL_DOUBLE) work = c0
!#endif
if (present(field_loc)) then
call ice_HaloUpdate (work(:,:,1,:), halo_info, &
field_loc, field_type)
Expand Down

0 comments on commit dfc6a11

Please sign in to comment.