Ticket #658 (closed task: fixed)

Opened 4 months ago

Last modified 4 months ago

Get rid of _GFORTRAN macro

Reported by: baker Owned by: somebody
Priority: trivial Milestone: OSX Intel
Component: hyp2000_mgr Version: 7.10
Keywords: Cc:

Description

I'm working on the ew_xxx.sh setup scripts for Mac OS X and Linux to add Intel compiler support. The Mac OS X ew_macosx_intel.sh setup script defines _GFORTRAN. It is the only place it is defined. The only place it is used is in hyp2000_mgr.c, apparently to select whether the Fortran compiler appends single or double underscores to the name of a procedure.

When we incorporate Fred Klein's changes to hyp2000, I'd like to address this to eliminate _GFORTRAN (the Intel Fortran compiler does the same thing as gfortran) and correctly deduce or specify how the Fortran compiler decorates the names of procedures. _GFORTRAN is not particularly descriptive of its purpose.

Change History

comment:1 Changed 4 months ago by baker

Same goes for _WINNT_INTEL9. It is also only used in hyp2000_mgr.c for setting up the proper linkage to call hypo_ew(). We need to do something different, like what I did for calling libray_() in rayloc_ew.

comment:2 Changed 4 months ago by baker

Same thing with USE_LOGIT. eqfilterII.c and rayloc1.c are the only places that use it. Not sure why it would not be used.

comment:3 Changed 4 months ago by paulf

I think eqfilterII and rayloc1 were codes that came from NEIC and they have a different logging system for hydra, so I guess they allowed it to be used with logit() for EW too. Keep that one for now.

Yes, if you can get rid of the weird #defines for hyp2000_mgr.c and still get the linking with fortran working on win, macosx, and linux that would be great.

comment:4 Changed 4 months ago by baker

I removed the #ifdef USE_LOGIT from eqfilterII in r7445. It turns out, eqfilterII is not even compiled. It looks like a good candidate to retire to me.

rayloc1.c is the other file with #ifdef USE_LOGIT's. All the calls to logit() in rayloc1.c are in lib_rayloc(). From day 1, 14 years ago, lib_rayloc() has included a call to logit() that is not inside an #ifdef USE_LOGIT. I think the #ifdef USE_LOGIT's serve no useful purpose and can all be removed.

comment:5 Changed 4 months ago by baker

hyp2000_mgr and rayloc_ew now use standard Fortran 2003 features for interoperability with C. There are two new Fortran 2003 wrappers, hypoinv_wrapper.f90 and libray_wrapper.f90, for C to call Fortran Subroutines HYPOINV and LIBRAY, respectively. There is no need for system-dependent code to handle argument marshaling, as long as the Fortran and C compilers are interoperable. hyp2000 FLFLAGS and hyp2000_mgr _GFORTRAN have been removed.

Fixed in r7448, r7449, and r7450.

comment:6 Changed 4 months ago by paulf

Compiled fine on Mac OS X. I will test with an event next to make sure it works end to end there.

Thanks Larry

comment:7 Changed 4 months ago by baker

If you can hold off for a few minutes, I was next going to remove the last remaining #ifdef USE_LOGIT's in a separate patch. I doubt anyone will ever want to reverse it, since the unconditional call to logit() in the same function has been there for 14 years. Not to mention that apparently no one uses rayloc_ew anyway. It will be simple to see the change.

comment:8 Changed 4 months ago by baker

  • Status changed from new to closed
  • Resolution set to fixed

Removed #ifdef USE_LOGIT's in rayloc1.c and /DUSE_LOGIT in makefiles; rayloc1.c always calls logit() now.

Fixed in r7451.

Note: See TracTickets for help on using tickets.