function writetofilecfg(OPT, outpath, pfstring) fid = fopen([outpath '\' pfstring '.CFG'],'w'); fprintf(fid,' *******************************************************\r\n'); fprintf(fid,' * SBEACH model configuration file: %s.CFG *\r\n',pfstring); fprintf(fid,' *******************************************************\r\n'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % A - MODEL SETUP fprintf(fid,'A---------------------------- MODEL SETUP -------------------------------A\r\n'); fprintf(fid,'A.1 RUN TITLE: TITLE\r\n'); fprintf(fid,' %s\r\n',pfstring); fprintf(fid,'A.2 INPUT UNITS (SI=1, AMERICAN CUST.=2): UNITS\r\n'); fprintf(fid,' %d\r\n',OPT.UNITS); fprintf(fid,'A.3 TOTAL NUMBER OF CALCULATION CELLS AND POSITION OF LANDWARD BOUNDARY\r\n'); fprintf(fid,' RELATIVE TO INITIAL PROFILE: NDX, XSTART\r\n'); fprintf(fid,' %d %d\r\n',OPT.NDX,OPT.XSTART); fprintf(fid,'A.4 GRID TYPE (CONSTANT=0, VARIABLE=1): IDX\r\n'); fprintf(fid,' %d\r\n',OPT.IDX); fprintf(fid,'A.5 COMMENT: IF GRID TYPE IS VARIABLE, CONTINUE TO A.8\r\n'); fprintf(fid,'A.6 CONSTANT GRID CELL WIDTH: DXC\r\n'); fprintf(fid,' %d\r\n',OPT.DXC); fprintf(fid,'A.7 COMMENT: IF GRID TYPE IS CONSTANT CONTINUE TO A.10\r\n'); fprintf(fid,'A.8 NUMBER OF DIFFERENT GRID CELL REGIONS: NGRID\r\n'); fprintf(fid,' %d\r\n',OPT.NGRID); fprintf(fid,'A.9 GRID CELL WIDTHS AND NUMBER OF CELLS IN EACH REGION FROM LANDWARD\r\n'); fprintf(fid,' TO SEAWARD BOUNDARY: (DXV(I), NDXV(I), I=1,NGRID)\r\n'); for ii = 1:length(OPT.NGRID) fprintf(fid,' %d %d',OPT.DXV(ii),OPT.NDXV(ii)); end fprintf(fid,'\r\n'); fprintf(fid,'A.10 NUMBER OF TIME STEPS AND VALUE OF TIME STEP IN MINUTES: NDT,DT\r\n'); fprintf(fid,' %d %d\r\n',OPT.NDT,OPT.DT); fprintf(fid,'A.11 NUMBER OF TIME STEP(S) INTERMEDIATE OUTPUT IS WANTED: NWR\r\n'); fprintf(fid,' %d\r\n',OPT.NWR); fprintf(fid,'A.12 TIME STEPS OF INTERMEDIATE OUTPUT: (WRI(I), I=1,NWR)\r\n'); for ii = 1:length(OPT.NWR) fprintf(fid,' %d',OPT.WRI(ii)); end fprintf(fid,'\r\n'); fprintf(fid,'A.13 IS A MEASURED PROFILE AVAILABLE FOR COMPARISON? (NO=0, YES=1): ICOMP\r\n'); fprintf(fid,' %d\r\n',OPT.ICOMP); fprintf(fid,'A.14 THREE PROFILE ELEVATION CONTOURS (MAXIMUM HORIZONTAL RECESSION OF EACH\r\n'); fprintf(fid,' WILL BE DETERMINED): ELV1, ELV2, ELV3\r\n'); fprintf(fid,' %.2f %.2f %.2f\r\n',OPT.ELV1,OPT.ELV2,OPT.ELV3); fprintf(fid,'A.15 THREE PROFILE EROSION DEPTHS AND REFERENCE ELEVATION (DISTANCE FROM\r\n'); fprintf(fid,' POSITION OF REFERENCE ELEVATION ON INITIAL PROFILE TO POSITION OF\r\n'); fprintf(fid,' LANDWARD MOST OCCURENCE OF EACH EROSION DEPTH WILL BE DETERMINED\r\n'); fprintf(fid,' EDP1, EDP2, EDP3, REFELV\r\n'); fprintf(fid,' %.2f %.2f %.2f %.2f\r\n',OPT.EDP1,OPT.EDP2,OPT.EDP3,OPT.REFELV); fprintf(fid,'A.16 TRANSPORT RATE COEFFICIENT (m^4/N): K\r\n'); fprintf(fid,' %.3e\r\n',OPT.K); fprintf(fid,'A.17 COEFFICIENT FOR SLOPE-DEPENDENT TERM (m^2/s): EPS\r\n'); fprintf(fid,' %.3f\r\n',OPT.EPS); fprintf(fid,'A.18 TRANSPORT RATE DECAY COEFFICIENT MULTIPLIER: LAMM\r\n'); fprintf(fid,' %.3f\r\n',OPT.LAMM); fprintf(fid,'A.19 WATER TEMPERATURE IN DEGREES C: TEMPC\r\n'); fprintf(fid,' %.2f\r\n',OPT.TEMPC); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % B - WAVES/WATER ELEVATION/WIND fprintf(fid,'B---------------------- WAVES/WATER ELEVATION/WIND -----------------------B\r\n'); fprintf(fid,'B.1 WAVE TYPE (MONOCHROMATIC=1, IRREGULAR=2): WVTYPE\r\n'); fprintf(fid,' %d\r\n',OPT.WVTYPE); fprintf(fid,'B.2 WAVE HEIGHT AND PERIOD INPUT (CONSTANT=0, VARIABLE=1): IWAVE\r\n'); fprintf(fid,' %d\r\n',OPT.IWAVE); fprintf(fid,'B.3 COMMENT: IF WAVE HEIGHT AND PERIOD ARE VARIABLE, CONTINUE TO B.6\r\n'); fprintf(fid,'B.4 CONSTANT WAVE HEIGHT AND PERIOD: HIN, T\r\n'); fprintf(fid,' %.3f %.3f\r\n',OPT.HIN,OPT.T); fprintf(fid,'B.5 COMMENT: IF WAVE HEIGHT AND PERIOD ARE CONSTANT, CONTINUE TO B.7\r\n'); fprintf(fid,'B.6 TIME STEP OF VARIABLE WAVE HEIGHT AND PERIOD INPUT IN MINUTES: DTWAV\r\n'); fprintf(fid,' %.2f\r\n',OPT.DTWAV); fprintf(fid,'B.7 WAVE ANGLE INPUT (CONSTANT=0, VARIABLE=1): IANG\r\n'); fprintf(fid,' %d\r\n',OPT.IANG); fprintf(fid,'B.8 COMMENT: IF WAVE ANGLE IS VARIABLE, CONTINUE TO B.11\r\n'); fprintf(fid,'B.9 CONSTANT WAVE ANGLE: ZIN\r\n'); fprintf(fid,' %.3f\r\n',OPT.ZIN); fprintf(fid,'B.10 COMMENT: IF WAVE ANGLE IS CONSTANT, CONTINUE TO B.12\r\n'); fprintf(fid,'B.11 TIME STEP OF VARIABLE WAVE ANGLE INPUT IN MINUTES: DTANG\r\n'); fprintf(fid,' %.2f\r\n',OPT.DTANG); fprintf(fid,'B.12 WATER DEPTH OF INPUT WAVES (DEEPWATER=0): DMEAS\r\n'); fprintf(fid,' %d\r\n',OPT.DMEAS); fprintf(fid,'B.13 IS RANDOMIZATION OF WAVE HEIGHT DESIRED? (NO=0, YES=1): IRAND\r\n'); fprintf(fid,' %d\r\n',OPT.IRAND); fprintf(fid,'B.14 COMMENT: IF RANDOMIZATION OF WAVE HEIGHT IS NOT DESIRED, CONTINUE TO B.16\r\n'); fprintf(fid,'B.15 SEED VALUE FOR RANDOMIZER AND PERCENT OF VARIABILITY: ISEED, RPERC\r\n'); fprintf(fid,' %d %.2f\r\n',OPT.ISEED,OPT.RPERC); fprintf(fid,'B.16 TOTAL WATER ELEVATION INPUT (CONSTANT=0, VARIABLE=1): IELEV\r\n'); fprintf(fid,' %d\r\n',OPT.IELEV); fprintf(fid,'B.17 COMMENT: IF WATER ELEVATION IS VARIABLE CONTINUE TO B.20\r\n'); fprintf(fid,'B.18 CONSTANT TOTAL WATER ELEVATION: TELEV\r\n'); fprintf(fid,' %.3f\r\n',OPT.TELEV); fprintf(fid,'B.19 COMMENT: IF WATER ELEVATION IS CONSTANT, CONTINUE TO B.21\r\n'); fprintf(fid,'B.20 TIME STEP OF VARIABLE TOTAL WATER ELEVATION INPUT IN MINUTES: DTELV\r\n'); fprintf(fid,' %.2f\r\n',OPT.DTELV); fprintf(fid,'B.21 WIND SPEED AND ANGLE INPUT (CONSTANT=0, VARIABLE=1): IWIND\r\n'); fprintf(fid,' %d\r\n',OPT.IWIND); fprintf(fid,'B.22 COMMENT: IF WIND SPEED AND ANGLE ARE VARIABLE, CONTINUE TO B.25\r\n'); fprintf(fid,'B.23 CONSTANT WIND SPEED AND ANGLE: W,ZWIND\r\n'); fprintf(fid,' %.3f %.3f\r\n',OPT.W,OPT.ZWIND); fprintf(fid,'B.24 COMMENT: IF WIND SPEED AND ANGLE ARE CONSTANT, CONTINUE TO C.\r\n'); fprintf(fid,'B.25 TIME STEP OF VARIABLE WIND SPEED AND ANGLE INPUT IN MINUTES: DTWND\r\n'); fprintf(fid,' %.2f\r\n',OPT.DTWND); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % C - BEACH fprintf(fid,'C------------------------------- BEACH ----------------------------------C\r\n'); fprintf(fid,'C.1 TYPE OF INPUT PROFILE (ARBITRARY=1, SCHEMATIZED=2): TPIN\r\n'); fprintf(fid,' %d\r\n',OPT.TPIN); fprintf(fid,'C.2 COMMENT: IF PROFILE TYPE IS ARBITRARY CONTINUE TO C.4\r\n'); fprintf(fid,'C.3 LOCATION AND ELEVATION OF LANDWARD BOUNDARY, LANDWARD BASE OF DUNE,\r\n'); fprintf(fid,' LANDWARD CREST OF DUNE, SEAWARD CREST OF DUNE, START OF BERM,\r\n'); fprintf(fid,' END OF BERM, AND FORESHORE: XLAND,DLAND,XLBDUNE,DLBDUNE,XLCDUNE,DLCDUNE,\r\n'); fprintf(fid,' XSCDUNE,DSCDUNE,XBERMS,DBERMS,XBERME,DBERME,XFORS,DFORS\r\n'); fprintf(fid,' %d %d %d %d %d %d\r\n',OPT.XLAND,OPT.DLAND,OPT.XLBDUNE,OPT.DLBDUNE,OPT.XLCDUNE,OPT.DLCDUNE); fprintf(fid,' %d %d %d %d %d %d %d %d\r\n',OPT.XSCDUNE,OPT.DSCDUNE,OPT.XBERMS,OPT.DBERMS,OPT.XBERME,OPT.DBERME,OPT.XFORS,OPT.DFORS); fprintf(fid,'C.4 DEPTH CORRESPONDING TO LANDWARD END OF SURF ZONE: DFS\r\n'); fprintf(fid,' %.3f\r\n',OPT.DFS); fprintf(fid,'C.5 EFFECTIVE GRAIN SIZE DIAMETER IN MILLIMETERS: D50\r\n'); fprintf(fid,' %.3f\r\n',OPT.D50); fprintf(fid,'C.6 MAXIMUM PROFILE SLOPE PRIOR TO AVALANCHING IN DEGREES: BMAX\r\n'); fprintf(fid,' %.3f\r\n',OPT.BMAX); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % D - BEACH FILL fprintf(fid,'D------------------------------ BEACH FILL --------------------------------D\r\n'); fprintf(fid,'D.1 IS A BEACH FILL PRESENT? (NO=0, YES=1): IBCHFILL\r\n'); fprintf(fid,' %d\r\n',OPT.IBCHFILL); fprintf(fid,'D.2 COMMENT: IF NO BEACH FILL, CONTINUE TO E.\r\n'); fprintf(fid,'D.3 POSITION OF START AND END OF BEACH FILL RELATIVE\r\n'); fprintf(fid,' TO INITIAL PROFILE: XBFS, XBFE\r\n'); fprintf(fid,' %.2f %.2f\r\n',OPT.XBFS,OPT.XBFE); fprintf(fid,'D.4 NUMBER OF REPRESENTATIVE POINTS BETWEEN START\r\n'); fprintf(fid,'AND END OF BEACH FILL: NFILL\r\n'); fprintf(fid,' %d\r\n',OPT.NFILL); fprintf(fid,'D.5 LOCATION AND ELEVATION OF REPRESENTATIVE POINTS RELATIVE TO THE\r\n'); fprintf(fid,'INITIAL PROFILE: (XF(I), EFILL(I), I=1,NFILL)\r\n'); for ii = 1:length(OPT.NFILL) if isempty(OPT.XF) fprintf(fid,'\r\n'); else fprintf(fid,' %.2f %.2f',OPT.XF(ii),OPT.EFILL(ii)); end end fprintf(fid,'\r\n'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % E - SEAWALL/REVETMENT fprintf(fid,'E--------------------------- SEAWALL/REVETMENT ----------------------------E\r\n'); fprintf(fid,'E.1 IS A SEAWALL PRESENT? (NO=0, YES=1): ISWALL\r\n'); fprintf(fid,' %d\r\n',OPT.ISWALL); fprintf(fid,'E.2 COMMENT: IF NO SEAWALL, CONTINUE TO F.\r\n'); fprintf(fid,'E.3 LOCATION OF SEAWALL RELATIVE TO INITIAL PROFILE: XSWALL\r\n'); fprintf(fid,' %.2F\r\n',OPT.XSWALL); fprintf(fid,'E.4 IS SEAWALL ALLOWED TO FAIL? (NO=0, YES =1): ISWFAIL\r\n'); fprintf(fid,' %d\r\n',OPT.ISWFAIL); fprintf(fid,'E.5 COMMENT: IF NO SEAWALL FAILURE, CONTINUE TO F.\r\n'); fprintf(fid,'E.6 PROFILE ELEVATION AT SEAWALL WHICH CAUSES FAILURE, TOTAL WATER ELEVATION\r\n'); fprintf(fid,' AT SEAWALL WHICH CAUSES FAILURE, AND WAVE HEIGHT AT SEAWALL WHICH CAUSES\r\n'); fprintf(fid,' FAILURE: PEFAIL, WEFAIL,HFAIL\r\n'); fprintf(fid,' %.2f %.2f %.2f\r\n',OPT.PEFAIL,OPT.WEFAIL,OPT.HFAIL); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % F - HARD BOTTOM fprintf(fid,'F------------------------------ HARD BOTTOM -----------------------------F\r\n'); fprintf(fid,'F.1 IS A HARD BOTTOM PRESENT? (NO=0, YES=1): IHBOT\r\n'); fprintf(fid,' %d\r\n',OPT.IHBOT); fprintf(fid,'F.2 COEFFICIENT FOR TRANSPORT GROWTH DOWNDRIFT EXPOSED HARD BOTTOM: SCF\r\n'); fprintf(fid,' %.2f\r\n',OPT.SCF); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% fprintf(fid,'----------------------------------- END ------------------------------------\r\n'); fclose(fid); end