Ignore:
Timestamp:
Sep 20, 2022, 4:09:48 PM (2 years ago)
Author:
lguez
Message:

Replace nf_def_var by nf90_def_var

The immediate motivation is a bug fix: nf_def_var was called with a
scalar instead of array actual argument for dummy array argument
vdims. The simplest way to correct this bug is to replace by a call to
nf90_def_var.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/dyn3d/guide_mod.F90

    r4252 r4253  
    17101710    USE comvert_mod, ONLY: presnivs
    17111711    use netcdf95, only: nf95_def_var, nf95_put_var
    1712     use netcdf, only: nf90_float
     1712    use netcdf, only: nf90_float, nf90_def_var
    17131713   
    17141714    IMPLICIT NONE
     
    17521752
    17531753! Creation des variables dimensions
    1754         ierr=NF_DEF_VAR(nid,"LONU",NF_FLOAT,1,id_lonu,vid_lonu)
    1755         ierr=NF_DEF_VAR(nid,"LONV",NF_FLOAT,1,id_lonv,vid_lonv)
    1756         ierr=NF_DEF_VAR(nid,"LATU",NF_FLOAT,1,id_latu,vid_latu)
    1757         ierr=NF_DEF_VAR(nid,"LATV",NF_FLOAT,1,id_latv,vid_latv)
    1758         ierr=NF_DEF_VAR(nid,"LEVEL",NF_FLOAT,1,id_lev,vid_lev)
    1759         ierr=NF_DEF_VAR(nid,"cu",NF_FLOAT,2,(/id_lonu,id_latu/),vid_cu)
    1760         ierr=NF_DEF_VAR(nid,"cv",NF_FLOAT,2,(/id_lonv,id_latv/),vid_cv)
    1761         ierr=NF_DEF_VAR(nid,"au",NF_FLOAT,2,(/id_lonu,id_latu/),vid_au)
    1762         ierr=NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av)
     1754        ierr=NF90_DEF_VAR(nid,"LONU",NF90_FLOAT,id_lonu,vid_lonu)
     1755        ierr=NF90_DEF_VAR(nid,"LONV",NF90_FLOAT,id_lonv,vid_lonv)
     1756        ierr=NF90_DEF_VAR(nid,"LATU",NF90_FLOAT,id_latu,vid_latu)
     1757        ierr=NF90_DEF_VAR(nid,"LATV",NF90_FLOAT,id_latv,vid_latv)
     1758        ierr=NF90_DEF_VAR(nid,"LEVEL",NF90_FLOAT,id_lev,vid_lev)
     1759        ierr=NF90_DEF_VAR(nid,"cu",NF90_FLOAT,(/id_lonu,id_latu/),vid_cu)
     1760        ierr=NF90_DEF_VAR(nid,"cv",NF90_FLOAT,(/id_lonv,id_latv/),vid_cv)
     1761        ierr=NF90_DEF_VAR(nid,"au",NF90_FLOAT,(/id_lonu,id_latu/),vid_au)
     1762        ierr=NF90_DEF_VAR(nid,"av",NF90_FLOAT,(/id_lonv,id_latv/),vid_av)
    17631763        call nf95_def_var(nid, "alpha_T", nf90_float, (/id_lonv, id_latu/), &
    17641764             varid_alpha_t)
     
    17981798! Pressure (GCM)
    17991799        dim4=(/id_lonv,id_latu,id_lev,id_tim/)
    1800         ierr = NF_DEF_VAR(nid,"SP",NF_FLOAT,4,dim4,varid)
     1800        ierr = NF90_DEF_VAR(nid,"SP",NF90_FLOAT,dim4,varid)
    18011801! Surface pressure (guidage)
    18021802        IF (guide_P) THEN
    18031803            dim3=(/id_lonv,id_latu,id_tim/)
    1804             ierr = NF_DEF_VAR(nid,"ps",NF_FLOAT,3,dim3,varid)
     1804            ierr = NF90_DEF_VAR(nid,"ps",NF90_FLOAT,dim3,varid)
    18051805        ENDIF
    18061806! Zonal wind
    18071807        IF (guide_u) THEN
    18081808            dim4=(/id_lonu,id_latu,id_lev,id_tim/)
    1809             ierr = NF_DEF_VAR(nid,"u",NF_FLOAT,4,dim4,varid)
    1810             ierr = NF_DEF_VAR(nid,"ua",NF_FLOAT,4,dim4,varid)
    1811             ierr = NF_DEF_VAR(nid,"ucov",NF_FLOAT,4,dim4,varid)
     1809            ierr = NF90_DEF_VAR(nid,"u",NF90_FLOAT,dim4,varid)
     1810            ierr = NF90_DEF_VAR(nid,"ua",NF90_FLOAT,dim4,varid)
     1811            ierr = NF90_DEF_VAR(nid,"ucov",NF90_FLOAT,dim4,varid)
    18121812        ENDIF
    18131813! Merid. wind
    18141814        IF (guide_v) THEN
    18151815            dim4=(/id_lonv,id_latv,id_lev,id_tim/)
    1816             ierr = NF_DEF_VAR(nid,"v",NF_FLOAT,4,dim4,varid)
    1817             ierr = NF_DEF_VAR(nid,"va",NF_FLOAT,4,dim4,varid)
    1818             ierr = NF_DEF_VAR(nid,"vcov",NF_FLOAT,4,dim4,varid)
     1816            ierr = NF90_DEF_VAR(nid,"v",NF90_FLOAT,dim4,varid)
     1817            ierr = NF90_DEF_VAR(nid,"va",NF90_FLOAT,dim4,varid)
     1818            ierr = NF90_DEF_VAR(nid,"vcov",NF90_FLOAT,dim4,varid)
    18191819        ENDIF
    18201820! Pot. Temperature
    18211821        IF (guide_T) THEN
    18221822            dim4=(/id_lonv,id_latu,id_lev,id_tim/)
    1823             ierr = NF_DEF_VAR(nid,"teta",NF_FLOAT,4,dim4,varid)
     1823            ierr = NF90_DEF_VAR(nid,"teta",NF90_FLOAT,dim4,varid)
    18241824        ENDIF
    18251825! Specific Humidity
    18261826        IF (guide_Q) THEN
    18271827            dim4=(/id_lonv,id_latu,id_lev,id_tim/)
    1828             ierr = NF_DEF_VAR(nid,"q",NF_FLOAT,4,dim4,varid)
     1828            ierr = NF90_DEF_VAR(nid,"q",NF90_FLOAT,dim4,varid)
    18291829        ENDIF
    18301830       
Note: See TracChangeset for help on using the changeset viewer.