# [MITgcm-support] [mitgcm-support] On the exact calculation of ADVx/y/r_TH and DFrx/y/rE_TH

Matthew Mazloff mmazloff at ucsd.edu
Mon Sep 25 00:39:19 EDT 2017

```Hello

You turn the fluxes into tendency by, for example,

for k = 1:NZ
VOL(:,:,k) = hFacC(:,:,k).*RAC.*DRF(k);
AREAWEST(:,:,k)  = DYG.*DRF(k).*hFacW(:,:,k);
AREASOUTH(:,:,k) = DXG.*DRF(k).*hFacS(:,:,k);
AREACELL(:,:,k)  = RAC;
end
RecipVol = VOL;

%zonal
tm2 = Q(ILON  ,ILAT,IDEP);% 'ADVx_TH '
Ax  = (tm1 - tm2);
%meridional
tm2 = Q(ILON,ILAT  ,IDEP);% 'ADVy_TH '
Ay  = (tm1 - tm2);
%vertical
Q1 = zeros(NX,NY,NZ+1,'single');%extra z lvl for vert der.
tm1 = Q1(ILON,ILAT,IDEP  );% 'ADVr_TH '
Az = (tm1 - tm2);

%Also need this to close budget
%zonal
Q = UVEL;
tm1 =   Q(ILON+1,ILAT,IDEP).*AREAWEST(ILON+1,ILAT,IDEP);%UVEL
tm2 =   Q(ILON  ,ILAT,IDEP).*AREAWEST(ILON,ILAT,IDEP);%UVEL
DU  =   (tm1 - tm2);
%meridional
Q = VVEL;
tm1 = Q(ILON,ILAT+1,IDEP).*AREASOUTH(ILON,ILAT+1,IDEP);%VVEL
tm2 = Q(ILON,ILAT  ,IDEP).*AREASOUTH(ILON,ILAT,IDEP);%VVEL
DV  = (tm1 - tm2);
%vertical
Q1(:,:,1:NZ) = WVEL;
Q1(:,:,1)=0; %NEED TO SET SURFACE W*T = 0
tm1 = Q1(ILON,ILAT,IDEP  ).*AREACELL(ILON,ILAT,IDEP);%WVEL
tm2 = Q1(ILON,ILAT,IDEP+1).*AREACELL(ILON,ILAT,IDEP+1);%WVEL
DW = (tm1 - tm2);

gTracer = -RecipVol(ILON,ILAT,IDEP)   ...
.*( (Ax+Ay+Az);
- TH.*(DU+DV+DW)    );

Diffusive are handled like advective, so would just add them in, i.e.:
gTracer = -RecipVol(ILON,ILAT,IDEP)   ...
.*( (Ax+Ay+Az+Dx+Dy+Dz);
- TH.*(DU+DV+DW)    );

Hope this helps

Matt

> On Sep 24, 2017, at 6:33 AM, liuyi315 <liuyi315 at mails.ucas.ac.cn> wrote:
>
> Hi, all users,
> I am trying to do some diagnostics analysis of heat transport and vertical redistribution in the Indonesian Seas using MITgcm. I have output ADVx/y/r_TH, DFr/x/yE_TH and DFrI_TH using "data.diagnostics". I found the unit of these variables is "degC.m^3/s", and my understanding is that the advection term of heat flux (i.e. ADVx/y/r_TH) is the product of potential temperature and volume transport. However, after I checked the results, I found the magnitude of heat transport is about one to two orders larger than observed data, although the simulated temperature and velocity compares well with observed data. Thus I believe that my understanding of the calculation of heat flux advection term has something wrong.
> Could anyone tell me how the model computes the advection and diffusion term of heat flux?
> Thanks very much.
>
> Best regards,
>
> Yi Liu
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support <http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20170924/b858aa94/attachment.html>
```