Welcome to the new DiscussCESM forum!
We are still working on the website migration, so you may experience downtime during this process.

Existing users, please reset your password before logging in here: https://xenforo.cgd.ucar.edu/cesm/index.php?lost-password/

Help me diagnose my 'parent type' error


Spencer Jones
New Member
This is a development problem, but I think it is probably quite basic, which is why I am asking here. I'm trying to get the drifters code (written my LuYu Sun and Matt Harrison) to compile with a modern version of MOM6 on one of the TAMU clusters. I can compile MOM6 itself on the cluster, but it's just stringing that together with the new code that I'm struggling with.

I'm basically using the recipe from https://github.com/lysun0725/MOM6-drifter-example/blob/1c91e7dc62c03d217c5695d2058ceb6eb2f9849e/Makefile-dt2-intel where I do an updated version of their compile_libs (which goes fine), and then I run

rm -f path_names
../../src/mkmf/bin/list_paths ../../src/drifters/{particle_driver.F90,particles.F90,particles_framework.F90,particles_io.F90}
../../src/mkmf/bin/mkmf -t linux-intel.mk -o '-I../../src/FMS/include -I../../src/MOM6/src/framework -I../../src/MOM6/config_src/dynamic -I../MOM6.repro -I../shared.repro' -l '-L../MOM6.repro -lMOM6 -L../shared.repro -lfms' -p drifters -c "-Duse_libMPI -Duse_netCDF -DSPMD " path_names
make NETCDF=4 TEST=1 drifters -j

Which gives me an error

../../src/drifters/particle_driver.F90(129): error #6292: The parent type of this field is use associated with the PRIVATE fields attribute. [GV]
call verticalGridInit( PF, CS%GV )
../../src/drifters/particle_driver.F90(129): error #6631: A non-optional actual argument must be present when invoking a procedure with an explicit interface. [US]
call verticalGridInit( PF, CS%GV )
../../src/drifters/particle_driver.F90(132): error #6292: The parent type of this field is use associated with the PRIVATE fields attribute. [OBC]
call MOM_initialize_fixed(dG,CS%OBC,PF,.false.,dirs%output_directory)

I don't know how to go about diagnosing what is wrong: maybe I am not compiling/linking some important code? Or maybe MOM6 has changed a lot since the drifters code was written. I am coming from MITgcm, and I'm not really familiar with public/private fields. Any pointers on how to make progress would be helpful.
MOM6 has changed. You can search it for verticalGridInit and find it in core/MOM_verticalGrid.F90. It now has a third argument which you must include when calling this routine. There is a new dimensional scaling check feature and the third argument is in support of that. See Marshall's talk from the 2020 tutorials. I bet Matt Harrison would know how to include that now. You'd need the line:

use MOM_unit_scaling, only : unit_scale_type

plus propagating it consistently down to the call to verticalGridInit.