From d619592358f8f40cd756aa5b7cb4421df60b2a8e Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 5 Nov 2024 09:34:23 -0700 Subject: [PATCH] rpointer fix for cesm (#990) With the change in cesm3_cice6_5_0_9 the correct cesm pointer_file name is written to the namelist file and so it is no longer required to append the instance number in a multi instance case. * add status feature to open existing file, remove no longer needed cesm pointer_file modification * add status for pointer_file open in netcdf --- cicecore/cicedyn/general/ice_init.F90 | 4 ---- cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90 | 2 +- cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cicecore/cicedyn/general/ice_init.F90 b/cicecore/cicedyn/general/ice_init.F90 index e966043fb..659711710 100644 --- a/cicecore/cicedyn/general/ice_init.F90 +++ b/cicecore/cicedyn/general/ice_init.F90 @@ -1198,10 +1198,6 @@ subroutine input_data call broadcast_scalar(sw_frac, master_task) call broadcast_scalar(sw_dtemp, master_task) -#ifdef CESMCOUPLED - pointer_file = trim(pointer_file) // trim(inst_suffix) -#endif - !----------------------------------------------------------------- ! update defaults !----------------------------------------------------------------- diff --git a/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90 b/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90 index 9bf3b1d8a..3c0c126b0 100644 --- a/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90 @@ -67,7 +67,7 @@ subroutine init_restart_read(ice_ic) filename = trim(ice_ic) else if (my_task == master_task) then - open(nu_rst_pointer,file=pointer_file) + open(nu_rst_pointer,file=pointer_file, status='old') read(nu_rst_pointer,'(a)') filename0 filename = trim(filename0) close(nu_rst_pointer) diff --git a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 index ae3aebd2b..8000b1e05 100644 --- a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 @@ -66,7 +66,7 @@ subroutine init_restart_read(ice_ic) filename = trim(ice_ic) else if (my_task == master_task) then - open(nu_rst_pointer,file=pointer_file) + open(nu_rst_pointer,file=pointer_file, status='old') read(nu_rst_pointer,'(a)') filename0 filename = trim(filename0) close(nu_rst_pointer)