Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-seaice committed Feb 5, 2024
1 parent e946aae commit e45b199
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions cicecore/cicedyn/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ subroutine input_data
endif
endif

if (history_format/='hdf5' .and. (history_chunksize(1)/=0 .or. history_chunksize(2)/=0)) then
if (history_format/='hdf5' .and. all(history_chunksize/=0)) then
if (my_task == master_task) then
write (nu_diag,*) subname//' WARNING: history_chunksize not compatible with '//history_format
write (nu_diag,*) subname//' WARNING: netcdf chunking only possible with history_type="hdf5" '
Expand All @@ -1778,7 +1778,7 @@ subroutine input_data
endif
endif

if (restart_format/='hdf5' .and. (restart_chunksize(1)/=0 .or. restart_chunksize(2)/=0)) then
if (restart_format/='hdf5' .and. all(restart_chunksize/=0)) then
if (my_task == master_task) then
write (nu_diag,*) subname//' WARNING: restart_chunksize not compatible with '//restart_format
write (nu_diag,*) subname//' WARNING: netcdf chunking only possible with restart_type="hdf5" '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ subroutine ice_write_hist (ns)
endif

time_coord = coord_attributes('time', 'time', trim(cal_units))
call ice_hist_coord_def(File, time_coord, pio_double, (/timid/), varid) !why is pio_double this not lprecision ?
call ice_hist_coord_def(File, time_coord, pio_double, (/timid/), varid)
call ice_pio_check(pio_put_att(File,varid,'calendar',cal_att), &
subname//' ERROR: defining att calendar: '//cal_att,file=__FILE__,line=__LINE__)
if (hist_avg(ns) .and. .not. write_ic) then
Expand All @@ -268,7 +268,7 @@ subroutine ice_write_hist (ns)
dimid2(1) = boundid
dimid2(2) = timid

call ice_hist_coord_def(File, time_coord, pio_double, dimid2, varid) !why is pio_double this not lprecision ?
call ice_hist_coord_def(File, time_coord, pio_double, dimid2, varid)
call ice_pio_check(pio_put_att(File,varid,'calendar',cal_att), &
subname//' ERROR: defining att calendar: '//cal_att,file=__FILE__,line=__LINE__)
endif
Expand Down
38 changes: 20 additions & 18 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,25 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
call abort_ice(trim(errmsg))
endif

! Netcdf output created by PIO
#else

! Read the cice namelist as part of the call to cice_init1
call t_startf ('cice_init1')
call cice_init1
call t_stopf ('cice_init1')

!-----------------------------------------------------------------
! Advertise fields
!-----------------------------------------------------------------
call ice_advertise_fields(gcomp, importState, exportState, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

#endif

!----------------------------------------------------------------------------
! Initialize netcdf output info
!----------------------------------------------------------------------------

call NUOPC_CompAttributeGet(gcomp, name="pio_typename", value=cvalue, &
isPresent=isPresent, isSet=isSet, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
Expand All @@ -659,7 +677,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
write(nu_diag,*) trim(subname)//restart_format//'WARNING: restart_format from cice_namelist ignored'
write(nu_diag,*) trim(subname)//'WARNING: using '//trim(cvalue)//' from ICE_modelio'
endif

! The only reason to set these is to detect in ice_history_write if the chunk/deflate settings are ok.
select case (trim(cvalue))
case ('netcdf4p')
Expand All @@ -674,22 +691,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
end select
else
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
call t_startf ('cice_init1')
call cice_init1
call t_stopf ('cice_init1')

!-----------------------------------------------------------------
! Advertise fields
!-----------------------------------------------------------------
call ice_advertise_fields(gcomp, importState, exportState, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

#endif
endif

!----------------------------------------------------------------------------
! Initialize grid info
Expand Down

0 comments on commit e45b199

Please sign in to comment.