NCAR / MOM6

NCAR/CESM fork of the Modular Ocean Model v.6 (MOM6)
Other
3 stars 20 forks source link

STOKES_MOST = True fails with Intel compiler in DEBUG mode #315

Open gustavo-marques opened 1 month ago

gustavo-marques commented 1 month ago

When compiling with the Intel compiler and enabling DEBUG = True, setting STOKES_MOST = True leads to a runtime error:

forrtl: severe (408): fort: (3): Subscript #1 of the array IFACEHEIGHT has value 0 which is less than the lower bound of 1

Below is the trace-back for reference:

dec0326.hsn.de.hpc.ucar.edu 619: cesm.exe           000000000599AF82  mom_cvmix_kpp_mp_        1155  MOM_CVMix_KPP.F90
dec0326.hsn.de.hpc.ucar.edu 619: cesm.exe           00000000030DE2DE  mom_diabatic_driv        1326  MOM_diabatic_driver.F90
dec0326.hsn.de.hpc.ucar.edu 619: cesm.exe           000000000307A591  mom_diabatic_driv         395  MOM_diabatic_driver.F90
dec0326.hsn.de.hpc.ucar.edu 619: cesm.exe           0000000002CC57F2  mom_mp_step_mom_t        1608  MOM.F90
dec0326.hsn.de.hpc.ucar.edu 619: cesm.exe           0000000002CA7E7C  mom_mp_step_mom_          956  MOM.F90
dec0326.hsn.de.hpc.ucar.edu 619: cesm.exe           0000000002BDAA9F  mom_ocean_model_n         638  mom_ocean_model_nuopc.F90
dec0326.hsn.de.hpc.ucar.edu 619: cesm.exe           0000000002B59439  mom_cap_mod_mp_mo        1845  mom_cap.F90
mnlevy1981 commented 1 month ago

The line that is aborting is delH = SLdepth_0d + iFaceHeight(ksfc-1), and I don't see anything that prevents ksfc=1. It looks like iFaceHeight(1) = 0., so I could see the fix being delH = SLdepth_0d + iFaceHeight(max(1,ksfc-1)) or maybe you really want delH = SLdepth_0d + iFaceHeight(ksfc)?

gustavo-marques commented 1 month ago

Thanks, @mnlevy1981! We need to double-check this with Bill Large.