Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some CMIP variables are computed using a mix of U and T quantities #904

Open
phil-blain opened this issue Oct 30, 2023 · 1 comment
Open

Comments

@phil-blain
Copy link
Member

Hi @dabail10,

I realized that some of the CMIP output variables are computed by multiplying the concentration aice (thus a T-point quantity) with variables from the dynamics which are U-point quantities. I'm wondering if we should not use grid_average_X2Y to shift the dynamical quantities to the T-point prior to computing these variables ?

Here is a diff that shows which variables I'm talking about:

diff --git a/cicecore/cicedyn/analysis/ice_history.F90 b/cicecore/cicedyn/analysis/ice_history.F90
index 570ef495..6340d503 100644
--- a/cicecore/cicedyn/analysis/ice_history.F90
+++ b/cicecore/cicedyn/analysis/ice_history.F90
@@ -2744,11 +2744,11 @@ subroutine accum_hist (dt)
 
          if (f_siu(1:1) /= 'x') then
            worka(:,:) = c0
            do j = jlo, jhi
            do i = ilo, ihi
-              if (aice(i,j,iblk) > puny) worka(i,j) = aice(i,j,iblk)*uvel(i,j,iblk)
+              if (aice(i,j,iblk) > puny) worka(i,j) = aice(i,j,iblk)*uvel(i,j,iblk) ! should be computed at the same location ?
            enddo
            enddo
            call accum_hist_field(n_siu, iblk, worka(:,:), a2D)
          endif
 
@@ -2816,11 +2816,11 @@ subroutine accum_hist (dt)
          if (f_sistrxdtop(1:1) /= 'x') then
            worka(:,:) = c0
            do j = jlo, jhi
            do i = ilo, ihi
               if (aice_init(i,j,iblk) > puny) &
-                 worka(i,j) = aice(i,j,iblk)*(aice(i,j,iblk)*strairxU(i,j,iblk)/aice_init(i,j,iblk))
+                 worka(i,j) = aice(i,j,iblk)*(aice(i,j,iblk)*strairxU(i,j,iblk)/aice_init(i,j,iblk)) !idem
            enddo
            enddo
            call accum_hist_field(n_sistrxdtop, iblk, worka(:,:), a2D)
          endif
 
@@ -2838,11 +2838,11 @@ subroutine accum_hist (dt)
          if (f_sistrxubot(1:1) /= 'x') then
            worka(:,:) = c0
            do j = jlo, jhi
            do i = ilo, ihi
               if (aice(i,j,iblk) > puny) &
-                 worka(i,j) = aice(i,j,iblk)*strocnxU(i,j,iblk)
+                 worka(i,j) = aice(i,j,iblk)*strocnxU(i,j,iblk) ! idem
            enddo
            enddo
            call accum_hist_field(n_sistrxubot, iblk, worka(:,:), a2D)
          endif
 
@@ -3302,11 +3302,11 @@ subroutine accum_hist (dt)
          if (f_sidragtop(1:1) /= 'x') then
            worka(:,:) = c0
            do j = jlo, jhi
            do i = ilo, ihi
               if (aice(i,j,iblk) > puny) then
-                 worka(i,j) = aice(i,j,iblk)*Cdn_atm(i,j,iblk)
+                 worka(i,j) = aice(i,j,iblk)*Cdn_atm(i,j,iblk) !idem
               endif
            enddo
            enddo
            call accum_hist_field(n_sidragtop, iblk, worka(:,:), a2D)
          endif
@@ -3327,11 +3327,11 @@ subroutine accum_hist (dt)
          if (f_siforcetiltx(1:1) /= 'x') then
            worka(:,:) = c0
            do j = jlo, jhi
            do i = ilo, ihi
               if (aice(i,j,iblk) > puny) then
-                 worka(i,j) = aice(i,j,iblk)*strtltxU(i,j,iblk)
+                 worka(i,j) = aice(i,j,iblk)*strtltxU(i,j,iblk) !idem
               endif
            enddo
            enddo
            call accum_hist_field(n_siforcetiltx, iblk, worka(:,:), a2D)
          endif
@@ -3339,11 +3339,11 @@ subroutine accum_hist (dt)
          if (f_siforcetilty(1:1) /= 'x') then
            worka(:,:) = c0
            do j = jlo, jhi
            do i = ilo, ihi
               if (aice(i,j,iblk) > puny) then
-                 worka(i,j) = aice(i,j,iblk)*strtltyU(i,j,iblk)
+                 worka(i,j) = aice(i,j,iblk)*strtltyU(i,j,iblk) ! idem
               endif
            enddo
            enddo
            call accum_hist_field(n_siforcetilty, iblk, worka(:,:), a2D)
          endif
@@ -3351,11 +3351,11 @@ subroutine accum_hist (dt)
          if (f_siforcecoriolx(1:1) /= 'x') then
            worka(:,:) = c0
            do j = jlo, jhi
            do i = ilo, ihi
               if (aice(i,j,iblk) > puny) then
-                 worka(i,j) = aice(i,j,iblk)*fmU(i,j,iblk)*vvel(i,j,iblk)
+                 worka(i,j) = aice(i,j,iblk)*fmU(i,j,iblk)*vvel(i,j,iblk) ! idem
               endif
            enddo
            enddo
            call accum_hist_field(n_siforcecoriolx, iblk, worka(:,:), a2D)
          endif
@@ -3363,11 +3363,11 @@ subroutine accum_hist (dt)
          if (f_siforcecorioly(1:1) /= 'x') then
            worka(:,:) = c0
            do j = jlo, jhi
            do i = ilo, ihi
               if (aice(i,j,iblk) > puny) then
-                 worka(i,j) = -aice(i,j,iblk)*fmU(i,j,iblk)*uvel(i,j,iblk)
+                 worka(i,j) = -aice(i,j,iblk)*fmU(i,j,iblk)*uvel(i,j,iblk) ! idem
               endif
            enddo
            enddo
            call accum_hist_field(n_siforcecorioly, iblk, worka(:,:), a2D)
          endif
@@ -3375,11 +3375,11 @@ subroutine accum_hist (dt)
          if (f_siforceintstrx(1:1) /= 'x') then
            worka(:,:) = c0
            do j = jlo, jhi
            do i = ilo, ihi
               if (aice(i,j,iblk) > puny) then
-                 worka(i,j) = aice(i,j,iblk)*strintxU(i,j,iblk)
+                 worka(i,j) = aice(i,j,iblk)*strintxU(i,j,iblk) ! idem
               endif
            enddo
            enddo
            call accum_hist_field(n_siforceintstrx, iblk, worka(:,:), a2D)
          endif

I'm working on some slight refactoring of the history code so I could include such a change if you think it makes sense.

@dabail10
Copy link
Contributor

This was a debate. According to the SIMIP protocol, everything was supposed to stay on the native grid. I agree that I probably should have interpolated these. I ended up leaving this as is. I am open to changing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants