Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#15 closed defect (fixed)

wrong _FillValue for fluxlat and fluxsens

Reported by: maignan Owned by: dsolyga
Priority: minor Milestone: ORCHIDEE 1.9.7
Component: Physical processes Version: orchidee_1_9_6
Keywords: FillValue Cc:

Description

The sechiba history file indicates _FillValue = 9.96921e+36f (NF90_FILL_REAL4 via IOIPSL) for all variables while fluxlat and fluxsens actually use 1.00000e+20 (undef_sechiba).

Change History (4)

comment:1 Changed 9 years ago by dsolyga

Diagnostic

After performing a simple test (1D, global scale, ncc forcing files), I found that the following variables also use undef_sechiba in sechiba history files:

temp_sol
tsol_max
tsol_min
alb_vis
alb_nir
swdown
fluxlat
fluxsens

Description for fluxlat and fluxsens

The origin of this problem is located in dim2_driver and intersurf modules. In dim2_driver, we have the following initializations :

  lev(:) = 0.0
  levuv(:) = 0.0
  swdown(:,:) = fill_init
  precip_rain(:,:) = 0.0
  precip_snow(:,:) = 0.0
  tair_obs(:,:) = 0.0
  u(:,:) = fill_init
  v(:,:) = fill_init
  qair_obs(:,:) = fill_init
  pb(:,:) = fill_init
  lwdown(:,:) = fill_init
  eair_obs(:,:) = fill_init
  zlev_vec(:,:) = 0.0
  zlevuv_vec(:,:) = 0.0
  relax(:,:) = 0.0
  petAcoef(:,:) = 0.0
  peqAcoef(:,:) = 0.0
  petBcoef(:,:) = 0.0
  peqBcoef(:,:) = 0.0
  cdrag(:,:) = 0.0
  for_u(:,:) = fill_init
  for_v(:,:) = fill_init
  for_swnet(:,:) = fill_init
  for_swdown(:,:) = fill_init
  for_lwdown(:,:) = fill_init
  for_psurf(:,:) = fill_init
  for_qair(:,:) = fill_init
  for_tair(:,:) = fill_init
  for_eair(:,:) = fill_init
  for_ccanopy(:,:) = 0.0
  for_rau(:,:) = fill_init
  for_contfrac(:,:) = 0.0
  for_neighbours(:,:,:) = 0
  for_resolution(:,:,:) = 0.0
  old_zlev(:,:) = 0.0
  old_qair(:,:) = 0.0
  old_eair(:,:) = 0.0
  tsol_rad(:,:) = 0.0
  vevapp(:,:) = 0.0
  temp_sol_NEW(:,:) = fill_init
  temp_sol_old(:,:) = fill_init
  dtdt(:,:) = 0.0
  coastalflow(:,:) = 0.0
  riverflow(:,:) = 0.0
  fluxsens(:,:) = 0.0
  fluxlat(:,:) = 0.0
  emis(:,:) = 0.0
  z0(:,:) = fill_init
  qsurf(:,:) = 0.0
  albedo(:,:,:) = fill_init
  albedo_vis(:,:) = fill_init
  albedo_nir(:,:) = fill_init
  kindex(:) = 0
  lon(:,:) = 0.0
  lat(:,:) = 0.0

where fill_init is defined by :

  REAL :: fill_init

  fill_init=REAL(nf90_fill_real,r_std)

fluxlat and fluxsens are set to zero.
But in intersurf (for example intersurf_main_2d), fluxlat and fluxsens are :

  • declared as intent(out) on the whole grid
