Compiling error - undefined reference to ice routines

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
c.drinkorn
Posts: 74
Joined: Thu Mar 08, 2018 2:47 am
Location: German Research Centre for Geosciences

Compiling error - undefined reference to ice routines

#1 Post by c.drinkorn » Thu Apr 11, 2019 3:04 pm

Hi all,

I recently switched to the COAWST because I want to run both ice and sediments in an Arctic domain but couldn't solve some inconsistencies in the Kate branch code... Howver, now I am unable to solve this compiling error which seems top be about some ice routines:

Code: Select all

/scratch/b/b380636/Arctic20km/obcatmforceriversinisedbulkice/Build/libNLM.a(main3d.o): In function `main3d':
/mnt/lustre01/scratch/b/b380636/Arctic20km/obcatmforceriversinisedbulkice/Build/main3d.f90:206: undefined reference to `ice_flux_mod_mp_ice_flux_rst_'
/mnt/lustre01/scratch/b/b380636/Arctic20km/obcatmforceriversinisedbulkice/Build/main3d.f90:210: undefined reference to `seaice_'
/scratch/b/b380636/Arctic20km/obcatmforceriversinisedbulkice/Build/libNLM.a(ini_fields.o): In function `ini_fields_tile':
/mnt/lustre01/scratch/b/b380636/Arctic20km/obcatmforceriversinisedbulkice/Build/ini_fields.f90:526: undefined reference to `ice_limit_mod_mp_ice_limit_'
make: *** [/scratch/b/b380636/Arctic20km/obcatmforceriversinisedbulkice/coawstG] Error 1
The error about main3d is really strange because in the referenced lines

Code: Select all

            IF (PerfectRST(1).and.iic(1).eq.ntstart(1)) THEN
              DO ig=1,GridsInLayer(nl)
                ng=GridNumber(ig,nl)
                DO tile=first_tile(ng),last_tile(ng),+1
                  CALL ice_flux_rst(ng, tile)
                END DO
              END DO
            ELSE
              CALL seaice
            END IF
the model isn't supposed to call ice_flux_rst at all since I did not set the respective CPP flag.
is this rather a compiler flag problem or is there something inconsistent in the routine wiring?
I tried to solve this the entire day but I just couldn't find the reason.
Any hint will be appreciated very much!

By the way, I also had to fix something in ice_mk.h. The call for caldate doesn't need r_date as an input and caused an error since r_date is not defined at all. I guess this hasn't been fixed after the dateclock changes... So my line 469 looks like this now:

Code: Select all

      CALL caldate(tdays(ng),year,month,yday,hour)
And furthermore, in mod_boundary.F, I had to change the if statement for the definition of XYsize so that it is also run when ICE_MODEL is defined:

Code: Select all

#if defined ADJUST_BOUNDARY || defined ICE_MODEL
      real(r8) :: XYsize
#endif
Otherwhise it will be an unknown variable later in the ICE_MODEL section of the routine...

Post Reply