Changeset 4287


Ignore:
Timestamp:
Sep 29, 2022, 9:19:32 PM (2 years ago)
Author:
lguez
Message:

Bug fix: add count argument to nf90_get_var

Because, in the rico case, NetCDF variables which are read have
dimensions (..., lat, lon), in NetCDF order, with lon = lat =

  1. Without the count argument, for apbp for example, nf90_get_var

tried to read nlevel + 1 subscript values in the dimension lon, 1
subscript value in the lat dimension, and 1 subscript value in the
nlevp1 dimension: not what we want. I have checked that the cases
ARMCU/REF, amma and rico work with this revision.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.F90

    r4274 r4287  
    711711        !-----------------------------------------------------------------------
    712712        if(i.LE.4) then     ! Lecture des coord pression en (nlevelp1,lat,lon)
    713            ierr = NF90_GET_VAR(nid,var3didin(i),apbp)
     713           ierr = NF90_GET_VAR(nid,var3didin(i),apbp, &
     714                count = [1, 1, nlevel + 1])
    714715           print *,'read2_cas(apbp), on a lu ',i,name_var(i)
    715716           if(ierr/=NF_NOERR) then
     
    719720           !-----------------------------------------------------------------------
    720721        else if(i.gt.4.and.i.LE.45) then   ! Lecture des variables en (time,nlevel,lat,lon)
    721            ierr = NF90_GET_VAR(nid,var3didin(i),resul)
     722           ierr = NF90_GET_VAR(nid,var3didin(i),resul, &
     723                count = [1, 1, nlevel, ntime])
    722724           print *,'read2_cas(resul), on a lu ',i,name_var(i)
    723725           if(ierr/=NF_NOERR) then
     
    727729           !-----------------------------------------------------------------------
    728730        else if (i.gt.45.and.i.LE.51) then   ! Lecture des variables en (time,lat,lon)
    729            ierr = NF90_GET_VAR(nid,var3didin(i),resul2)
     731           ierr = NF90_GET_VAR(nid,var3didin(i),resul2, count = [1, 1, ntime])
    730732           print *,'read2_cas(resul2), on a lu ',i,name_var(i)
    731733           if(ierr/=NF_NOERR) then
Note: See TracChangeset for help on using the changeset viewer.