From e68dd144aa1577111f5a87f93378afd15847b62e Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 4 Mar 2024 08:57:59 -0700 Subject: [PATCH] Add present for dagedt and fix indents --- cicecore/cicedyn/general/ice_step_mod.F90 | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/cicecore/cicedyn/general/ice_step_mod.F90 b/cicecore/cicedyn/general/ice_step_mod.F90 index 0392ee4e6..c39e4c2b0 100644 --- a/cicecore/cicedyn/general/ice_step_mod.F90 +++ b/cicecore/cicedyn/general/ice_step_mod.F90 @@ -828,26 +828,26 @@ subroutine update_state (dt, daidt, dvidt, dvsdt, dagedt, offset) nt_strata = nt_strata(:,:), & Tf = Tf(i,j,iblk)) - if (present(offset)) then - - !----------------------------------------------------------------- - ! Compute thermodynamic area and volume tendencies. - !----------------------------------------------------------------- - - if (present(daidt)) daidt(i,j,iblk) = (aice(i,j,iblk) - daidt(i,j,iblk)) / dt - if (present(dvidt)) dvidt(i,j,iblk) = (vice(i,j,iblk) - dvidt(i,j,iblk)) / dt - if (present(dvsdt)) dvsdt(i,j,iblk) = (vsno(i,j,iblk) - dvsdt(i,j,iblk)) / dt - if (tr_iage) then - if (offset > c0) then ! thermo - if (trcr(i,j,nt_iage,iblk) > c0) & - dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & - - dagedt(i,j,iblk) - offset) / dt - else ! dynamics - dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & - - dagedt(i,j,iblk)) / dt - endif - endif ! tr_iage - endif ! present(offset) + if (present(offset)) then + + !----------------------------------------------------------------- + ! Compute thermodynamic area and volume tendencies. + !----------------------------------------------------------------- + + if (present(daidt)) daidt(i,j,iblk) = (aice(i,j,iblk) - daidt(i,j,iblk)) / dt + if (present(dvidt)) dvidt(i,j,iblk) = (vice(i,j,iblk) - dvidt(i,j,iblk)) / dt + if (present(dvsdt)) dvsdt(i,j,iblk) = (vsno(i,j,iblk) - dvsdt(i,j,iblk)) / dt + if (present(dagedt) .and. tr_iage) then + if (offset > c0) then ! thermo + if (trcr(i,j,nt_iage,iblk) > c0) & + dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & + - dagedt(i,j,iblk) - offset) / dt + else ! dynamics + dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & + - dagedt(i,j,iblk)) / dt + endif + endif ! tr_iage + endif ! present(offset) enddo ! i enddo ! j