@@ -1290,7 +1290,7 @@ SUBROUTINE hymo_all(STATUS)
1290
1290
CALL write_subdaily_output_TC(f_snowWaterEquiv,' snowWaterEquiv.out' , snowWaterEquiv)
1291
1291
CALL write_subdaily_output_TC(f_snowAlbedo,' snowAlbedo.out' , snowAlbedo)
1292
1292
CALL write_subdaily_output_TC(f_snowCover,' snowCover.out' , snowCover)
1293
- CALL write_subdaily_output_TC(f_snowTemp,' snowTemp.out' , snowTemp)
1293
+ CALL write_subdaily_output_TC(f_snowTemp,' snowTemp.out' , snowTemp, 1 )
1294
1294
CALL write_subdaily_output_TC(f_surfTemp,' surfTemp.out' , surfTemp)
1295
1295
CALL write_subdaily_output_TC(f_liquFrac,' liquFrac.out' , liquFrac)
1296
1296
CALL write_subdaily_output_TC(f_fluxPrec,' fluxPrec.out' , fluxPrec)
@@ -1498,19 +1498,19 @@ SUBROUTINE open_subdaily_output_TC(f_flag,file_name,headerline)
1498
1498
END SUBROUTINE open_subdaily_output_TC
1499
1499
1500
1500
1501
- SUBROUTINE write_output (f_flag ,file_name ,value_array ,spec_decimals )
1501
+ SUBROUTINE write_output (f_flag , file_name , value_array , decimals )
1502
1502
! Output daily values of given array
1503
1503
use utils_h
1504
1504
IMPLICIT NONE
1505
1505
LOGICAL , INTENT (IN ) :: f_flag
1506
1506
CHARACTER (len=* ), INTENT (IN ) :: file_name
1507
1507
REAL , INTENT (IN ) :: value_array(:,:)
1508
- INTEGER , optional :: spec_decimals
1508
+ INTEGER , optional :: decimals
1509
1509
1510
1510
IF (f_flag) THEN ! if output file is enabled
1511
1511
OPEN (11 ,FILE= pfadn(1 :pfadi)// file_name, STATUS= ' old' ,POSITION= ' append' )
1512
1512
1513
- write (fmtstr,' (a,i0,a,a,a)' ) ' (i0,a,i0,' ,subasin,' (a,' ,fmt_str(maxval (value_array)),' ))' ! generate format string
1513
+ write (fmtstr,' (a,i0,a,a,a)' ) ' (i0,a,i0,' ,subasin,' (a,' ,fmt_str(maxval (abs ( value_array)), decimals ),' ))' ! generate format string
1514
1514
1515
1515
DO d= 1 ,dayyear
1516
1516
write (11 ,trim (fmtstr))t,char (9 ),d,(char (9 ),value_array(d,i),i= 1 ,subasin)
@@ -1520,18 +1520,20 @@ SUBROUTINE write_output(f_flag,file_name,value_array,spec_decimals)
1520
1520
END IF
1521
1521
END SUBROUTINE write_output
1522
1522
1523
- SUBROUTINE write_subdaily_output (f_flag ,file_name ,value_array )
1523
+ SUBROUTINE write_subdaily_output (f_flag ,file_name ,value_array , decimals )
1524
1524
! Output subdaily values of given array
1525
1525
use utils_h
1526
1526
IMPLICIT NONE
1527
1527
LOGICAL , INTENT (IN ) :: f_flag
1528
1528
CHARACTER (len=* ), INTENT (IN ) :: file_name
1529
- REAL , POINTER :: value_array(:,:,:)
1529
+ REAL , POINTER , INTENT (IN ) :: value_array(:,:,:)
1530
+ integer , optional , INTENT (IN ) :: decimals
1530
1531
1531
1532
IF (f_flag) THEN ! if output file is enabled
1532
1533
OPEN (11 ,FILE= pfadn(1 :pfadi)// file_name, STATUS= ' old' ,POSITION= ' append' )
1533
1534
1534
- write (fmtstr,' (a,i0,a,a,a)' ) ' (i0,a,i0,a,i0,' ,subasin,' (a,' ,fmt_str(maxval (value_array)),' ))' ! generate format string
1535
+ write (fmtstr,' (a,i0,a,a,a)' ) ' (i0,a,i0,a,i0,' ,subasin,' (a,' ,fmt_str(maxval (abs (value_array)), decimals),' ))' ! generate format string
1536
+ ! write(fmtstr,'(a,i0,a,a,a)') '(i0,a,i0,a,i0,',subasin,'(a,','f0.8','))' !generate format string
1535
1537
1536
1538
DO d= 1 ,dayyear
1537
1539
DO j= 1 ,nt
@@ -1542,20 +1544,22 @@ SUBROUTINE write_subdaily_output(f_flag,file_name,value_array)
1542
1544
END IF
1543
1545
END SUBROUTINE write_subdaily_output
1544
1546
1545
- SUBROUTINE write_subdaily_output_TC (f_flag ,file_name ,value_array )
1547
+ SUBROUTINE write_subdaily_output_TC (f_flag ,file_name ,value_array , decimals )
1546
1548
! Output subdaily values of given array on TC-scale
1547
1549
use utils_h
1548
1550
IMPLICIT NONE
1549
1551
LOGICAL , INTENT (IN ) :: f_flag
1550
1552
CHARACTER (len=* ), INTENT (IN ) :: file_name
1551
- REAL , POINTER :: value_array(:,:,:)
1553
+ REAL , POINTER , INTENT (IN ) :: value_array(:,:,:)
1554
+ integer , optional , INTENT (IN ) :: decimals
1552
1555
INTEGER :: sb_counter, lu_counter, tc_counter, i_lu
1553
1556
1554
1557
IF (f_flag) THEN ! if output file is enabled
1555
1558
OPEN (11 ,FILE= pfadn(1 :pfadi)// file_name, STATUS= ' old' ,POSITION= ' append' )
1556
1559
1557
1560
! fmtstr ='(6(i0,a),'//fmt_str(maxval(value_array)*10)//')' !generate format string
1558
1561
fmtstr = ' (6(i0,a),E12.5)' ! generate format string
1562
+ write (fmtstr,' (a,a,a)' ) ' (6(i0,a),' , fmt_str(maxval (abs (value_array)), decimals),' )' ! generate format string
1559
1563
1560
1564
DO d= 1 ,dayyear
1561
1565
DO j= 1 ,nt
0 commit comments