Commit d380ec6c184ab44623ef58bfd647112c08300860

Authored by Jérémy Baudry
1 parent 81dede1c
Exists in master

second commit

WIM2 0 → 100755
No preview for this file type
nml/.parameter.nml.swp 0 → 100644
No preview for this file type
nml/parameter.nml
... ... @@ -2,8 +2,8 @@
2 2 &waves_parameters
3 3  
4 4 Tm =6
5   -Hs =1
6   -disp =0
  5 +Hs =3
  6 +disp =1
7 7  
8 8  
9 9  
... ... @@ -11,9 +11,12 @@ disp =0
11 11  
12 12 &model_parameter
13 13  
14   -nbin =10
  14 +nbin =40
15 15 dx =5000
16   -Cfl =0.7
  16 +Cfl =1
  17 +name_sim ='simulation1'
  18 +root = 'output/'
  19 +FSD_scheme =1
17 20 /
18 21  
19 22  
... ... @@ -31,10 +34,9 @@ gamma_s =3.3
31 34 /
32 35  
33 36 &ice_parameters
34   -cice =0.5
  37 +cice =0.95
35 38 hice =1
36 39 D0 =500
37 40 gam =1.5
38 41 Dmin =20
39   -
40 42 /
... ...
output/Energy_spectrum.dat 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 + 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
  2 + 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
  3 + 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
  4 + 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
  5 + 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
  6 + 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
  7 + 4.67950925783336522E-067 2.22629063774832403E-043 1.86047825022193849E-029 7.26884501201403012E-021 2.37388636149809682E-015 1.06929631400098977E-011 3.26805736321345173E-009 1.74290715738444442E-007 2.89921538309260074E-006 2.17440833634750726E-005 9.35026054732778790E-005 2.70691375180493105E-004 5.88858707265495782E-004 1.04046745784872399E-003 1.58646763233278709E-003 2.21413746427823362E-003 3.03256060311372574E-003 4.36234121430526846E-003 6.65167145503830007E-003 9.67152294436269058E-003 1.12773173537781685E-002 1.02218877788641249E-002 7.91893718082620560E-003 5.73020415903088484E-003 4.21942005067637953E-003 3.31030307813106120E-003 2.77627384988582675E-003 2.44069346588253726E-003 2.19977333455199150E-003 2.00224635066572655E-003 1.82692365653251698E-003 1.66659906324478652E-003 1.51918118656764727E-003 1.38394576701342861E-003 1.26034009460873099E-003 1.14772599771339892E-003 1.04537854225776085E-003 9.52528217916501479E-004 8.68398034709047962E-004 7.92229374888612971E-004 7.23298493270941277E-004 6.60926203581860619E-004 6.04482786654046526E-004 5.53389628981113338E-004 5.07118685465212347E-004 4.65190549475677723E-004 4.27171683928026036E-004 3.92671199296484299E-004 3.61337442763468887E-004 3.32854575163448927E-004 3.06939249970022651E-004 2.83337464540176550E-004 2.61821623141505273E-004 2.42187830234146884E-004 2.24253418333657207E-004 2.07854705551948184E-004 1.92844972152353476E-004 1.79092642113339549E-004 1.66479654018151678E-004 1.54900005033988496E-004 1.44258451929288615E-004
  8 + 6.52602436873789001E-066 3.10477576885178824E-042 2.59461531743540874E-028 1.01371013641173847E-019 3.31061215827662809E-014 1.49123624253775803E-010 4.55761936041964985E-008 2.43065115481894441E-006 4.04323385162878518E-005 3.03242092465927718E-004 1.30398349108432760E-003 3.77505078738318801E-003 8.21219931753570422E-003 1.45103163829264376E-002 2.21248123646438609E-002 3.08782700310448743E-002 4.22919654715200669E-002 6.08370311943501954E-002 9.27639365938913857E-002 0.13487866128710674 0.15727300409022502 0.14255402663795091 0.11043717229550717 7.99131915746931071E-002 5.88438585233288097E-002 4.61653506072852299E-002 3.87178009495667275E-002 3.40378107133899738E-002 3.06779484685386107E-002 2.79232452736102171E-002 2.54782021905330253E-002 2.32423220051220167E-002 2.11864383588354389E-002 1.93004507586400503E-002 1.75766511339743060E-002 1.60061395693864156E-002 1.45788061641501515E-002 1.32839193589109929E-002 1.21106432833499641E-002 1.10483982855648262E-002 1.00870910449765618E-002 9.21724965773377571E-003 8.43009208622318151E-003 7.71754901027740543E-003 7.07225633467517718E-003 6.48752827425853277E-003 5.95731873867440080E-003 5.47617639866981344E-003 5.03919711851076851E-003 4.64197621818215975E-003 4.28056215867802983E-003 3.95141262958358368E-003 3.65135359017345479E-003 3.37754152163295901E-003 3.12742895073536741E-003 2.89873317660003247E-003 2.68940805181255242E-003 2.49761862258705098E-003 2.32171840926017475E-003 2.16022910068454019E-003 2.01182243866920765E-003
  9 + 1.51826113888746689E-065 7.22317314257711228E-042 6.03629926007493500E-028 2.35836800362409231E-019 7.70204568943687947E-014 3.46931900345249416E-010 1.06031727278158217E-007 5.65484126634858119E-006 9.40646936865404326E-005 7.05484164097563591E-004 3.03368076550261222E-003 8.78254904359004537E-003 1.91054497870714324E-002 3.37578412711627140E-002 5.14727511275170635E-002 7.18374231772530014E-002 9.83910632791546585E-002 0.14153563494205867 0.21581267868903800 0.31379139630301978 0.36589120238369222 0.33164791702760277 0.25692896242941149 0.18591578332673386 0.13689857501319794 0.10740238440714167 9.00758704587491243E-002 7.91880053444266735E-002 7.13713807194720773E-002 6.49626415335383123E-002 5.92743178525471648E-002 5.40726057458935511E-002 4.92896505041330452E-002 4.49019536154772816E-002 4.08915824714526366E-002 3.72378316701078918E-002 3.39171808129226510E-002 3.09046632301343722E-002 2.81750695754676914E-002 2.57037865875577448E-002 2.34673324411283565E-002 2.14436710193704506E-002 1.96123711597949932E-002 1.79546598169226489E-002 1.64534046311945355E-002 1.50930513122575320E-002 1.38595338016561341E-002 1.27401697358372704E-002 1.17235497815161259E-002 1.07994265750325294E-002 9.95860697248665723E-003 9.19284988873881638E-003 8.49477100768124271E-003 7.85775496309692838E-003 7.27587513046845918E-003 6.74382087066400984E-003 6.25683187951033004E-003 5.81063918884650032E-003 5.40141231023485904E-003 5.02571199454080342E-003 4.68044808659517312E-003
  10 + 1.95873867346487579E-065 9.31875829336317988E-042 7.78754886262852974E-028 3.04257712763802231E-019 9.93656122144324420E-014 4.47583694833191780E-010 1.36793624966385249E-007 7.29542237300393300E-006 1.21354718639815330E-004 9.10159049942831566E-004 3.91381145584134525E-003 1.13305399332603515E-002 2.46483180089165331E-002 4.35516575751703355E-002 6.64060125631479731E-002 9.26788780765710474E-002 0.12693625347575638 0.18259791727104541 0.27842419801512130 0.40482847620644036 0.47204346474590375 0.42786552617163764 0.33146912751284846 0.23985362299165147 0.17661555469770751 0.13856193679222009 0.11620865903401190 0.10216200926826749 9.20776274997427147E-002 8.38095865349079566E-002 7.64709678376607194E-002 6.97601363406503278E-002 6.35895513434259207E-002 5.79288969519493741E-002 5.27550379539480363E-002 4.80412619015349179E-002 4.37572246641666704E-002 3.98707162482138042E-002 3.63492135782859244E-002 3.31609625999054469E-002 3.02756689466330414E-002 2.76649033890685007E-002 2.53023072810697643E-002 2.31636611459887093E-002 2.12268621884786034E-002 1.94718435114342031E-002 1.78804582151066184E-002 1.64363445318617719E-002 1.51247830555507421E-002 1.39325534599805262E-002 1.28477954886866003E-002 1.18598771550093816E-002 1.09592718069343419E-002 1.01374448298839851E-002 9.38675016854672271E-003 8.70033646251960023E-003 8.07206234939613146E-003 7.49642034906078739E-003 6.96846867274685845E-003 6.48377027723753656E-003 6.03833849233373354E-003
