Opened 11 years ago

Closed 7 years ago

#41 closed defect (fixed)

Backward compatibility of the driver

Reported by: nvuilsce Owned by: jgipsl
Priority: major Milestone: ORCHIDEE 1.9.7
Component: Driver files Version:
Keywords: branch Hydrology Cc:

Description

The reading (throught the forcing file) of the height of the atmospheric fields has been added into the driver of the branch Hydrology (see a description here Branches/Driver_Atm_Lev).
See changes induced by this new feature, here.

Two problems have been diagnosed:

  • When using default setting with old forcing file (default values for Height_Lev1 and Height_LevW), there is a bug in the value of zsame_levuv (a flag that defines if the height for wind and other fiels such temperature are equal or not).

Lines 1771:1773

IF ( ABS(zlevuv_fixed-zlev_fixed) <= EPSILON(zlev_fixed)) THEN 
   zsamelev_uv = .TRUE. 
ENDIF 

should be modified as followed, because zsamelev_uv is initialized to .TRUE. at the top of the routine forcing_vertical

IF ( ABS(zlevuv_fixed-zlev_fixed) > EPSILON(zlev_fixed)) THEN 
   zsamelev_uv = .FALSE. 
ENDIF 
  • When using plot-scale forcing files (for Fluxnet site), we previously read the lev variable contained in the forcing file in order to define both zlev and zlev_uv. In order to keep this possibility, we do a call to flin_get for getting the 'lev' variable as we do for the other new variables (Sigma, HybSig?, ...). The routine flinget_scal of IOIPSL is used for reading this variable. But in this routine, a scalar variable is only assumed to be a variable with no dimension (dim=0) but the lev scalar variable in our forcing as one dimension (and the size of this dimension is 1). So in order to account for this, it is needed to modified the routine flinget_scal.

The section

     IF ( (vid >= 0).AND.(iret == NF90_NOERR) ) THEN
        iret = NF90_INQUIRE_VARIABLE (fid, vid, &
             ndims=ndims, dimids=dimids, nAtts=nb_atts)
        IF ( (ndims == 0) .AND. (nb_atts >= 0) ) THEN
           iret = NF90_GET_VAR(fid, vid, var)
        ELSE
           CALL histerr (3,'flinget_scal', &
                'The variable has coordinates and thus is probably not a scalar.', &
                'Check your netCDF file.', " ")
        ENDIF
     ENDIF

should be modified as followed:

     IF ( (vid >= 0).AND.(iret == NF90_NOERR) ) THEN
        iret = NF90_INQUIRE_VARIABLE (fid, vid, &
             ndims=ndims, dimids=dimids, nAtts=nb_atts)
        IF (ndims == 1) THEN
           iret = NF90_INQUIRE_DIMENSION (fid, dimids(1), len=lll)
        ENDIF

        IF ( ((ndims == 0) .OR. ((ndims == 1).AND.(lll == 1))) .AND. (nb_atts >= 0) ) THEN
           iret = NF90_GET_VAR(fid, vid, var)
        ELSE
           CALL histerr (3,'flinget_scal', &
                'The variable has coordinates and thus is probably not a scalar.', &
                'Check your netCDF file.', " ")
        ENDIF
     ENDIF

and the lll variable has to be declared as a local variable.

Change History (3)

comment:1 Changed 11 years ago by peylin

  • Owner changed from somebody to jgipsl
  • Status changed from new to assigned

comment:2 Changed 7 years ago by jgipsl

  • First problem : was commited in the trunk previously. Additional commit done on the trunk just to make it easier to understand [4217]
  • Second problem : The code in the trunk has been changed. The above section do not exist. I think it has been replaced by a call to flinget on line 2176 in current readdim2.f90. Now in readdim2/forcing_read_interpol :
IF ( zheight ) THEN
        !
        ! Constant height
        !
        IF ( levlegacy ) THEN
           CALL flinget (force_id,'lev',1, 1, 1, 1,  1, 1, zlev_fixed)
        ELSE

I think the problem is resolved and the ticket can be closed.

comment:3 Changed 7 years ago by jgipsl

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.