ESCOMP / CTSM

Community Terrestrial Systems Model (includes the Community Land Model of CESM)
http://www.cesm.ucar.edu/models/cesm2.0/land/
Other
308 stars 312 forks source link

mkprocdata_map requires NetCDF4 interface to build #1130

Closed ekluzek closed 4 years ago

ekluzek commented 4 years ago

Brief summary of bug

mkprocdata test is failing on izumi with a build problem.

General bug information

CTSM version you are using: ctsm1.0.dev108-3-g19349614 release-cesm2.2 branch Does this bug cause significantly incorrect results in the model's science? N

Configurations affected: just mkprocdata on izumi

Important output or errors that show the problem

s/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(7): error #7013: This module file was not generated by any release of this compiler.   [NETCDF]
  use netcdf
------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(54): error #6683: A kind type parameter must be a compile-time constant.   [R8]
  real(r8)          :: dattvalue
-------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(55): error #6683: A kind type parameter must be a compile-time constant.   [R4]
  real(r4)          :: fattvalue
-------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(57): error #6457: This derived type name has not been declared.   [GRIDMAP_TYPE]
  type(gridmap_type):: tgridmap
-------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(279): error #6457: This derived type name has not been declared.   [GRIDMAP_TYPE]
    type(gridmap_type), intent(inout) :: tgridmap
---------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(285): error #6683: A kind type parameter must be a compile-time constant.   [R8]
    real(r8), allocatable :: rarrayi(:),rarrayo(:)
---------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(291): error #6683: A kind type parameter must be a compile-time constant.   [R8]
    real(r8), allocatable, save :: landfraci(:) 
---------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(292): error #6683: A kind type parameter must be a compile-time constant.   [R8]
    real(r8), allocatable, save :: src_mask(:)
---------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(294): error #6683: A kind type parameter must be a compile-time constant.   [R8]
    real(r8):: spval = 1.e36 
---------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(488): error #6457: This derived type name has not been declared.   [GRIDMAP_TYPE]
     type(gridmap_type), intent(in) :: tgridmap ! grid information; we're interested in
----------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(495): error #6683: A kind type parameter must be a compile-time constant.   [R8]
     real(r8), dimension(:,:), allocatable :: area_2d  ! grid cell areas, on a 2-d array,
----------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(66): error #6404: This name does not have a type, and must have an explicit type.   [NF90_NOWRITE]
  call handle_ncerr(nf90_open(locfn, NF90_NOWRITE, ncidi))
-------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(66): error #6404: This name does not have a type, and must have an explicit type.   [NF90_OPEN]
  call handle_ncerr(nf90_open(locfn, NF90_NOWRITE, ncidi))
--------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(70): error #6404: This name does not have a type, and must have an explicit type.   [NF90_CLOSE]
  call handle_ncerr(nf90_close(ncidi))
--------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(71): error #6404: This name does not have a type, and must have an explicit type.   [TGRIDMAP]
  call gridmap_mapread(tgridmap, locfn)
-----------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(103): error #6404: This name does not have a type, and must have an explicit type.   [NF90_64BIT_OFFSET]
  call handle_ncerr(nf90_create(fileo, NF90_64BIT_OFFSET, ncido))
---------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(103): error #6404: This name does not have a type, and must have an explicit type.   [NF90_CREATE]
  call handle_ncerr(nf90_create(fileo, NF90_64BIT_OFFSET, ncido))
