From 41efd1d330c9d55a017d176f2915b707471d4e01 Mon Sep 17 00:00:00 2001 From: menzel-gfdl <43218622+menzel-gfdl@users.noreply.github.com> Date: Mon, 18 Oct 2021 10:42:43 -0400 Subject: [PATCH] Fix nudge logic (#157) * fix logic errors * fix answer changes --- GFDL_tools/read_climate_nudge_data.F90 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/GFDL_tools/read_climate_nudge_data.F90 b/GFDL_tools/read_climate_nudge_data.F90 index c2f991d60..05b40f6de 100644 --- a/GFDL_tools/read_climate_nudge_data.F90 +++ b/GFDL_tools/read_climate_nudge_data.F90 @@ -262,7 +262,7 @@ subroutine read_time ( times, units, calendar ) if( n == 1) then time_axis = Files(n)%axes(INDEX_TIME) call get_variable_units(fileobj, time_axis, units) - if( variable_att_exists(fileobj, time_axis, calendar) ) then + if( variable_att_exists(fileobj, time_axis, "calendar") ) then call get_time_calendar(fileobj, time_axis, calendar) else calendar = 'gregorian ' @@ -445,16 +445,15 @@ subroutine read_climate_nudge_data_2d (itime, field, dat, is, js) start = 1 if (present(is)) start(1) = is if (present(js)) start(2) = js - start(3) = atime - nread = 1 nread(1) = size(dat,1) nread(2) = size(dat,2) allocate(pes(mpp_npes())) call mpp_get_current_pelist(pes) if (open_file(fileobj, trim(filenames(n)), "read", pelist=pes)) then - call read_data(fileobj, Files(n)%fields(this_index), dat, corner=start, edge_lengths=nread) + call read_data(fileobj, Files(n)%fields(this_index), dat, unlim_dim_level=atime, & + corner=start(1:2), edge_lengths=nread(1:2)) call close_file(fileobj) endif deallocate(pes) @@ -529,9 +528,7 @@ subroutine read_climate_nudge_data_3d (itime, field, dat, is, js) start = 1 if (present(is)) start(1) = is if (present(js)) start(2) = js - start(4) = atime - nread = 1 nread(1) = size(dat,1) nread(2) = size(dat,2) nread(3) = size(dat,3) @@ -539,7 +536,8 @@ subroutine read_climate_nudge_data_3d (itime, field, dat, is, js) allocate(pes(mpp_npes())) call mpp_get_current_pelist(pes) if (open_file(fileobj, trim(filenames(n)), "read", pelist=pes)) then - call read_data(fileobj, Files(n)%fields(this_index), dat, corner=start, edge_lengths=nread) + call read_data(fileobj, Files(n)%fields(this_index), dat, unlim_dim_level=atime, & + corner=start(1:3), edge_lengths=nread(1:3)) call close_file(fileobj) endif deallocate(pes)