I am trying to launch trunk NEMO with one nested domain in coupled mode (NEMO + WRF + OASIS).
The coupled model fails with the messages
(oasis_coupler_setup) ERROR: namcouple variable not used: 1_O_SSTSST
(oasis_coupler_setup) ERROR: namcouple variable not used: 1_O_OCurx1
etc
I checked debug files and it seems that NEMO does not call oasis_def_var() for nested domain, i.e. for variables 1_O_SSTSST 1_O_OCurx1 1_O_OCury1 1_O_OTaux1 1_O_OTauy1 1_O_QsrOce 1_O_QnsOce 1_OOEvaMPr 1_O_TauMod
the first thing to look at is your namcouple, namelist_cfg and 1_namelist_cfg files to make sure you properly defined all exchanges between OASIS and NEMO parent and child grids.
It seems there is a bug in NEMOGCM/src/OCE/SBC/cpl_oasis3.F90
#if defined key_agrif
! Warning: Agrif_Nb_Fine_Grids not yet defined at this stage for Agrif_Root -> must use Agrif_Root_Only()
IF( Agrif_Root_Only() .OR. agrif_fixed() == Agrif_Nb_Fine_Grids() ) THEN
#endif
CALL oasis_enddef(nerror)
IF( nerror /= OASIS_Ok ) CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef')
#if defined key_agrif
ENDIF
#endif
I checked that agrif_fixed() and Agrif_Nb_Fine_Grids() are both = 0 for a parent domain.
So NEMO calls oasis_enddef for a parent domain, which prevents initialisation of variables for a nested domain.
I replaced IF( Agrif_Root_Only() .OR. agrif_fixed() == Agrif_Nb_Fine_Grids() ) THEN by IF( .not. Agrif_Root() ) THEN