Warning, /verification/fizhi-gridalt-hs/matlab/use_fromPhys2Dyn.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit cc5fb010 on 2005-07-07 23:51:52 UTC
cc5fb01035 Jean*0001 %- this is an exemple for how to use "fromPhys2Dyn.m"
0002 % after running mitgcmuv in directory "build"
0003 %- note: all pressure variables need to be in the same units;
0004
0005 dir0='../build/';
0006 Dp=rdmds([dir0,'Depth']); Dp=Dp/100 ; %<- convert to [mb]
0007 hFacC=rdmds([dir0,'hFacC']);
0008 dp=rdmds([dir0,'fizhidt']);
0009
0010 delR=100*ones(1,10); %<- converted to [mb]
0011 nP=size(dp,3); nr=length(delR);
0012 %- old version only:
0013 % convert to mb & reverse level index in dp to match Physics levels order:
0014 % var=dp/100; dp(:,:,[1:nP])=var(:,:,[nP:-1:1]);
0015
0016 %- load the field to interpolate to the Dynamics grid:
0017 it=5; vPh=rdmds([dir0,'fizhi_T'],it);
0018
0019 %--Do the mapping: Physics.grid -> Dynamics.grid
0020 %- 1rst time:
0021 [vDy,klev,dpDyn]=fromPhys2Dyn(vPh,dp,Dp,delR);
0022 %- next time:
0023 %[vDy,klev,dpDyn]=fromPhys2Dyn(vPh,dp,klev);
0024
0025 %- check versus hFacC:
0026 for k=1:nr,
0027 dpDyn(:,:,k)=dpDyn(:,:,k)/delR(k);
0028 end
0029 dd=dpDyn-hFacC;
0030 fprintf(' Check / hFac : max(|Diff|)= %e \n',max(max(max(abs(dd)))) );
0031