Skip to content

Commit

Permalink
Merge pull request CICE-Consortium#253 from apcraig/rasmB
Browse files Browse the repository at this point in the history
Updates for RASM compatibility
  • Loading branch information
eclare108213 authored Nov 27, 2018
2 parents 0681335 + fb569b1 commit 2d88626
Show file tree
Hide file tree
Showing 11 changed files with 370 additions and 300 deletions.
5 changes: 3 additions & 2 deletions cicecore/cicedynB/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ subroutine input_data
integer (kind=int_kind) :: rpcesm, rplvl, rptopo
real (kind=dbl_kind) :: Cf, puny
integer :: abort_flag
character (len=64) :: tmpstr

character(len=*), parameter :: subname='(input_data)'

Expand Down Expand Up @@ -472,8 +473,8 @@ subroutine input_data
! each task gets unique ice log filename when if test is true, for debugging
if (1 == 0) then
call get_fileUnit(nu_diag)
write(str,'(a,i4.4)') "ice.log.task_",my_task
open(nu_diag,file=str)
write(tmpstr,'(a,i4.4)') "ice.log.task_",my_task
open(nu_diag,file=tmpstr)
endif
end if
if (trim(ice_ic) /= 'default' .and. trim(ice_ic) /= 'none') then
Expand Down
11 changes: 8 additions & 3 deletions cicecore/cicedynB/infrastructure/io/io_pio/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3,diag, &
integer (kind=int_kind) :: &
j, & ! dimension counter
n, & ! number of dimensions for variable
ndims, & ! number of variable dimensions
status ! status variable from netCDF routine

real (kind=dbl_kind) :: amin,amax,asum
Expand All @@ -681,20 +682,24 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3,diag, &
status = pio_inq_varid(File,trim(vname),vardesc)

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

status = pio_inq_varndims(File, vardesc, ndims)

call pio_seterrorhandling(File, PIO_INTERNAL_ERROR)

if (ndim3 == ncat .and. ncat>1) then
! if (ndim3 == ncat .and. ncat>1) then
if (ndim3 == ncat .and. ndims == 3) then
call pio_read_darray(File, vardesc, iodesc3d_ncat, work, status)
if (present(field_loc)) then
do n=1,ndim3
call ice_HaloUpdate (work(:,:,n,:), halo_info, &
field_loc, field_type)
enddo
endif
elseif (ndim3 == 1) then
! elseif (ndim3 == 1) then
elseif (ndim3 == 1 .and. ndims == 2) then
call pio_read_darray(File, vardesc, iodesc2d, work, status)
if (present(field_loc)) then
call ice_HaloUpdate (work(:,:,1,:), halo_info, &
Expand Down
4 changes: 2 additions & 2 deletions cicecore/drivers/cesm/CICE_FinalMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
module CICE_FinalMod

use ice_kinds_mod
use ice_exit, only: abort_ice, end_run
use ice_communicate, only: my_task, master_task
use ice_exit, only: end_run, abort_ice
use ice_fileunits, only: nu_diag, release_all_fileunits
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted

Expand Down Expand Up @@ -70,7 +71,6 @@ end subroutine CICE_Finalize
subroutine writeout_finished_file()

use ice_restart_shared, only: restart_dir
use ice_communicate, only: my_task, master_task

character(len=char_len_long) :: filename
character(len=*), parameter :: subname = '(writeout_finished_file)'
Expand Down
Loading

0 comments on commit 2d88626

Please sign in to comment.