Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

ERROR timeaddmonths(): MM out of range

kyle.clem

Kyle Clem
New Member
Hello,

I tried running CESM2.1 compset B1850 (after successfully building cesm.exe), but the run crashed with the following error in the cesm.log:

ERROR timeaddmonths(): MM out of range
set_time_float_from_date: error return from ESMF_TimeSet for set_time_float_from_date
ERROR: CHKRC

Any idea what the issue may be related to? I am attaching the entire log for your reference. There are also many reports of "NetCDF: Variable not found" and "NetCDF: Invalid dimension ID or name"...but I'm not sure if these are problems or if they are related to the error.

Thank you for any advice,
Kyle
 

Attachments

  • cesm.log.323973.200408-160532.txt
    86.9 KB · Views: 31

mlevy

Michael Levy
CSEG and Liaisons
Staff member
Hi Kyle,

I'm sorry you're having trouble with your port! I think the netCDF messages you are seeing are unrelated, they appear in most cesm.log files. My rough understanding of the "Variable not found" message is that some variables are read in from a file if the file contains them, otherwise they can be computed from other variables.

Are there error messages in any of your other log files? It looks like this error occurred during / immediately after reading CAM emissions, so atm.log.323973.200408-160532 might have more information on what went wrong. If you do find a log file with more error messages, could you please attach it? I'm hoping to track down the component that actually produced the error, and then I can move this issue to the appropriate forum for that component.

Thanks!
~Mike
 

kyle.clem

Kyle Clem
New Member
Dear Mike and Fvitt,

Wow, thank you both for your quick replies and assistance! I am confident we can to figure this out. Mike, I am attaching the atm log (please ignore the different date; I wasn't very smart and deleted the old case while trying to play with the batch settings, so this is a re-run, but same error).

Things seemed to be going smoothly, up until it crashed at ESMF_TimeSet opening the emissions file:

open_trc_datafile: /nfs/scratch/clemky/cesm/inputdata/atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a1_anthro-ene_vertical_1750-2015_1.9x2.5_c20170616.nc
set_time_float_from_date: error return from ESMF_TimeSet for set_time_float_from_date
ERROR: CHKRC

So indeed it does seem like it might be tied to ESMF_LIB...but I don't know how to check if this is set to TRUE. Can you please tell me where I can find this? ESMF_LIB is not an environment variable or a xml variable from what I could tell.

Thanks,
Kyle
 

Attachments

  • atm.log.324075.200409-085829.txt
    98.5 KB · Views: 17

mlevy

Michael Levy
CSEG and Liaisons
Staff member
Kyle,

Thanks for the atm.log, it does look like this should be in the CAM-Chem forum so I'll move it after making this comment.

I think Francis is referring to USE_ESMF_LIB in env_build.xml. Did you know you can give xmlquery a partial variable name with the -p option? I don't recall exactly when this was added, but it's definitely available in my CESM 2.1 sandbox:

Code:
$ ./xmlquery -p ESMF_LIB
    USE_ESMF_LIB: FALSE

~Mike
 

kyle.clem

Kyle Clem
New Member
Dear Mike and Francis,

I've confirmed that USE_ESMF_LIB is set to FALSE (because I do not have a ESMF library specified), and I've confirmed that the file (below) is there.

/nfs/scratch/clemky/cesm/inputdata/atm/cam/chem/emis/CMIP6_emissions_1750_2015_2deg/emissions-cmip6_so4_a1_anthro-ene_vertical_1750-2015_1.9x2.5_c20170616.nc

Any other ideas why set_time_float_from_date doesn't work when opening/after opening emissions-cmip6_so4_a1_anthro-ene_vertical_1750-2015_1.9x2.5_c20170616.nc file?
 

mlevy

Michael Levy
CSEG and Liaisons
Staff member
Sorry Kyle, I'm out of my league at this point. @fvitt does the USE_ESMF_LIB setting shed any light for you?
 

kyle.clem

Kyle Clem
New Member
Is it possible that I need ESMF libraries? Though Michael, it looks like you don't have it set as TRUE either.

Is it also possible that something may be wrong with the way I configured, built, or set the path to my NetCDF libraries? Below I show the versions and how I built my NetCDF libraries:

NetCDF-C
./configure CPPFLAGS=-I/nfs/home/clemky/software/hdf5/1.10.6/include LDFLAGS=-L/nfs/home/clemky/software/hdf5/1.10.6/lib --enable-netcdf-4 --disable-dap-remote-tests prefix=/nfs/home/clemky/software/netcdf-c/4.7.3

NetCDF-Fortran
./configure LDFLAGS=-L/nfs/home/clemky/software/netcdf-c/4.7.3/lib CPPFLAGS=-I/nfs/home/clemky/software/netcdf-c/4.7.3/include --prefix=/nfs/home/clemky/software/netcdf-fortran/4.5.2

I then link these two libraries together and the path to both libraries is set as NETCDF_PATH in config_compilers.xml
 

kyle.clem

Kyle Clem
New Member
I found this information on ESMF_Time from CESM1 shown below (http://www.cesm.ucar.edu/models/ces...l_code/esmf_wrf_timemgr/ESMF_TimeMod.F90.html).

I do not have NetCDF-C++ built...do you know if CESM2 needs NetCDF-C++ in addition to C and Fortran?

!------------------------------------------------------------------------------
! !PRIVATE TYPES:
private
!------------------------------------------------------------------------------
! ! ESMF_Time
!
! ! F90 class type to match C++ Time class in size only;
! ! all dereferencing within class is performed by C++ implementation

type ESMF_Time
type(ESMF_BaseTime) :: basetime ! inherit base class
! time instant is expressed as year + basetime
integer :: YR
type(ESMF_Calendar), pointer :: calendar ! associated calendar
end type
 

kyle.clem

Kyle Clem
New Member
So I am getting the error below when CESM opens a NetCDF file and calls the subroutine timeaddmonths:

ERROR timeaddmonths(): MM out of range

Here is what I tracked down about the actual subroutine (the portion that produces my error), written in F90 I believe:

SUBROUTINE timeaddmonths( time, MM, ierr ) 1,6
USE ESMF_BaseMod
USE ESMF_BaseTimeMod
USE ESMF_TimeMod
USE ESMF_CalendarMod
IMPLICIT NONE
TYPE(ESMF_Time), INTENT(INOUT) :: time
INTEGER, INTENT(IN) :: MM
INTEGER, INTENT(OUT) :: ierr
! locals
INTEGER :: nfeb
TYPE(ESMF_BaseTime), POINTER :: MMbdys(:)
ierr = ESMF_SUCCESS
! PRINT *,'DEBUG: BEGIN timeaddmonths()'
IF ( ( MM < 1 ) .OR. ( MM > MONTHS_PER_YEAR ) ) THEN
CALL wrf_message( 'ERROR timeaddmonths(): MM out of range' )
ierr = ESMF_FAILURE
ENDIF

Therefore, MM (month) is not between 1 and 12 inclusive. I am under the impression that the dates are written yyyy-mm-dd-sssss. Is it possible that the error could be related to reading in the wrong direction (right to left versus left to right) such that it is reading some other aspect of the date (dd or sssss) instead of MM which isn't between 1 and 12?
 

zjjiang

ZhongjingJiang
New Member
Hi, all

I've found this problem is probably because the inputdata file is broken. Maybe you've downloaded only part of a *.nc file, then the date read in will be 0 and report an error: MM out of range when Call cime_init().

Thanks,
Zhongjing
 
Top