# ACCESS-CM2 model run error in 'coupled' step

**URL:** <https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311>\
**Category:** Coupled Model\
**Tags:** python, help, access-cm2, help-needed\
**Created:** [15 March 2025 05:43 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311 "2025-03-15T05:43:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![huazhen](https://avatars.discourse-cdn.com/v4/letter/h/59ef9b/32.png) [@huazhen](https://forum.access-hive.org.au/u/huazhen)\
**Post date:** [15 March 2025 05:43 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/1 "2025-03-15T05:43:31Z")

</div>

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Aidan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/aidan/32/42_2.png) [@Aidan](https://forum.access-hive.org.au/u/Aidan)\
**Post date:** [17 March 2025 03:06 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/2 "2025-03-17T03:06:24Z")

</div>

Have you ever run this suite successfully before?

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

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

```

---

<div class="post-metadata">

**Author:** ![huazhen](https://avatars.discourse-cdn.com/v4/letter/h/59ef9b/32.png) [@huazhen](https://forum.access-hive.org.au/u/huazhen)\
**Post date:** [17 March 2025 03:18 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/3 "2025-03-17T03:18:42Z")

</div>

> [@Aidan](#):
>
> `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.

```auto
(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

```

---

<div class="post-metadata">

**Author:** ![anton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/anton/32/1836_2.png) [@anton](https://forum.access-hive.org.au/u/anton)\
**Post date:** [17 March 2025 03:38 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/4 "2025-03-17T03:38:48Z")

</div>

> [@huazhen](#):
>
> ```auto
> python3 -c 'import f90nml; print(f90nml)'
> 
> ```

This command works as exptected for me:

```auto
[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 ?

---

<div class="post-metadata">

**Author:** ![huazhen](https://avatars.discourse-cdn.com/v4/letter/h/59ef9b/32.png) [@huazhen](https://forum.access-hive.org.au/u/huazhen)\
**Post date:** [17 March 2025 03:57 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/5 "2025-03-17T03:57:15Z")

</div>

> [@anton](#):
>
> whereis python

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

```auto
(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

```

---

<div class="post-metadata">

**Author:** ![anton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/anton/32/1836_2.png) [@anton](https://forum.access-hive.org.au/u/anton)\
**Post date:** [17 March 2025 04:10 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/6 "2025-03-17T04:10:48Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Aidan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/aidan/32/42_2.png) [@Aidan](https://forum.access-hive.org.au/u/Aidan)\
**Post date:** [17 March 2025 04:13 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/7 "2025-03-17T04:13:19Z")

</div>

> [@anton](#):
>
> @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 ?

Not that I know of. Good catch!

---

<div class="post-metadata">

**Author:** ![anton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/anton/32/1836_2.png) [@anton](https://forum.access-hive.org.au/u/anton)\
**Post date:** [18 March 2025 00:33 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/8 "2025-03-18T00:33:50Z")

</div>



---

<div class="post-metadata">

**Author:** ![anton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/anton/32/1836_2.png) [@anton](https://forum.access-hive.org.au/u/anton)\
**Post date:** [19 March 2025 02:06 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/13 "2025-03-19T02:06:04Z")

</div>

Thankyou for raising this @huazhen - I created an [issue](https://github.com/ACCESS-NRI/access-cm2-configs/issues/10) 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!

---

<div class="post-metadata">

**Author:** ![anton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/anton/32/1836_2.png) [@anton](https://forum.access-hive.org.au/u/anton)\
**Post date:** [7 May 2025 00:15 UTC](https://forum.access-hive.org.au/t/access-cm2-model-run-error-in-coupled-step/4311/14 "2025-05-07T00:15:58Z")

</div>