... ...
output/WIM-OUTPUT 0 → 100644
No preview for this file type
output/advection.m 0 → 100644
... ... @@ -0,0 +1,42 @@
  1 +function E = advection(E,c,dx,dt)
  2 +%ADVECTION is a 1d advection code Lax Wendroff scheme with Superbee flux limiter
  3 +%
  4 +% E = advection(E,c,dx,dt)
  5 +%
  6 +% INPUTS:
  7 +% E = vector of the thing to be advected;
  8 +% c = scalar speed;
  9 +% dx = the spatial resolution;
  10 +% dt = the temporal resolution;
  11 +%
  12 +% OUTPUT:
  13 +% E = vector of the thing to be advected - after advection;
  14 +
  15 +if ~isequal(size(E),size(c))
  16 + c = c';
  17 +end
  18 +
  19 +f = flux(E,c,dx,dt);
  20 +E = E-dt*diffl(f)/dx;
  21 +
  22 +function f = flux(E,c,h,dt)
  23 + % Lax-Wendroff with Superbee flux limiting;
  24 + theta = diffl(E)./(diffr(E)+3e-14);
  25 + phi = limiter(theta);
  26 + f = c.*E+c/2.*(1-c*dt/h).*diffr(E).*phi;
  27 +end
  28 +
  29 +
  30 +function y = diffl(x)
  31 +y = [x(1);diff(x)];
  32 +end
  33 +
  34 +function y = diffr(x)
  35 +y = [diff(x);-x(end)];
  36 +end
  37 +
  38 + % Superbee
  39 +function phi = limiter(r)
  40 + phi = max(0,max(min(1,2*r),min(r,2)));
  41 +end
  42 +end
... ...
output/advection.m~ 0 → 100644
... ... @@ -0,0 +1,42 @@
  1 +function E = advection(E,c,dx,dt)
  2 +%ADVECTION is a 1d advection code Lax Wendroff scheme with Superbee flux limiter
  3 +%
  4 +% E = advection(E,c,dx,dt)
  5 +%
  6 +% INPUTS:
  7 +% E = vector of the thing to be advected;
  8 +% c = scalar speed;
  9 +% dx = the spatial resolution;
  10 +% dt = the temporal resolution;
  11 +%
  12 +% OUTPUT:
  13 +% E = vector of the thing to be advected - after advection;
  14 +
  15 +if ~isequal(size(E),size(c))
  16 + c = c';
  17 +end
  18 +
  19 +f = flux(E,c,dx,dt);
  20 +E = E-dt*diffl(f)/dx;
  21 +
  22 +function f = flux(E,c,h,dt)
  23 + % Lax-Wendroff with Superbee flux limiting;
  24 + theta = diffl(E)./(diffr(E)+3e-14);
  25 + phi = limiter(theta);
  26 + f = c.*E+c/2.*(1-c*dt/h).*diffr(E).*phi;
  27 +end
  28 +
  29 +
  30 +function y = diffl(x)
  31 +y = [0;diff(x)];
  32 +end
  33 +
  34 +function y = diffr(x)
  35 +y = [diff(x);0];
  36 +end
  37 +
  38 + % Superbee
  39 +function phi = limiter(r)
  40 + phi = max(0,max(min(1,2*r),min(r,2)));
  41 +end
  42 +end
... ...
output/data_treatment.m
1   -% clear all;
  1 +clear all;