REAL(r_std),DIMENSION (iim,jjm), INTENT(out)            :: fluxsens      !! Sensible chaleur flux
REAL(r_std),DIMENSION (iim,jjm), INTENT(out)            :: fluxlat       !! Latent chaleur flux
  • are set to undef_sechiba on the whole grid :
        fluxsens(:,:)     = undef_sechiba
        fluxlat(:,:)      = undef_sechiba
    
  • are filled only with land points after by zfluxsens and zfluxlat :
    DO ik=1, kjpindex
      
    
       j = ((kindex(ik)-1)/iim) + 1
       i = (kindex(ik) - (j-1)*iim)

       z0(i,j)           = zz0(ik)
       coastalflow(i,j)  = zcoastal(ik)/mille
       riverflow(i,j)    = zriver(ik)/mille
       tsol_rad(i,j)     = ztsol_rad(ik)
       vevapp(i,j)       = zvevapp(ik)
       temp_sol_new(i,j) = ztemp_sol_new(ik)
       qsurf(i,j)        = zqsurf(ik)
       albedo(i,j,1)     = zalbedo(ik,1)
       albedo(i,j,2)     = zalbedo(ik,2)
       fluxsens(i,j)     = zfluxsens(ik)
       fluxlat(i,j)      = zfluxlat(ik)
       emis(i,j)         = zemis(ik)
       cdrag(i,j)        = zcdrag(ik)
       dswnet(i,j)       = zswnet(ik)
       dswdown(i,j)      = zswdown(ik)

    ENDDO

But we write fluxsens and fluxlat with undef_sechiba values on the ocean points :

  CALL histwrite (hist_id, 'fluxsens', itau_sechiba, fluxsens, kjpindex, kindex)
  CALL histwrite (hist_id, 'fluxlat',  itau_sechiba, fluxlat, kjpindex, kindex)

It seems that IOIPSL does not take in charge the fill values not for all the operators.

Solution proposed

I suggest to implement it this way :

  • Delete the initializations done in dim2_driver for the variables listed above
  • Declare in the different interfaces in intersurf (intersurf_main_2d, intersurf_main_1d, intersurf_gathered) a fill_init parameter :
      REAL :: fill_init
    
      fill_init=REAL(nf90_fill_real,r_std)
    
  • Initialize the variables by this value :
    fill_init = REAL(nf90_fill_real,r_std)
    z0(:,:)           = undef_sechiba
    coastalflow(:,:)  = undef_sechiba
    riverflow(:,:)    = undef_sechiba
    tsol_rad(:,:)     = undef_sechiba
    vevapp(:,:)       = undef_sechiba
    temp_sol_new(:,:) = fill_init
    qsurf(:,:)        = undef_sechiba
    albedo(:,:,:)     = fill_init
    fluxsens(:,:)     = fill_init
    fluxlat(:,:)      = fill_init
    emis(:,:)         = undef_sechiba
    cdrag(:,:)        = undef_sechiba
    dswnet(:,:)       = fill_init
    dswdown(:,:)      = fill_init

These modifications need to add "USE netcdf" in intersurf module.
Tests needed : OFF-LINE, LMDZOR

comment:2 Changed 9 years ago by dsolyga

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

After discussion with Anne, this problem is a little bit more complicated than expected.
In fact, histwrite uses either the whole grid and for the land points. It is a bit inconsistent because some operators like tmax_cels calculates over the whole grid with no particular reason. We should use tmax(cels(scatter(X))) instead of tmax(cels(X)) for example.
With 'scatter', the operation is performed only on land points. Anne implemented this patch to the interface with LMDZ and I will implement it for the OFF-LINE interface. I will initialize fluxlat and fluxsens by fill_init in dim2_driver module.
To sum up, the following modifications consist to :

  • Add 'scatter' operations to all operators.
  • Change the histwrite calls performed on the whole grid to histwrite calls performed on land points. So no more histwrite will be performed on the whole grid. We can expect some gain in computation time.
  • Delete some local variables like dswnet and dswdown which are necessary any more.
  • Initialize fluxsens and fluxlat by fill_init.

All these modifications will be applied to intersurf and dim2_driver. The first proposal is out of order now.

comment:3 Changed 9 years ago by dsolyga

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

Corrections propagated. No changes in results. Fixed by the same occasion 2 inconsistencies signalled by Frédérique Cheruy. See revision [1062].

comment:4 Changed 9 years ago by dsolyga

  • Milestone changed from ORCHIDEE 2.0 to ORCHIDEE 1.9.7
Note: See TracTickets for help on using tickets.