--------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(110): error #6404: This name does not have a type, and must have an explicit type.   [NF90_INQUIRE]
  call handle_ncerr(nf90_inquire(ncidi, nDimensions, nVariables, &
--------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(115): error #6632: Keyword arguments are invalid without an explicit interface.   [DIMID]
     call handle_ncerr(nf90_inquire_dimension(ncidi, dimid=nd, name=dimname, len=dimlen))
-----------------------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(115): error #6632: Keyword arguments are invalid without an explicit interface.   [NAME]
     call handle_ncerr(nf90_inquire_dimension(ncidi, dimid=nd, name=dimname, len=dimlen))
---------------------------------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(115): error #6632: Keyword arguments are invalid without an explicit interface.   [LEN]
     call handle_ncerr(nf90_inquire_dimension(ncidi, dimid=nd, name=dimname, len=dimlen))
-----------------------------------------------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(115): error #6404: This name does not have a type, and must have an explicit type.   [NF90_INQUIRE_DIMENSION]
     call handle_ncerr(nf90_inquire_dimension(ncidi, dimid=nd, name=dimname, len=dimlen))
-----------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(121): error #6632: Keyword arguments are invalid without an explicit interface.   [NAME]
        call handle_ncerr(nf90_def_dim(ncido, name=dimname, len=nf90_unlimited, dimid=dimid))
----------------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(121): error #6632: Keyword arguments are invalid without an explicit interface.   [LEN]
        call handle_ncerr(nf90_def_dim(ncido, name=dimname, len=nf90_unlimited, dimid=dimid))
------------------------------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(121): error #6404: This name does not have a type, and must have an explicit type.   [NF90_UNLIMITED]
        call handle_ncerr(nf90_def_dim(ncido, name=dimname, len=nf90_unlimited, dimid=dimid))
----------------------------------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(121): error #6632: Keyword arguments are invalid without an explicit interface.   [DIMID]
        call handle_ncerr(nf90_def_dim(ncido, name=dimname, len=nf90_unlimited, dimid=dimid))
--------------------------------------------------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(121): error #6404: This name does not have a type, and must have an explicit type.   [NF90_DEF_DIM]
        call handle_ncerr(nf90_def_dim(ncido, name=dimname, len=nf90_unlimited, dimid=dimid))
--------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(125): error #6632: Keyword arguments are invalid without an explicit interface.   [NAME]
           call handle_ncerr(nf90_def_dim(ncido, name='lon', len=nlon, dimid=dimid_lon)) 
-------------------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(125): error #6632: Keyword arguments are invalid without an explicit interface.   [LEN]
           call handle_ncerr(nf90_def_dim(ncido, name='lon', len=nlon, dimid=dimid_lon)) 
-------------------------------------------------------------^
/fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90(125): error #6632: Keyword arguments are invalid without an explicit interface.   [DIMID]
           call handle_ncerr(nf90_def_dim(ncido, name='lon', len=nlon, dimid=dimid_lon)) 
-----------------------------------------------------------------------^
/tmp/iforty8TOPO.i90(527): catastrophic error: Too many errors, exiting
compilation aborted for /fs/cgd/data0/erik/ctsm_release-cesm2.2/tools/mkprocdata_map/src/./mkprocdata_map.F90 (code 1)
Makefile.common:348: recipe for target 'mkprocdata_map.o' failed
gmake: *** [mkprocdata_map.o] Error 1
ekluzek commented 4 years ago

I'm not completely sure if this still is a useful tool or not. It should be easy to fix. But, we should consider if we still want to keep it. The alternative would be for people to use their own tools to do this function.

billsacks commented 4 years ago

I was about to make the same comment. Mariana and I put this tool in place a long time ago, and I'm not sure if anyone has ever actually used it. Arguably, it may become more important if CAM starts using unstructured grids more commonly. But at the same time, there are probably better tools available for doing this now.

olyson commented 4 years ago

FYI, I've used this in the past (not lately though) to regrid individual CLM SE history files, in part because it's pretty fast compared to other methods I've tried (e.g., NCL). However, as has been mentioned, if it goes away, I'm sure there are other tools available.

ekluzek commented 4 years ago

I asked Adam Herrington and Patrick Callaghan about they don't have any robust solution either. So I suppose we should keep it around for at least now. I put this as a discussion point for Thursday.

I also don't have anything general enough that CLM could use ... the problem is that (AKAIK) the connectivity files (SCRIP or ESMF files) cannot be created easily on the fly. Another issue is that the lat-lon arrays in the CLM output set points over ocean to missing values. So generating a weights file requires grabbing those coordinates from a grid or domain file as well.

You could look into adapting the se-dycore module cam/src/dynamics/se/interp_mod.F90 that interpolates to a lat-lon grid during run-time. This is invoked in user_nl_cam:

interpolate_output = .true.
interpolate_nlat = 192
interpolate_nlon = 288

Which in this example would dump out i/o on the f09 grid.

Adam

On Mon, Aug 31, 2020 at 1:44 PM Patrick Callaghan <patc@ucar.edu> wrote:
Hi Erik,

  I wrote a plugin for the VISIT program, which is what I use to look at things.
It is not widely used and there has been no interest in using it, so it is just a
thing I do. I had a prototype to adapt this plugin for a simple viewer like ncview,
but I have not had time to work on it. I think that there are a number of people
working on display programs in python, but I have not seen any robust working
versions yet. 

--> Patrick
ekluzek commented 4 years ago

OK, the underlying problem is that the build requires NetCDF library to be built with the NetCDF4 interface. So we'll just support this on cheyenne and drop testing it on CGD machines.