ACCESS-CM2 model run error in 'coupled' step

Hi there,

I’m trying to set up a preindustrial run with ACCESS-CM2. I copied suite u-cy339 to my folder (u-do347 in my case). However, when I attempted to run it for a few months, I encountered the following error message during the ‘coupled’ step.
I have also copied the log files to path /scratch/public/hl1052/u-do347/ in case they are needed. It seems that the Python module ‘f90nml’ cannot be found, but in Line 16, we can see that module pythonlib/f90nml/1.0.2 has actually been loaded.
Does this mean a different Python version is required, or could it be something else? Does anyone have any ideas on how to fix this?
Thank you in advance!
Huazhen

Using the cylc session localhost

Loading cylc7/24.03
  Loading requirement: mosrs-setup/2.0.1
- Package -----------------------------.- Versions --------.- Last mod. -------
Currently Loaded Modulefiles:
cdo/2.0.5                                                   2022/06/27 04:42:13
nco/5.0.5                                                   2022/02/01 00:26:36
ncview/2.1.7                                                2019/12/02 03:32:10
ncl/6.6.2                                                   2019/12/11 03:45:33
mosrs-setup/2.0.1                       default             2024/05/19 23:31:13
cylc7/24.03                             default             2024/05/06 03:30:21
python2-as-python                                           2019/11/04 03:02:35
openmpi/4.0.2                                               2022/02/14 19:20:11
fcm/2019.09.0                                               2020/12/14 04:10:00
pythonlib/f90nml/1.0.2                                      2020/12/14 04:15:56
[WARN] file:/home/561/hl1052/cylc-run/u-do347/work/09500101/coupled/ATM_RUNDIR/IDEALISE: skip missing optional source: namelist:idealise
[WARN] file:/home/561/hl1052/cylc-run/u-do347/work/09500101/coupled/ATM_RUNDIR/STASHC: skip missing optional source: namelist:exclude_package(:)
[WARN] file:/home/561/hl1052/cylc-run/u-do347/work/09500101/coupled/ATM_RUNDIR/RECONA: skip missing optional source: namelist:trans(:)
[WARN] file:/home/561/hl1052/cylc-run/u-do347/work/09500101/coupled/ATM_RUNDIR/IOSCNTL: skip missing optional source: namelist:lustre_control
[WARN] file:/home/561/hl1052/cylc-run/u-do347/work/09500101/coupled/ATM_RUNDIR/IOSCNTL: skip missing optional source: namelist:lustre_control_custom_files
+ echo 'ACCESS COUPLED MODEL DRIVER,' /home/561/hl1052/cylc-run/u-do347/work/09500101/coupled
+ [[ -z oasis3_mct ]]
+ [[ -z /home/561/hl1052/cylc-run/u-do347/share/mom/exec/access-cm2/ACCESS-CM/fms_ACCESS-CM.x ]]
+ ATMOS_LINK=toyatm
+ OCEAN_LINK=mom5xx
+ ICE_LINK=cicexx
+ ln -sf /home/561/hl1052/cylc-run/u-do347/share/fcm_make_um/build-atmos/bin/um-atmos.exe toyatm
+ ln -sf /home/561/hl1052/cylc-run/u-do347/share/mom/exec/access-cm2/ACCESS-CM/fms_ACCESS-CM.x mom5xx
+ ln -sf /home/561/hl1052/cylc-run/u-do347/share/cice/bin/cice5.exe cicexx
+ ATMOS_EXEC=toyatm
+ OCEAN_EXEC=mom5xx
+ export UM_NPES=576
+ UM_NPES=576
+ NPROC_MAX=576
+ export OCN_NPES=80
+ OCN_NPES=80
+ TOT_NPES=672
+ HIST_FILE=do347.xhist
+ fix_cice_namelist.py /home/561/hl1052/cylc-run/u-do347/work/09500101/coupled/ICE_RUNDIR/cice_in.nml /home/561/hl1052/cylc-run/u-do347/work/09500101/coupled/ICE_RUNDIR/input_ice.nml
Traceback (most recent call last):
  File "/home/561/hl1052/cylc-run/u-do347/share/access-cm2-drivers/src/fix_cice_namelist.py", line 2, in <module>
    import os, sys, f90nml
ModuleNotFoundError: No module named 'f90nml'
[FAIL] access-coupled # return-code=1
2025-03-14T07:42:50Z CRITICAL - failed/EXIT

Have you ever run this suite successfully before?

What happens if you try and import that library separately from the command line?

module use /g/data/access/modules
module load pythonlib/f90nml
python3 -c 'import f90nml; print(f90nml)'

Yes, I have run this suite successfully in December 2024.
I got the same error message from the command line.

(base) [hl1052@gadi-login-05 ~]$ module use /g/data/access/modules
(base) [hl1052@gadi-login-05 ~]$ module load pythonlib/f90nml
(base) [hl1052@gadi-login-05 ~]$ python3 -c 'import f90nml; print(f90nml)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'f90nml'
(base) [hl1052@gadi-login-05 ~]$ module list
Currently Loaded Modulefiles:
 1) pbs         3) nco/5.0.5      5) ncl/6.6.2                    7) cylc7/24.03(default)
 2) cdo/2.0.5   4) ncview/2.1.7   6) mosrs-setup/2.0.1(default)   8) pythonlib/f90nml/1.0.2

This command works as exptected for me:

[as2285@gadi-login-03 as2285]$ module purge
[as2285@gadi-login-03 as2285]$ module use /g/data/access/modules
[as2285@gadi-login-03 as2285]$ module load pythonlib/f90nml
[as2285@gadi-login-03 as2285]$ python3 -c 'import f90nml; print(f90nml)'
<module 'f90nml' from '/g/data/access/projects/access/apps/pythonlib/f90nml/1.0.2/f90nml-1.0.2-py2.7.egg/f90nml/__init__.py'>

I think this is probably related to your user conda installation.

if you run whereis python, what’s the result?

@Aidan or others - is there a guide on how to use conda so folks don’t get issues with it interfering with other python workflows ?

1 Like

Yeah, I have installed miniconda in my folder one month ago.
Here’s the results.

(base) [hl1052@gadi-login-05 u-do347]$ whereis python
python: /usr/bin/python3.6m /usr/bin/python2.7-config /usr/bin/python3.6m-x86_64-config /usr/bin/python /usr/bin/python2.7 /usr/bin/python3.6m-config /usr/bin/python3.6-config /usr/bin/python3.11 /usr/bin/python3.6 /usr/lib/python2.7 /usr/lib/python3.11 /usr/lib/python3.6 /usr/lib64/python2.7 /usr/lib64/python3.11 /usr/lib64/python3.6 /half-root/usr/include/python3.6m /half-root/usr/include/python2.7 /half-root/usr/include/python3.11 /half-root/usr/share/python3.11-wheels /home/561/hl1052/miniconda3/bin/python /home/561/hl1052/miniconda3/bin/python3.1 /home/561/hl1052/miniconda3/bin/python3.12 /home/561/hl1052/miniconda3/bin/python3.12-config /half-root/usr/share/man/man1/python.1.gz

I think I would try

conda config --set auto_activate_base False

and then open a new bash session, confirm (base) does not appear in you terminal prompt, and the re-run Aidan’s test.

(When you need to use conda, you will have to activate it)

1 Like

Not that I know of. Good catch!

Thankyou for raising this @huazhen - I created an issue to make a future release of CM2 more robust against this problem.

Ill close this topic soon, but let us know if there is anything else!

1 Like