Opened 5 years ago

Closed 5 years ago

#207 closed defect (fixed)

Inconsistency of dimension when passing 'frac_nobio_lastyear' in slowproc_main as ‘totfrac_nobio_old’ in stomate_main

Reported by: cyue Owned by: jgipsl
Priority: major Milestone: IPSLCM6.v1
Component: Biogeochemical processes Version: trunc
Keywords: dimension Cc:

Description

Description:
The variable 'frac_nobio_lastyear' has dimension of (kjpindex,nnobio) in slowproc_main, and it’s passed directly as 'totfrac_nobio_old' in stomate_main, which has a dimension of (kjpindex), this is probably fine when nnobio=1 (not sure). Still, there is a little confusion.

revision No.: 2952


Proposed changes:

keep the same in slowproc_main when calling stomate_main, change the receiving dummy variable in stomate_main the same dimension as the ‘frac_nobio_lastyear’, calculate the ‘totfrac_nobio_old’ again in stomate_main before it’s used.

--- src_stomate/stomate.f90	(revision 2952)
+++ src_stomate/stomate.f90	(working copy)
@@ -1131,7 +1131,7 @@
        &  humrel, shumdiag, litterhumdiag, precip_rain, precip_snow, &
        &  gpp, deadleaf_cover, assim_param, &
        &  lai, frac_age, height, veget, veget_max, &
-       &  veget_max_old, totfrac_nobio_old, &
+       &  veget_max_old, frac_nobio_old, &
        &  hist_id, hist2_id, rest_id_stom, hist_id_stom, hist_id_stom_IPCC, &
        &  co2_flux, fco2_lu, resp_maint,resp_hetero,resp_growth,temp_growth)
     
@@ -1182,7 +1182,7 @@
                                                                          !! cover and effective time step to obtain ::gpp_d 
     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in)  :: veget_max_old     !! Old "maximal" coverage fraction of a PFT: only if 
                                                                          !! vegetation is updated in slowproc
-    REAL(r_std),DIMENSION(kjpindex),INTENT(in)      :: totfrac_nobio_old !! Old fraction of nobio per gridcell
+    REAL(r_std),DIMENSION(kjpindex,nnobio),INTENT(in):: frac_nobio_old !! Old fraction of nobio per gridcell
     INTEGER(i_std),INTENT(in)                       :: hist_id           !! ?? [DISPENSABLE] SECHIBA's _history_ file 
                                                                          !! identifier 
     INTEGER(i_std),INTENT(in)                       :: hist2_id          !! ?? [DISPENSABLE] SECHIBA's _history_ file 2 
@@ -1310,6 +1310,7 @@
                                                                                    !! computing 
     REAL(r_std), DIMENSION(kjpindex,nvm,nbpools)  :: carbon_stock                  !! Array containing the carbon stock for each pool
                                                                                    !! used by ORCHIDEE
+    REAL(r_std), DIMENSION(kjpindex)              :: totfrac_nobio_old             !! Old fraction of nobio per gridcell
 
 !_ ================================================================================================================================
     
@@ -1356,6 +1357,11 @@
        ENDWHERE
     ENDDO
 
+    totfrac_nobio_old(:) = zero
+    DO jv = 1, nnobio
+       totfrac_nobio_old(:) = totfrac_nobio_old(:) + frac_nobio_old(:,jv)
+    ENDDO
+    
     IF ( do_now_stomate_lcchange ) THEN
        DO j=1,nvm
           WHERE ((1.-totfrac_nobio_old(:)) > min_sechiba)

Change History (2)

comment:1 Changed 5 years ago by jgipsl

  • Milestone set to IPSLCM6.v1
  • Owner changed from somebody to jgipsl
  • Status changed from new to accepted

This is obviously a problem of dimension. The solution proposed is correct but I'd prefer to calculate totfrac_nobio_old in slowproc before calling stomate_main. I propose this because totfrac_nobio is already calculated in slowproc and we need just to add the calculation of totfrac_nobio_old. All calculations of totfrac_nobio are then grouped in the same module.

comment:2 Changed 5 years ago by jgipsl

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

Done in rev [2955]

Note: See TracTickets for help on using tickets.