Opened 4 years ago

Closed 4 years ago

#408 closed defect (fixed)

routing_diagnostic error: output conversion error

Reported by: ajornet Owned by: somebody
Priority: major Milestone:
Component: Physical processes Version: trunc
Keywords: routing_diagnostic Cc:

Description

This error is raised when Running a branch of Orchidee.
I am not able the reproduce it in the trunk. But It seems reasonable to me it could also happen in the trunk.

The error message:

1115 forrtl: error (63): output conversion error, unit -5, file Internal Formatted Write
1116 Image              PC                Routine            Line        Source
1117 orchidee_debug     000000000586DFAE  Unknown               Unknown  Unknown
1118 orchidee_debug     000000000586CA46  Unknown               Unknown  Unknown
1119 orchidee_debug     0000000005820B32  Unknown               Unknown  Unknown
1120 orchidee_debug     00000000057E16DB  Unknown               Unknown  Unknown
1121 orchidee_debug     00000000057E0C42  Unknown               Unknown  Unknown
1122 orchidee_debug     0000000005805F8D  Unknown               Unknown  Unknown
1123 orchidee_debug     0000000005803EEC  Unknown               Unknown  Unknown
1124 orchidee_debug     0000000003E37DFE  routing_mp_routin        5161  routing.f90
1125 orchidee_debug     0000000003DF8B01  routing_mp_routin        4639  routing.f90
1126 orchidee_debug     0000000003BEB22C  routing_mp_routin         646  routing.f90
1127 orchidee_debug     0000000000C54B8A  sechiba_mp_sechib         706  sechiba.f90
1128 orchidee_debug     00000000005E26F0  intersurf_mp_inte         398  intersurf.f90
1129 orchidee_debug     00000000004DE0F7  MAIN__                   1098  dim2_driver.f90
1130 orchidee_debug     00000000004138DC  Unknown               Unknown  Unknown
1131 libc.so.6          00002BA0411EAC05  Unknown               Unknown  Unknown
1132 orchidee_debug     00000000004137D9  Unknown               Unknown  Unknown

Routing_diagnostic subroutine:

3209        IF ( name_found > 1 ) THEN
3210           DO ic=num_largest,1,-1
3211              IF ( TRIM(sorted_names(icc)) == TRIM(sorted_names(ic)) ) THEN
3212                 IF ( name_found > 1 ) THEN
3213                    WRITE(nn,'(I1)')  name_found  <--- ERROR HERE
3214                    sorted_names(ic) = TRIM(sorted_names(ic))//nn
3215                    name_found = name_found - 1
3216                 ENDIF
3217              ENDIF
3218           ENDDO
3219        ENDIF

When name_found is a number bigger than 9. It does not fit in nn variable because it is declared as CHARACTER(1).

If name_found cannot be bigger than 9 then this ticket is wrong.

Change History (3)

comment:1 Changed 4 years ago by ajornet

Proposed fix:

nn initialization:

CHARACTER(LEN=3)                              :: nn                 !!

New code:

 5146        IF ( name_found > 1 ) THEN
 5147           DO ic=num_largest,1,-1
 5148              IF ( TRIM(sorted_names(icc)) == TRIM(sorted_names(ic)) .AND. &
 5149                  name_found > 1 ) THEN
 5150                 IF ( name_found < 10 ) THEN
 5151                    WRITE(nn,'(I1)')  name_found
 5152                 ELSE IF ( name_found < 100 ) THEN
 5153                    WRITE(nn,'(I2)')  name_found
 5154                 ELSE IF ( name_found < 1000 ) THEN
 5155                    WRITE(nn,'(I3)')  name_found
 5156                 ELSE
 5157                    ! Make sur to increase nn size when adding more cases
 5158                    CALL ipslerr_p(3, 'routing_diagnostic', &
 5159                         'Non of the previous values can fit in the new char', &
 5160                         'Add a new condition to deal with it', '')
 5161                 ENDIF
 5162                 sorted_names(ic) = TRIM(sorted_names(ic))//TRIM(nn)
 5163                 name_found = name_found - 1
 5164              ENDIF
 5165           ENDDO
 5166        ENDIF

It can deal up to 999 numbers for INTEGER to CHAR conversion.

comment:2 Changed 4 years ago by jgipsl

  • Milestone orchidee_1_9_6 deleted

comment:3 Changed 4 years ago by jgipsl

  • Resolution set to fixed
  • Status changed from new to closed

Done in the trunk rev [4743]

Note: See TracTickets for help on using tickets.