-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader_write.f90
559 lines (514 loc) · 24.4 KB
/
header_write.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
subroutine header_write
use basin_module
use aquifer_module
use channel_module
use reservoir_module
use hydrograph_module
use sd_channel_module
use maximum_data_module
use calibration_data_module
implicit none
if (pco%fdcout == "y") then
open (6000,file="flow_duration_curve.out", recl=800)
write (6000,*) bsn%name, prog
write (6000,*) fdc_hdr
write (9000,*) "FDC flow_duration_curve.out"
end if
!! hru-out.cal - hru soft calibration output including soft and predicted budgets and
!! calibration parameter adjustments
if (cal_soft == "y") then
open (4999,file="hru-out.cal", recl = 800)
write (4999,*) bsn%name, prog
write (4999,*) calb_hdr
write (9000,*) "HRU_SOFT_CALIB_OUT hru-out.cal"
end if
!!!!!! hru-new.cal - hru soft calibration output file. The same format as calibration.upd and
!!!!!! can be used as input (calibration.upd) in subsequent simulations
if (cal_codes%hyd_hru /= "n") then
open (5000,file="hru-new.cal", recl = 800)
! write (5000,*) " calibration.upd_developed_from_soft_data_calibration"
! write (9000,*) "HRU SOFT OUT CALIB hru-new.cal"
! write (5000,*) calb3_hdr
end if
if (cal_codes%hyd_hru /= "n" .or. cal_codes%plt == "y") then
open (5001,file="hydrology-cal.hyd", recl = 800)
! write (5000,*) " calibration.upd_developed_from_soft_data_calibration"
! write (9000,*) "HRU SOFT OUT CALIB hru-new.cal"
! write (5000,*) calb3_hdr
end if
!!!!!! hru-lte-out.cal - hru lte soft calibration output including soft and predicted budgets and
!!!!!! calibration parameter adjustments
!open (5003,file="hru-lte-out.cal", recl = 800)
!write (9000,*) "LTE SOFT OUT CALIB hru-lte-out.cal"
!write (5003,*) calb_hdr
!!!!!! hru-lte-new.cal - hru lte soft calibration output file. The same format as hru-lte.hru and
!!!!!! can be used as input (hru-lte.hru) in subsequent simulations
!open (5002,file="hru-lte-new.cal", recl = 800)
!write (9000,*) "LTE SOFT CAL INPUT hru-lte-new.cal"
!write (5002,*) calb2_hdr
!! BASIN AQUIFER OUTPUT
if (pco%aqu_bsn%d == "y") then
open (2090,file="basin_aqu_day.txt", recl = 1500)
write (2090,*) bsn%name, prog
write (2090,*) aqu_hdr
write (2090,*) aqu_hdr_units
write (9000,*) "BASIN_AQUIFER basin_aqu_day.txt"
if (pco%csvout == "y") then
open (2094,file="basin_aqu_day.csv", recl = 1500)
write (2094,*) bsn%name, prog
write (2094,'(*(G0.3,:","))') aqu_hdr
write (2094,'(*(G0.3,:","))') aqu_hdr_units
write (9000,*) "BASIN_AQUIFER basin_aqu_day.csv"
end if
endif
if (pco%aqu_bsn%m == "y") then
open (2091,file="basin_aqu_mon.txt",recl = 1500)
write (2091,*) bsn%name, prog
write (2091,*) aqu_hdr
write (2091,*) aqu_hdr_units
write (9000,*) "BASIN_AQUIFER basin_aqu_mon.txt"
if (pco%csvout == "y") then
open (2095,file="basin_aqu_mon.csv",recl = 1500)
write (2095,*) bsn%name, prog
write (2095,'(*(G0.3,:","))') aqu_hdr
write (2095,'(*(G0.3,:","))') aqu_hdr_units
write (9000,*) "BASIN_AQUIFER basin_aqu_mon.csv"
end if
end if
if (pco%aqu_bsn%y == "y") then
open (2092,file="basin_aqu_yr.txt",recl = 1500)
write (2092,*) bsn%name, prog
write (2092,*) aqu_hdr
write (2092,*) aqu_hdr_units
write (9000,*) "BASIN_AQUIFER basin_aqu_yr.txt"
if (pco%csvout == "y") then
open (2096,file="basin_aqu_yr.csv",recl = 1500)
write (2096,*) bsn%name, prog
write (2096,'(*(G0.3,:","))') aqu_hdr
write (2096,'(*(G0.3,:","))') aqu_hdr_units
write (9000,*) "BASIN_AQUIFER basin_aqu_yr.csv"
end if
end if
if (pco%aqu_bsn%a == "y") then
open (2093,file="basin_aqu_aa.txt",recl = 1500)
write (2093,*) bsn%name, prog
write (2093,*) aqu_hdr
write (2093,*) aqu_hdr_units
write (9000,*) "BASIN_AQUIFER basin_aqu_aa.txt"
if (pco%csvout == "y") then
open (2097,file="basin_aqu_aa.csv",recl = 1500)
write (2097,*) bsn%name, prog
write (2097,'(*(G0.3,:","))') aqu_hdr
write (2097,'(*(G0.3,:","))') aqu_hdr_units
write (9000,*) "BASIN_AQUIFER basin_aqu_aa.csv"
end if
end if
!! BASIN AQUIFER OUTPUT
!! BASIN RESERVOIR OUTPUT
if (pco%res_bsn%d == "y") then
open (2100,file="basin_res_day.txt", recl = 1500)
write (2100,*) bsn%name, prog
write (2100,*) ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (2100,*) ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units3, hyd_hdr_units3
write (9000,*) "BASIN_RESERVOIR basin_res_day.txt"
if (pco%csvout == "y") then
open (2104,file="basin_res_day.csv", recl = 1500)
write (2104,*) bsn%name, prog
write (2104,'(*(G0.3,:","))') ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (2104,'(*(G0.3,:","))') ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units3, hyd_hdr_units3
write (9000,*) "BASIN_RESERVOIR basin_res_day.csv"
end if
endif
if (pco%res_bsn%m == "y") then
open (2101,file="basin_res_mon.txt",recl = 1500)
write (2101,*) bsn%name, prog
write (2101,*) ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (2101,*) ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units3, hyd_hdr_units3
write (9000,*) "BASIN_RESERVOIR basin_res_mon.txt"
if (pco%csvout == "y") then
open (2105,file="basin_res_mon.csv",recl = 1500)
write (2105,*) bsn%name, prog
write (2105,'(*(G0.3,:","))') ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (2105,'(*(G0.3,:","))') ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units3, hyd_hdr_units3
write (9000,*) "BASIN_RESERVOIR basin_res_mon.csv"
end if
end if
if (pco%res_bsn%y == "y") then
open (2102,file="basin_res_yr.txt", recl = 1500)
write (2102,*) bsn%name, prog
write (2102,*) ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (2102,*) ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units3, hyd_hdr_units3
write (9000,*) "BASIN_RESERVOIR basin_res_yr.txt"
if (pco%csvout == "y") then
open (2106,file="basin_res_yr.csv", recl = 1500)
write (2106,*) bsn%name, prog
write (2106,'(*(G0.3,:","))') ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (2106,'(*(G0.3,:","))') ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units3, hyd_hdr_units3
write (9000,*) "BASIN_RESERVOIR basin_res_yr.txt"
end if
endif
if (pco%res_bsn%a == "y") then
open (2103,file="basin_res_aa.txt",recl = 1500)
write (2103,*) bsn%name, prog
write (2103,*) ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (2103,*) ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units3, hyd_hdr_units3
write (9000,*) "BASIN_RESERVOIR basin_res_aa.txt"
if (pco%csvout == "y") then
open (2107,file="basin_res_aa.csv",recl = 1500)
write (2107,*) bsn%name, prog
write (2107,'(*(G0.3,:","))') ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (2107,'(*(G0.3,:","))') ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units3, hyd_hdr_units3
write (9000,*) "BASIN_RESERVOIR basin_res_aa.csv"
end if
end if
!! BASIN RESERVOIR OUTPUT
!! RECALL OUTPUT
if (pco%recall%d == "y") then
open (4600,file="recall_day.txt", recl = 1500)
write (4600,*) bsn%name, prog
write (4600,*) hyd_hdr_time, hyd_hdr
write (4600,*) hyd_hdr_units
write (9000,*) "RECALL recall_day.txt"
if (pco%csvout == "y") then
open (4604,file="recall_day.csv", recl = 1500)
write (4604,*) bsn%name, prog
write (4604,'(*(G0.3,:","))') hyd_hdr_time, hyd_hdr
write (4604,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "RECALL recall_day.csv"
end if
endif
if (pco%recall%m == "y") then
open (4601,file="recall_mon.txt",recl = 1500)
write (4601,*) bsn%name, prog
write (4601,*) hyd_hdr_time, hyd_hdr
write (4601,*) hyd_hdr_units
write (9000,*) "RECALL recall_mon.txt"
if (pco%csvout == "y") then
open (4605,file="recall_mon.csv",recl = 1500)
write (4605,*) bsn%name, prog
write (4605,'(*(G0.3,:","))') hyd_hdr_time, hyd_hdr
write (4605,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "RECALL recall_mon.csv"
end if
end if
if (pco%recall%y == "y") then
open (4602,file="recall_yr.txt", recl = 1500)
write (4602,*) bsn%name, prog
write (4602,*) hyd_hdr_time, hyd_hdr
write (4602,*) hyd_hdr_units
write (9000,*) "RECALL recall_yr.txt"
if (pco%csvout == "y") then
open (4606,file="recall_yr.csv", recl = 1500)
write (4606,*) bsn%name, prog
write (4606,'(*(G0.3,:","))') hyd_hdr_time, hyd_hdr
write (4606,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "RECALL recall_yr.csv"
end if
endif
if (pco%recall%a == "y") then
open (4603,file="recall_aa.txt",recl = 1500)
write (4603,*) bsn%name, prog
write (4603,*) hyd_hdr_time, hyd_hdr
write (4603,*) hyd_hdr_units
write (9000,*) "RECALL AA recall_aa.txt"
if (pco%csvout == "y") then
open (4607,file="recall_aa.csv",recl = 1500)
write (4607,*) bsn%name, prog
write (4607,'(*(G0.3,:","))') hyd_hdr_time, hyd_hdr
write (4607,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "RECALL recall_aa.csv"
end if
end if
!! RECALL OUTPUT
!! BASIN CHANNEL OUTPUT
if (pco%chan_bsn%d == "y") then
open (2110,file="basin_cha_day.txt", recl = 1500)
write (2110,*) bsn%name, prog
write (2110,*) ch_hdr
write (2110,*) ch_hdr_units
write (9000,*) "BASIN_CHANNEL basin_cha_day.txt"
if (pco%csvout == "y") then
open (2114,file="basin_cha_day.csv", recl = 1500)
write (2114,*) bsn%name, prog
write (2114,'(*(G0.3,:","))') ch_hdr
write (2114,'(*(G0.3,:","))') ch_hdr_units
write (9000,*) "BASIN_CHANNEL basin_cha_day.txt"
end if
endif
if (pco%chan_bsn%m == "y") then
open (2111,file="basin_cha_mon.txt",recl = 1500)
write (2111,*) bsn%name, prog
write (2111,*) ch_hdr
write (2111,*) ch_hdr_units
write (9000,*) "BASIN_CHANNEL basin_cha_mon.txt"
if (pco%csvout == "y") then
open (2115,file="basin_cha_mon.csv",recl = 1500)
write (2115,*) bsn%name, prog
write (2115,'(*(G0.3,:","))') ch_hdr
write (2115,'(*(G0.3,:","))') ch_hdr_units
write (9000,*) "BASIN_CHANNEL basin_cha_mon.txt"
end if
end if
if (pco%chan_bsn%y == "y") then
open (2112,file="basin_cha_yr.txt", recl = 1500)
write (2112,*) bsn%name, prog
write (2112,*) ch_hdr
write (2112,*) ch_hdr_units
write (9000,*) "BASIN_CHANNEL basin_cha_yr.txt"
if (pco%csvout == "y") then
open (2116,file="basin_cha_yr.csv", recl = 1500)
write (2116,*) bsn%name, prog
write (2116,'(*(G0.3,:","))') ch_hdr
write (2116,'(*(G0.3,:","))') ch_hdr_units
write (9000,*) "BASIN_CHANNEL basin_cha_yr.csv"
end if
endif
if (pco%chan_bsn%a == "y") then
open (2113,file="basin_cha_aa.txt",recl = 1500)
write (2113,*) bsn%name, prog
write (2113,*) ch_hdr
write (2113,*) ch_hdr_units
write (9000,*) "BASIN_CHANNEL basin_cha_aa.txt"
if (pco%csvout == "y") then
open (2117,file="basin_cha_aa.csv",recl = 1500)
write (2117,*) bsn%name, prog
write (2117,'(*(G0.3,:","))') ch_hdr
write (2117,'(*(G0.3,:","))') ch_hdr_units
write (9000,*) "BASIN_CHANNEL basin_cha_aa.csv"
end if
end if
!! BASIN CHANNEL OUTPUT
!! BASIN SWAT DEG CHANNEL OUTPUT
if (pco%sd_chan_bsn%d == "y") then
open (4900,file="basin_sd_cha_day.txt", recl = 1500)
write (4900,*) bsn%name, prog
write (4900,*) ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (4900,*) ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units1, hyd_hdr_units1
write (9000,*) "BASIN_SWAT_DEG_CHANNEL basin_sd_cha_day.txt"
if (pco%csvout == "y") then
open (4904,file="basin_sd_cha_day.csv", recl = 1500)
write (4904,*) bsn%name, prog
write (4904,'(*(G0.3,:","))') ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (4904,'(*(G0.3,:","))') ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units1, hyd_hdr_units1
write (9000,*) "BASIN_SWAT_DEG_CHANNEL basin_sd_cha_day.csv"
end if
endif
if (pco%sd_chan_bsn%m == "y") then
open (4901,file="basin_sd_cha_mon.txt",recl = 1500)
write (4901,*) bsn%name, prog
write (4901,*) ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (4901,*) ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units1, hyd_hdr_units1
write (9000,*) "BASIN_SWAT_DEG_CHANNEL basin_sd_cha_mon.txt"
if (pco%csvout == "y") then
open (4905,file="basin_sd_cha_mon.csv",recl = 1500)
write (4905,*) bsn%name, prog
write (4905,'(*(G0.3,:","))') ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (4905,'(*(G0.3,:","))') ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units1, hyd_hdr_units1
write (9000,*) "BASIN_SWAT_DEG_CHANNEL basin_sd_cha_mon.csv"
end if
end if
if (pco%sd_chan_bsn%y == "y") then
open (4902,file="basin_sd_cha_yr.txt", recl = 1500)
write (4902,*) bsn%name, prog
write (4902,*) ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (4902,*) ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units1, hyd_hdr_units1
write (9000,*) "BASIN_SWAT_DEG_CHANNEL basin_sd_cha_yr.txt"
if (pco%csvout == "y") then
open (4906,file="basin_sd_cha_yr.csv", recl = 1500)
write (4906,*) bsn%name, prog
write (4906,'(*(G0.3,:","))') ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (4906,'(*(G0.3,:","))') ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units1, hyd_hdr_units1
write (9000,*) "BASIN_SWAT_DEG_CHANNEL basin_sd_cha_yr.csv"
end if
endif
if (pco%sd_chan_bsn%a == "y") then
open (4903,file="basin_sd_cha_aa.txt",recl = 1500)
write (4903,*) bsn%name, prog
write (4903,*) ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (4903,*) ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units1, hyd_hdr_units1
write (9000,*) "BASIN_SWAT_DEG_CHANNEL basin_sd_cha_aa.txt"
if (pco%csvout == "y") then
open (4907,file="basin_sd_cha_aa.csv",recl = 1500)
write (4907,*) bsn%name, prog
write (4907,'(*(G0.3,:","))') ch_wbod_hdr, hyd_stor_hdr, hyd_in_hdr, hyd_out_hdr
write (4907,'(*(G0.3,:","))') ch_wbod_hdr_units, hyd_hdr_units3, hyd_hdr_units1, hyd_hdr_units1
write (9000,*) "BASIN_SWAT_DEG_CHANNEL basin_sd_cha_aa.csv"
end if
end if
!! BASIN SWAT DEG CHANNEL OUTPUT
!! BASIN SWAT DEG CHANNEL MORPH OUTPUT
if (pco%sd_chan_bsn%d == "y") then
open (2120,file="basin_sd_chamorph_day.txt", recl = 1500)
write (2120,*) bsn%name, prog
write (2120,*) sdch_hdr
write (2120,*) sdch_hdr_units
write (9000,*) "BASIN_SWAT_DEG_CHAN_MORPH basin_sd_chamorph_day.txt"
if (pco%csvout == "y") then
open (2124,file="basin_sd_chamorph_day.csv", recl = 1500)
write (2124,*) bsn%name, prog
write (2124,'(*(G0.3,:","))') sdch_hdr
write (2124,'(*(G0.3,:","))') sdch_hdr_units
write (9000,*) "BASIN_SWAT_DEG_CHAN_MORPH basin_sd_chamorph_day.csv"
end if
endif
if (pco%sd_chan_bsn%m == "y") then
open (2121,file="basin_sd_chamorph_mon.txt",recl = 1500)
write (2121,*) bsn%name, prog
write (2121,*) sdch_hdr
write (2121,*) sdch_hdr_units
write (9000,*) "BASIN_SWAT_DEG_CHAN_MORPH basin_sd_chamorph_mon.txt"
if (pco%csvout == "y") then
open (2125,file="basin_sd_chamorph_mon.csv",recl = 1500)
write (2125,*) bsn%name, prog
write (2125,'(*(G0.3,:","))') sdch_hdr
write (2125,'(*(G0.3,:","))') sdch_hdr_units
write (9000,*) "BASIN_SWAT_DEG_CHAN_MORPH basin_sd_chamorph_mon.csv"
end if
end if
if (pco%sd_chan_bsn%y == "y") then
open (2122,file="basin_sd_chamorph_yr.txt", recl = 1500)
write (2122,*) bsn%name, prog
write (2122,*) sdch_hdr
write (2122,*) sdch_hdr_units
write (9000,*) "BASIN_SWAT_DEG_CHAN_MORPH basin_sd_chamorph_yr.txt"
if (pco%csvout == "y") then
open (2126,file="basin_sd_chamorph_yr.csv", recl = 1500)
write (2126,*) bsn%name, prog
write (2126,'(*(G0.3,:","))') sdch_hdr
write (2126,'(*(G0.3,:","))') sdch_hdr_units
write (9000,*) "BASIN_SWAT_DEG_CHAN_MORPH basin_sd_chamorph_yr.csv"
end if
endif
if (pco%sd_chan_bsn%a == "y") then
open (2123,file="basin_sd_chamorph_aa.txt",recl = 1500)
write (2123,*) bsn%name, prog
write (2123,*) sdch_hdr
write (2123,*) sdch_hdr_units
write (9000,*) "BASIN_SWAT_DEG_CHAN_MORPH basin_sd_chamorph_aa.txt"
if (pco%csvout == "y") then
open (2127,file="basin_sd_chamorph_aa.csv",recl = 1500)
write (2127,*) bsn%name, prog
write (2127,'(*(G0.3,:","))') sdch_hdr
write (2127,'(*(G0.3,:","))') sdch_hdr_units
write (9000,*) "BASIN_SWAT_DEG_CHAN_MORPH basin_sd_chamorph_aa.csv"
end if
end if
!! BASIN SWAT DEG CHANNEL MORPH OUTPUT
!! BASIN RECALL OUTPUT (PTS - Point Source)
if (pco%recall_bsn%d == "y") then
open (4500,file="basin_psc_day.txt", recl = 1500)
write (4500,*) bsn%name, prog
write (4500,*) rec_hdr_time, hyd_hdr
write (4500,*) hyd_hdr_units
write (9000,*) "BASIN_RECALL basin_psc_day.txt"
if (pco%csvout == "y") then
open (4504,file="basin_psc_day.csv", recl = 1500)
write (4504,*) bsn%name, prog
write (4504,'(*(G0.3,:","))') rec_hdr_time, hyd_hdr
write (4504,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "BASIN_RECALL basin_psc_day.csv"
end if
endif
if (pco%recall_bsn%m == "y") then
open (4501,file="basin_psc_mon.txt",recl = 1500)
write (4501,*) bsn%name, prog
write (4501,*) rec_hdr_time, hyd_hdr
write (4501,*) hyd_hdr_units
write (9000,*) "BASIN_RECALL basin_psc_mon.txt"
if (pco%csvout == "y") then
open (4505,file="basin_psc_mon.csv",recl = 1500)
write (4505,*) bsn%name, prog
write (4505,'(*(G0.3,:","))') rec_hdr_time, hyd_hdr
write (4505,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "BASIN_RECALL basin_psc_mon.csv"
end if
end if
if (pco%recall_bsn%y == "y") then
open (4502,file="basin_psc_yr.txt", recl = 1500)
write (4502,*) bsn%name, prog
write (4502,*) rec_hdr_time, hyd_hdr
write (4502,*) hyd_hdr_units
write (9000,*) "BASIN_RECALL basin_psc_yr.txt"
if (pco%csvout == "y") then
open (4506,file="basin_psc_yr.csv", recl = 1500)
write (4506,*) bsn%name, prog
write (4506,'(*(G0.3,:","))') rec_hdr_time, hyd_hdr
write (4506,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "BASIN_RECALL basin_psc_yr.csv"
end if
endif
if (pco%recall_bsn%a == "y") then
open (4503,file="basin_psc_aa.txt",recl = 1500)
write (4503,*) bsn%name, prog
write (4503,*) rec_hdr_time, hyd_hdr
write (4503,*) hyd_hdr_units
write (9000,*) "BASIN_RECALL_AA basin_psc_aa.txt"
if (pco%csvout == "y") then
open (4507,file="basin_psc_aa.csv",recl = 1500)
write (4507,*) bsn%name, prog
write (4507,'(*(G0.3,:","))') rec_hdr_time, hyd_hdr
write (4507,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "BASIN_RECALL_AA basin_psc_aa.csv"
end if
end if
!! BASIN RECALL OUTPUT
!! BASIN ROUTING UNIT OUTPUT
if (pco%ru%d == "y") then
open (2600,file="ru_day.txt", recl = 1500)
write (2600,*) bsn%name, prog
write (2600,*) hyd_hdr_time, hyd_hdr
write (2600,*) hyd_hdr_units
write (9000,*) "ROUTING_UNITS ru_day.txt"
if (pco%csvout == "y") then
open (2604,file="ru_day.csv", recl = 1500)
write (2604,*) bsn%name, prog
write (2604,'(*(G0.3,:","))') hyd_hdr_time, hyd_hdr
write (2604,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "ROUTING_UNITS ru_day.csv"
end if
endif
if (pco%ru%m == "y") then
open (2601,file="ru_mon.txt",recl = 1500)
write (2601,*) bsn%name, prog
write (2601,*) hyd_hdr_time, hyd_hdr
write (2601,*) hyd_hdr_units
write (9000,*) "ROUTING_UNITS ru_mon.txt"
if (pco%csvout == "y") then
open (2605,file="ru_mon.csv",recl = 1500)
write (2605,*) bsn%name, prog
write (2605,'(*(G0.3,:","))') hyd_hdr_time, hyd_hdr
write (2605,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "ROUTING_UNITS ru_mon.csv"
end if
end if
if (pco%ru%y == "y") then
open (2602,file="ru_yr.txt", recl = 1500)
write (2602,*) bsn%name, prog
write (2602,*) hyd_hdr_time, hyd_hdr
write (2602,*) hyd_hdr_units
write (9000,*) "ROUTING_UNITS ru_yr.txt"
if (pco%csvout == "y") then
open (2606,file="ru_yr.csv", recl = 1500)
write (2606,*) bsn%name, prog
write (2606,'(*(G0.3,:","))') hyd_hdr_time, hyd_hdr
write (2606,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "ROUTING_UNITS ru_yr.csv"
end if
endif
if (pco%ru%a == "y") then
open (2603,file="ru_aa.txt",recl = 1500)
write (2603,*) bsn%name, prog
write (2603,*) hyd_hdr_time, hyd_hdr
write (2603,*) hyd_hdr_units
write (9000,*) "ROUTING_UNITS ru_aa.txt"
if (pco%csvout == "y") then
open (2607,file="ru_aa.csv",recl = 1500)
write (2607,*) bsn%name, prog
write (2607,'(*(G0.3,:","))') hyd_hdr_time, hyd_hdr
write (2607,'(*(G0.3,:","))') hyd_hdr_units
write (9000,*) "ROUTING_UNITS ru_aa.csv"
end if
end if
!! BASIN ROUTING UNIT OUTPUT
return
end subroutine header_write