2 2 close all;
3 3  
4   -E=load('output/Energy_spectrum.dat');
5   -subplot(1,2,1)
6   -cmap=jet(size(E,1));
7   -for i=1:size(E,1)
8   - plot(E(i,:),'color',cmap(i,:))
9   - hold on
  4 +
  5 +x=ncread('simulation1.nc','x_axis');
  6 +t=ncread('simulation1.nc','time');
  7 +om=ncread('simulation1.nc','omega');
  8 +spectre=ncread('simulation1.nc','Spectrum');
  9 +Dave=ncread('simulation1.nc','Dave');
  10 +Dmax=ncread('simulation1.nc','Dmax');
  11 +
  12 +
  13 +f=om/(2*pi);
  14 +E=reshape(spectre(end,end,:),length(om),1);
  15 +Ei=reshape(spectre(30,:,:),length(x),length(om));
  16 +E1=reshape(spectre(1,1,:),length(om),1);
  17 +
  18 +
  19 +
  20 +
  21 +
  22 +figure(1)
  23 +cmap=rand(length(t),3);
  24 + w = waitforbuttonpress;
  25 +for i=1:length(t)
10 26  
  27 + figure(1)
  28 +
  29 + sp=reshape(spectre(i,:,:),length(x),length(om));
  30 + h=mesh(f,x,sp);
  31 + axis([min(f) max(f) min(x) max(x) 0 max(E1)])
  32 + xlabel('Frequency [s^{-1}]')
  33 + zlabel('Energy')
  34 +
  35 + ylabel('x [km]')
  36 + pause(0.1)
11 37  
12 38 end
13   -
14   -FSD=load('output/floe_size.dat');
15   -subplot(1,2,2)
16   -plot(FSD(:,1))
  39 +
  40 +for i=1:length(om)
  41 + EE(i)=sum(Ei(:,i));
  42 +
  43 +end
  44 +figure
  45 +plot(E1)
17 46 hold on
18   -plot(FSD(:,2),'r')
  47 +plot(EE,'r')
  48 +
  49 +for i=1:length(t)
  50 +
  51 +E2=reshape(spectre(i,:,:),length(x),length(om));
  52 +m0(i)=sum(sum(E2))/sum(E1);
  53 +end
  54 +figure
  55 +plot(t,m0)
  56 +
  57 +
  58 +
  59 +
  60 +
  61 +
  62 +figure
  63 +
  64 +
  65 +
  66 + plot(x,Dmax,'color','r')
  67 + hold on
  68 + plot(x,Dave,'--b')
  69 + grid on
  70 +
  71 + xlabel('x [km]')
  72 + ylabel('Floe size [m]')
  73 +
  74 + legend('Dmax','<D>')
19 75 \ No newline at end of file
... ...
output/data_treatment.m~ 0 → 100644
... ... @@ -0,0 +1,79 @@
  1 +clear all;
  2 +close all;
  3 +
  4 +
  5 +x=ncread('simulation1.nc','x_axis');
  6 +t=ncread('simulation1.nc','time');
  7 +om=ncread('simulation1.nc','omega');
  8 +spectre=ncread('simulation1.nc','Spectrum');
  9 +Dave=ncread('simulation1.nc','Dave');
  10 +Dmax=ncread('simulation1.nc','Dmax');
  11 +
  12 +
  13 +f=om/(2*pi);
  14 +E=reshape(spectre(end,end,:),length(om),1);
  15 +Ei=reshape(spectre(30,:,:),length(x),length(om));
  16 +E1=reshape(spectre(1,1,:),length(om),1);
  17 +
  18 +
  19 +
  20 +
  21 +
  22 +figure(1)
  23 +cmap=rand(length(t),3);
  24 + w = waitforbuttonpress;
  25 +for i=1:length(t)
  26 +
  27 + figure(1)
  28 +
  29 + sp=reshape(spectre(i,:,:),length(x),length(om));
  30 + h=mesh(f,x,sp);
  31 + axis([min(f) max(f) min(x) max(x) 0 max(E1)])
  32 + xlabel('Frequency [s^{-1}]')
  33 + zlabel('Energy')
  34 +
  35 + ylabel('x [km]')
  36 + pause(0.1)
  37 +
  38 +end
  39 +
  40 +for i=1:length(om)
  41 + EE(i)=sum(Ei(:,i));
  42 +
  43 +end
  44 +figure
  45 +plot(E1)
  46 +hold on
  47 +plot(EE,'r')
  48 +
  49 +for
  50 +
  51 +
  52 +
  53 +
  54 +
  55 +
  56 +
  57 +% figure
  58 +%
  59 +% subplot(1,2,1)
  60 +%
  61 +% plot(T,E,'color','r')
  62 +% hold on
  63 +% plot(T,Ei,'--b')
  64 +% grid on
  65 +% xlabel('Frequency [s^{-1}]')
  66 +% ylabel('Energy')
  67 +%
  68 +%
  69 +% subplot(1,2,2)
  70 +%
  71 +% plot(x,Dmax,'color','r')
  72 +% hold on
  73 +% plot(x,Dave,'--b')
  74 +% grid on
  75 +%
  76 +% xlabel('x [km]')
  77 +% ylabel('Floe size [m]')
  78 +%
  79 +% legend('Dmax','<D>')
0 80 \ No newline at end of file
... ...
output/ferret.jnl 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 + ! NOAA/PMEL TMAP
  2 + ! FERRET v6.93
  3 + ! Linux 2.6.32-504.el6.x86_64 64-bit - 11/13/14
  4 + ! 1-Oct-15 15:51
  5 +
  6 +use simulation1
  7 +use simulation1.nc
  8 +show data
  9 +use simulation1.nc
  10 +exit
... ...
output/ferret.jnl.~1~ 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 + ! NOAA/PMEL TMAP
  2 + ! FERRET v6.93
  3 + ! Linux 2.6.32-504.el6.x86_64 64-bit - 11/13/14
  4 + ! 30-Sep-15 15:02
  5 +
  6 +use simulation1.nc
  7 +use simulation1
  8 +quit
