Opened 5 weeks ago

Last modified 5 weeks ago

#794 new defect

Shape missmatch found by compiler but it is not a true error

Reported by: jgipsl Owned by: somebody
Priority: major Milestone: ORCHIDEE 4.1
Component: Model architecture Version: trunc
Keywords: Cc:


Following issue has been found at Jean-Zay at IDRIS but it might be the same at irene.

At Jean-Zay/idris, when running offline FG2 the trunk of today, after compilation in debug mode, following error is found during execution:

forrtl: severe (408): fort: (33): Shape mismatch: 
The extent of dimension 3 of array TEMP4 is 2 and 
the corresponding extent of array HARVEST_POOL is 6

for the corresponding line in stomate_lpj:

temp4(:,iforest,:) = temp4(:,iforest,:) + SUM(harvest_pool(:,j,:,:),2)

There is no error on this line but the compiler thinks so, due to option -check bounds. The compiler checks the dimensions of the full variables temp4(:,:,:) and harvest_pool(:,:,:,:).

When removing -check bounds (and -check all because it adds -check bounds) from compilation (arch-X64_JEANZAY.fcm, DEBUG_FLAGS), the model runs.

Possible solutions:
1) remove -check bounds from debug compile options. But this is a pitty because it is usefull in other cases.
2) use a temporary variable for SUM(). This is the option we've used in the passed.

Change History (1)

comment:1 Changed 5 weeks ago by jgipsl

Commit [7290] resolved the ticket using solution 2.
Note that it was not possible to set temp5(:,:)=SUM(harvest_pool(:,j,:,:),2). This was also too complex for the compiler with option -check bounds.

Note: See TracTickets for help on using tickets.