Changeset 5075 for LMDZ6/trunk/libf/misc


Ignore:
Timestamp:
Jul 19, 2024, 10:05:57 AM (12 months ago)
Author:
abarral
Message:

[continued & end] replace netcdf by lmdz_netcdf.F90 wrapper
"use netcdf" is now only used in lmdz_netcdf.F90 (except ecrad and obsolete/)
<include "netcdf.inc"> is now likewise only used in lmdz_netcdf.F90.

systematically specify explicitely <USE lmdz_netcdf, ONLY:> (probably left some missing, to correct later on)

Further replacement of nf_put_* by nf90_put_* (same for _get_)

[minor] replace deprecated boolean operators along the way

Location:
LMDZ6/trunk/libf/misc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/misc/lmdz_netcdf.F90

    r5073 r5075  
    44!  1) Turn netcdf into a "real" fortran module, without the INCLUDE call
    55!  2) Handle the NC_DOUBLE CPP key. This key should ONLY be used here.
    6 ! Ideally, the "real" netcdf module/headers should ONLY be called here. (WIP) TODO
     6! The "real" netcdf module/headers should ONLY be called here.
    77! ---------------------------------------------
    8 ! TODO check all uses of `use netcdf` + netcdf.inc
    98
    109MODULE lmdz_netcdf
  • LMDZ6/trunk/libf/misc/write_field.F90

    r2342 r5075  
    1 !
    2 ! $Id$
    3 !
    41module write_field
    5 implicit none
     2  USE lmdz_netcdf, ONLY: nf_sync, nf90_put_var, nf_enddef, nf_def_dim, nf_unlimited, &
     3      nf_clobber, nf90_format, nf_create, nf_def_var
     4
     5  implicit none
    66
    77  integer, parameter :: MaxWriteField = 100
     
    7373    subroutine WriteField_gen(name,Field,dimx,dimy,dimz)
    7474    implicit none
    75     include 'netcdf.inc'
    7675      character(len=*) :: name
    7776      integer :: dimx,dimy,dimz
     
    102101      count(4)=1
    103102
    104       status = NF_PUT_VARA_DOUBLE(FieldId(Index),FieldVarId(Index),start,count,Field)
     103      status = nf90_put_var(FieldId(Index),FieldVarId(Index),Field,start,count)
    105104      status = NF_SYNC(FieldId(Index))
    106105     
     
    109108    subroutine CreateNewField(name,dimx,dimy,dimz)
    110109    implicit none
    111     include 'netcdf.inc' 
    112110      character(len=*) :: name
    113111      integer :: dimx,dimy,dimz
     
    126124      status = NF_DEF_DIM(FieldId(NbField),'Z',dimz,TabDim(3))
    127125      status = NF_DEF_DIM(FieldId(NbField),'iter',NF_UNLIMITED,TabDim(4))
    128       status = NF_DEF_VAR(FieldId(NbField),FieldName(NbField),NF_DOUBLE,4,TabDim,FieldVarId(NbField))
     126      status = NF_DEF_VAR(FieldId(NbField),FieldName(NbField),NF90_FORMAT,4,TabDim,FieldVarId(NbField))
    129127      status = NF_ENDDEF(FieldId(NbField))
    130128
    131129    end subroutine CreateNewField
    132    
    133    
    134130   
    135131  subroutine write_field1D(name,Field)
     
    285281                      //trim(int2str(pos+offset))      &   
    286282                      //'," ---> ",g22.16," | ")'
    287 ! dépent de l'implémention, sur compaq, c'est necessaire
     283! d�pent de l'impl�mention, sur compaq, c'est necessaire
    288284!            Pos=Pos+ColumnSize
    289285          endif
  • LMDZ6/trunk/libf/misc/wxios.F90

    r4817 r5075  
    7070        reformaop = "average"
    7171       
    72         IF (op.EQ."inst(X)") THEN
     72        IF (op=="inst(X)") THEN
    7373            reformaop = "instant"
    7474        END IF
    7575       
    76         IF (op.EQ."once") THEN
     76        IF (op=="once") THEN
    7777            reformaop = "once"
    7878        END IF
    7979       
    80         IF (op.EQ."t_max(X)") THEN
     80        IF (op=="t_max(X)") THEN
    8181            reformaop = "maximum"
    8282        END IF
    8383       
    84         IF (op.EQ."t_min(X)") THEN
     84        IF (op=="t_min(X)") THEN
    8585            reformaop = "minimum"
    8686        END IF
     
    604604    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    605605    SUBROUTINE wxios_add_field(fieldname, fieldgroup, fieldlongname, fieldunit)
    606         USE netcdf, only: nf90_fill_real
     606        USE lmdz_netcdf, only: nf90_fill_real
    607607
    608608        IMPLICIT NONE
     
    621621        def = nf90_fill_real
    622622       
    623         IF (fieldunit .EQ. " ") THEN
     623        IF (fieldunit == " ") THEN
    624624            newunit = "-"
    625625        ELSE
     
    666666       
    667667        ! Ajout Abd pour NMC:
    668         IF (fid.LE.6) THEN
     668        IF (fid<=6) THEN
    669669          axis_id="presnivs"
    670670        ELSE
     
    682682       
    683683        !On selectionne le bon groupe de champs:
    684         IF (fdim.EQ.2) THEN
     684        IF (fdim==2) THEN
    685685          CALL xios_get_handle("fields_2D", fieldgroup)
    686686        ELSE
     
    726726            CALL xios_set_attr(field, level=field_level, enabled=.TRUE.)
    727727           
    728             IF (fdim.EQ.2) THEN
     728            IF (fdim==2) THEN
    729729                !Si c'est un champ 2D:
    730730                IF (prt_level >= 10) THEN
Note: See TracChangeset for help on using the changeset viewer.