主题:fortran 读写dat文件
急求大神,这边有一个复杂的文件需要Fortran程序读入和输出,要求把里面的参数进行赋值,因为比较复杂,不知如何下手,请大神指导。下面是文件内容
*Horizon |============GENERAL SYSTEM DATA================| | NP NRSP NNODE IPRINT IUNITS DURATION KPCHAR IOUT INITSS| 17 1 -20 60 5 30 1 0 1 | ALIN FRICTN AITER TOLVAR AFAC VAPCAV VAPHED FTEMP 0 'HW' 0 0.0002 0.15 0 0.24 | NXPLOT NTPLOT PLOT3D EGYPLT 41 41 'TPLOT' 'DEFAULT' | IEPRNT IECALC NEGY NTFC ...... TFC(I) ...... PHILMT TAULMT 10 0 0 0 0.02 0.01 |======================== NODE DATA ==============================| OUT OF | NODE ID ELEVATION NODE HGL CONSUMPTION BALANCE | (ft) (ft) (MGD) (MGD) 94 2349.200 2365.050 32.8202591 0.000000 4048 2357.000 2365.131 -32.8117294 0.000000 4046 2357.000 2530.872 32.8200989 0.000000 4044 2357.000 2530.896 0.0000000 0.000000 4042 2336.000 2531.821 0.0000000 0.000000 4040 2132.000 2535.251 0.0000000 0.000000 4038 2042.000 2539.722 6.0000000 0.000000 4036 1944.000 2542.220 0.0000000 0.000000 4034 1903.790 2543.143 0.0000000 0.000000 4032 2067.400 2549.041 0.0000000 0.000000 4030 2105.500 2550.681 0.0000000 0.000000 4028 2050.920 2552.343 0.0000000 0.000000 4026 2119.800 2556.878 -193.0000153 0.000000 4060 2362.800 2530.856 0.0000000 0.000000 4062 2394.000 2530.256 13.0000000 0.000000 4072 2208.780 2514.922 45.0000000 0.000000 4080 2220.000 2504.807 0.0000000 0.000000 4082 2400.000 2499.846 96.1731873 0.000000 4084 2400.000 2421.996 -96.1726913 0.000000 96 2404.600 2421.953 96.1973114 0.000000 |================== PIPE DATA ===================| | GLOBAL LEAK LEAK DAMPING START STOP | TYPE RATE FRICTION DAMP DAMP 'NONE' 0.000000 0.000 0.00 0.00 | PIPE U/S D/S FLOW LENGTH DIA WAVE VEL. PIPE LEAK | INPUT | NO NODE NODE (MGD) (ft) (in) (ft/s) coefficient RATE | WAVESP 4054 4048 94 32.8117294 265.0 60.000 3313.9 135.000000 4048 4044 4046 32.8200989 80.0 60.000 3500.0 135.000000 4046 4042 4044 186.9928741 2033.7 108.000 3489.4 135.000000 4044 4040 4042 187.0047607 7917.3 108.000 3500.0 135.000000 4042 4038 4040 187.0007935 10306.1 108.000 3509.0 135.000000 4040 4036 4038 193.0063782 5395.9 108.000 3497.9 135.000000 4038 4034 4036 193.0279694 2049.4 108.000 3516.8 135.000000 4036 4032 4034 193.0131073 12662.1 108.000 3495.4 135.000000 4034 4030 4032 193.0096588 3617.2 108.000 3478.3 135.000000 4032 4028 4030 192.9989471 3400.4 108.000 3500.9 135.000000 4030 4026 4028 192.9999237 10062.2 108.000 3507.8 135.000000 4056 4044 4060 154.1722107 131.1 108.000 3827.5 135.000000 4058 4060 4062 154.1661987 1106.2 96.000 3586.3 135.000000 4066 4062 4072 141.1618958 24298.7 90.000 3502.8 135.000000 4074 4072 4080 96.1729202 23312.4 84.000 3498.9 135.000000 4076 4080 4082 96.1731873 11301.4 84.000 3494.7 135.000000 4080 4084 96 96.1726913 100.1 84.000 2922.7 135.000000 |======= BOUNDARY CONDITION (DEVICE) DATA ============| 4 | Device 1 IS A PREVIL ELEMENT |Name: PRV_1 | BCTYPE NDN BCOUT 'PREVIL' 2 'OUTPUT' | NLBC (node list) 4082 4084 | XLRISE DRISE FRISE FRACL VALTYP MODTYP DELTAU1 DELTAU2 1 48 0.012 0.5 'ON/OFF' 'NONE' 0.1 0.1 | ESout ESin TAU0 TAUF TV1 TV2 10.9 10.9 1 1 0.2 0 | SET0 SET1 SET2 NST NENT MM 0 0 0 1 3 3 | Tabulated Tau Points 1.00000 1.00000 1.00000 | Device 2 IS A TURBINE UNIT |Name: Horizon_Turbine | BCTYPE NDN BCOUT 'TURB' 2 'OUTPUT' | NLBC(1) NLBC(2) (Node list) 4046 4048 | TSID 'Horizon_Turbine' | NValT Isyn Igov 0 0 1 | TTYPE TCOde KTRUN 'Adjustable WG' 1 10 | NR QR HR PR WRR Tg 900 33 171 892 835 900 | NTP 2 | PG (I) I=1,NTP 892 0 | TPG(I) I=1,NTP 0 0.1 | Device 3 IS A CONSTANT RESERVOIR |Name: 水库_1 | BCTYPE NDN BCOUT 'RCRES' 1 'OUTPUT' | NLBC (node list) 94 | ZRCRES 2365 | RIRCRES RORCRES 0 0 | Device 4 IS A CONSTANT RESERVOIR |Name: 水库_2 | BCTYPE NDN BCOUT 'RCRES' 1 'OUTPUT' | NLBC (node list) 96 | ZRCRES 2422 | RIRCRES RORCRES 0 0 |END OF PUMP DATA |============OUTPUT PATH==============| | NGPATHS | PATH NAME NOUTP PIPE PATH LIST 6 4056 4058 4066 4074 4076 4080 |============ENERGY OUTPUT PATH(S)==============| | NEP(I) PIPE PATH LIST |============NODAL TRACES==============| | NOUTN OUTPUT FOR NODES 1 4044 |===== PUMP STATION VALVES =========| | NPTAU PSNAME[1....NPTAU] 0 | NPVALV VALVE LIST (by ordinal input number) | End of Data File