Opened 5 years ago

Closed 4 years ago

#439 closed defect (fixed)

diffuco: templeafci dimension missmatch between histwrite and histdef

Reported by: ajornet Owned by: nvuilsce
Priority: minor Milestone: ORCHIDEE 4.0
Component: Physical processes Version: trunc
Keywords: diffuco templeafci lai Cc:

Description

There is a problem when writting data with IOIPSL. It's due to the templeafci variable and it sometimes crashes the simulation. That's because it's defined as nlai+1 but when it's written is defined as nlai. This missing part gets a random value. It could potentialy lead to a crash or wrong output data.

In diffuco.f90 the variable templeafci is defined and used as:

REAL(r_std), DIMENSION(kjpindex,nlai)      :: templeafci
      IF(jv==testpft) THEN
         templeafci(:,:)=leaf_ci(:,testpft,:)
         CALL histwrite_p(hist_id, 'Cc', kjit, Cc, kjpindex*(nlai+1), indexlai)
         CALL histwrite_p(hist_id, 'Vc', kjit, Vc2, kjpindex*(nlai+1), indexlai)
         CALL histwrite_p(hist_id, 'Vj', kjit, JJ, kjpindex*(nlai+1), indexlai)
         CALL histwrite_p(hist_id, 'limitphoto', kjit, info_limitphoto, kjpindex*(nlai+1), indexlai)
         CALL histwrite_p(hist_id, 'gammastar', kjit, gamma_star, kjpindex,index)
         CALL histwrite_p(hist_id, 'Kmo', kjit, Kmo, kjpindex,index)
         CALL histwrite_p(hist_id, 'Kmc', kjit, Kmc, kjpindex,index)
         CALL histwrite_p(hist_id, 'gm', kjit, gm, kjpindex, index)
         CALL histwrite_p(hist_id, 'gs', kjit, gs, kjpindex*(nlai+1), indexlai)
         CALL histwrite_p(hist_id, 'leafci', kjit, templeafci, kjpindex*(nlai),  indexlai)  <--- here
         CALL histwrite_p(hist_id, 'assimi', kjit, assimi, kjpindex*(nlai+1), indexlai)
         CALL histwrite_p(hist_id, 'Rd', kjit, Rd, kjpindex*(nlai+1), indexlai)
      ENDIF

In ioipslctrl.f90 leafci is defined as nlai+1:

   CALL histdef(hist_id, 'leafci', 'leaf ci', 'ppm', &
      & iim,jjm, hori_id, nlai+1, 1, nlai+1, laiax_id, 32, avescatter(10), dt,dw)

Change History (5)

comment:1 Changed 5 years ago by ajornet

Another issue found. leafci variable is not initialized with a value. It's sending weird values to histwrite IOISPL subroutine. At the point of writting them into the file netcdf crashes.

Propsed fix: [5188/branches/ORCHIDEE-MICT/ORCHIDEE]

comment:2 Changed 5 years ago by jgipsl

  • Milestone ORCHIDEE 2.0 deleted

comment:3 Changed 5 years ago by aducharne

  • Milestone set to ORCHIDEE 4.0
  • Owner changed from somebody to nvuilsce
  • Status changed from new to assigned

comment:4 Changed 4 years ago by jgipsl

I propose to remove this variable leafci in the IOIPSL output. Note that that the variable is not added as xios output and is only output for testpft=6. We know the problem since nearly 2 years. It is better that the person who needs the variable puts it back with a correct implementation.

A reason that motivates me as well to remove it, is that we can not use ORCHIDEE with the updated version of IOIPSL coming soon.

comment:5 Changed 4 years ago by jgipsl

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

After discussion with N. Vuichard, the variable leafci has been removed in the trunk [6380]. When needed, the variable can be added with a correct implementation using XIOS.

Note: See TracTickets for help on using tickets.