Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#225 closed defect (invalid)

routing_linkup upper bound in contfrac array

Reported by: ajornet Owned by: somebody
Priority: major Milestone: orchidee_1_9_6
Component: Biogeochemical processes Version: trunc
Keywords: routing routing_linkup array contfrac Cc: albert.jornet-puig@…

Description

At the soubroutine routing_linkup, the array contfrac index is out the scope. contfrac is declared with 155 elements but the index has a value of 274.

forrtl: severe (408): fort: (2): Subscript #1 of the array CONTFRAC has value 274 which is greater than the upper bound of 155

Image              PC                Routine            Line        Source             
orchidee_ol        00000000013E96E0  routing_mp_routin        6226  routing.f90
orchidee_ol        000000000136D656  routing_mp_routin        4419  routing.f90
orchidee_ol        000000000134E6D3  routing_mp_routin        3950  routing.f90
orchidee_ol        000000000128AB11  routing_mp_routin         361  routing.f90
orchidee_ol        0000000000710F33  sechiba_mp_sechib         491  sechiba.f90
orchidee_ol        000000000050A8D9  intersurf_mp_inte         365  intersurf.f90
orchidee_ol        000000000049DEC4  MAIN__                   1264  dim2_driver.f90
orchidee_ol        00000000004339C6  Unknown               Unknown  Unknown
libc.so.6          00002AF02BFC1D5D  Unknown               Unknown  Unknown
orchidee_ol        00000000004338B9  Unknown               Unknown  Unknown

For this, it necessary to understand that contfrac is declared twice in ORCHIDEE but with different sizes:

  • One is declared as nbp_glo
  • The other one is declared as nbpt

In this subroutine, it is expected to find the contfrac (nbp_glo) instead of the contfrac (nbpt). For this purpose, contfrac needs to be passed as an argument:

Proposed solution:

When passed as argument, the subroutine does not take the contfrac declared in the module. Instead, it uses the one passed as argument.

@@ -4399,7 +4408,7 @@
     !
     CALL routing_linkup(nbpt, neighbours, nwbas, basin_count, basin_area, basin_id, basin_flowdir, &
          & basin_hierarchy, outflow_grid, outflow_basin, inflow_number, inflow_grid, inflow_basin, &
-         & nbcoastal, coastal_basin, invented_basins)
+         & nbcoastal, coastal_basin, invented_basins, contfrac, lalo)
     ! 
     !
     WRITE(numout,*) 'The maximum number of basins in any grid :', MAXVAL(basin_count)
@@ -5891,7 +5905,7 @@
 
 SUBROUTINE routing_linkup(nbpt, neighbours, nwbas, basin_count, basin_area, basin_id, basin_flowdir, &
        & basin_hierarchy, outflow_grid, outflow_basin, inflow_number, inflow_grid, inflow_basin, nbcoastal,&
-       & coastal_basin, invented_basins)
+       & coastal_basin, invented_basins, contfrac, lalo)
     !
     IMPLICIT NONE
     !
@@ -5899,6 +5913,8 @@
     INTEGER(i_std), INTENT (in)                    :: nbpt                  !! Domain size  (unitless)
     INTEGER(i_std), DIMENSION(nbpt,8), INTENT (in) :: neighbours            !!
     REAL(r_std), INTENT(in)                        :: invented_basins       !!
+    REAL(r_std), INTENT(in)                        :: contfrac(nbpt)        !! Fraction of land in each grid box (unitless;0-1)
+    REAL(r_std), INTENT(in)                        :: lalo(nbpt,2)          !! Vector of latitude and longitudes (beware of the order !)
     !
     INTEGER(i_std)                                 :: nwbas                 !!
     INTEGER(i_std), DIMENSION(nbpt)                :: basin_count           !!

Attachments (1)

run.def.contfrac (7.7 KB) - added by ajornet 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by ajornet

comment:1 Changed 7 years ago by ajornet

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

comment:2 Changed 7 years ago by ajornet

I discussed it with Jan. This is not a problem.

Note: See TracTickets for help on using tickets.