Ignore:
Timestamp:
Jul 20, 2024, 6:08:57 PM (2 months ago)
Author:
abarral
Message:

Move lmdz_netcdf_format.F90 -> lmdz_cppkeys_wrapper.F90 to handle other CPP keys
Replace all (except wrapper) use of CPP_PHYS by fortran logical

File:
1 moved

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/misc/lmdz_cppkeys_wrapper.F90

    r5089 r5090  
    11! ---------------------------------------------
    2 ! This module serves as a wrapper around netcdf.
    3 ! It serves two primary functions:
    4 !  1) Turn netcdf into a "real" fortran module, without the INCLUDE call
    5 !  2) Handle the NC_DOUBLE CPP key. This key should ONLY be used here.
    6 ! The "real" netcdf module/headers should ONLY be called here.
     2! This file is part of an effort to replace most uses of preprocessor CPP keys by fortran variables,
     3! to improve readability, compilation coverage, and linting.
     4! CPP keys used here should ONLY be used here,
     5! and imported through USE ..., ONLY: ... elsewhere
     6! CPP keys supported (key -> fortran variables associated):
     7!      NC_DOUBLE -> nf90_format
     8!      CPP_PHYS  -> CPPKEY_PHYS
    79! ---------------------------------------------
    810
    9 MODULE lmdz_netcdf_format
     11MODULE lmdz_cppkeys_wrapper
    1012  USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : REAL64, REAL32
    1113  USE netcdf, ONLY: nf90_float, nf90_double
    1214  IMPLICIT NONE; PRIVATE
    13   PUBLIC nf90_format
     15  PUBLIC nf90_format, CPPKEY_PHYS
    1416
    1517#ifdef NC_DOUBLE
     
    1820  INTEGER, PARAMETER :: nf90_format = nf90_float
    1921#endif
    20 END MODULE lmdz_netcdf_format
     22
     23#ifdef CPP_PHYS
     24  LOGICAL, PARAMETER :: CPPKEY_PHYS = .TRUE.
     25#else
     26  LOGICAL, PARAMETER :: CPPKEY_PHYS = .FALSE.
     27#endif
     28
     29END MODULE lmdz_cppkeys_wrapper
Note: See TracChangeset for help on using the changeset viewer.