Parker,
Thank you very much for taking a look at this!
Are you using "nudging to climatology" in your domain?
I do not have M2CLM_NUDGING nor M3CLM_NUDGING defined (I found that with daily boundary conditions there was no need for nudging).
This was done with ROMS 3.6 revision 571, but I am getting similar problems with revision 656. I have the feeling a bug may have been introduced in the writing/accumulating of diagnostic terms, and that it was introduced some time not too long ago. Perhaps, if your ROMS version is different, I can try downloading the same revision you used (for the diagnostics you described above) to test my hypothesis.
My simulation is realistic with a domain from 41 to 48 North and from -129 to -123.4 West. The regular output look just fine, however the diagnostics don't.
I am attaching some plots where the order of magnitude for each term can be seen.
The first plot is a time series of the mean and standard deviations for the sum of the u and v momentum terms.
The second two plots are a time series of U and V momentum terms at a single point (away from boundaries) this one looks reasonable, and thus misleading.
The last two plots are a time series of the zonally-, meridionally- and depth-averaged momentum terms for u and for v.
Something is clearly wrong in the v-momentum, while u-momentum seems to be in a better shape.
Where could those huge vertical viscosity values be coming from?
I am including the code with which the plots were produced for scrutiny.
Here are my CPP options from the DIA files themselves.
Code: Select all
:CPP_options = "ORE2005, ANA_BSFLUX, ANA_BTFLUX, ASSUMED_SHAPE, AVERAGES, DIAGNOSTICS_UV, DJ_GRADPS, DOUBLE_PRECISION, MASKING, MIX_ISO_TS, MIX_GEO_UV, MPI, MY25_MIXING, NONLINEAR, NONLIN_EOS, POWER_LAW, PROFILE, K_GSCHEME, RADIATION_2D, !RST_SINGLE, SALINITY, SOLVE3D, SPLINES, TS_U3HADVECTION, TS_C4VADVECTION, TS_DIF2, TS_PSOURCE, UV_ADV, UV_COR, UV_U3HADVECTION, UV_C4VADVECTION, UV_QDRAG, UV_PSOURCE, UV_VIS2, VAR_RHO_2D" ;
Here is the code that computes and plots the values in the attached figures:
Code: Select all
zi=35; %z52(loi,lai,zi)=-128.4202 meters depth
loi=80;% lon(loi)=-126.3667 West
lai=190;%lat(lai)=45.5831 North
kk=1;
for kk=1:length(loopvec)
file=files{loopvec(kk)};
ncload(file)
v_accel=makenan(v_accel); % CONVERT FILL_VALUES TO NAN
v_cor=makenan(v_cor);
v_hadv=makenan(v_hadv);
v_vadv=makenan(v_vadv);
v_prsgrd=makenan(v_prsgrd);
v_hvisc=makenan(v_hvisc);
v_vvisc=makenan(v_vvisc);
u_accel=makenan(u_accel);
u_cor=makenan(u_cor);
u_hadv=makenan(u_hadv);
u_vadv=makenan(u_vadv);
u_prsgrd=makenan(u_prsgrd);
u_hvisc=makenan(u_hvisc);
u_vvisc=makenan(u_vvisc);
vmom=(v_accel-(v_cor+v_hadv+v_vadv+v_prsgrd+v_hvisc+v_vvisc)); %SUM OF MOMENTUM TERMS
umom=(u_accel-(u_cor+u_hadv+u_vadv+u_prsgrd+u_hvisc+u_vvisc));
vpaccel(kk)=v_accel(zi,lai,loi); %pointwise values for v-momentum
vpcor(kk)=v_cor(zi,lai,loi);
vphadv(kk)=v_hadv(zi,lai,loi);
vpvadv(kk)=v_vadv(zi,lai,loi);
vpprs(kk)=v_prsgrd(zi,lai,loi);
vphvisc(kk)=v_hvisc(zi,lai,loi);
vpvvisc(kk)=v_vvisc(zi,lai,loi);
upaccel(kk)=u_accel(zi,lai,loi); %pointwise values for u-momentum
upcor(kk)=u_cor(zi,lai,loi);
uphadv(kk)=u_hadv(zi,lai,loi);
upvadv(kk)=u_vadv(zi,lai,loi);
upprs(kk)=u_prsgrd(zi,lai,loi);
uphvisc(kk)=u_hvisc(zi,lai,loi);
upvvisc(kk)=u_vvisc(zi,lai,loi);
%V
v_cort(kk,:)=lims2(v_cor); %GET MAX, MIN, MEAN STD, MEDIAN SEE lims2 function below
v_prsgrdt(kk,:)=lims2(v_prsgrd);
v_accelt(kk,:)=lims2(v_accel);
v_hadvt(kk,:)=lims2(v_hadv);
v_vadvt(kk,:)=lims2(v_vadv);
v_hvisct(kk,:)=lims2(v_hvisc);
v_vvisct(kk,:)=lims2(v_vvisc);
%U
u_cort(kk,:)=lims2(u_cor);
u_prsgrdt(kk,:)=lims2(u_prsgrd);
u_accelt(kk,:)=lims2(u_accel);
u_hadvt(kk,:)=lims2(u_hadv);
u_vadvt(kk,:)=lims2(u_vadv);
u_hvisct(kk,:)=lims2(u_hvisc);
u_vvisct(kk,:)=lims2(u_vvisc);
%balance
V(kk,:)=lims2(vmom);
U(kk,:)=lims2(umom);
end %for kk
time=1:size(u_accelt,1); %generic time
%this is the plot for the mean of each u-momentum term
hh=plot(time,u_accelt(:,3),time,u_hadvt(:,3),time,u_prsgrdt(:,3),time,u_vvisct(:,3),time,u_cort(:,3),time,u_hvisct(:,3),time,u_vadvt(:,3));
set(hh,'MarkerSize',8,'Linewidth',1.5)
legend('MeanU accel','Mean U hadv','Mean U prsgrd','Mean U vvisct','Mean Ucor','Mean U hvisc','Mean U vadv','Location','Best')
%this is the plot for the mean of each v-momentum term
hh=plot(time,v_accelt(:,3),time,v_hadvt(:,3),time,v_prsgrdt(:,3),time,v_vvisct(:,3),time,v_cort(:,3),time,v_hvisct(:,3),time,v_vadvt(:,3));
set(hh,'MarkerSize',8,'Linewidth',1.5)
legend('MeanV accel','MeanV hadv','MeanV prsgrd','MeanV vvisct','MeanV cor','MeanV hvisc','MeanV vadv','Location','Best')
%this is plot for pointwise u-momentum
hh=plot(time,upaccel,time,uphadv,time,upprs,time,upvvisc,time,upcor,time,uphvisc,time,upvadv);
set(hh,'MarkerSize',8,'Linewidth',1.5)
legend(' PointU accel','PointU hadv','PointU prsgrd','PointU vvisct','PointU cor','PointU hvisc','PointU vadv','Location','Best')
%this is plot for pointwise v-momentum
hh=plot(time,vpaccel,time,vphadv,time,vpprs,time,vpvvisc,time,vpcor,time,...
vphvisc,time,vpvadv);
set(hh,'MarkerSize',8,'Linewidth',1.5)
legend(' PointV accel','PointV hadv','PointV prsgrd','PointV vvisct','PointV cor','PointV hvisc','PointV vadv','Location','Best')
% this plots the mean and the standard deviation of the sum of v-momentum and u-momentum %terms
U=abs(U);
V=abs(V);
hh=semilogy(time,V(:,3),'ro',time,V(:,4),'rx',time,U(:,3),'bo',time,U(:,4),'bx');
set(hh,'MarkerSize',8,'Linewidth',1.5)
legend('MeanV','StdV','MeanU','StdU','Location','Best')
Here is lims2.m function used to get mean and standard deviation :
Code: Select all
function all=lims2(x)
% all=lims2(x)
% all=[absmax, absmin, mean, standard_deviation, median];
x=x(:);
absmax=max(x); %all of these are matlab built-in functions
absmin=min(x);
m=nanmean(x);
s=nanstd(x);
me=nanmedian(x);
if nargout>0
all=[absmax, absmin, m, s, me];
disp(' absMax absMin Mean Std Median')
disp(all)
lb %lb prints a line
else
disp(' absMax absMin Mean Std Median')
disp([absmax, absmin, m, s, me])
lb %lb prints a line
end
end