From 52a7054b870f54e8ca3f9d55ea2b03b71e20daa5 Mon Sep 17 00:00:00 2001 From: Tony Craig Date: Tue, 1 Mar 2022 19:05:29 -0800 Subject: [PATCH] fix bugs in binary and pio2 updates (#62) --- .../io/io_binary/ice_restart.F90 | 21 ++++++++++++++++++- .../infrastructure/io/io_pio2/ice_restart.F90 | 12 +++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 b/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 index a6f42a6a5..5dd35fdf4 100644 --- a/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 @@ -30,7 +30,8 @@ module ice_restart implicit none private public :: init_restart_write, init_restart_read, & - read_restart_field, write_restart_field, final_restart + read_restart_field, write_restart_field, final_restart, & + query_field real(kind=dbl_kind) :: time_forc = -99. ! historic now local @@ -892,6 +893,24 @@ subroutine final_restart() end subroutine final_restart +!======================================================================= + +! Inquire field existance, doesn't work in binary files so set to true and return +! author T. Craig + + logical function query_field(nu,vname) + + integer (kind=int_kind), intent(in) :: nu ! unit number + character (len=*) , intent(in) :: vname ! variable name + + ! local variables + + character(len=*), parameter :: subname = '(query_field)' + + query_field = .true. + + end function query_field + !======================================================================= end module ice_restart diff --git a/cicecore/cicedynB/infrastructure/io/io_pio2/ice_restart.F90 b/cicecore/cicedynB/infrastructure/io/io_pio2/ice_restart.F90 index 68dcd309d..24a5b75be 100644 --- a/cicecore/cicedynB/infrastructure/io/io_pio2/ice_restart.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_pio2/ice_restart.F90 @@ -255,15 +255,15 @@ subroutine init_restart_write(filename_spec) call define_rest_field(File,'vvel',dims) if (grid_ice == 'CD') then - call define_rest_field(ncid,'uvelE',dims) - call define_rest_field(ncid,'vvelE',dims) - call define_rest_field(ncid,'uvelN',dims) - call define_rest_field(ncid,'vvelN',dims) + call define_rest_field(File,'uvelE',dims) + call define_rest_field(File,'vvelE',dims) + call define_rest_field(File,'uvelN',dims) + call define_rest_field(File,'vvelN',dims) endif if (grid_ice == 'C') then - call define_rest_field(ncid,'uvelE',dims) - call define_rest_field(ncid,'vvelN',dims) + call define_rest_field(File,'uvelE',dims) + call define_rest_field(File,'vvelN',dims) endif