... ...
output/ferret.jnl.~2~ 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 + ! NOAA/PMEL TMAP
  2 + ! FERRET v6.93
  3 + ! Linux 2.6.32-504.el6.x86_64 64-bit - 11/13/14
  4 + ! 30-Sep-15 15:05
  5 +
  6 +use simulation1.nc
  7 +show data
  8 +show axis/all
  9 +show data
  10 +plot/I=1/J=1 SPECTRUM
... ...
output/floe_size.dat 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 + 0.0000000000000000 0.0000000000000000
  2 + 500.00000000000000 500.00000000000000
  3 + 500.00000000000000 500.00000000000000
  4 + 500.00000000000000 500.00000000000000
  5 + 500.00000000000000 500.00000000000000
  6 + 500.00000000000000 500.00000000000000
  7 + 500.00000000000000 500.00000000000000
  8 + 500.00000000000000 500.00000000000000
  9 + 500.00000000000000 500.00000000000000
  10 + 500.00000000000000 500.00000000000000
... ...
output/jonswap.m 0 → 100755
... ... @@ -0,0 +1,18 @@
  1 +function [E] = JONSWAP(Tm,Hs,om)
  2 +% Formule http://hmf.enseeiht.fr/travaux/CD0910/bei/beiere/groupe4/node/59
  3 +
  4 +gam = 3.3;
  5 +alp = 0.0624/(0.23+0.0336*gam-0.185/(1.9+gam));
  6 +fp = 1/Tm;
  7 +f = om/(2*pi);
  8 +sig = zeros(length(om),1);
  9 +sig(f<=fp) = 0.07;
  10 +sig(f>fp) = 0.09;
  11 +
  12 +E = alp*Hs^2*fp^4*f.^-5.*exp(-5/4*(fp./f).^4).*gam.^(exp(-(f-fp).^2./(2.*sig.^2.*fp^2)));
  13 +
  14 +
  15 +
  16 +
  17 +end
  18 +
... ...
output/simulation1 .nc 0 → 100644
No preview for this file type
output/simulation1.nc 0 → 100644
No preview for this file type
output/test_adv 0 → 100644
... ... @@ -0,0 +1,29 @@
  1 +clear all;
  2 +close all;
  3 +
  4 +% Parameters
  5 +g = 9.81; % gravitational acceleration
  6 +dx = 5000; % spatial resolution
  7 +
  8 +Hs=1;
  9 +Tm=6;
  10 +
  11 +% Waves
  12 +fmin = 1/20; % minimum wave frequency
  13 +fmax = 1/2.5; % maximum wave frequency
  14 +om1 = 2*pi*fmin; % minimum wave radial frequency
  15 +om2 = 2*pi*fmax; % maximum wave radial fequency
  16 +nw = 61; % number of frequency bins
  17 +dw = (om2-om1)/(nw-1); % integral interval for wave radial frequencies
  18 +om = om1+(0:nw-1)'*dw; % wave radial frequencies vector
  19 +T = 2*pi./om; % wave periods vector
  20 +
  21 +wlng = g.*T.^2./(2.*pi); % wavelength as a function only of wave period
  22 +cp = sqrt(g.*wlng./(2.*pi)); % phase speed
  23 +cg = cp./2; % group speed
  24 +cgmax = max(cg); % group speed maximum
  25 +cg(:) = cgmax; % no dispersion = all group speed are the same (maximum)
  26 +
  27 +dt = dx/cgmax; % time interval (temporal resolution)
  28 +
  29 +Ei = jonswap(Tm,Hs,om); % JONSWAP spectrum
0 30 \ No newline at end of file
... ...
output/test_adv.m 0 → 100644
... ... @@ -0,0 +1,84 @@
  1 +clear all;
  2 +close all;
  3 +
  4 +% Parameters
  5 +g = 9.81; % gravitational acceleration
  6 +dx = 500; % spatial resolution
  7 +nbin=80;
  8 +x=linspace(0,dx*nbin/1000,nbin);
  9 +
  10 +Hs=1;
  11 +Tm=6;
  12 +
  13 +% Waves
  14 +fmin = 1/20; % minimum wave frequency
  15 +fmax = 1/2.5; % maximum wave frequency
  16 +om1 = 2*pi*fmin; % minimum wave radial frequency
  17 +om2 = 2*pi*fmax; % maximum wave radial fequency
  18 +nw = 61; % number of frequency bins
  19 +dw = (om2-om1)/(nw-1); % integral interval for wave radial frequencies
  20 +om = om1+(0:nw-1)'*dw; % wave radial frequencies vector
  21 +T = 2*pi./om; % wave periods vector
  22 +
  23 +wlng = g.*T.^2./(2.*pi); % wavelength as a function only of wave period
  24 +cp = sqrt(g.*wlng./(2.*pi)); % phase speed
  25 +cg = cp./2; % group speed
  26 +cgmax = max(cg); % group speed maximum
  27 +cg(:) = cgmax; % no dispersion = all group speed are the same (maximum)
  28 +
  29 +CN=0.7;
  30 +dt = CN*dx/cgmax; % time interval (temporal resolution)
  31 +nsteps=ceil(nbin/CN);
  32 +
  33 +Ei = jonswap(Tm,Hs,om); % JONSWAP spectrum
  34 +E=zeros(nsteps,nbin,length(om));
  35 +E(1,1,:)=Ei;
  36 +EE=reshape(E(1,:,:),nbin,length(om));
  37 +
  38 +
  39 +
  40 +for n=2:nsteps
  41 +
  42 + for w=1:nw % Advection loop over each frequency
  43 +
  44 + EE(:,w) = advection(EE(:,w),cg(w,:),dx,dt); % SEE advection routine
  45 + end
  46 +
  47 + E(n,:,:)=reshape(EE,1,nbin,length(om));
  48 +
  49 +
  50 +
  51 +end
  52 +
  53 +
  54 +
  55 +figure(1)
  56 + rr = waitforbuttonpress;
  57 +for n=1:nsteps
  58 + figure(1)
  59 +
  60 +
  61 + E3=reshape(E(n,:,:),nbin,length(om));
  62 + h=mesh(om,x,E3);
  63 + axis([om1 om2 min(x) max(x) 0 max(Ei)])
  64 + xlabel('Frequency [s^{-1}]')
  65 + zlabel('Energy')
  66 +
  67 + ylabel('x [km]')
  68 + pause(0.1)
  69 +
  70 +
  71 +end
  72 +
  73 +
  74 +for i=1:nsteps
  75 +
  76 +E2=reshape(E(i,:,:),nbin,length(om));
  77 +m0(i)=sum(sum(E2))/sum(Ei);
  78 +end
  79 +figure
  80 +plot(m0)
  81 +
  82 +
  83 +
  84 +
