Changeset 5071 for LMDZ6/trunk/libf


Ignore:
Timestamp:
Jul 18, 2024, 3:07:22 PM (4 months ago)
Author:
abarral
Message:

Replace nf_put_var* by nf90_put_var as discussed w/ Lionel

Location:
LMDZ6/trunk/libf
Files:
3 edited

Legend:

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

    r5068 r5071  
    1212  USE Write_Field
    1313  USE lmdz_netcdf, ONLY: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close, &
    14           nf90_inq_dimid, nf90_inquire_dimension, nf_put_var_rd, nf90_float, nf90_def_var, &
     14          nf90_inq_dimid, nf90_inquire_dimension, nf90_float, nf90_def_var, &
    1515          nf_create, nf_def_dim, nf_open, nf_unlimited, nf_write, nf_enddef, nf_redef, &
    16           nf_close, nf_inq_varid, nf_put_vara_rd, nf90_get_var, nf90_noerr, nf_clobber, &
    17           nf_64bit_offset, nf_inq_dimid, nf_inq_dimlen
     16          nf_close, nf_inq_varid, nf90_get_var, nf90_noerr, nf_clobber, &
     17          nf_64bit_offset, nf_inq_dimid, nf_inq_dimlen, nf90_put_var
    1818  USE pres2lev_mod, ONLY: pres2lev
    1919
     
    17071707
    17081708! Enregistrement des variables dimensions
    1709         ierr = nf_put_var_rd(nid,vid_lonu,rlonu*180./pi)
    1710         ierr = nf_put_var_rd(nid,vid_lonv,rlonv*180./pi)
    1711         ierr = nf_put_var_rd(nid,vid_latu,rlatu*180./pi)
    1712         ierr = nf_put_var_rd(nid,vid_latv,rlatv*180./pi)
    1713         ierr = nf_put_var_rd(nid,vid_lev,presnivs)
    1714         ierr = nf_put_var_rd(nid,vid_cu,cu)
    1715         ierr = nf_put_var_rd(nid,vid_cv,cv)
    1716         ierr = nf_put_var_rd(nid,vid_au,alpha_u)
    1717         ierr = nf_put_var_rd(nid,vid_av,alpha_v)
     1709        ierr = nf90_put_var(nid,vid_lonu,rlonu*180./pi)
     1710        ierr = nf90_put_var(nid,vid_lonv,rlonv*180./pi)
     1711        ierr = nf90_put_var(nid,vid_latu,rlatu*180./pi)
     1712        ierr = nf90_put_var(nid,vid_latv,rlatv*180./pi)
     1713        ierr = nf90_put_var(nid,vid_lev,presnivs)
     1714        ierr = nf90_put_var(nid,vid_cu,cu)
     1715        ierr = nf90_put_var(nid,vid_cv,cv)
     1716        ierr = nf90_put_var(nid,vid_au,alpha_u)
     1717        ierr = nf90_put_var(nid,vid_av,alpha_v)
    17181718        call nf95_put_var(nid, varid_alpha_t, alpha_t)
    17191719        call nf95_put_var(nid, varid_alpha_q, alpha_q)
     
    17891789    END SELECT
    17901790
    1791     ierr = nf_put_vara_rd(nid,varid,start,count,field2)
     1791    ierr = nf90_put_var(nid,varid,field2,start,count)
    17921792    ierr = NF_CLOSE(nid)
    17931793
  • LMDZ6/trunk/libf/dyn3dmem/guide_loc_mod.F90

    r5070 r5071  
    1010  use lmdz_netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close, &
    1111          nf90_inq_dimid, nf90_inquire_dimension, nf_get_vara_rd, nf_inq_dimid, &
    12           nf_inq_dimlen, nf_enddef, nf_def_dim, nf_put_var_rd, nf_noerr, nf_close, nf_inq_varid, &
     12          nf_inq_dimlen, nf_enddef, nf_def_dim, nf90_put_var, nf_noerr, nf_close, nf_inq_varid, &
    1313          nf_redef, nf_write, nf_unlimited, nf_float, nf_clobber, nf_64bit_offset, nf90_float, &
    14           nf_create, nf_def_var, nf_open, nf_put_vara_rd
     14          nf_create, nf_def_var, nf_open
    1515  USE parallel_lmdz
    1616  USE pres2lev_mod, only: pres2lev
     
    22572257
    22582258! Enregistrement des variables dimensions
    2259         ierr = nf_put_var_rd(nid,vid_lonu,rlonu*180./pi)
    2260         ierr = nf_put_var_rd(nid,vid_lonv,rlonv*180./pi)
    2261         ierr = nf_put_var_rd(nid,vid_latu,rlatu*180./pi)
    2262         ierr = nf_put_var_rd(nid,vid_latv,rlatv*180./pi)
    2263         ierr = nf_put_var_rd(nid,vid_lev,presnivs)
    2264         ierr = nf_put_var_rd(nid,vid_cu,cu)
    2265         ierr = nf_put_var_rd(nid,vid_cv,cv)
    2266         ierr = nf_put_var_rd(nid,vid_au,zu)
    2267         ierr = nf_put_var_rd(nid,vid_av,zv)
     2259        ierr = nf90_put_var(nid,vid_lonu,rlonu*180./pi)
     2260        ierr = nf90_put_var(nid,vid_lonv,rlonv*180./pi)
     2261        ierr = nf90_put_var(nid,vid_latu,rlatu*180./pi)
     2262        ierr = nf90_put_var(nid,vid_latv,rlatv*180./pi)
     2263        ierr = nf90_put_var(nid,vid_lev,presnivs)
     2264        ierr = nf90_put_var(nid,vid_cu,cu)
     2265        ierr = nf90_put_var(nid,vid_cv,cv)
     2266        ierr = nf90_put_var(nid,vid_au,zu)
     2267        ierr = nf90_put_var(nid,vid_av,zv)
    22682268        call nf95_put_var(nid, varid_alpha_t, zt)
    22692269        call nf95_put_var(nid, varid_alpha_q, zq)
     
    23552355!$OMP MASTER
    23562356
    2357     ierr = nf_put_vara_rd(nid,varid,start,count,field_glo)
     2357    ierr = nf90_put_var(nid,varid,field_glo,start,count)
    23582358    ierr = NF_CLOSE(nid)
    23592359
  • LMDZ6/trunk/libf/misc/lmdz_netcdf.F90

    r5069 r5071  
    3030CONTAINS
    3131
    32   ! Note: below, we use the same declarations as the fortran netcdf lib, hence the use of (*)
    33 
    34   ! We'd like to use "nf_put_var", but it already exists as a legacy nc4 function
    35   ! CPP_NC_DOUBLE wrapper around nf_put_var_real, nf_put_var_double
    36   INTEGER FUNCTION nf_put_var_rd(ncid, varid, vals)
    37     INTEGER, INTENT(IN) :: ncid, varid
    38     REAl(REAL_FORMAT), INTENT(IN) :: vals(*)  ! (*) as declared in netcdf lib
    39 
    40     IF (CPP_NC_DOUBLE) THEN
    41       nf_put_var_rd = nf_put_var_double(ncid, varid, vals)
    42     ELSE
    43       nf_put_var_rd = nf_put_var_real(ncid, varid, vals)
    44     END IF
    45   END FUNCTION nf_put_var_rd
    46 
    47   ! CPP_NC_DOUBLE wrapper around nf_put_vara_real, nf_put_vara_double
    48   INTEGER FUNCTION nf_put_vara_rd(ncid, varid, start, counts, vals)
    49     INTEGER, INTENT(IN) :: ncid, varid
    50     INTEGER, INTENT(IN) :: start(*), counts(*)
    51     REAl(REAL_FORMAT), INTENT(IN) :: vals(*)
    52 
    53     IF (CPP_NC_DOUBLE) THEN
    54       nf_put_vara_rd = nf_put_vara_double(ncid, varid, start, counts, vals)
    55     ELSE
    56       nf_put_vara_rd = nf_put_vara_real(ncid, varid, start, counts, vals)
    57     END IF
    58   END FUNCTION nf_put_vara_rd
    59 
    60   ! CPP_NC_DOUBLE wrapper around nf_get_vara_real, nf_get_vara_double
    61   INTEGER FUNCTION nf_get_vara_rd(ncid, varid, start, counts, vals)
    62     INTEGER, INTENT(IN) :: ncid, varid
    63     INTEGER, INTENT(IN) :: start(*), counts(*)
    64     REAl(REAL_FORMAT), INTENT(OUT) :: vals(*)
    65 
    66     IF (CPP_NC_DOUBLE) THEN
    67       nf_get_vara_rd = nf_get_vara_double(ncid, varid, start, counts, vals)
    68     ELSE
    69       nf_get_vara_rd = nf_get_vara_real(ncid, varid, start, counts, vals)
    70     END IF
    71   END FUNCTION nf_get_vara_rd
    72 
    7332END MODULE lmdz_netcdf
Note: See TracChangeset for help on using the changeset viewer.