ESCOMP / CISM-wrapper

Community Ice Sheet Model wrapper for CESM
http://www.cesm.ucar.edu/models/cesm2.0/land-ice/
Other
3 stars 16 forks source link

Length of message needs to be longer than filename (or at least as long) #27

Closed ekluzek closed 5 years ago

ekluzek commented 5 years ago

This is something that @billsacks added in for cism2_1_31. The subroutine glc_io_write_history_tavg_helper was added and it creates a string in the variable "message" from the variable "filename", and the problem is that filename can actually be longer than message, so this becomes a problem if that's the case. The reverse should actually be true in this case.

This can be a problem running with DEBUG=TRUE and with cases that happen to have long filenames.

The error I get on cheyenne is:

38:forrtl: severe (66): output statement overflows record, unit -5, file Internal List-Directed Write 38:Image PC Routine Line Source
38:cesm.exe 0000000004F9052C Unknown Unknown Unknown 38:cesm.exe 0000000004FEBB84 Unknown Unknown Unknown 38:cesm.exe 000000000340CB4F glc_io_mp_glcio 338 glc_io.F90 38:cesm.exe 0000000003431D75 history_tape_base 118 history_tape_base.F90 38:cesm.exe 0000000003430BC2 glc_history_mp_gl 116 glc_history.F90 38:cesm.exe 0000000003426A04 glc_initmod_mp_gl 370 glc_InitMod.F90

The relevant part of the code is:

    character(CL) :: filename

    !WHL - debug
    character(len=150) :: message
.
.
.
.  (NOTE: CL is 256, so the length of message should be at least that...)
.
.
       write(message,*) '   filename =', trim(filename)
billsacks commented 5 years ago

I believe this code was added by @whlipscomb and/or @Katetc . Given this:

    !WHL - debug
    character(len=150) :: message

I wonder if you can just remove this message variable and the associated print. Bill L?

Katetc commented 5 years ago

Looks pretty simple to fix. I can do this after finishing the MG3 tag. I don't mind leaving a message write out with the tavg helper filename. But we can remove it if it's not necessary as well. I'm ambivalent.

Thanks for catching that Eric!

ekluzek commented 5 years ago

By the way, how I came upon this was from running the rtm testlist (the mosart test list passed without problems, and it should include cism as well)...

These tests passed
================================================================================
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_gnu.rtm-default         
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-default           
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOff            
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOnIceOff           
SMS_D_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_gnu.rtm-default           
SMS_D_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-default         
================================================================================
These tests failed
================================================================================
ERS_D_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOnFloodOnEffvelOn        
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOnFloodOnEffvelOff     
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOnFloodOnEffvelOn

I think the problem might just be that those RTM tests have longer names, so it must have just gone over the string length.

whlipscomb commented 5 years ago

Erik, thanks for spotting this. I'm fine with removing the message variable and associated print.

Bill L.

On Tue, Jun 11, 2019 at 1:21 PM Erik Kluzek notifications@github.com wrote:

By the way, how I came upon this was from running the rtm testlist (the mosart test list passed without problems, and it should include cism as well)...

These tests passed

ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_gnu.rtm-default
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-default
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOff
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOnIceOff
SMS_D_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_gnu.rtm-default
SMS_D_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-default

These tests failed

ERS_D_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOnFloodOnEffvelOn
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOnFloodOnEffvelOff
ERS_Ld5.f10_f10_musgs.I2000Clm50BgcCropRtm.cheyenne_intel.rtm-rtmOnFloodOnEffvelOn

I think the problem might just be that those RTM tests have longer names, so it must have just gone over the string length.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ESCOMP/cism-wrapper/issues/27?email_source=notifications&email_token=ABU7CKP77WEGSTINFWC6YVDPZ73LXA5CNFSM4HXCAIW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXOG7TQ#issuecomment-500985806, or mute the thread https://github.com/notifications/unsubscribe-auth/ABU7CKPNZTMTWHMLM54T5UTPZ73LXANCNFSM4HXCAIWQ .

-- William Lipscomb National Center for Atmospheric Research Boulder, CO (505) 699-8016