Changeset 4179


Ignore:
Timestamp:
Jun 18, 2022, 1:32:25 AM (2 years ago)
Author:
lguez
Message:

Use an external updated NetCDF95 library

Remove NetCDF95 from source files. We want to use an up-to-date
NetCDF95 library to read a NetCDF file containing groups, for aerosol
optical properties. It seems complicated to keep the NetCDF95 library
inside LMDZ because:

  • NetCDF95 now also needs a C compiler. I do not know how to make this work with FCM.


  • NetCDF95 cannot be compiled with the -r8 option: some specific procedures in a generic interface become identical.


  • Secondarily, we would have to change the names of files to adhere to the LMDZ standard. We are not glad to do that every time we update.


For now, we can compile using the options -include and -link of
makelmdz_fcm.

As we use an updated NetCDF95 library, we have to update some of the
calls in LMDZ. Those are the calls to nf95_inquire_variable and
nf95_gw_var which used to take a pointer argument and now take an
allocatable argument.

Location:
LMDZ6/branches/LMDZ_ECRad
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ_ECRad/bld.cfg

    r4177 r4179  
    3838src::ext_src %EXT_SRC
    3939src::Ocean_skin %SRC_PATH/%PHYS/Ocean_skin
    40 src::NetCDF95 %SRC_PATH/misc/NetCDF95
    4140
    4241bld::lib            lmdz
     
    101100bld::excl_dep        use::ifile_attr
    102101bld::excl_dep        use::ixml_tree
     102bld::excl_dep        use::netcdf95
    103103
    104104# Don't generate interface files
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/open_climoz_m.F90

    r2821 r4179  
    2727! Arguments (OpenMP shared):
    2828  INTEGER, INTENT(OUT):: ncid      !--- "climoz_LMDZ.nc" identifier
    29   REAL, POINTER :: press_in_cen(:) !--- at cells centers
    30   REAL, POINTER :: press_in_edg(:) !--- at the interfaces (pressure intervals)
    31   REAL, POINTER :: time_in(:)      !--- records times, in days since Jan. 1st
     29  REAL, allocatable, intent(out):: press_in_cen(:) !--- at cells centers
     30  REAL, allocatable, INTENT(OUT):: press_in_edg(:) !--- at the interfaces (pressure intervals)
     31  REAL, allocatable, intent(out):: time_in(:)      !--- records times, in days since Jan. 1st
    3232  LOGICAL, INTENT(IN) :: daily     !--- daily files (calendar dependent days nb)
    3333  LOGICAL, INTENT(IN) :: adjust    !--- tropopause adjustement required
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/physiq_mod.F90

    r4170 r4179  
    11091109    !     climatology and the daylight climatology
    11101110    INTEGER,SAVE :: ncid_climoz                ! NetCDF file identifier
    1111     REAL, POINTER, SAVE :: press_cen_climoz(:) ! Pressure levels
    1112     REAL, POINTER, SAVE :: press_edg_climoz(:) ! Edges of pressure intervals
    1113     REAL, POINTER, SAVE :: time_climoz(:)      ! Time vector
     1111    REAL, allocatable, SAVE :: press_cen_climoz(:) ! Pressure levels
     1112    REAL, allocatable, SAVE :: press_edg_climoz(:) ! Edges of pressure intervals
     1113    REAL, allocatable, SAVE :: time_climoz(:)      ! Time vector
    11141114    CHARACTER(LEN=13), PARAMETER :: vars_climoz(2) &
    11151115                                  = ["tro3         ","tro3_daylight"]
     
    53515351         IF (read_climoz >= 1) THEN
    53525352           IF (is_mpi_root) CALL nf95_close(ncid_climoz)
    5353             DEALLOCATE(press_edg_climoz) ! pointer
    5354             DEALLOCATE(press_cen_climoz) ! pointer
     5353            DEALLOCATE(press_edg_climoz)
     5354            DEALLOCATE(press_cen_climoz)
    53555355         ENDIF
    53565356       
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/press_coefoz_m.F90

    r1907 r4179  
    44  implicit none
    55
    6   real, pointer, save:: plev(:)
     6  real, allocatable, save:: plev(:)
    77  ! (pressure level of Mobidic input data, converted to Pa, in strictly
    88  ! ascending order)
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/readaerosolstrato.F90

    r3531 r4179  
    3131    integer n_lev   ! number of levels in the input data
    3232    integer n_month ! number of months in the input data
    33     real, pointer:: latitude(:)
    34     real, pointer:: longitude(:)
    35     real, pointer:: time(:)
    36     real, pointer:: lev(:)
     33    real, allocatable:: latitude(:)
     34    real, allocatable:: longitude(:)
     35    real, allocatable:: time(:)
     36    real, allocatable:: lev(:)
    3737    integer i, k, band, wave
    3838    integer, save :: mth_pre=1
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/readaerosolstrato_m.F90

    r3436 r4179  
    3232!  USE YOERAD, ONLY : NLW
    3333  IMPLICIT NONE
    34   REAL, POINTER:: latitude(:)
    35   REAL, POINTER:: longitude(:)
     34  REAL, allocatable:: latitude(:)
     35  REAL, allocatable:: longitude(:)
    3636  INTEGER :: nlat, nlon
    3737  REAL    :: null_array(0)
     
    7575!  USE YOERAD, ONLY : NLW
    7676  IMPLICIT NONE
    77   REAL, POINTER:: latitude(:)
    78   REAL, POINTER:: wav(:)
     77  REAL, allocatable:: latitude(:)
     78  REAL, allocatable:: wav(:)
    7979  INTEGER :: nlat,n_wav
    8080  REAL    :: null_array(0)
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/readchlorophyll.F90

    r3531 r4179  
    2929    INTEGER n_lev   ! number of levels in the input data
    3030    INTEGER n_month ! number of months in the input data
    31     REAL, POINTER :: latitude(:)
    32     REAL, POINTER :: longitude(:)
    33     REAL, POINTER :: time(:)
     31    REAL, ALLOCATABLE :: latitude(:)
     32    REAL, ALLOCATABLE :: longitude(:)
     33    REAL, ALLOCATABLE :: time(:)
    3434    INTEGER i, k
    3535    INTEGER, SAVE :: mth_pre
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/regr_horiz_time_climoz_m.F90

    r3465 r4179  
    8888  INTEGER :: nlev_in                       ! Number of pressure levels
    8989  INTEGER :: nmth_in                       ! Number of months
    90   REAL, POINTER     :: lon_in(:)           ! Longitudes   (ascending order, rad)
    91   REAL, POINTER     :: lat_in(:)           ! Latitudes    (ascending order, rad)
    92   REAL, POINTER     :: lev_in(:)           ! Pressure levels (ascen. order, hPa)
     90  REAL, ALLOCATABLE:: lon_in(:)           ! Longitudes   (ascending order, rad)
     91  REAL, ALLOCATABLE:: lat_in(:)           ! Latitudes    (ascending order, rad)
     92  REAL, ALLOCATABLE:: lev_in(:)           ! Pressure levels (ascen. order, hPa)
    9393  REAL, ALLOCATABLE :: lon_in_edge(:)      ! Longitude intervals edges
    9494                                           !              (ascending order,  / )
     
    125125  INTEGER :: fID_in_m, fID_in, levID_ou, dimid, vID_in(read_climoz), ntim_ou
    126126  INTEGER :: fID_in_p, fID_ou, timID_ou, varid, vID_ou(read_climoz), ndims, ncerr
    127   INTEGER, POINTER :: dIDs(:)
     127  INTEGER, ALLOCATABLE :: dIDs(:)
    128128  CHARACTER(LEN=20) :: cal_ou     !--- Calendar; no time inter => same as input
    129129  CHARACTER(LEN=80) :: press_unit !--- Pressure unit
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/regr_lat_time_coefoz_m.F90

    r2788 r4179  
    5555    integer n_lat! number of latitudes in the input data
    5656
    57     real, pointer:: latitude(:)
     57    real, allocatable:: latitude(:)
    5858    ! (of input data, converted to rad, sorted in strictly ascending order)
    5959
     
    6262    ! ascending order)
    6363
    64     real, pointer:: plev(:) ! pressure level of input data
     64    real, allocatable:: plev(:) ! pressure level of input data
    6565    logical desc_lat ! latitude in descending order in the input file
    6666
     
    172172    forall (j = 2:n_lat) lat_in_edg(j) = (latitude(j - 1) + latitude(j)) / 2
    173173    lat_in_edg(n_lat + 1) = pi / 2
    174     deallocate(latitude) ! pointer
     174    deallocate(latitude)
    175175
    176176    call nf95_inq_varid(ncid_in, "plev", varid)
     
    192192    call nf95_put_var(ncid_out, varid_plev, plev)
    193193
    194     deallocate(plev) ! pointer
     194    deallocate(plev)
    195195
    196196    allocate(o3_par_in(n_lat, n_plev, 12))
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/tracco2i_mod.F90

    r4050 r4179  
    358358
    359359    INTEGER :: n_glo, n_month
    360     REAL, POINTER:: vector(:), time(:)
     360    REAL, allocatable:: vector(:), time(:)
    361361    REAL,ALLOCATABLE       :: flx_co2ff_glo(:,:) !  fossil-fuel CO2
    362362    REAL,ALLOCATABLE       :: flx_co2bb_glo(:,:) !  biomass-burning CO2
  • LMDZ6/branches/LMDZ_ECRad/makelmdz

    r4177 r4179  
    9595EXT_SRC=""
    9696#src_dirs: directories containing source files
    97 src_dirs="grid misc misc/NetCDF95"
     97src_dirs="grid misc"
    9898########################################################################
    9999# lecture des options
Note: See TracChangeset for help on using the changeset viewer.