... ...
output/test_adv.m~ 0 → 100644
... ... @@ -0,0 +1,77 @@
  1 +clear all;
  2 +close all;
  3 +
  4 +% Parameters
  5 +g = 9.81; % gravitational acceleration
  6 +dx = 500; % spatial resolution
  7 +nbin=80;
  8 +x=linspace(0,dx*nbin/1000,nbin);
  9 +
  10 +Hs=1;
  11 +Tm=6;
  12 +
  13 +% Waves
  14 +fmin = 1/20; % minimum wave frequency
  15 +fmax = 1/2.5; % maximum wave frequency
  16 +om1 = 2*pi*fmin; % minimum wave radial frequency
  17 +om2 = 2*pi*fmax; % maximum wave radial fequency
  18 +nw = 61; % number of frequency bins
  19 +dw = (om2-om1)/(nw-1); % integral interval for wave radial frequencies
  20 +om = om1+(0:nw-1)'*dw; % wave radial frequencies vector
  21 +T = 2*pi./om; % wave periods vector
  22 +
  23 +wlng = g.*T.^2./(2.*pi); % wavelength as a function only of wave period
  24 +cp = sqrt(g.*wlng./(2.*pi)); % phase speed
  25 +cg = cp./2; % group speed
  26 +cgmax = max(cg); % group speed maximum
  27 +cg(:) = cgmax; % no dispersion = all group speed are the same (maximum)
  28 +
  29 +CN=0.5;
  30 +dt = CN*dx/cgmax; % time interval (temporal resolution)
  31 +nsteps=ceil(nbin/CN);
  32 +
  33 +Ei = jonswap(Tm,Hs,om); % JONSWAP spectrum
  34 +E=zeros(nsteps,nbin,length(om));
  35 +E(1,1,:)=Ei;
  36 +EE=reshape(E(1,:,:),nbin,length(om));
  37 +
  38 +
  39 +
  40 +figure(1)
  41 + rr = waitforbuttonpress;
  42 +for n=2:nsteps
  43 +
  44 + for w=1:nw % Advection loop over each frequency
  45 +
  46 + EE(:,w) = advection(EE(:,w),cg(w,:),dx,dt); % SEE advection routine
  47 + end
  48 +
  49 + % Incident wave spectrum
  50 + %EE(1,:) = Ei;
  51 +
  52 + figure(1)
  53 +
  54 +
  55 + h=mesh(om,x,EE);
  56 + axis([om1 om2 min(x) max(x) 0 max(Ei)])
  57 + xlabel('Frequency [s^{-1}]')
  58 + zlabel('Energy')
  59 +
  60 + ylabel('x [km]')
  61 + pause(0.1)
  62 +
  63 + E(n,:,:)=reshape(EE,1,nbin,length(om));
  64 +end
  65 +
  66 +
  67 +for i=1:nsteps
  68 +
  69 +E2=reshape(E(i,:,:),nbin,length(om));
  70 +m0(i)=sum(sum(E2))/sum(Ei);
  71 +end
  72 +figure
  73 +plot(m0)
  74 +
  75 +
  76 +
  77 +
