Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad format in error reporting for dtlimit in dshr_strdata_mod #272

Open
ekluzek opened this issue Apr 12, 2024 · 2 comments
Open

Bad format in error reporting for dtlimit in dshr_strdata_mod #272

ekluzek opened this issue Apr 12, 2024 · 2 comments
Labels
bug Something isn't working CESM Only

Comments

@ekluzek
Copy link
Collaborator

ekluzek commented Apr 12, 2024

The code in streams/dshr_strdata_mod.F90 has a bad format when the dtlimit error is written out. This is in cdeps1.0.28
We found this issue in CTSM here:

ESCOMP/CTSM#2155 (comment)

The error/traceback looks like this:

forrtl: severe (61): format/variable-type mismatch, unit -132, file /glade/u/home/wwieder/scratch/PLUMBER2_tests/ZM-Mon_SP_test2/run/lnd.log.4099263.desched1.240412-105520
Image              PC                Routine            Line        Source             
cesm.exe           0000000001375993  Unknown               Unknown  Unknown
cesm.exe           0000000000FBDD94  dshr_strdata_mod_        1023  dshr_strdata_mod.F90
cesm.exe           0000000000707D58  laistreammod_mp_l         190  laiStreamMod.F90
cesm.exe           00000000005E201C  clm_driver_mp_clm         474  clm_driver.F90
cesm.exe           000000000058F44E  lnd_comp_nuopc_mp         904  lnd_comp_nuopc.F90

The error is in this block of code:

                   if ((sdat%pstrm(ns)%dtmax/sdat%pstrm(ns)%dtmin) > sdat%stream(ns)%dtlimit) then
                      if (sdat%mainproc) then
                         write(sdat%stream(1)%logunit,'(a,i8)') trim(subname),' ERROR: for stream ',ns
                         write(sdat%stream(1)%logunit,'(a,i8)') trim(subname),' ERROR: dday = ',dday
                         write(sdat%stream(1)%logunit,'(a,4(f15.5,2x))') trim(subName),' ERROR: dtime, dtmax, dtmin, dtlimit = ',&
                              dtime, sdat%pstrm(ns)%dtmax, sdat%pstrm(ns)%dtmin, sdat%stream(ns)%dtlimit
                         write(sdat%stream(1)%logunit,'(a,4(i10,2x))') trim(subName),' ERROR: ymdLB, todLB, ymdUB, todUB = ', &
                              sdat%pstrm(ns)%ymdLB, sdat%pstrm(ns)%todLB, sdat%pstrm(ns)%ymdUB, sdat%pstrm(ns)%todUB
                      end if
                      write(6,*) trim(subname),' ERROR: for stream ',ns, ' and calendar ',trim(calendar)
                      write(6,*) trim(subName),' ERROR: dtime, dtmax, dtmin, dtlimit = ',&
                           dtime, sdat%pstrm(ns)%dtmax, sdat%pstrm(ns)%dtmin, sdat%stream(ns)%dtlimit
                      write(6,*) trim(subName),' ERROR: ymdLB, todLB, ymdUB, todUB = ', &
                           sdat%pstrm(ns)%ymdLB, sdat%pstrm(ns)%todLB, sdat%pstrm(ns)%ymdUB, sdat%pstrm(ns)%todUB
                      call shr_sys_abort(trim(subName)//' ERROR dt limit for stream, see atm.log output')
                   endif
@ekluzek ekluzek added bug Something isn't working CESM Only labels Apr 12, 2024
@ekluzek
Copy link
Collaborator Author

ekluzek commented Apr 12, 2024

I verified that this problem is NOT fixed in the latest CDEPS version.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Apr 22, 2024

@swensosc gives the fix as the following:

I think I found a bug in cdeps while helping katya. In components/cdeps/streams/dshr_strdata_mod.F90, the format statements in lines 1012-1018 are wrong and the a should be 2a e.g '(a,i8)' should be '(2a,i8)', otherwise it dies due to that without going further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CESM Only
Projects
None yet
Development

No branches or pull requests

1 participant