Skip to content

Commit

Permalink
- reduce gcmfaces.pdf to a few links, including to the reformatted do…
Browse files Browse the repository at this point in the history
…cumentation hosted at readthedocs

- add .gitignore and gcmfaces_calc/calc_UV_zonmer.m (replacement for gcmfaces_calc/calc_UEVNfromUXVY.m)
- gcmfaces_calc/calc_UEVNfromUXVY.m: now just applies masks and calls gcmfaces_calc/calc_UV_zonmer.m
- gcmfaces_diags/diags_driver_tex.m: add a new section title
  • Loading branch information
gaelforget committed Mar 28, 2018
1 parent b9bec05 commit b7eb0c4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
docs/_build
.ipynb_checkpoints
octave-workspace
release2_climatology
GRID
devel

Binary file modified gcmfaces.pdf
Binary file not shown.
20 changes: 2 additions & 18 deletions gcmfaces_calc/calc_UEVNfromUXVY.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,9 @@
%inputs: fldU/fldV are the X/Y vector fields at velocity points
%outputs: fldUe/fldVn are the Eastward/Northward vectors at tracer points

global mygrid;
gcmfaces_global;

%fldU(mygrid.hFacW==0)=NaN; fldV(mygrid.hFacS==0)=NaN;
nr=size(fldU.f1,3); fldU(mygrid.hFacW(:,:,1:nr)==0)=NaN; fldV(mygrid.hFacS(:,:,1:nr)==0)=NaN;

[FLDU,FLDV]=exch_UV(fldU,fldV);

fldUe=fldU; fldVn=fldV;
for iF=1:fldU.nFaces;
tmp1=FLDU{iF}(1:end-1,:,:); tmp2=FLDU{iF}(2:end,:,:);
fldUe{iF}=reshape(nanmean([tmp1(:) tmp2(:)],2),size(tmp1));
tmp1=FLDV{iF}(:,1:end-1,:); tmp2=FLDV{iF}(:,2:end,:);
fldVn{iF}=reshape(nanmean([tmp1(:) tmp2(:)],2),size(tmp1));
end;

FLDU=fldUe; FLDV=fldVn;
cs=mk3D(mygrid.AngleCS,FLDU); sn=mk3D(mygrid.AngleSN,FLDU);

fldUe=+FLDU.*cs-FLDV.*sn;
fldVn=FLDU.*sn+FLDV.*cs;


[fldUe,fldVn]=calc_UV_zonmer(fldU,fldV);
26 changes: 26 additions & 0 deletions gcmfaces_calc/calc_UV_zonmer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function [fldUe,fldVn]=calc_UV_zonmer(fldU,fldV);
%object: compute Eastward/Northward vectors form X/Y vectors
%inputs: fldU/fldV are the X/Y vector fields at velocity points
%outputs: fldUe/fldVn are the Eastward/Northward vectors at tracer points
%
%note: this routine does no apply any mask -- unlike the old calc_UEVNfromUXVY.m

gcmfaces_global;

[FLDU,FLDV]=exch_UV(fldU,fldV);

fldUe=fldU; fldVn=fldV;
for iF=1:fldU.nFaces;
tmp1=FLDU{iF}(1:end-1,:,:); tmp2=FLDU{iF}(2:end,:,:);
fldUe{iF}=reshape(nanmean([tmp1(:) tmp2(:)],2),size(tmp1));
tmp1=FLDV{iF}(:,1:end-1,:); tmp2=FLDV{iF}(:,2:end,:);
fldVn{iF}=reshape(nanmean([tmp1(:) tmp2(:)],2),size(tmp1));
end;

FLDU=fldUe; FLDV=fldVn;
cs=mk3D(mygrid.AngleCS,FLDU); sn=mk3D(mygrid.AngleSN,FLDU);

fldUe=+FLDU.*cs-FLDV.*sn;
fldVn=FLDU.*sn+FLDV.*cs;


3 changes: 3 additions & 0 deletions gcmfaces_diags/diags_driver_tex.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@
elseif strcmp(setDiags{ii},'SEAICE');
write2tex(fileTex,1,'seaice and snow fields',1);
diags_display({dirMat,dirMatRef},'SEAICE',dirTex,nameTex);
elseif strcmp(setDiags{ii},'drwn3');
write2tex(fileTex,1,'Plankton and related fields',1);
diags_display({dirMat,dirMatRef},'drwn3',dirTex,nameTex);
elseif strcmp(setDiags{ii},'controls');
%controls
write2tex(fileTex,1,'controls',1);
Expand Down

0 comments on commit b7eb0c4

Please sign in to comment.