... ...
output/wim.m 0 → 100755
... ... @@ -0,0 +1,134 @@
  1 +function [T,cice,Hsig,Ei,E,S_win,S_wcp,S_ice,Dmax,Dave,om_do] = wim(C,h,D,U10,Tm,Hs)
  2 +% WIM - Models the propagation of a wave spectrum along a 1D
  3 +% ice-covered transect.
  4 +%
  5 +% Syntax: [T,cice,Hsig,Ei,E,S_win,S_wcp,S_ice] = wim_final(C,h,D,U10,Tm,Hs)
  6 +%
  7 +% Inputs:
  8 +% C : ice concentration. For a homogeneous concentration, C is scalar
  9 +% in tenths. Otherwise, C is a vector of the size of the spatial
  10 +% grid, in fraction of 1 (0 < C < 1). In this version of WIM, if
  11 +% C is homogeneous, the transect is 5km long with spatial
  12 +% resolution of 500m.
  13 +% h : ice thickness in meters. h is a scalar.
  14 +% D : average floe diameter in meters. D is a scalar.
  15 +% U10 : wind speed at 10m elevation in m/sec. U10 is a scalar.
  16 +% Tm : mean wave period to build the spectrum, in seconds. Tm is a scalar.
  17 +% Hs : significant wave height, in meters. Hs is a scalar.
  18 +%
  19 +% Outputs:
  20 +% T : wave period in seconds. T is a vector the size of the frequency range.
  21 +% cice : ice concentration vector in fraction of 1. cice has the size of
  22 +% the spatial grid.If C is a vector, then cice = C.
  23 +% Hsig : final wave heigh in each cell in meters. Hsig has the size of
  24 +% the spatial grid.
  25 +% Ei : initial spectrum in m2/hz.
  26 +% E : final wave spectrum in each cell [m2/Hz].
  27 +% S_win: final wind source term in each cell in m2/Hz/sec.
  28 +% S_wcp: final white-capping source term in each cell in m2/Hz/sec.
  29 +% S_ice: final ice source term in each cell in m2/Hz/sec.
  30 +
  31 +% Parameters
  32 +g = 9.81; % gravitational acceleration
  33 +dx = 5000; % spatial resolution
  34 +
  35 +% Ice conditions
  36 +if length(C) == 1 % Homogeneous ice concentration case
  37 + nx = 10; % 10 cells of 500m -> 5km long transect
  38 + cice = zeros(1,nx)+C; % homogeneous ice concentration vector
  39 + hice = zeros(1,nx)+h; % homogeneous ice thickness vector
  40 + Dmax = zeros(1,nx)+D; % homogeneous floe diameter vector
  41 + Dave = zeros(1,nx)+D;
  42 +else % Variable ice concentration case
  43 + nx = length(C); % number of cells
  44 + cice = C; % ice concentration vector
  45 + hice = zeros(1,nx); % ice thickness vector size allocation
  46 + hice(find(C)) = h; % ice thickness vector
  47 + Dmax = zeros(1,nx); % floes diameter vector size allocation
  48 + Dmax(find(C)) = D; % floes diameter vector
  49 +end
  50 +
  51 +% Waves
  52 +fmin = 1/20; % minimum wave frequency
  53 +fmax = 1/2.5; % maximum wave frequency
  54 +om1 = 2*pi*fmin; % minimum wave radial frequency
  55 +om2 = 2*pi*fmax; % maximum wave radial fequency
  56 +nw = 61; % number of frequency bins
  57 +dw = (om2-om1)/(nw-1); % integral interval for wave radial frequencies
  58 +om = om1+(0:nw-1)'*dw; % wave radial frequencies vector
  59 +T = 2*pi./om; % wave periods vector
  60 +Ei = jonswap(Tm,Hs,om); % JONSWAP spectrum
  61 +wlng = g.*T.^2./(2.*pi); % wavelength as a function only of wave period
  62 +cp = sqrt(g.*wlng./(2.*pi)); % phase speed
  63 +cg = cp./2; % group speed
  64 +cgmax = max(cg); % group speed maximum
  65 +cg(:) = cgmax; % no dispersion = all group speed are the same (maximum)
  66 +
  67 +% Wind
  68 +U10 = repmat(U10,nx,1); % wind speed at 10m elevation vector
  69 +
  70 +% Temporal grid
  71 +dt = dx/cgmax; % time interval (temporal resolution)
  72 +nsteps = nx+1; % number of time steps (=nx+1 because advection is
  73 + % done from one cell at each time step)
  74 +time = 0:dt:nsteps*dt; % time vector
  75 +nt = length(time); % time vector size
  76 +
  77 +% Memory preallocation
  78 +E = zeros(nx,nw); % wave spectrum
  79 +Swin = zeros(nx,nw); % wind source term
  80 +Swcp = zeros(nx,nw); % white-capping source term
  81 +Sice = zeros(nx,nw); % ice dissipation source term
  82 +S_win = zeros(nx,nw); % wind source term weighted by open water fraction (for outputs)
  83 +S_ice = zeros(nx,nw); % ice dissipation source terme weighted by ice fraction
  84 +S_wcp = zeros(nx,nw); % white-capping source term weighted by open water fraction
  85 +Hsig = zeros(1,nx); % significant wave height
  86 +
  87 +% Action density limiter
  88 +Slim = action_density_limiter(om,cp); % SEE action_density_limiter routine
  89 +
  90 +
  91 +for n=1:nt % Time loop
  92 + % Advection.
  93 + % The advection is done by solving Dt(S) = 0 using the
  94 + % Lax-Wendroff scheme with Superbee flux limiting and a Neumann
  95 + % boundary condition. The advection is performed over the whole domain
  96 + % in one step on an unattenuated intermediate spectrum.
  97 + for w=1:nw % Advection loop over each frequency
  98 + E(:,w) = advection(E(:,w),cg(w,:),dx,dt); % SEE advection routine
  99 + end
  100 + % Incident wave spectrum
  101 + E(1,:) = Ei; % The initial wave spectrum is forced in the first cell
  102 + % Processes for each spatial cell with ice (generation by wind, dissipation
  103 + % by white-capping and attenuation by ice)
  104 + for i=2:nx % Spatial loop
  105 +% % Generation by wind
  106 +% Swin(i,:) = wind_gen(U10(i),E(i,:),om,cp); % SEE wind_gen routine
  107 +% Swin(i,:) = min(Swin(i,:),Slim'); % action density limiter
  108 +% E(i,:) = E(i,:) + Swin(i,:)*dt*(1-cice(i)); % the wave spectrum is updated (explicit scheme)
  109 +% S_win(i,:) = Swin(i,:)*(1-cice(i)); % effective wind source term for outputs
  110 +% % Dissipation by white-capping
  111 +% Swcp(i,:) = white_cap(E(i,:),om,cp); % SEE white-cap routine
  112 +% Swcp(i,:) = max(Swcp(i,:),-Slim'); % action density limiter
  113 +% E(i,:) = E(i,:) + Swcp(i,:)*dt*(1-cice(i)); % the wave spectrum is updated (semi-implicit scheme)
  114 +% S_wcp(i,:) = Swcp(i,:)*(1-cice(i)); % effective white-capping source term for outputs
  115 +
  116 + % Attenuation by ice
  117 + if cice(i)>0
  118 + Sice(i,:) = ice_att(E(i,:),T,cg,cice(i),hice(i),Dave(i),dt*cice(i)); % SEE ice_att routine
  119 + E(i,:) = E(i,:) + Sice(i,:)*dt; % the wave spectrum is updated (implicit scheme)
  120 + else
  121 + Sice(i,:) = 0; % if there is no ice, there is no attenuation Sherlock !
  122 + end
  123 + S_ice(i,:) = Sice(i,:)*cice(i); % effective ice dissipation source term for outputs
  124 + [Dmax(i),om_do(i)]=floe_breaking(E(i,:),h,om,Dmax(i),dw);
  125 + Dave(i)=FSD(Dmax(i),D);
  126 + % Wave spectrum statistics
  127 + E(E<0) = 0; % avoiding negative energy
  128 + m0 = trapz(om,E(i,:)); % total energy
  129 + Hsig(i) = 4*sqrt(m0); % significant wave height
  130 + end
  131 +end
  132 +
  133 +end
  134 +
... ...
src/advection.f90
... ... @@ -4,35 +4,59 @@ use parameters
4 4  
5 5 implicit none
6 6  
7   - double precision, allocatable :: beta_1(:),beta_2(:),beta_3(:)
8   -
9   -
10   - allocate(beta_1(nfreq))
11   - allocate(beta_2(nfreq))
12   - allocate(beta_3(nfreq))
13   -
14   - beta_1=CN/2*(CN+1)
15   - beta_2=1-CN**2
16   - beta_3=CN/2*(CN-1)
17   -
18   -
19   - E(n,1,1:nfreq)=beta_2*E(n-1,1,1:nfreq)+beta_3*E(n-1,2,1:nfreq)
20   -
21   - if (i.le.nbin) then
22   - E(n,i,1:nfreq)=beta_1*E(n-1,i-1,1:nfreq)+beta_2*E(n-1,i,1:nfreq)+beta_3*E(n-1,i+1,1:nfreq)
23   - else
24   -
25   - E(n,i,1:nfreq)=beta_1*E(n-1,i-1,1:nfreq)!+beta_2*E(n-1,i,1:nfreq)
26   - end if
27   -
28   -
29   - do j=1,nbin
30   - do ii=1,nfreq
31   - if (E(n,j,ii).lt.0) then
32   - E(n,j,ii)=0
33   - end if
34   - end do
35   - end do
36   -
  7 + double precision, allocatable :: diffF(:),diffl(:),diffr(:),phi(:),theta(:)
  8 + double precision, allocatable :: F(:),diff1(:)
  9 +
  10 +
  11 + allocate(diffl(nbin))
  12 + allocate(diffr(nbin))
  13 + allocate(diffF(nbin))
  14 + allocate(theta(nbin))
  15 + allocate(phi(nbin))
  16 + allocate(F(nbin))
  17 + allocate(diff1(nbin-1))
  18 +
  19 +
  20 + do i=2,nbin
  21 + diffl(i)=E(n-1,i,ii)-E(n-1,i-1,ii)
  22 + end do
  23 +
  24 + do i=1,nbin-1
  25 + diffr(i)=E(n-1,i+1,ii)-E(n-1,i,ii)
  26 + end do
  27 + diffr(nbin)=-E(n-1,nbin,ii)
  28 + diffl(1)=E(n-1,1,ii)
  29 +
  30 +
  31 + do i=1,nbin
  32 + theta(i)=diffl(i)/(diffr(i)+3e-14)
  33 + phi(i)=max(0d0,min(theta(i)*2,1d0),min(theta(i),2d0))
  34 + end do
  35 +
  36 +
  37 + F=E(n-1,1:nbin,ii)+0.5*(1-CN(ii))*diffr*phi
  38 + do i=2,nbin
  39 + diffF(i)=F(i)-F(i-1)
  40 + end do
  41 + diffF(1)=F(1)
  42 + E(n,1:nbin,ii)=E(n-1,1:nbin,ii)-CN(ii)*diffF
  43 +
  44 +
37 45  
38 46 end subroutine advection
  47 +
  48 +
  49 +
  50 +
  51 +
  52 +
  53 +
  54 +
  55 +
  56 +
  57 +
  58 +
  59 +
  60 +
  61 +
  62 +
... ...
src/advection.o 0 → 100644
No preview for this file type
src/attenuation.o 0 → 100644
No preview for this file type
src/floe_breaking.o 0 → 100644
No preview for this file type
src/fsd_build.f90
... ... @@ -8,9 +8,10 @@ use parameters
8 8 Dave(i)=Dmin
9 9 elseif (Dmax(i).eq.D0) then
10 10 Dave(i)=Dmax(i)
11   - else
  11 + elseif (FSD_scheme.eq.1) then
12 12 coeff=1/((1/(1-gam))*(Dmax(i)**(1-gam)-Dmin**(1-gam)))
13 13 Dave(i)=coeff*(1/(2-gam))*(Dmax(i)**(2-gam)-Dmin**(2-gam))
  14 +
14 15 end if
15 16  
16 17  
... ...
src/fsd_build.o 0 → 100644
No preview for this file type
src/initialization.f90
... ... @@ -11,7 +11,7 @@ implicit none
11 11  
12 12  
13 13 !_________________________INITIAL SPECTRUM_____________________________
14   - E(1,1:nbin,1:nfreq)=0
  14 + E(1:nsteps,1:nbin,1:nfreq)=0d0
15 15  
16 16 !build JONSWAP spectrum
17 17  
... ...
src/initialization.o 0 → 100644
No preview for this file type
src/main.f90
... ... @@ -19,31 +19,27 @@ PROGRAM WIM2
19 19 do n=2,nsteps
20 20  
21 21 call progress(n,nsteps)
22   -
  22 + do ii=1,nfreq
  23 + call advection
  24 + end do
  25 +
23 26 do i=2,nbin
24   - call advection
25   - !call attenuation
26   - !call floe_breaking
27   - !call fsd_build
  27 +
  28 + call attenuation
  29 + call floe_breaking
  30 + call fsd_build
28 31 end do
29 32 end do
30 33 !______________________OUTPUTS_________________________
31   - root='output/'
32 34 spectrum=trim(root)//'Energy_spectrum.dat'
33 35 floe_size=trim(root)//'floe_size.dat'
34   -
  36 + namefile=trim(root)//trim(name_sim)//'.nc'
35 37  
36 38 open(10,file=spectrum)
37 39 open(11,file=floe_size)
38 40  
39   - !call write_output
40   - do i=1,nbin
41   - !do j=1,nsteps
42   - write(10,*)E(nsteps,i,1:nfreq)
43   - !end do
44   - write(11,*)Dave(i),Dmax(i)
45   - end do
46   -
  41 + call write_output
  42 +
47 43 close(10)
48 44 close(11)
49 45  
... ...
src/main.o 0 → 100644
No preview for this file type
src/makefile
... ... @@ -2,9 +2,9 @@ COMPILER= gfortran
2 2  
3 3 OPTION= -O3
4 4  
5   -
6   -NETCDFinc= -I/usr/local/include
7   -NETCDFLIB= -L/usr/local/lib -lnetcdf
  5 +NETCDFinc=-I/usr/include
  6 +NETCDFLIB=-L/usr/lib64 -lnetcdff
  7 +NETCDFMOD=-I/usr/lib64/gfortran/modules
8 8  
9 9 OBJ= *.o
10 10  
... ... @@ -17,7 +17,7 @@ EXEC= WIM2
17 17  
18 18  
19 19 WIM2: $(OBJ)
20   - $(COMPILER) $(OPTION) $(NETCDFinc) -o $(EXEC) $(OBJ) $(NETCDFLIB)
  20 + $(COMPILER) $(OPTION) $(NETCDFinc) $(NETCDFMOD) -o $(EXEC) $(OBJ) $(NETCDFLIB)
21 21 mv WIM2 ../
22 22  
23 23  
... ... @@ -26,7 +26,7 @@ $(MOD): parameters.f90
26 26  
27 27  
28 28 $(OBJ): $(SRC) $(MOD)
29   - $(COMPILER) $(NETCDFinc) -c $(SRC) $(NETCDFLIB)
  29 + $(COMPILER) $(NETCDFinc) $(NETCDFMOD) -c $(SRC) $(NETCDFLIB)
30 30  
31 31  
32 32 clean:
... ...
src/parameters.f90
... ... @@ -3,8 +3,8 @@ module parameters
3 3 implicit none
4 4  
5 5 !__________________name of files__________________
6   - character(len=100) ::root,spectrum,floe_size
7   -
  6 + character(len=100) ::root='output/',spectrum,floe_size,name_sim='test'
  7 + character(len=100) ::namefile
8 8 !______________dummys_____________________________
9 9 integer :: i,ii,n,j,jj
10 10 !______________global parameters__________________
... ... @@ -17,6 +17,7 @@ implicit none
17 17 double precision :: alpha_s=8.1e-3,beta_s=1.25
18 18 double precision :: Tmin=2.5,Tmax=20,Tm=6,Hs=1
19 19 double precision :: gamma_s=3.3,freq_s,domega
  20 + double precision, allocatable :: x_axis(:),time(:)
20 21 !____________waves_________________________________
21 22 double precision, allocatable ::wl(:),Cp(:),Cg(:),CN(:)
22 23 integer ::disp=0
... ... @@ -37,7 +38,8 @@ implicit none
37 38 double precision :: gam=2
38 39 double precision :: Dmin=20
39 40  
40   -
  41 +!_________model parameters____________________________
  42 + integer :: FSD_scheme=1
41 43  
42 44  
43 45  
... ... @@ -48,7 +50,7 @@ subroutine read_namelist
48 50  
49 51 namelist /spectrum_parameters/ nfreq,alpha_s, &
50 52 beta_s,Tmin,Tmax,gamma_s
51   - namelist /model_parameter/ nbin,dx,Cfl
  53 + namelist /model_parameter/ nbin,dx,Cfl,name_sim,root,FSD_scheme
52 54 namelist /waves_parameters/ Tm,Hs,disp
53 55 namelist /ice_parameters/ cice,hice,D0,gam,Dmin
54 56  
... ... @@ -93,6 +95,8 @@ allocate(alpha(nbin,nfreq))
93 95 allocate(h(nbin))
94 96 allocate(C_ice(nbin))
95 97 allocate(S_ice(nbin,nfreq))
  98 +allocate(x_axis(nbin))
  99 +
96 100  
97 101  
98 102  
... ... @@ -114,7 +118,10 @@ allocate(S_ice(nbin,nfreq))
114 118 if (disp.eq.0) then
115 119 CN=Cfl
116 120 Cg=maxval(Cg)
117   - dt=CN(1)*dx/maxval(Cg)
  121 + dt=CN(1)*dx/maxval(Cg)
  122 + else
  123 + dt=dx/maxval(Cg)
  124 + CN=Cg*dt/dx
118 125 end if
119 126  
120 127  
... ... @@ -130,12 +137,25 @@ allocate(S_ice(nbin,nfreq))
130 137 allocate(E(nsteps,nbin,nfreq))
131 138 allocate(Dmax(nbin))
132 139 allocate(Dave(nbin))
  140 +allocate(time(nsteps))
133 141  
134 142 Dmax=D0
135 143 Dave=D0
136 144 Dmax(1)=0
137 145 Dave(1)=0
138 146  
  147 + time(1)=0
  148 + do ii=2,nsteps
  149 + time(ii)=time(ii-1)+dt/60
  150 + end do
  151 + x_axis(1)=0
  152 + do ii=2,nbin
  153 + x_axis(ii)=x_axis(ii-1)+dx/1000
  154 + end do
  155 +
  156 +
  157 +
  158 +
139 159 end subroutine array_allocation
140 160  
141 161  
... ...
src/parameters.mod 0 → 100644
... ... @@ -0,0 +1,191 @@
  1 +GFORTRAN module version '0' created from parameters.f90 on Mon Oct 5 10:51:18 2015
  2 +MD5:2945bfc901545c55dde121545c48b899 -- If you edit this, you'll get what you deserve.
  3 +
  4 +(() () () () () () () () () () () () () () () () () () () () () () () ()
  5 +() () ())
  6 +
  7 +()
  8 +
  9 +()
  10 +
  11 +()
  12 +
  13 +()