Skip to content

Commit

Permalink
clean up merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Oct 17, 2024
1 parent 56dc381 commit 11da279
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
16 changes: 8 additions & 8 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ subroutine init_restart_read(ice_ic)
filename = trim(ice_ic)
else
if (my_task == master_task) then
write(pointer_file,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') &
trim(pointer_file)//'.',myear,'-',mmonth,'-',mday,'-',msec
open(nu_rst_pointer,file=pointer_file)
read(nu_rst_pointer,'(a)') filename0
filename = trim(filename0)
Expand Down Expand Up @@ -163,7 +165,7 @@ subroutine init_restart_write(filename_spec)

logical (kind=log_kind) :: &
tr_iage, tr_FY, tr_lvl, tr_iso, tr_aero, &
tr_pond_topo, tr_pond_lvl, tr_pond_sealvl, tr_brine, tr_snow, &
tr_pond_topo, tr_pond_lvl, tr_brine, tr_snow, &
tr_bgc_N, tr_bgc_C, tr_bgc_Nit, &
tr_bgc_Sil, tr_bgc_DMS, &
tr_bgc_chl, tr_bgc_Am, &
Expand Down Expand Up @@ -193,7 +195,6 @@ subroutine init_restart_write(filename_spec)
tr_iage_out=tr_iage, tr_FY_out=tr_FY, tr_lvl_out=tr_lvl, &
tr_iso_out=tr_iso, tr_aero_out=tr_aero, &
tr_pond_topo_out=tr_pond_topo, tr_pond_lvl_out=tr_pond_lvl, &
tr_pond_sealvl_out=tr_pond_sealvl, &
tr_snow_out=tr_snow, tr_brine_out=tr_brine, &
tr_bgc_N_out=tr_bgc_N, tr_bgc_C_out=tr_bgc_C, tr_bgc_Nit_out=tr_bgc_Nit, &
tr_bgc_Sil_out=tr_bgc_Sil, tr_bgc_DMS_out=tr_bgc_DMS, &
Expand All @@ -215,14 +216,14 @@ subroutine init_restart_write(filename_spec)
restart_dir(1:lenstr(restart_dir)), &
restart_file(1:lenstr(restart_file)),'.', &
myear,'-',mmonth,'-',mday,'-',msec
write(pointer_file,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') &
'rpointer.ice.',myear,'-',mmonth,'-',mday,'-',msec
end if

if (restart_format(1:3) /= 'bin') filename = trim(filename) // '.nc'

! write pointer (path/file)
if (my_task == master_task) then
write(pointer_file,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') &
trim(pointer_file)//'.',myear,'-',mmonth,'-',mday,'-',msec
open(nu_rst_pointer,file=pointer_file)
write(nu_rst_pointer,'(a)') filename
close(nu_rst_pointer)
Expand Down Expand Up @@ -336,7 +337,7 @@ subroutine init_restart_write(filename_spec)
call define_rest_field(File,'a12_4',dims)
endif

if (tr_pond_lvl .or. tr_pond_sealvl) then
if (tr_pond_lvl) then
call define_rest_field(File,'fsnow',dims)
endif

Expand Down Expand Up @@ -428,7 +429,7 @@ subroutine init_restart_write(filename_spec)
call define_rest_field(File,'ipnd',dims)
end if

if (tr_pond_lvl .or. tr_pond_sealvl) then
if (tr_pond_lvl) then
call define_rest_field(File,'apnd',dims)
call define_rest_field(File,'hpnd',dims)
call define_rest_field(File,'ipnd',dims)
Expand Down Expand Up @@ -743,6 +744,7 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3,diag, &

call ice_pio_check(pio_inq_varndims(File, vardesc, ndims), &
subname// " ERROR: missing varndims "//trim(vname),file=__FILE__,line=__LINE__)
call pio_seterrorhandling(File, PIO_INTERNAL_ERROR)

if (ndim3 == ncat .and. ndims == 3) then
call pio_read_darray(File, vardesc, iodesc3d_ncat, work, status)
Expand Down Expand Up @@ -771,8 +773,6 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3,diag, &
call ice_pio_check(status, &
subname//" ERROR: reading var "//trim(vname),file=__FILE__,line=__LINE__)

call pio_seterrorhandling(File, PIO_INTERNAL_ERROR)

if (diag) then
if (ndim3 > 1) then
do n=1,ndim3
Expand Down
6 changes: 2 additions & 4 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if(mastertask) write(nu_diag,*) trim(subname)//'WARNING: pio_typename from driver needs to be set for netcdf output to work'
end if



#else

! Read the cice namelist as part of the call to cice_init1
Expand Down Expand Up @@ -850,7 +848,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
idate0 = start_ymd
year_init = (idate0/10000)
month_init= (idate0-year_init*10000)/100 ! integer month of basedate
day_init = idate0-year_init*10000-month_init*100
day_init = idate0-year_init*10000-month_init*100

! - Set use_leap_years based on calendar (as some CICE calls use this instead of the calendar type)
if (calendar_type == ice_calendar_gregorian) then
Expand Down Expand Up @@ -892,7 +890,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
! Prescribed ice initialization
!-----------------------------------------------------------------

call ice_prescribed_init(clock, ice_mesh, rc)
call ice_prescribed_init(gcomp, clock, ice_mesh, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

#ifdef CESMCOUPLED
Expand Down

0 comments on commit 11da279

Please sign in to comment.