Back to home page

MITgcm

 
 

    


Warning, /verification/advect_cs/input/gendata.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit 5ce54005 on 2010-03-30 13:59:46 UTC
f014439617 Alis*0001 for tl=1:6,
9260a3d038 Jean*0002 %lon(:,tl,:)=rdda(sprintf('LONC.%3.3i.bin',tl),[32 32],1,'real*8','b')*pi/180;
                0003 %lat(:,tl,:)=rdda(sprintf('LATC.%3.3i.bin',tl),[32 32],1,'real*8','b')*pi/180;
                0004  xx=rdda(sprintf('grid_cs32.face%3.3i.bin',tl),[33 33],1,'real*8','b');
                0005  lon(:,tl,:)=xx(1:32,1:32)*pi/180;
                0006  xx=rdda(sprintf('grid_cs32.face%3.3i.bin',tl),[33 33],2,'real*8','b');
                0007  lat(:,tl,:)=xx(1:32,1:32)*pi/180;
f014439617 Alis*0008 end
                0009 X=cos(lat).*sin(lon);Y=-cos(lat).*cos(lon);Z=sin(lat);clear lat lon
                0010 
9260a3d038 Jean*0011 %lon0=-90  *pi/180;
                0012 lon0=+90  *pi/180;
f014439617 Alis*0013 lat0=  0  *pi/180;
                0014 xo=cos(lat0).*sin(lon0);yo=-cos(lat0).*cos(lon0);zo=sin(lat0);
                0015 ro=0.3;
                0016 R=sqrt( (X-xo).^2 + (Y-yo).^2 + (Z-zo).^2 );
9260a3d038 Jean*0017 t=1+(1+cos( pi*min(R/ro,1+0*R) ))/2;
5ce5400572 Davi*0018 fid=fopen('T.init','w','b');
                0019 fwrite(fid,t(:),'real*8');
                0020 fclose(fid)
f014439617 Alis*0021 
9260a3d038 Jean*0022 %lon0=  0  *pi/180;
                0023 lon0=180  *pi/180;
f014439617 Alis*0024 lat0=35   *pi/180;
                0025 xo=cos(lat0).*sin(lon0);yo=-cos(lat0).*cos(lon0);zo=sin(lat0);
                0026 ro=0.3;
                0027 R=sqrt( (X-xo).^2 + (Y-yo).^2 + (Z-zo).^2 );
                0028 s=1+(1+cos( pi*min(R/ro,1+0*R) ))/2;
5ce5400572 Davi*0029 fid=fopen('S.init','w','b');
                0030 fwrite(fid,s(:),'real*8');
                0031 fclose(fid)
f014439617 Alis*0032 
                0033 lon0=0    *pi/180;
                0034 lat0=0    *pi/180;
                0035 xo=cos(lat0).*sin(lon0);yo=-cos(lat0).*cos(lon0);zo=sin(lat0);
                0036 ro=0.3;
                0037 R=sqrt( (X-xo).^2 + (Y-yo).^2 + (Z-zo).^2 );
                0038 h=1e4*(1+cos( pi*min(R/ro,1+0*R) ))/2; %cosine bell
                0039 %h=1e4*(1-( min(R/ro,1+0*R) ))/2;       %cone
5ce5400572 Davi*0040 %fid=fopen('mountain_eq.init','w','b');
                0041 %fwrite(fid,h(:),'real*8');
                0042 %fclose(fid)
f014439617 Alis*0043 
                0044 lon0=0    *pi/180;
                0045 lat0=30   *pi/180;
                0046 xo=cos(lat0).*sin(lon0);yo=-cos(lat0).*cos(lon0);zo=sin(lat0);
                0047 ro=0.3;
                0048 R=sqrt( (X-xo).^2 + (Y-yo).^2 + (Z-zo).^2 );
                0049 h=1e4*(1+cos( pi*min(R/ro,1+0*R) ))/2; %cosine bell
                0050 %h=1e4*(1-( min(R/ro,1+0*R) ))/2;       %cone
5ce5400572 Davi*0051 %fid=fopen('mountain_30.init','w','b');
                0052 %fwrite(fid,h(:),'real*8');
                0053 %fclose(fid)